Before my second semester at DigiPen ended, I started work on the beginning of a game engine that I thought I could possibly use the following school year. The idea came from the creation of some Windows programming assignment for CS230. I set up classes and relations between handlers and objects, and I thought that I could take out the specifics of the assignment and start creating something that could easily be used for my next game project. I also wanted to have a small 2D demo ready so I could show off an idea that had perking in my mind. I was crazy, but I wanted to make another game with ninjas. My friend Matt did not even want to be on my team for a second time. The object of the game was that you were supposed to be a stealthy ninja who had to infiltrate some Russian missile silo and kill commie bastards. Note: Sadly, I did not end up making this game.
Throughout the summer I improved the game engine. It wasn't much, but at least I could make a character (ninja) jump around. I also played around with some Inverse Kinematics and got one of its arms and hand to reach for the cursor whenever I held down the left mouse button. My only problem was that I had never programmed any 2D graphics before. Back in high school I messed around in 3D with DirectX for my senior project. Sure, this was technically taking a step down in dimensions and should be easier, but there seems to be more management of the sprites and attention to rendering order (this still is biting me in the butt). I also didn't feel the need to work with all the odds and ends of DirectX to show some simple graphics in a window. Matt had used Simple DirectMedia Layer (SDL) in his 2D senior project, so I got some help from him and was able to see results within a day. Later in the summer Matt decided to leave the team he would have been on this year and be on mine (except at the time I didn't have one). He felt that all they were making was a small tech demo.
He and I arrived to our game class without a full team on the first week of our third semester. Luckily two school friends of ours were in the same boat, and we decided to join forces. Unfortunately I was unable to persuade anyone else into creating my ninja game, even though I had an "awesome" demo. Matt and I forfeited any idea of ours to work on Bryan and Brandon's Kudos. It is a game like Pikmin where you play a character that can control various little "puffy/fat" creatures to do various things such as fight to the death or solve fun puzzles. There are about 10 different kinds of Kudos each with their own special abilities. You have to go out into the areas around the main town of Kudo Valley and weaken mind-controlled Kudos. Then you can get them on your own team. The objective is to stop the main evil-doer (Mortimer) and his lackeys from taking over all of the Kudos.
I wanted to be the product manager. The role of the product manager was to create all the marketing materials for the game. I also did not want to be a producer or technical director because those are the top positions on a team. I wanted to save those for my final two years, and I had already been a designer. Being the product manager was my ideal goal; I would be great with it if I was working on my ninja game. Well Brandon was the best artist in our group and he had been working with Bryan with the idea and art direction of Kudos, so he got the job. Bryan had been the main creative thinker for the game design, so he became the designer. I was stuck with the two positions that I did not want to be. From his personality, I figured that Bryan would be demanding and would spiritually take over the role of producer, so I picked to be the technical director. Also, Matt had been the technical director the previous year in The Pirate-Ninja. Since I was the technical director, it would be my job to layout the architecture of the engine for our game.
In game class I learned that we would have 2 weeks for our Game Design Document, 3 for our Technical Design Document, and 3 weeks for our midterm project. We weren't supposed to start programming until our TDD was done, but this ended up being turned in during Week 10. Well, limitations put on by the teacher were not going to stop me. I knew we would be in trouble if we started programming from scratch at that date, although we were encouraged to use our midterm as the foundation for our game. I ended up using the foundation of our game for my midterm. I was also able to use it for my personal project because no one else had touched the code at that point in time. Our assignment was to create a Bejeweled clone with graphics, input, and a game loop. It took me about 6 hours to make it with my existing engine. Note: It did not have any menus or text.
Throughout the first 9 weeks of the semester I had been improving the engine and somewhat changing it drastically. I introduced the concept of processes (idea stolen from Game Coding Complete by Mike McShaffry; I use it for larger things such as modules rather than small things such as timers), created game states, developed the relation of GameObjects and GraphicsObjects, and converted my SDL rendering to use OpenGL. I wanted to use a better graphics system so I didn't have to worry about rendering in the correct order, so I was excited that I would be again programming in DirectX. Well that idea was shot down when Matt wanted to be able to program in Linux (and he still can't due to other reasons not created by me). So I started to learn OpenGL. I had heard about Glut, but I didn't want to use it because it was outdated and some of the lines of code seemed to make me wonder if I would have to restructure the engine, which I did not want to do at that point. Maybe it wasn't the brightest decision to dismiss the wrapper, but I did.
I got OpenGL to work pretty well. We had an isometric game, and handling the different z orders of the GraphicsObjects along with those on the same z value turned out to be easy. My only problem that I faced was rendering text. Since Matt wanted to program in Linux, I had to also make the font rendering work on both platforms. Unfortunately I could not find a font system that was platform-independent and did not use Glut. I ended up spending many frustrating hours figuring out how to render my own text. Because SDL was platform-independent, I was able to use SDL TTF. My first attempt was to try and render the image generated by SDL TTF onto a texture then display it on the screen, but this was taking up 100% of the CPU and slowing down the program because SDL is a software renderer. I got some inspiration from other tutorials and examples, and I decided to create a bitmap of all the characters of the font I was loading in. I then performed a clever use of OpenGL's Display Lists and was able to render text just fine.
Engine Proof was a demonstration of all of our technology, and we had a presentation during Week 11. This, mind you, was one week after we submitted our game (aka: one week to actually work on Kudos). Well I had my graphics (including simple frame-based animations), sound, input, and basic controls. I was set. My only concern was what everyone else was doing. My dream was that we could get Bryan's state machine and physics, Brandon's AI movement, and Matt's soon to be created tile maps integrated into the game. Luckily we did not have to have all the sections integrated. Bryan and Brandon presented their own separate sections, but Matt had a tile map loading in from a file and rendering in the engine I created. The nice thing is that he did not have to touch much of the stuff I had already created. He was able to create his files and a MapProcess that needed a few items such as the GraphicsProcess and have the MapProcess created when the main level was loading.
Our next goal, finally, was to integrate all of our code together (aka: have Bryan and Brandon put their code into my engine). We had a First-Playable Prototype due at the end of Week 14; 3 weeks with Thanksgiving in the middle of it to create a basic game. Nothing much got done by my part for 2 weeks. Byran and Brandon slapped in their stuff and we had a bunch (tested hundreds and thousands) of Kudos following the player around. I then bought Mass Effect and played it all day for a few days and beat it. It wasn't until about a week and a few days before our submission that I started to get back on track.
The major thing lacking at this point was combat and player control over the Kudos. I didn't like so many dependencies with different modules, so I created an events system. With this I was able to send out simple data, which I could expand later on, with just a name of an event attached to it. The event manager would look up the event name and send out the data to various event listeners (functors), and the event listeners who were listening to particular events would handle the data that was sent. With this system in place, the UI was able to handle all input and tell the AI that there was a mouse click on some part of the world. The AI could them figure out which Kudo was selected. The best part was that UI and AI processes did not know about each other.
Before our presentation, I got one more major thing put in place. At that current point in time, the Kudos and the player were always at a fixed angle (looking towards the bottom-right corner of the screen). I wanted to have animations that changed the angle based on the direction the characters were moving. I figured eight different directions were good enough. With my current frame animations and sets, I was able to expand it to create eight-way animations. Whenever a frame is created I specify an angle (0 is default for non-eight-way animations). I can create the multiple angles for the frames and compile them together. I also had fluid transitions between angles while an animation was being played. This made the Kudos feel a lot less rigid.
I wanted everyone to meet to have a long coding session on Monday, but Bryan and Brandon didn't even show up to school. Tuesday went by without any team progress. We had to meet on Wednesday. It was crucial to our presentation; combat was not in the game at this point. We started work around 10 in the morning and kept on working until about 6 or 8 in the evening. We managed to get in combat between Kudos and between the player and Kudos, yet the evil Kudos could not attack the player. It ended up with me programming the player's combat, which I was not supposed to do (according to our project planning timeline). I also added evil-looking Kudos and the ability to switch the animations so the two sides looked different. Our presentation was OK. There were no physics in the tiles and Brandon's code was flawed (some Kudos seemed to be chased when fighting and would run off to infinity). There were definitely better games than ours.
One thing that I was not happy about the game was Brandon's willing to work on the project during the last week. I had asked him to work on the AI movement over the weekend before our game was due. He said on Monday that he was halfway there, and he had uploaded some code which was only a few lines and most were just duplicates. He told me he would be working on it all Monday, when he didn't show up to school. On Wednesday I told him we had to meet to get it done and that I would pick him up later on in the day. He said he would upload the code before I picked him up. He did not upload any new code before we started to work, so it gave me the impression that either he was crazy to start over again or that he wasn't working on the game. Late in the evening he quit what he was doing and wanted to go home. I was his ride and was still working, so he wasn't able to go home. I asked him if he was satisfied with what he did and if he would have no problems showing it to the class. I thought it was lacking, but he was OK with it. I came to the assumption that he was playing Morrowind all weekend and up until this point as he was talking about it with Matt, whom had played it extensively 5 years prior. If this highly probable situation was true, then he poorly lied to me, and I don't like that.
During the winter break I thought I would be using the bonus hours and work on the game a bunch. I spent a week of relaxation, then my brother came home. The rest of the time I was with him or playing BioShock, and I didn't touch the code until 2 days before the new semester. Brandon failed one of his three classes, which was a prerequisite for GAM250, and is now technically off our team. He has still made promises of fixing the AI movement, but has failed to actually do so. If you have read the Assembly post, then you would know I hate repeated false promises. Justin, someone I have known during my entire time at DigiPen, left his team and joined ours. We'll see how that goes, but I am pretty hopeful at this point.
1/21/08
Subscribe to:
Posts (Atom)