Author Topic: Think This Programming Type Could Be Useful?  (Read 3262 times)

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Think This Programming Type Could Be Useful?
« on: March 24, 2006, 01:32:43 AM »
http://en.wikipedia.org/wiki/Spore_(game)

saw a vid for it, and it was talking about procedural something in the coding
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline Sl0vi

  • Sr. Member
  • ****
  • Posts: 464
Think This Programming Type Could Be Useful?
« Reply #1 on: March 26, 2006, 01:23:54 PM »
Seems very similar to an old game. Called life or something like that, can't remember. Also a game where you had to help lifeforms evolve. Seemed very boring, so I never bothered to play it.
!!!YAY!!!

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Think This Programming Type Could Be Useful?
« Reply #2 on: March 29, 2006, 02:48:27 AM »
ANYWAY, the prcedural whatchamacallits (I keep remembering the word for only a fraction of a second, then forget it again), they use input given to develop the most natural behavior and movement possible for the creatures.  Think the same idea could be used to create a better "AI" program?
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Think This Programming Type Could Be Useful?
« Reply #3 on: March 29, 2006, 08:05:33 AM »
Well, a brief description of procedurals (as I am a coder).

Procedurals are pieces of code that, in general, handle rendering of a graphical effect (often times in 3d games), instead of using prerendered artwork to create the effect.

For example, in 3d games, most particle / smoke effects, as well as waves (in a liquid) are procedurals, rather than using textures to create the effects. (Using textures to create smoke: think of old FPS games like Duke Nukem and Doom, where weapon impacts were just sprites drawn on the screen whereever the projectile happened to hit).

Mirror image effects can be done using procedurals as well.

Instead, a piece of code is used to produce the effect. Like the description said, it uses input (information from the environment) to create more realistic effects. (This is why, in 3d games there can be a reflection of the player/items behind him in a mirror or pool of water, because a piece of code handled the generation of this effect).

A closer-to-home example of a procedural would be in Outpost 2.
Most of the weapons fire in OP2 are just bitmaps stored in OP2_ART. When the game wants to show the weapons fire for a weapon such as the Rail Gun, it just uses the bitmaps from OP2_ART (in this case, the blue torus-shaped projectiles from the rail gun) and draws them in the correct place, to show the fire from the rail gun.

However, the laser, microwave, and thor's hammer fire are all procedural effects, as well as the 'glowing unit' when a lightning bolt hits a unit (either from the Thor's hammer or from a lightning storm). This means, there are no bitmaps for these graphical effects, they are rendered using a piece of code. (Albeit, these effects are pretty simple)

You might notice how they are 'semi transparent', you can see part of the terrain / unit below the weapons fire. This is due to procedural effects, as they can perform the alpha blending. (OP2_ART bitmaps have no alpha blending support, only basic sprite support (transparent/opaque))

EMP of any sort (both from the weapon, and from other events like a tokamak explosion) is not procedural however. It uses sprites from OP2_ART. Acid cloud also uses sprites (every other pixel in the cloud is transparent, in a checkerboard pattern, so it's possible to see through the cloud)

Anyway, hope that answers some questions.

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Think This Programming Type Could Be Useful?
« Reply #4 on: April 01, 2006, 03:54:19 AM »
well, in the vid I watched, they mentioned that procedurals were also used to develope behavior of compute controlled units that are player made
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline Betaray

  • Administrator
  • Hero Member
  • *****
  • Posts: 2897
Think This Programming Type Could Be Useful?
« Reply #5 on: April 01, 2006, 09:51:02 AM »
yea spore, that looks like the coolest game ever besides op2 of corse

ive always thought it would be cool having a game where it would evolve itself allowing each game to become unique, instead of cookie cutter

just think, takeing over the galixy with carebears with mechs lol
I am the nincompoop, I eat atomic bombs for breakfest, fusion bombs for lunch, and anti-matter bombs for dinner

I just hope they don't explode

Offline Sl0vi

  • Sr. Member
  • ****
  • Posts: 464
Think This Programming Type Could Be Useful?
« Reply #6 on: April 01, 2006, 10:09:40 AM »
procedurals can also be used to make cool 96kb games with awesome graphics like this one:

kkrieger
!!!YAY!!!

Offline Betaray

  • Administrator
  • Hero Member
  • *****
  • Posts: 2897
Think This Programming Type Could Be Useful?
« Reply #7 on: April 01, 2006, 10:34:29 AM »
dude, thats 96 kb? that is AWESOME!!

why dont they make every game with procedurals, it would allow them to pack wayyyyyyyyyyyyy more into a small space

instead of a really detailed game only have 10 levels or so, because the entire level design is stored in the disc, it could have 100 levels because they are stored as procedurals
I am the nincompoop, I eat atomic bombs for breakfest, fusion bombs for lunch, and anti-matter bombs for dinner

I just hope they don't explode

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Think This Programming Type Could Be Useful?
« Reply #8 on: April 01, 2006, 07:33:52 PM »
Yeah, that is an interesting use there in that game.

However, it's just not used everywhere, since procedural rendering can take more system resources to do, especially in the case of a 3d game. It's just faster to use prerendered data than to generate that data on the fly. (If you have ever created a custom level for a 3d game, and waited several minutes for the level to compile into a form that the game engine can use, that's proof enough why procedurals might not be such a good idea). In most cases, the level files contain data that tell the game what vertices and surfaces are / aren't visible in different parts of the level, that way the game can speed up rendering greatly (it doesn't try to render stuff that the user wouldn't be able to see). They might also store other types of data, like data that describes how light hits various surfaces in the game. To figure all this out at runtime can take lots of time. (Hence why the game up above would need to make levels and textures a lot simpler, so it doesn't take a long time to prepare the level)

It's also not the greatest for every possible use out there.
In a game like that where the textures are mostly very simple (I see things like checkerboards and such), it works great. If you have to render more complex textures, or even photos or large images of some sort, procedurally creating them would take a long time. (and possibly not look very good. Also, the data that describes such files might be larger than if you just took a standard bitmap file in the first place)

Also, another example of procedurals in everyday computing.
Truetype fonts utilize procedural rendering. TTF files contain bytecodes (similar to Java .class files) that are run by the font renderer to render the font. (You could debate whether this is 'fully procedural' since there are letter glyphs stored in the TTF file, however the bytecode program is still responsible for rendering these glyphs)

The definition of a procedural renderer can be as wide or as narrow as you want it to be. The widest definition would be to say ALL graphics renderers are procedurals (since a bitmap can't draw itself, a program is needed to load it into memory and display it on the screen or do whatever is needed with it).
The narrowest definition would be a renderer that does all rendering thru code, utilizing no external data to do its work (not even meta data that describes how to do the render would be allowed).

The generally accepted definition, I would have to say, is where code does most of the rendering (it's not just loading bitmaps and displaying them), but it might use some sort of external data to tell it how to render (in the case of the 96kb game up above).

Offline Sl0vi

  • Sr. Member
  • ****
  • Posts: 464
Think This Programming Type Could Be Useful?
« Reply #9 on: May 05, 2006, 09:25:52 PM »
All the graphics in kkrieger are procedurally rendered, it doesn't use any external data. Procedurals simply just take up alot less space. Take a look at their faq:
http://www.theprodukkt.com/faq.html

Also look at the video in the thread about spore in general discussion. Almost everything in the game is procedurally rendered, and it looks amazing!

Try finding the full lecture on www.video.google.com, he explains alot about the advantages of procedurals.
!!!YAY!!!

Offline zigzagjoe

  • Hero Member
  • *****
  • Posts: 626
Think This Programming Type Could Be Useful?
« Reply #10 on: May 06, 2006, 10:56:52 AM »
yea, i messed around with theproducktt's demos n such around a year ago, cool stuff. never thought to post it lol