Categories
Game Development

Game Development Skill Acquisition

In response to my post on Creative Writing Prompts and my search for a similar tool for programmers, scott posted a link to Code Kata at Dave Thomas’ (The Pragmatic Programmer) blog, PragDave.

There are a few posts describing Code Kata, but one of them mentions the Dreyfus model for skills acquisition.

The Dreyfus model suggests that there are five stages in the acquisition of mastery. We start at novice: unsure and with no experience. We don’t particularly want to know the “why,” we just want to be shown what to do. We need to know the rules, because we just want to achieve some goal.

While Code Kata is for learning how to program in general, I think the skills acquisition description was very insightful and can apply to learning game development. I think I had posted previously about how beginners should start by making simple games because doing so will teach them a lot about what it takes to make more complex games later. Of course, I was mainly talking about myself as the beginner game developer.

I already knew that I needed more game development experience, but I need to realize that it is not just OK to make a clone for my first game or four. It might be necessary. As PragDave mentions, it is like learning karate. If you’re a beginner game developer, you should be able to emulate existing game developers before you start trying to work on your own plans. You can’t start by being the Master. You have to start as a beginner by emulating the Master.

People on GameDev.net periodically find that they need to inform idealistic newbies that they won’t be able to make the best MMO game ever. “Try something simpler, like a Tetris clone” or “You need to learn how to program” or “/me slaps you with a trout” might be common responses. The newbie is a student of game development who thinks he/she can skip the beginner and intermediate phases and start making games like a master. The newbie needs to learn how development works first. He/she needs to learn the rules. It’s learning the “How” before the “Why”.

I have a number of ideas that I think are somewhat unique, and I would love to make games out of those ideas. At the same time, I know that if I try to make those games today they won’t turn out nearly as good as I would want. I can, however, make simple clones, and I’ve already made a Pac-man clone in QBasic years before, complete with bouncing cherries and multiple levels, so I know I can do it. Perhaps a Space Invaders or Asteroids clone wouldn’t be such a bad idea after all. For a long time I thought that making clones of existing classics would be wrong in some way. I could do better and make something unique for my first few projects, right? I mean, does the world need another Pong clone?

Well, perhaps it does.

I’ll still try to finish Oracle’s Eye first since I think that finishing a game project is a good habit to gain. My next projects will likely be some simple clones which will be easier to complete in a month.

Categories
Game Development

I Want This Musician!

Paul Taylor wrote about working on an indie game called Determinance, and he is exactly the kind of musician I would want to have working on any of my own games:

Each track, even the menu music and closing theme, is based around a core melody or chorus. This is something I believe in passionately – if you can’t whistle the tune of a song then it’s 99.9% likely to be worthless.

Wouldn’t you want a person who is passionate about what he does making your games?

Categories
Game Development

Oracle’s Eye Development: Frame Rate Independence

Last time I mentioned that I had made a stick figure to move around. I implemented four degrees of movement for it, but I still don’t have a timer to make it move at a sane rate. Since this project is late anyway, I figured I might as well learn about implementing frame rate independent movement.

I actually looked at my GiD entry and found that it was handling the timer code badly. Basically, the game would update every time an SDL Event occurred. Normally the event would just be the timer callback and would run fairly regularly. But if you pressed a key or released a key, an extra update and draw would occur. Now, I programmed it to allow you to hold the key down to move so it only speeds up when changing directions and may not be as noticeable; however, if you press keys multiple times, it becomes very obvious. For my first GiD, I suppose it isn’t that big of a deal.

For Oracle’s Eye, I decided to create frame rate independence. It basically means that the rendering happens independent of the game world updates. The game can go from 30 frames per second to 100 frames per second to 15 frames per second, but the game world will still update once every 10 milliseconds or whatever I want to set it to. It should result in smoother animation and movement.

When I started this project I didn’t think that I would be working on such an “advanced” topic. It sounded a bit complex and beyond my abilities. Well, screw that thinking. It can’t be THAT far beyond what I can currently do. In fact, when I think about it, making games in general is still a challenge I haven’t decisively overcome yet, so I’m charging forth. Screw you, Pessimism!

Luckily someone just posted about this topic on the SDL mailing list and so now I have a link: Game Physics: Fix Your Timestep!. Reading it gave me some idea about what needs to be done, but variable names like t and dt and functons that come out of nowhere make it hard to follow. I was able to find another article on gamedev.net called Achieiving Frame Rate Independent Game Movement. It is a bit shorter, more to the point, and easier to follow.

Problem # 1: It is a good thing that I haven’t gotten too far with my game project because implementing this feature is going to require a redesign. I originally envisioned moving my characters about by telling them to move so many pixels directly. For example,

player->moveX( moveSpeed );

should move the player sprite to the right by moveSpeed distance. If moveSpeed is 5, then the sprite will move to the right five pixels.

It would have been fine, but with FRI movement, I would need to do something different. As I understand it, I would have to know where the sprite started and where it will end up. Then I have to calculate at any given moment where it is along that path. Whereas before I would have moved the player sprite an arbitrary number of pixels, now I will need to determine how many pixels it moves each second then calculate how far to move it per frame. If a player should move 60 pixels per second, then the total movement of the sprite in all frames in that second should add up to 60 pixels. The trick is figuring out the movement each frame.

Problem #2: FRI movement works much better in 3D than in 2D. In 3D, the actual 3D model is just math. You can interpolate the animation of the model, and it will look smooth no matter how slow or fast you run it. I’m using sprites, and sprites have only as many frames of animation as I created. Let’s say I have three frames of animation for a walking sprite. Normally, I would just update every so often and make the animation step forward each time, but with FRI movement, how do I handle the partial movements AND animate at a normal pace? I can’t update each movement because then it looks like the player sprite is running way too fast. Do I have to figure out how far it should move before each frame gets updated? Does it even make sense to have FRI movement in a 2D game?

Starting this, I felt a bit overwhelmed. That’s a lot of things to take in, and all I wanted to do with Oracle’s Eye is make a simple game. Still, I forged ahead. I figured it is better to learn about it sooner rather than later.

I found a few more articles: Main Loop with Fixed Time Steps on Flipcode and Frame Rate Independent Movement on Gamedev.net. I also found a few threads on gamedev.net that discuss “time based movement”.

It actually doesn’t seem so bad now, at least for Problem #1. In fact, I don’t have to change my existing code all that much. I changed the moveX() and moveY() functions to take floats as arguments instead of ints. I added some timer variables: one for the delta, one for the current time, and one for the last time.

In my PlayState::update() function:

gTemp_currentTime = SDL_GetTicks();
gTemp_deltaTime = (gTemp_currentTime - gTemp_lastTime) / 50.0f;
gTemp_lastTime = gTemp_currentTime;

Then for each of the directions, I just change the code from:

gTemp_player->moveX( -gTemp_speed );

to

gTemp_player->moveX( -gTemp_speed * gTemp_deltaTime );

The 50.0f is fairly arbitrary. The code I got it from used 1000.0f to convert from milliseconds to seconds, but I found that the delta almost never became anything greater than 0, which meant that nothing moved. Using 50.0f seems to be fairly fast and smooth on my system. Of course, it depended on gTemp_speed which is in pixels per second. If I set it to 50, it ran quickly. Setting it to 25 slowed it down quite a bit, but it was also jerky, and setting it to 100 made it too fast.

It also didn’t take me too long to implement it, so I got suspicious that I did something wrong. After all, it shouldn’t matter how fast the sprite is moving. I will likely have sprites moving at different speeds, so what gives?

I found yet another tutorial, and this one actually made use of SDL. It turns out that I don’t do much differently. I ended up having to add SDL_Delay( 10) to the draw() function to get it to slow down enough, but I think that is a bad kludge. I believe that the reason it won’t move the sprites between each frame is because there isn’t enough to do between frames. The time between frames looks like 0.0 and so nothing happens. The delay allows changes to happen, but there is still the ugly jerkiness every once in awhile.

The next day, I tried again. I changed it so that it will constantly loop until deltaTime is something other than 0. It worked and looked great, but I found out that I forgot to remove the SDL_Delay() line. When I removed it, it ran incredibly slowly again.

So I changed the loop. I basically checked to see if the start and end times were 1/30th of a second apart since I wanted the game to update game logic at 30 frames a second. If the difference was less than that time, I delayed. It seems to work out well. 1/60th of a second looks even nicer, but I’ll have to do more testing to verify.

Unfortunately the use of floats/doubles means that when movement gets converted to ints for Kyra’s sprite movement the precision gets lopped off. I think this loss of precision is the reason why some of the movement might look a bit jerky. Of course, Problem #2 might be a tougher issue, but I’ll have to tackle both of them another time.

I am fairly pleased with what I have done in a few hours over the course of a couple of days. To think that I originally believed that I wasn’t up to the task and would have skipped it. I win.

Categories
Game Development Geek / Technical

J2ME Development

I mentioned previously that I was going to help a friend with his mobile game development company, and so I finally got around to learning how to work with J2ME.

I’m reading J2ME Game Programming by Martin J. Wells. I don’t much care for his randomly inserted jokes, and it is fairly obvious that the book is geared towards Windows. At one point I thought that Sun didn’t offer a MIDP1.x package for Linux-based systems, but I finally found it. I really didn’t want to be forced to use Windows every time I worked games in general, let alone mobile games.

It didn’t take me long to get things going, as you can see:

/me finally gets to check off an entry in his TODO list.

Categories
Game Development

Oracle’s Eye Development: Third Week

I covered the results of the first week of development on Oracle’s Eye. By the end of that first week I realized that my plan was overly optimistic, considering I usually have a single day of development time per week. While I can use the 10 Minute Method to get something done each day, there really is only so much code that can get written in a 10 minute session. I basically try to do other things on those days, such as setup the build files or create really simple images in the GIMP. Basically, whatever I can do that doesn’t require much concentration. I don’t need to be in the zone to create simple images. Let the artists worry about making it look just right.

According to my plan, I was supposed to be able to move the player around in four directions and create a room by the first week. By the end of last week, I was hoping to be able to load levels, and ball movement should have been in place the second week.

Unfortunately, I’ve only just now created a stick figure with one frame of animation that moves in one direction. Well, enters hyperspace in one direction is more like it. I realized that I never placed any timers in my code, so the drawing and updating is happening many, many times per millisecond. It literally looks like the stick figure is getting pulled through space-time as it moves. That’s fine and can be fixed, but oddly enough, it somehow wraps around the other side, even though I never coded it to do so. I am definitely not comfortable with not knowing why my code is behaving in this way.

Bottom line: I am WAY behind schedule. I have to decide if running late is acceptable or if I should minimize the design so much that it is an even simpler game than I originally envisioned. I wanted to have a small game completed by the end of August, but I’m wondering if it might be better to continue with my current design and plan to work through September and likely October.

It basically boils down to this question: is it more important to have more games in general, or finish this game specifically? Finishing this game design would allow me to show what I can do when I dedicate myself to the project. On the other hand, making a really simple game would allow me to not only have a finished project sooner but also let me work on a new one right away.

I’ve got some thinking to do.

Categories
Game Development Games

August IGDA Presentation: Creativity Is a Dirty Word

The Chicago chapter of the IGDA flew in Lorne Lanning, of Oddworld fame, to give a talk titled “In a Walmart World, Creativity is a Dirty Word”. I took the opportunity to volunteer to help out by collecting the entrance fee and selling the occasional IGDA t-shirt. I got to meet quite a few people, if only to shake hands with them, including Dan Choi of Joystiq.

I only played an Oddworld game once at a friend’s house, and so I wasn’t familiar with Lanning, his work, or his history. I went into it thinking that it would be a fairly standard presentation.

I was wrong. His presentation was very humorous, including many classic pictures that anyone who has been online for any length of time must have seen in a forward or link. It covered topics ranging from the role of games in escapism to the cost of imagination realization to the barriers games have in a world where “creativity” equates to “high risk”. The whole time you could tell that Lanning has a passion for what he does, and it was very infectious. At least for me. I couldn’t wait to get home and start creating things. In the interest of full disclosure, I actually ended up eating macaroni and cheese and cookie dough ice cream with friends that night.

Lanning started off talking about what the culture was like when he was growing up. Basically, gloom and doom. Vietnam, fear of nuclear war, and all sorts of issues with trust in politics resulted in a very disgruntled population. Then George Lucas makes Star Wars, and people have an escape. Lanning notes that in some poverty-stricken countries, people go to the movies every night. Movies were a form of escapism, and the nation desperately needed it.

Lanning mentioned that the costs of realizing your imagination had been going up. He talks about how he used to draw and paint, and he would think of it as taking “Kodak images” of some other world and time. A pencil and paper costs very little when you’re a child. Paint sets start to cost money, but they are doable on student’s budget. A basic camera to create a film costs even more, and when you add up the costs of actually producing a movie, it starts to get prohibitive to do. Then supercomputers were used to make computer graphics in movies, and the costs were astronomical. It costs hundreds of thousands of dollars per month for cooling the machines. Computing costs have come down recently, however, and a personal computer for a few thousand dollars is a supercomputer compared to the machines that cost millions a few years ago. He basically makes the point that movies and games cost quite a lot to produce. When I asked if he agreed with EA that game budgets are going to go up as much as they say, he basically said yes, but he did acknowledge that not all games are trying to be incredibly realistic or flashy.

He showed a number of pictures portraying developers and publishers. That was hilarious. He displayed some movie clips from work he had done in the past, including some computer generated movies, Abe’s Oddysee (“Follow me.” “OK”), and the latest, Stranger’s Wrath. He talked about the importance of empathy in games, and that it didn’t take too much work to get people to love the characters in Oddworld’s universe.

He documented the downfall of the word “creative”. In 1994, it was good. Companies wanted creative. They might not understand games, but they understood that good, creative games resulted in cold, hard cash. Today, publishers want to be able to sell games that they already know how to sell. Creativity is still good, but only incrementally. They know how to market a first person shooter or a real time strategy game. New genres are scary. If an incremental improvement can result in profit, why risk so much on a completely innovative game?

Retailers and magazines will push those games that get the most marketing bucks in their pockets. Lanning mentions that Alexander was a terrible movie, yet gets an entire wall of shelfspace at a rental store. Meanwhile, The Fog of War: Eleven Lessons From the Life of Robert MacNamara gets over 100 great reviews and an Academy Award among others, and you will find it buried on a shelf with a bunch of terrible movies. Similarly, you can have the greatest game ever, but if a magazine doesn’t think it will get full page ads from it, good luck getting on the cover.

At some point he commented on the political issues in the game industry. Interestingly enough, he warns that the political attacks have only just started. When I asked if he could comment on what he thinks it might look like, he simply answered that politicians are like game developers. Both are trying to cut through the noise and promote their brand. In the case of the politician, that brand IS the politician. Games are an easy target.

He concluded with a comment on the ability of game engines to create film-like experiences. Previously a computer-generated movie had to be scripted and pre-rendered. Now machinima is just being explored. Next-gen systems will only increase the possibilities to make compelling stories. While pre-rendered will always look better than real-time in movies, Lanning notes that it is getting to the point where it won’t matter to the viewer. Linear and non-linear stories will just become easier to develop.

My favorite part of his presentation was the idea that in a few years the question “Are you a gamer?” will be as silly as asking people today “Do you listen to music?” No one today says, “I’m a movie watcher”. In the future, “I’m a gamer” will be just as silly a statement.

The IGDA Chicago chapter recently decided to try to create higher quality meetings, and if this one is any indication, I look forward to the next one.

Categories
Game Development Games Geek / Technical Linux Game Development Marketing/Business

Quake 3 Source Now Under GPL

It’s been in the news for some time, but it is still very cool news: Quake 3: Arena Source GPL’d

id has been pretty good about releasing the source to their older game engines. It’s not a new idea for the company. Apparently you still have people who think that the GPL is about stealing someone’s work, as this comment shows:

A Shame
Why did not you buy this game ?

Quake 3 is a great game, it costs few bucks

You want games for free, so I ask you to work freely, without salary.
Give your goods for free if you ask the games for free !

Huh?!? id released the source code to their engine under the General Public License. The game data and scripts remain proprietary, so you can’t legally play the GAME unless you pay for the proprietary data . It isn’t like some GPL zealots hacked into their servers and placed the code under the GPL. It isn’t like Carmack will come out with a statement like, “It is with great regret that I must inform everyone that we’ve lost our source code to the scourge of the GPL; however, we will not give up. We will fight back, and we will win!” It was a conscious decision to release the source, and no one is under the delusion that it is a free lunch except for people who think that the GPL equates to legalized piracy.

The Complete Text of General Public License
The GPL covers whatever an author wants to cover. Some games, source code and data, are covered under the GPL entirely, but the terms are restricted to the engine’s source code in this case. Therefore, the GPL dictates the terms of copying, modifying, and distributing the Quake 3 Arena source code. Not how you actually use the program. Not what you can do to the art or music that comes with the game. Copyright law gives id exclusive rights to the Quake 3 Arena engine source code. If they want to allow people to read the code, change the code, compile the code, redistribute the code, etc, they have the right to do so. The GPL is simply one of a number of standard documents to express what rights they are allowing others to have.

Don’t worry. No one is ripping id off.

Categories
Game Development Marketing/Business

Success With Style

I didn’t know that Donald Trump had a blog, and I never really paid attention to him anyway. “You’re fired!” was never really a catch phrase I cared about, and I always thought that he was just an incredibly rich guy. No reason to care one way or the other about him, right? I find it funny how many of the comments on his blog are just people throwing compliments left and right. Not just compliments, either. Worship is probably not too strong a word to describe it.

Anyway, I did enjoy reading Success with Style, where he essentially talks about how true beauty is deep. Success comes with style, and style isn’t something you can slap on as an afterthought. It has to be there throughout the design and development of whatever endeavor you are taking on.

While he wasn’t talking about game development, I think that if you were to make a game and try to add higher poly counts or orchestral sounds without truly paying attention to how it fits into the game, you would have something superficial, and people will know. Generally, it is understood that a good game isn’t just good graphics, although I have been surprised to find people who thought it was the most important thing in a game. Of course, it isn’t like there is a definite formula for making a good game since the definition is different for so many people. Still, I think that if you keep style in mind, how can you go wrong?

Now we just need to decide on exactly what style means, and we’ll be all set. B-) Maybe this is related to a timeless way of game design?

Categories
Game Development Linux Game Development

Open Source Multiplayer Server/Client Library

Maybe a year or so ago I was trying to find something along the lines of a multiplayer lobby to include in my own games. I didn’t have any games in mind, but I knew that I would need this software if I wanted to make a useful multiplayer game. Unfortunately it was difficult to find, and I didn’t like the idea of using GameSpy’s software as there didn’t seem to be anything Gnu/Linux compatible about it. It’s even more out of the question since I want to release the code under a Free/Open Source license. I would have to write my own server/client software, and I basically took comfort that I wouldn’t have to worry about making a multiplayer game anytime soon.

Then I saw a post on gamedev.net:

GNS, or Game Name Search, is an open source game portal client/server package. Game developers may integrate the GNS client into their video games, and host an online GNS server to allow clients to find each other over the Internet. GNS servers also provide chat room functionality and content hosting.

It is under the MIT license, which makes it perfect for FOSS and proprietary software developers alike. It is currently at v0.1 Beta, but Gamieon, Inc already has plans to host gaming servers in the future. I imagine that charging for this service will be their main source of revenue from this product, although they do have others.

I think this software sounds like it has a lot of promise and would fit in perfectly with my own game development. When I get to the point where multiplayer games are a possibility for me, GNS will definitely be on the short list when I decide what tools to use.

Categories
Game Development Geek / Technical

Time Flies

Whoops! I didn’t meant to stay up past midnight programming!

I think it is a good thing that I was getting so into it that I didn’t notice when an hour or two went by. At least, that’s what makes me feel better about how behind my project is. In this time, I managed to get the program window to come up and close on the correct input without seg faulting for the first time.

I was still having fun, as frustrating as it was. I distinctly remember not feeling motivated when I started this programming session, but here I am, hours later. Good night!