April 22 2011

The start of this journey

I am Menno Gouw (madmenyo) and at the moment i'm writing this i don't have much experience with "real" programming languages. A week or 2 ago I only had some PHP, CSS, MYSQL, javascript, jquery experience. I fiddled around with a tiny bit of java and c# in the passed but nothing more then a hello world or a calculator tutorial. I did do a little pascal programming on school more then a decade ago, i was pretty good at it but haven't bothered exploring it further after i quit school.

Back to a week or two ago. I installed visual studio again and started to do the c# console RPG of this game tutorial. Nothing fancy but i learned some very essantial basics about how a game works. After the RPG console he has some XNA tutorials so i downloaded and installed the XNA framework and di those tutorials and finished the very crappy pong game. Up to this part i was understanding 99% of the code by rereading everything and figures i could make my own arkanoid/break-out clone.

So i started on that game with the knowledge i had from these previous tutorials and managed to make it. I made functionality for the paddle that bounced the ball in different direction depending on where it hit. And made a simple level with an array of blocks. The only bug it had is when the ball ended up in 2 blocks it would calculate the direction of the block that came first in the array. For the first time i managed to locate a bug and managed to solve it. I was pretty proud :D. At this time i stopped the project and started looking for a new tutorial. I could have implemented some different blocks, powerups and extra more enjoyable levels but i felt i was ready for a next step. Besides, i never liked break out.

I found a tutorial for a XNA tower defense game by a guy named FireFly. I wasted many hours of my life playing these mods with starcraft and warcraft 3. So i was really excided about it. You won't end up with a complete game but the tutorial shows you all that is nececary for your own tower defense game. When this was finished i was missing something i never seen included in a tutorial. A game screen, and believe it or not the headache starts here :D.

I found a screen managing sample on the app hub forums. I downloaded it and tried to extract and learn from it. And even now i don't really understand every aspect of it. But i have managed to make my own game screen that can be controlled by the mouse. It took me like 6 tries from scratch, retyping all the code myself each time with the sample as reference. My version doesn't include flashy animations and i'm not sure if it unloads content when nececary but the functionality is there. This project discouraged me very often, majorly because it took a couple of days to make such a simple thing as a main menu for a game.

So yesterday i left the main menu for what it was and wanted to look a little into some 3D drawing and this got a little out of controll. I found these video tutorials. It starts again from the beginning, drawing a spritebatch, but i figured it would not hurt to do those parts again. So when i finished the XNA 101 course with my own model skipping part 12 (audio), because i can learn about that later i started fiddling around and this is where it got out of controll...

Since i have a game design on paper that needs a camera to rotate around the player model i started on this. Within a couple of hours i had my own bug free rotating camera that could zoom in by using the mouse scroller. I was so damn excided i could pull this off without any tutorial and just googling around when i got stuck or needed some info. I wondered how hard it could be to allign my ship to the camera direction, well... very easy as i used the yaw and pitch values for the camera to set the playersX and Y rotation. Then started slowly incrementing rotation when currentrotation is not equal to destination rotation. Added some drag to it and made a balance variable so if the ship would rotate far over X and little over Y both rotation come at it's destination at the same time. Finally i needed movement, this was only 4 lines, crazy stuff. I just googled how to calculate direction from vector3's. I had to subtract the destination from the origin and normalize that new vector3 so it becomes a low value. And BLAM!! here i was, flying in my space ship over a plain with a checker texture. Basic functionality for my game, all done in a day. I never heard of a matrix and never worked with vector3's, models and camera's that morning.

So a couple of hours ago i woke up. All excided but i figured i make a blog about my programming experiences. Tthis could be really helpfull for others. But i could also use this to burst out when i'm excided and it would be fun to see what i accomplished over time. Today i dedicate my time on this website, trying to get as much functionality in as possible. I'm planning on adding a database so people can reply to topics, ask questions or maybe teach me something new, which should not be hard at the time if this writing.

Ow.... and sorry for the wall of text. I'll try keep my next blogs shorter and to the point :D.