Open mspraggs opened 9 years ago
Hmm. I'm not too sire how that'd be done without basically writing another (far more complicated) version of the game. Looking at the Minetest example, it looks like they wrote the whole thing with that in mind.
I just tend to stick whatever it is I'm debugging on the menu screen, as that's guaranteed to come up.
What if we had a config option to swap between loading levels normally, and loading a testing room? If the testing room was the only level available, you could be sure it would turn up.
EDIT: Just because sticking new things in the menu feels a bit wrong… Plus, it's easier to reload non-menu rooms if you need to start the test over.
I can see what you mean (and it's slightly annoying when the layout of the menu gets in the way, like that time I was testing sideways gravity and fell out of the exit and it closed the program D: ).
Putting in a #define DEBUG = true macro or something would be nice, and is something I've done before. Then, we could just stick it in at any debug things (such as going to a debug screen).
It would be good to have a level with features in that we add to over time and can refer to when reporting bugs. At the moment you either have to edit the rooms that are loaded, or play long enough to get a room with the block configuration you need to replicate the bug.
There's already a de facto preprocessor flag for debugging, and that's NDEBUG. If it's defined, then debugging options (such as the assert macro) are switched off, otherwise they're switched on (this can also be passed in as an option to the compiler.
This could be a totally rubbish suggestion, but I thought I'd propose in case you guys think it's a good idea.
Quite often we want to play the game to test new features/replicate bugs and so forth. In these situations it would be good to have a condensed, deterministic version of the game so that things can be tested easily.
If you look at Minetest (open source minecraft clone), they do this by having a stripped-down testing version of the game by default, with the ability to plug in other games as necessary. Admittedly they do this via Lua scripting, which would probably be a bit OTT for our purposes, but we could achieve something similar just with configuration files that can edited/swapped.