Wednesday, October 11, 2006

Still Alive

It's been a crazy couple of weeks and I haven't had much time for working on the project. Last time I was into it, I came to see that I would need a lot more programming skill to wirte this game if I even had a chance of getting it going.

Brent heard my thoughts and gave me a link the other day that brings me much further down the line then even the books I am reading. Thanks for that.

Ok, so now I need to work on things in a different direction. Mainly in the aspect of the game world itself. I am going to start out with a simple map with a "hunt and kill" a setup. Then I'll see if I can get two people on it.

The main thing I need to do it come up with a story line, plot, map, and purpose of interaction. This might take a little while with all my other projects in upgrading the house, but I'd thought I should let you know I am still working on it.

Monday, September 18, 2006

Jumping Someone Else's Code

I found a free compiler called Bloodshed Dev that has solved all (well most of) my problems with Visual C++ and now can concentrate on actually programming. How is that going? Well, that’s hard to say.

I just finished chapter 3 and have tested the program I made. The program was a very basic design to draw an icon all over the screen in random locations. The main purpose was to create the game engine, so I’m not too saddened by the lack of luster in the item I created. I am her to learn and tell you what that was. So, what did I learn?

I learned this book assumes I am well versed in the world of C++ programming and that I know how to quote the stuff like Shakespeare. I also learned that C++ has almost no actual commands of its own and that the “#include” commands I type it do much more then I possibly imagined. I find it daunting to see that adding the lines “#include “or “#include ” are not just one line commands but links to layers upon layers of programming files that make up commands and define them with names of the original programmers choosing. I learned to start making sense of Hungarian notation. What is Hungarian notation? Go look it up. It’s a clever idea, but is about as boring as reading the back of a paint can.

I learned in chapter 3 that it’s not that I don’t have a clue about programming, but that programming in C++ is mostly just connecting things you want done to the work done by programmers before you. I don’t have a chance it hell to “learn” programming, I just have to learn the etiquette of writing code and keep thinks that I am not actually crating anything out of thin air. I am just associating endless amounts of people’s code with what I want done.

Then again, that may just be the game engine that makes me feel that way. The next chapter is about graphics. Perhaps I’ll start really seeing things I can control, and not just link my coding with. Wish me luck.

Thursday, September 14, 2006

Everyone Knows I’m In Over My Head

I just got finished reading chapter 3 and I am just clueless what the second half of it meant. I’ll start to explain the first half and see if it comes to me.

The first part of the chapter goes into describing what a game engine does and how it helps to make one. Please chime in to correct me if I am wrong, I am learning this, not teaching it. A game engine is a part of the program that creates the parameters for your game to run. It sets the screen dimensions, the devices it will interact with (a keyboard, mouse, game controller, etc,) sound devices, and a myriad of other things. A game engine is where you put all your code with how your program will interact with your operating system and hardware.

An interesting thing about the game engine is that one created, it can be become the foundation for you to make an entire set of games. I will use the example of NCSoft; they have about six games out right now that all seem to be the same game in different genres. I’ll bet they all use the same game engine and just have different designers making the rest of it. A game engine is something they probably make, refine, and perfect to be the base of all their games. It sounds daunting, and it sure as hell looked it.

The first part of this chapter talked about something that helped me see games in a different way. It would take pages of my blathering to explain what I see now, but the core was learning of cycles, which can also be referred to as frames.

Every game goes through a cycle. The cycle takes the current game state, applies the changes the user applied, adds the variables the game applies, and then ends. Greek, right? Well, let me try to clear it up. Remember Asteroids? The game has random bouncing rocks, and a space ship you control to destroy them. Well, what happens is that the program is made to create rocks, and let them move randomly until they hit each other, get shot by the space ship, or hit the spaceship. In the sense of one cycle here is what happens:

Game clears the screen
Game calculates where the rocks are.
Game calculates where the rocks are moving to.
Game calculates any collisions
Game calculates any user input (shooting, moving, etc.)
Game draws the rocks, ship, and shooting.
Game ends.

The cycle has ended and a new one begins. The new cycle now clears the screen, runs where all the calculations say the object now are, and draws the screen again. It repeats it till a variable comes up that will change the calculations, say running out of rocks, or the ship being destroyed. So, that being said, the number of cycles you run per second will determine how smooth the game graphics appear. Just this little description of cycles has made years of playing games much more understandable.

I hope that made sense, if not, let me know. Ok, I’m off to make sense of the game engine code the chapter has in the second half. I still don’t have a clue what most of it means. Once again, wish me luck.

Monday, September 11, 2006

I did it!

After a two hour battle, I have successfully compiled my first application. I know it’s not curing cancer, but it was a big step in my plan. Microsoft has not put in a near rage as it decided where to put my files for me, what they should be named, and how they should be linked. But I am now set up correctly to compile the programs I will make in the book I am using.

I will stress to anyone reading this that the Visual C++ express is not build to help you, but instead to be a preview for people who already used previous versions and want to see the new version. I had to go through endless webpages and settings to find out that I needed to load SDK, then link the SDK libraries to the VC++ Express directories, and then edit the corewin_express.vsprops file to get it working. I read to edit the corewin.vsprops an hour earlier and found out later express had a file of its own, but I’ll not get into that frustrating moment.

Ok, so to sum it up. I have built a program and it has showed me it works. I have learned a great deal this past week, but the biggest lesson I have learned is that I have come into learning to program windows applications in the middle of the way you should learn it, and I have to expect a lot of backtracking in the lessons ahead.

A quick thanks to Doc and Adam for a few tips to get me closer. On to chapter 3.

Thursday, September 07, 2006

Stuck in Compiler Hell

Well, compilers are a pain in my ass. I downloaded the Visual C++ Express from Microsoft and found the damn thing reads like stereo instructions. Once I figured out the categories the files I created were supposed to go in, I got stuck again. I think at first the program was trying to make things for me, but since I don’t know what it was trying to create for me, I got tripped up.

Ok, so I finally get the files in the right categories and start the build. What I get is an error saying that the compile didn’t complete because it can’t find the “windows.h” file and has failed. Great, what the hell does that mean?

Well, apparently “windows.h” is a header file that links to a bag of other files to build what I guess is all the default programming for a program to talk to windows. I said I was a novice, quit chuckling. Ok, so now I find out that Visual C++ Express doesn’t come with these files and I have to find another way to get them, and then figure out how the hell to get them referenced correctly by the build so it can make the program I wrote to write one damn sentence in a window. The book came with a trial version of Borland that needs to be registered and the command line compiler is beyond me at this point of frustration.

I’m off to do some research on how to get the files onto my machine without snapping and buying the full MS version. Wish me luck.

Wednesday, September 06, 2006

Compilers

I’m a bit stuck in my studies. My friend Adam put it best that they throw a bunch of code at you and tell you that it will all make sense later. I have a problem with that. I like to know what I am doing and it is slowing me down. The main thing I am getting a grasp on is compilers.

It looks like that I can program all I want in a text editor, but I will need something to build it into an executable so it will run. A compiler does this, and apparently a lot more. There was a free compiler on the CD that came with the book, but I thought I would go with something else to do the work. I would like to use other programs because they do the same thing, but in different ways. That helps me ask better question instead of just typing in some code as the book says and getting a pat on the head for following instructions. After all, this is about learning how to do it, not just proving I have good reading comprehension.

I think I’ll try MS Visual C++ express. It’s mainstream, free, and probably has a lot more versatile help then other things. I’m off to type out some code, apparently what they call the “Program Code.” If I have it right, it’s the file that sets the parameters for the game I actually write to operate within. Please correct me if I am wrong.

I’ll see how the compiler works first, and then I’ll be on to chapter 3. Right now I am working a full week while having my house painted, and still finishing the kitchen, so it might be a few days before I get there. Wish me luck.

Friday, September 01, 2006

Day 2.1

The next stage of this chapter was concerned with writing the code for having the game run in Windows. It was a still bore and the author acknowledged that it would be.

It’s basically the code for getting it to open a window, what interfaces it will use connect to the windows, what the icons for the executable with be used, and code on how to stop running the program upon close.

I did enjoy the information just for the simple sake that it helped me to understand that it tries to stop running code when you close an application, not just severs it. That little distinction gives my puny brain a storm of education on why a program gone awry takes forever to close. Years of angry moments just flooded through me with a better understanding. If nothing else, this book will help me teach me more about how programs are going about things. That alone is worth the price to me.

But I still want more. The next lesson is making a game engine. Just reading those words made me think of Doom. The evolutions of games seem to not be in the ability of the programmer, but in the power of the system running it. I bet when the person that made Asteroids first saw it working he dreamed of the games we play and wondered if there would ever be a system fast enough to run all that code.