I know Sean James already said it. But seriously, Visual Studio (specifically the debugging tools) is terrific for this.
I don't use C++ much these days, so I'm not sure about how well these apply there. But for C# (including in C# Express) you have:
- Edit and Continue - where you can make wholesale changes to your game logic.
- The Watch Window - where you can see and modify variables with ease.
And this might blow your mind (it blew mine when I found out about it):
The Immediate Window is actually kind of hard to find (it's in the Debug/Windows menu).
The only major downside to using the Visual C# debugger is that it doesn't like changing
const values. So I usually just make my gameplay-related values
static while I'm tweaking them.
(Also: having two monitors helps a lot.)
Now I must admit that the above method involves pausing your application - which can be unsatisfyingly slow for a few particularly fiddly things.
On these rare occasions, what I do (in XNA) is to simply hack in a bit of code (probably using Edit and Continue, as above) to grab
Keyboard.GetState().IsKeyDown() (actually I have an easier-to-type wrapper for this) and adjust the value by keystrokes. Anything more complicated is not worth the effort.
In practice what I usually find vastly more important is being able to visualise (rather than modify) values in real-time. For this I have a nice little class that can buffer lines and text to be drawn at the end of the frame. It's also useful for quick prototyping.
(And, once again, it's nice to be able to "Edit and Continue" these visualisations in at runtime.)
I'm afraid I don't have "nice" source to publish at the moment (maybe later). But it's basically just a list of lines (for this round line library) and strings (for XNA's built-in SpriteBatch). Just make it
public static somewhere, and draw everything with an appropriate transform so that everything appears in "world space" (and then clear the lists for the next frame).