Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Article Text (Score 0) 277

Immortalized for the horror.

--

If you are a maxis fan, you probably have heard of their new project "Spore." The game which was originally dubbed "Sim Everything" allows you to do just about anything you could think of, from evolving a single celled creature, to creating advanced space faring societies. Perhaps the coolest thing about this game though, is that no two player's creatures, buildings, vehicles, or even planets will be alike, and yet they are all still fully functional. How does this work when the basic building blocks of ANY of these things are just polygons? Well, to see that first we have to examine the game itself.

Spore is a game of editors. In each stage of the game, you will spend your points to change and improve different aspects of your society. You start with the cellular editor, followed by the creature editor, object editor, building editor, vehicle editor, until eventually you become able to terraform planets. The best thing about these editors: their sheer flexibility. Any number of body parts, with any number of joints and features can be stretched and pulled to any number of sizes and shapes and attached almost anywhere on your creature. The same thing goes for the tiny cell bits at the cellular stage, and the interacting material parts for buildings and vehicles. The key to making all this work? Procedural programming.

Procedural programming is a bit hard to explain, but I'll give it a shot. First lets look at what procedural programming is not. Many games and programs that you are used to use something caused "sequential" programming. Sequential programming is essentially a gigantic looped together tangle of If/Then statements. This may seem simple, but its true enough. Lets take an easy example, think back to the old days, such as street fighter 2. The If/Then statement for say, Ryu's fireball would be something like: IF your command input looks like Down, Down Forward, Forward, Punch, THEN throw a fireball, or IF the fireball image is overlapping the opponent THEN deal a certain amount of damage.

The basics of sequential programming are all object oriented. To explain this fuller, their basic building block is the object, or a thing. In the above examples, the objects were the command input, the fireball and the opponent. Programs can check whether certain objects are doing certain things by comparing their numerical values. For example if every space on the game screen is assigned a number, much like grid coordinates, the program can use simple greater than or less than comparisons to figure out where the characters, the fireballs, the floor, and everything else was.

So why can't this be used in games like spore? Well in games with so many options, the IF/THEN list becomes so long it becomes scrambled. Several calls to previous points in the list are made and the whole thing gets disorganized, something which programmers affectionately call "Spaghetti Code." Also, that much code and that many variables simply gets huge! Even though information technology has been growing at an exponential rate, there is only a limited amount of space you can put on a CD or DVD. On the PS1 there were 4 disk games, and on the PS2 there were 2 and 3 DVD games. It is only a matter of time before we have games which fill up 2 or 3 HD DVDs or Blu Ray disks.

The solution? Change the way the game thinks, and that is exactly what procedural programming does. Procedural programming dosen't use "things" as the basic building block of a program, but instead "actions." Taking the SF2 example from above "throw fireball" is one whole action, as is "Kick" "Jump" "Get Hit" and "Die" with all their particulars defined right there in the action itself. The interesting thing about procedural programming: modularity. Think of it like this: there is an action for jump and an action for kick, when you combine those two actions at once, you get jump kick. Of course its actually a lot more complicated than this, but this is perhaps the most simple way to describe it.

If you watched the spore trailers, you heard the developers comment on how nearly everything is created procedurally, and this is what makes spore so unique. There are procedures for every way a limb could move, or interact with its surroundings (including attacking, seeing, eating, and so on). Limbs and body parts are defined by these actions. The result? The program computes how the creature acts and behaves based on its construction. This allows spore's editors to contain essentially unlimited possibilities, allowing you to mold your creature, or building, or vehicle like clay, rather than create it via menus with limited choices and options.

Procedural programming can be used in just about any sort of game and has been used in emulation for years, but where it really shines is in simulation games, like Spore and Maxis' "Sim" series. Where there used to be a complex list of rules and statements, now is only a few calls to a couple procedures like "go to work" or "drive your car" for example for one of the sims in "The Sims" or one of the many inhabitants of a "Sim City".

So what does this mean for the future of sim gaming? Well first of all look at games such as Civilization. Procedural programming may mean the removal of concepts such as the "unit." No longer will you have settlers, workers, soldiers, and so forth. Instead, there may come a time in which all you have are "people" each with their own stats. You can then have these "people" do whatever you want, whether it be tending the fields or patrolling your country's borders.

As of now, the only game which is almost 100% procedural is spore itself, but fan favorites like Doom and Quake have also been largely based on procedural routines as well. This adds a realm of flexibility to FPS's. Whereas procedural programming was originally just used to dictate how certain guns and ammunition behaved, the programming can be applied to the guns themselves. Perhaps sometime in the future we will see a counter-strike type game, where instead of buying weapons you buy parts of weapons and assemble them quickly and on the fly.

Overall, procedural programming is not an advancement in technology, but an advancement in the way we think about technology. Procedural programming essentially shrinks the technological world, allowing us to fit a lot more information in limited space, and allowing this information to interact in near infinite ways. Games will continue to become more and more procedural as time goes on, increasing their flexibility as they do.

Slashdot Top Deals

Work without a vision is slavery, Vision without work is a pipe dream, But vision with work is the hope of the world.

Working...