About the powerup plants. Would you consider making them 1 offs, or grow back on a timer?
I want the plants to be: a way to encourage the player to spend shells, a convenience for collectable/secret-hunting players to get a specific powerup that they want, and a little bit of extra help for players who take damage often. I think adding a limit to the plants would detract from all of those uses. If there was a rare powerup (I don't have any in the game though) that I wanted to limit, I could just make it expensive. Is there a particular reason why you would consider putting limits on them?
Maybe I missed it in one of your earlier posts, but I'd really like to know the process/implementation you follow for setting up your debugging stuff.
I don't think I went into any detail about it before! I don't do anything super fancy but can talk a bit about my methods.
Debug KeysFor the controls for various debug features I wanted to avoid having them spread all throughout the code. It can be easy to lose track of what they all are. So my keyboard system keeps track of them.
m_pKeyboard->AssignDebugKey("SlowMo", KEY_LCONTROL);
m_pKeyboard->AssignDebugKey("SpeedUp", KEY_LSHIFT);
m_pKeyboard->AssignDebugKey("Pause", KEY_RCONTROL);
m_pKeyboard->AssignDebugKey("DebugRender", KEY_TAB);
m_pKeyboard->AssignDebugKey("DebugPage_Game", KEY_F1);
m_pKeyboard->AssignDebugKey("DebugPage_Sound", KEY_F2);
m_pKeyboard->AssignDebugKey("DebugPage_Resources", KEY_F3);
m_pKeyboard->AssignDebugKey("DebugPage_Input", KEY_F4);
Then I just refer to it by name elsewhere in the code. For example, this will run the game at 1/10th speed if I hold down the left control key.
if(m_pKeyboard->DebugKeyHeld("SlowMo"))
{
deltaTime *= 0.1f;
}
So it's really easy to change what the keys are if I need to. It produces an error if I try to assign multiple things to the same key. I also only have to change the code in one place to turn all these debug keys off in final builds of the game!
Debug controlsYou can see above that I have some time controls for the game. Running at 1/10th speed is handy for observing behaviour especially with collisions between objects. Running the game fast is useful for skipping bits, especially when combined with another button which makes Leilani float around and be invincible!
I also have some other buttons like:
- Instant level restart, which will also reload any changes made to the level
- In-place level restart, which is the same but keeps Leilani at the same location in the level
- Skip button which takes Leilani to the entrance of the next area, if the level has multiple areas
Debug PagesFinally I have a simple concept of debug pages. The tab button turns the debug display on and off, and the F keys change which page is displayed.
The first is a generic gameplay page, I can display whatever info I want to see at the time. For example entities are labelled with their X Velocity because I wanted to see it when testing moving platforms.
It also draws entity hit boxes, which is especially handy for seeing trigger areas and things like that that aren't normally visible. And it draws bounding boxes around UI elements which is rarely useful, especially as they currently are drawn beneath the UI itself, but you never know when it might come in handy.
The sound page lists how many sounds are loaded and playing. And the most important feature of this screen is that sounds with a location are drawn at their in-game location, for example the "jump" sound playing where Leilani is. This is very useful especially when there's a bug and a sound is being played unexpectedly, but you're not sure where it's coming from...
Resource page shows info about how many of all the kinds of resource are loaded.
Input page shows the available devices, and which one is currently active. It shows an icon next to devices which have buttons pressed which is useful for identifying joypads and things, especially when there is Steam shenanigans going on where Steam is emulating an xbox pad or something.
I think that covers my biggest debug features! Hope it was interesting Photon.