Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by Sam, posted on February 28, 2005

Image Description, by Sam

This is a screenshot from the game I'm programming for PC using MSVC++, using OpenGL and DirectX.

As I am primarily responsible for the engine, I will talk about that. I'm particularly interested in the use of fractals and random seeds to create compelling worlds. The engine consists of two main parts: the city and the character.

The city is represented as an mxn array of quadtrees that stores objects, textures and neighbors. Each quadtree is made of subtrees that store smaller levels of detail from city blocks, to buildings, to sidewalk tiles. The idea was to write a script to do a fractalized-"Conway's Game of Life" thing to create a believable, randomly-generated city. I'm looking into Python and Lua to help me do that.

Like the city, the character is also built on fractals. The GameCharacter class supports stats like health and strength and manages control and animation. It is built on top of a Stickman class that stores the appearance and animation. The Animation class stores various poses and interpolates to fill in the blanks using either slow-in or slow-out animation. There's also a tool that allows animators to create these files. The animation pose system is built on fractals: the Body class contains 5 Limbs, (torso being a Limb) and each Limb contians 3 Joints. The plan was to apply this idea to animate hands so that each hand could be represented as an instance of the Body class.

Image of the Day Gallery


Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

February 28, 2005, 08:43 AM

Looks interesting, but where is the lighting and the shadows?

Sounds like u put a lot of time in it, what made u choose this (in character part) over a ready animation package (think cal3d)?


Sam Jew

February 28, 2005, 10:40 AM

Actually there is OpenGL lighting there. It's maybe just not apparent because it's high noon and the building faces are flat.

The reason there are no pixel shaders and projected shadows and such is that this is still a work in progress and I made the decision at the beginning to implement basic functionality before worrying about eye candy. If I did the eye candy first, it would all be obsolete by ship time, as was the case with Duke Nuke'em Forever. Furthermore, I figured it would be easier to integrate new features iteratively without breaking anything if everything was part of a complete and functional framework rather than trying to build a game underneath a graphics engine. Finally, I thought it would make it easier to prototype the fun aspect, that being the gameplay, which was what was most important.

I even coined a catch-phrase to describe this philosophy: "Bake the cake before frosting it."

The dinosaurs of Jurassic Park started out as wireframes.

Alex Herz

February 28, 2005, 12:28 PM



February 28, 2005, 12:37 PM

Slap some hemisphere lighting on your models in the meantime, will make it look a little bit less dull.

That is (per vertex, in your vertex shader):

lightcolor = lerp(downcolor,upcolor,(worldspacenormal.y+1)*0.5);

where downcolor is gray/brown and upcolor is your sky color.


February 28, 2005, 01:46 PM

I thought he said he didnt use any shaders yet.


February 28, 2005, 05:10 PM

He said there are no PIXEL shaders =]

nice stuff here, looks promising


February 28, 2005, 08:58 PM

Why on earth do you want the hands to be a body? I can't quite see how this saves you any effort.


March 01, 2005, 06:24 AM

Yes because all games need to look as good as Unreal 3, even during prototyping.

Sam Jew

March 01, 2005, 06:46 AM

By making the hands an instantiation of the Body class, I get to reuse all of the stuff I already wrote for animation of the body for hand gestures and have the handgestures move independently of the body without writing extra code.


March 01, 2005, 04:06 PM

Just curious, what sort of game is this going to be?

Sam Jew

March 03, 2005, 01:37 AM

The Sims Online

This thread contains 11 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.