Tuesday, October 16, 2012

Experimentation with procedural levels

Well while doing the loading bar, I found out some neat commands; Application.LoadLevelAdditive namely. And in a case of "when you have a hammer, everything looks like a nail" decided to change how levels were setup. Since the game only takes place in 4 environments and has much more levels I thought it would be good to build the levels procedurally by reusing the environments by additive loading them into a blank scene that contains the relevant level data.

It works but on experimentation it leaves this slow blank awkward pausing screens that I rather not deal with. So scrapping that idea, I just dumped all the level data into the start menu scene, deactivated and ready to go on level select. It's not ideal but it works. The issues with this method is that it is harder to control scene specific objects with a script that isn't even based in the same scene. - Say like I needed to script some doors locked, I probably would have to create a level specific reference list script in the scene just to get easy access to variables needed to properly setup the environment for the current level.

Also got the generic event system going and it seems to work without problems for purpose of objective tracking, haven't extensively tested it or seen how it handles large amounts of data, but handle problems as they come along I guess.

No comments:

Post a Comment