Friday, February 20, 2009

Not much people have downloaded the console, so I decided I'll post the things you'll get by using it. Probably some of you are wondering, why use this crappy component if I have my old school .NET's Console.WriteLine(debugThis) that hasn't ever let me down?. I'll explain the neat features:

The main feature is the Show method. It receives two parameters: a string identifying what you are showing, and a value. For example: Console.Show("Player1.Position", pos); you can write this call inside the Update of your main character and a new variable will be added to the Console's TreeView, and everytime this gets called the value in the TreeView gets updated. Let me show you a screenshot.


So, as you can see you will get live coverage of some variables of interest, and they will stay right there, visible everytime you need them. Another thing to note is that the console creates a hierarchy of values, if you need some other variables from Player1 you will get them grouped under the same node so you can quickly check the state of some component of your game. I'm planning to use the reflection API to add variables from the console itself, for example you could write "Game.Player1.Position" at runtime and you will see the value being added and updated every frame, I'm not sure if the .NET reflection API is available on the XBOX.

4 comments:

PC Troll said...

I've not downloaded the console because right now I'm focused on finishing my degree project. However, I'm closed to your blog because I'm interested in the console and your work when I get into XNA development.

Thanks for the info and keep the hard work =)

PC Troll said...

sorry... I'm close**

Rod Navarro said...
This comment has been removed by the author.
Rod Navarro said...

Yes, it is present, but not all features of the ref API can be used, because remember the Xbox360 uses a reducted version of the .Net frameworlk.

So for example, I remember the method invoke() can be used from windows but not xbox360.