Categories
Making Games

Debug Menu V2: Revenge of the Debug Menu

Because most of you wrote considered to write in demanding more information on the sequel of the debug menu, here’s an update:

debugmenu2

New features:

  1. Shows which level you are currently in (a feature most requested by the future beta testers) painting it black
  2. If you try to load a level that doesn’t exists, it will be marked with a.. slightly deeper red

Now, feature 2. literally took me hours and hours to create, probably eliminating any time-savings the debug menu could have brought.

I wanted the menu to actually pre-emptively mark levels that can’t be loaded, which would make more sense. But, turns out this short of trickery just is not possible in Unity, because you cannot read the scene list without opening all the scenes. To find that bit of disappointing information took hours, mainly because I just could not believe it.

One could also maybe write a pre-processing script to read the file names and create a separate index of the scenes and blahhety blah, but the guiding principles of Planet Jone prohibit such actions. If you’re unsure what the principles were again, here’s a visual representation of it:

[Here was an image, which was lost in a WordPress migration or some such. I have no idea what the picture was. We’re in the same boat now, reader.]

I like that picture, it’s a very good life lesson for anyone, and after the saddening hours lost it also gave me the strength to just give up and accept the fact that an underwhelming slightly dark red button appears only when you press it, because the level fails to load, and then the system knows that hey, it doesn’t exist.

The silver lining of the struggle was that I also modified the level changing routine to not crash if the next level is not found, but to try again with a “level number+1” until a level is found and can be loaded. This allows me to plop in new levels randomly at any point and they will just work.

Because the blog post seems to be ending, I feel the need to somehow inject a point too. Here it is: when making a game by yourself, any automatic system that eliminates any routine work is always (okay, let’s say 99.3% always) , since if you need to spend even a couple of minutes on a task every time you add a level, you have a couple of minutes of less time and energy for the creative part. And if you average a total of one hour per day of development, those minute are pretty valuable. (Note that I only promised to inject a point, not an astonishing revelation.)

In any case, the debug menu is now done, and I shall not touch it until I need to start on the very secret Super American Mode that adds to the needs of the menu.

Leave a Reply

Your email address will not be published. Required fields are marked *