15-09-2006, 09:00 PM
Well, I couldn't post in the Knowledge Base forum so...
Now. Programming an online game is by no means a small task (unless you use some shitty engine... but why are you reading this if you use an engine ^_^). It can be quite difficult keeping track of the packets being sent, buttons being pressed, subroutines being called. People who have spent the most time customizing the source will know that it gets very big. I think I have around 15-20 .bas files in Naruto Realm Beta, and I only just started programming that a month or two ago!
So we need to see what is actually going on in the program whilst it is running. Which is fine when dealing with the visual stuff. If you added in mining and you see your person mine like you programmed it, see the rock/ore/whatever enter your inventory you know it has all working out. Nice and peachy. But then whilst dealing with packet encryption, tricky combat subroutines and functions and the like, you start to need to know more than 'it worked' and you need to start seeing what the integers, bytes and strings have become whilst the program was running. You also need it written out in a way you will understand!
Now, I know Mirage comes with some sort of 'debug' form (which I couldn't get to work until writing something up in handlekeypresses...) and it might work for you. But when you close down the test run of your game, you lose that data (unless copied to a text file or something stupid like that...). Now, this function I am about to tell you will allow you to keep track of all the important variables in your server or client, and have them in a editable, deleteable and readable text file, even whilst not in 'Run' mode!
=) Nice and easy.
You can use it like this, to show the 'name' of your packet
You can have it to have a look at a packets encryption key, pre-compressed data and post-compressed data.
It can be used to print out any text you want it to, and variables which are set and changed whilst the program is running. You can use it to make warning messages if a sub error's... whatever you want.
It is a great function and should be used whilst either debugging, or just wondered what the hell you just programmed!
Oh, the 'debug' window should pop up when you run. If not, just press 'ctrl + g'.
You can access this window either whilst the program is running, or when you are programming.
The window's title will be 'Immediate'. That is what I get.
Like the properties box and the project viewer it can be aligned around the development window, or just put into it's own little box.
It's a very useful tool.
No doubt most of you will know about it, and use it, but some people might not. Now you do =)
~Kite
Now. Programming an online game is by no means a small task (unless you use some shitty engine... but why are you reading this if you use an engine ^_^). It can be quite difficult keeping track of the packets being sent, buttons being pressed, subroutines being called. People who have spent the most time customizing the source will know that it gets very big. I think I have around 15-20 .bas files in Naruto Realm Beta, and I only just started programming that a month or two ago!
So we need to see what is actually going on in the program whilst it is running. Which is fine when dealing with the visual stuff. If you added in mining and you see your person mine like you programmed it, see the rock/ore/whatever enter your inventory you know it has all working out. Nice and peachy. But then whilst dealing with packet encryption, tricky combat subroutines and functions and the like, you start to need to know more than 'it worked' and you need to start seeing what the integers, bytes and strings have become whilst the program was running. You also need it written out in a way you will understand!
Now, I know Mirage comes with some sort of 'debug' form (which I couldn't get to work until writing something up in handlekeypresses...) and it might work for you. But when you close down the test run of your game, you lose that data (unless copied to a text file or something stupid like that...). Now, this function I am about to tell you will allow you to keep track of all the important variables in your server or client, and have them in a editable, deleteable and readable text file, even whilst not in 'Run' mode!
Code:
Debug.Print
=) Nice and easy.
You can use it like this, to show the 'name' of your packet
Code:
Debug.Print "Packet 'name': " & Parse(0)
You can have it to have a look at a packets encryption key, pre-compressed data and post-compressed data.
Code:
Debug.Print "Packet Key: " & UnCompress(Key, COMPRESS_KEY)
Debug.print "Pre-Compressed Data: " & TmpData
Debug.Print "Post-Compressed Data: " & Compress(TmpData, UnCompress(Key, COMPRESSION_KEY))
It can be used to print out any text you want it to, and variables which are set and changed whilst the program is running. You can use it to make warning messages if a sub error's... whatever you want.
It is a great function and should be used whilst either debugging, or just wondered what the hell you just programmed!
Oh, the 'debug' window should pop up when you run. If not, just press 'ctrl + g'.
You can access this window either whilst the program is running, or when you are programming.
The window's title will be 'Immediate'. That is what I get.
Like the properties box and the project viewer it can be aligned around the development window, or just put into it's own little box.
It's a very useful tool.
No doubt most of you will know about it, and use it, but some people might not. Now you do =)
~Kite
Quote:Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?