A loader question

#1

Hi guys,

I made a loader using proxys and it work well, but as I created more levels it got a little messy. So I was wondering, is it a way to create a loader for each lvl ? and if so, is it a way to go back to the main loader from any other load ? ( I tried to make it but an cycle error apeared so i puted it all in just one loader)

1 Like

#2

Can’t really say without more specific info, you could share your current code.

I usually have some kind of ID for each level (a level number, a name, etc.), and name the proxy components to match, so it doesn’t matter which level is loaded, I just remember which proxy is currently loaded and all the code works the same.

2 Likes

#3

Yes it’s certainly possible. In my game I have a main loader as a proxy, then each level is constructed using a collectionfactory within that proxy. This allows me to setup a tree of levels so I can have essentially infinite numbers of them with sub levels to each level. For instance, when the player enters a dungeon in my game the dungeon itself takes over the role of level coordinator and then calls to load a sub-level will load a level from the dungeon instead of loading an overworld level for instance.

My suggestion is to write out some graphs describing the situation you want to have happen, then see if you can implement it some way. If you get stuck let us know. Or you can post the diagram and explain it so others know what kind of system you plan to use.

1 Like