Slashdot Mirror


Procedural Programming- The Secret Behind Spore

imashoe writes "Ever wonder how Spore works under the hood? The game seems to be insanely huge and how is it that there can be an infinite amount of different creates created in the game? The answer is Procedural Programming."

65 of 277 comments (clear)

  1. Well, no by ucblockhead · · Score: 5, Funny

    Given that I've only seen videos of someone else playing "Spore", I have to say, no, I don't wonder how it works. I wonder when the hell it'll be done.

    --
    The cake is a pie
    1. Re:Well, no by zn0k · · Score: 5, Funny

      I wonder when the hell it'll be done. $ apt-cache showpkg spore
      Package: spore
      Versions:
      1.0
      Description Language:
      File: /var/lib/apt/lists/spore.maxis.com-i386_Packages
      MD5: b7b55c3327e373b0abee0ccb25902a2b
      Dependencies:
      1.0 - dukenukem3d
    2. Re:Well, no by ichigo+2.0 · · Score: 4, Insightful

      Duke Nukem 3D was released in 1996.

      I guess you meant Duke Nukem Forever. ;)

  2. Can one use PP by Anonymous Coward · · Score: 3, Funny

    to generate one meaningful article about it? since apparently it's good at increasing noise by putting out fluff pieces as this one.

    --
    captcha: uncouth. Quite.

  3. not really by clubhi · · Score: 3, Funny

    Actually I never even heard of Spore.

    1. Re:not really by dohzer · · Score: 2, Funny

      Welcome to Slashdot.

    2. Re:not really by clubhi · · Score: 3, Funny

      Thanks!

  4. Eh? by MrSteveSD · · Score: 5, Informative

    I really feel like the person who wrote the article doesn't know what he is talking about.

    1. Re:Eh? by mmacdona86 · · Score: 4, Informative

      Yes, the distinction that they are probably trying to make is that between procedural or algorithmic content generation and the more common situation where content is created individually by artists.

      The talk about procedural versus object-oriented programming is moronic bs.

    2. Re:Eh? by tundra_man · · Score: 3, Interesting

      Yes I would have to agree. The method of programming being discussed is more akin to a Finite State Machine (FSM) in which you describe various states, events which cause state transitions and of course the define what all happens during the transition. It is a valid programming methodology and is used in telephony and other places. One popular application for working with such code was Rational ObjecTime which became part of the Rational Rose product before Rational was bought by IBM. Where FSM has troubles is with switch statements as they become quite complex (switch is the same as many IF and IF ELSE in many ways) which may be why the author was so negative to IF statements. As for games size, yes games have gotten bigger, this is however more to do with all the artwork and sounds that accompany the games and not the software driving them. As for the developer's of comment "nearly everything is created procedurally" this would explain the smaller size not because of "procedural programming" but because rather then grabbing an image or sound from artwork on a CD they are creating it in code. For example I can write some code to render a sphere, with the API allowing for color, material, lighting and others to be defined, now I can write small bits of code to call the API and create a thousand spheres all with unique characteristics, all with minimal amount of CD space being used (lets say 1K for the API definition and 100bytes per sphere = 1K+(100B*1000) = 98.6Kb). Now if I was to have 1000 unique spheres using artwork you would have 1000 unique images saved on CD plus a smaller API to load them (0.2Kb API, 100Kb per image = 0.2Kb + 100Kb *100 = 12.2Mb). Even if you were to do some optimization, which you would, the difference is clearly visible.

    3. Re:Eh? by TheGeneration · · Score: 3, Insightful

      The biggest fault with that article is that the author doesn't take into account who his audience will be. If you are going to write an article on the "breaking news" that the creators of Spore have gone to the future year of 1987 to use Pascal to write a mutliplayer online game, well... chances are the only people who will want to read your article are programmers. So don't bother trying to explain Ryu's fireball to us, we got that back in 1990 when Ryu spit out his first fireball in front of our eyes. Instead give actual details that are worth reading to your potential audience.

      --


      The Generation
      I'd say something witty here, but I'm not that bright.
    4. Re:Eh? by MrSteveSD · · Score: 3, Informative

      Yes, the distinction that they are probably trying to make is that between procedural or algorithmic content generation and the more common situation where content is created individually by artists.

      Yeah, that would be something interesting to talk about. Whoever wrote the article probably isn't the man to do it though. Did you ever play Kreiger? http://www.theprodukkt.com/kkrieger#20 They managed to cram a 3D first person shooter into 96k. It relies heavily on procedurally generated content.
  5. Crap alert by VeryProfessional · · Score: 4, Informative

    This article reads like pure garbage. Procedural programming simply refers to any form of programming in which procedure calls are made... ie. any mainstream imperative programming language. Does anybody really believe that games fill up multiple DVDs because there are too many IF statements? Editors, wake up please.

    1. Re:Crap alert by el_womble · · Score: 3, Insightful

      I think the author was confused. What they actually meant was functional programming. In fact I know the author was confused. How did they not make the connection that the 4 CD PS1 games had a lot of FMV?

      An excellent example of a little knowledge doing a lot of harm. It reads well enough that my non coding tech friends could read it, and then tell me I'm a fuck-gnut for not using a procedural language...

      Still, I'm going to assume that the eds know what they're doing and are actually just trying to get an argument blaring on this no news sunday.

      --
      Scared of flying, pointy things snce 1979!
    2. Re:Crap alert by geeknado · · Score: 5, Insightful
      I think that part of the issue here is that they've both confused the concept of procedural programming(and I'd be shocked if most games weren't programmed procedurally) with procedural generation then proceded to give a better description of the first.

      It's not that they're wrong that Spore is innovative this way(assuming it's ever more than vaporware), but rather that they do an exceptionally poor job of describing the way it works...The distinction here isn't between gated logic trees and 'actions', it's between static and dynamic content.

    3. Re:Crap alert by TrappedByMyself · · Score: 2, Funny

      This article makes baby von Neumann cry

      --

      Help me take back Slashdot. When did 'News for Nerds' become 'FUD and Conspiracy Theories for Extremist Nutjobs'?
    4. Re:Crap alert by init100 · · Score: 2, Informative

      I think that part of the issue here is that they've both confused the concept of procedural programming(...) with procedural generation then proceded to give a better description of the first.

      Exactly. And procedural generation isn't hard to understand (at least conceptually), he could just have given a brief on fractals, since they are a well-known example of procedural content generation. A tiny piece of code generates a nice-looking picture. And regardless of how much you zoom in, it never becomes pixelated, as new content is generated on the fly. The Mandelbrot set is an excellent example.

  6. hype by BrandonBlizard · · Score: 2, Insightful

    There is no way spore is going to live up to the hype they keep generating. Even if it is a moderate financial success people will view it as a failure because of expectations. as far as procedural programming is all bull, they're franticly animating to fix the impossible procedural animation system. My prediction is that it will be delayed and be a disappointment to anyone who is expecting the greatest game ever.

  7. Re:Typo in summary by buswolley · · Score: 4, Funny

    Yeah who here is sick and tired of crates being everywhere in games. I hardly ever see crates in my day to day.

    --

    A Good Troll is better than a Bad Human.

  8. Inifinite Creates? by eldavojohn · · Score: 5, Insightful

    The game seems to be insanely huge and how is it that there can be an infinite amount of different creates created in the game? The word infinite gets abused quite a bit.

    I think you meant to say 'seemingly infinite' or 'infinite for all intents and purposes.'

    I've tried to think of mental exercises to challenge people with a concept of something being infinite. For example, if you had an object of infinite mass with no gravity, would it be possible for us to exist alongside this infinite object?

    Infinity has interesting properties and I challenge the use of 'infinite' in this summary. The article uses cautious words:

    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. The basic theory of how one would store infinite states of data instantly disqualifies any device I know of. Computers, game systems, etc. are ultimately storing data in a binary on/off form. You can story many bits of data and come up with many states very quickly. You cannot, however, store an infinite amount of states on a finite amount of bytes. There's just no way to do it. A very large amount of different states? Of course. But not an infinite amount.

    For the purposes of speculation, what would be the best way to give a user a seemingly 'infinite' number of states? Well, the obvious choice (and what random number generators on computers seem to favor) is to use time. Time is infinitely divisible (although the representation of that depends on decimal precision) and it is (seemingly) never ending. So one would base the resulting states in the game off of when a user entered input. It is still very easy to show that this is a many-to-one mapping. You can divide time down to a small enough unit that they are technically different moments yet the hardware that captures the analog input cannot discern between them.

    I think that this concept of 'infinite' states is desirable to gamers. And it's the states that you find yourself in in a game that were clearly not thought out by the developers that makes a game special. When you have a large freedom of configuration pitted against players with that same freedom, you have the core success behind real time strategy games where players would build cities and armies and pit them against each other.

    I don't think this claim can ever be made when a digital machine is being used. I guess you could design a program that would adjust to the size of the machine and extrapolate the amount of precision it used to measure the moment at which the user clicked the remote button and then stamped this number on the create's forehead (or some other form of uniqueness). But, I do not know enough about how the CPU acquires the time stamp. If it's a quartz crystal, this is only accurate to the number of vibration the crystal makes per second with electricity pumped through it. I have good reason to believe you will always encounter some theoretical issue or barrier when trying to achieve truly infinite implementations. Best to leave that word where it belongs: in mathematicl proofs and scientific theories.
    --
    My work here is dung.
    1. Re:Inifinite Creates? by nschubach · · Score: 2, Funny

      Sure, it's infinite until the computer tracking your winnings hits it's floating point limit, throws an exception and crashes losing all your winnings.

      --
      Every time I start to have faith in humanity, I ruin it by driving to work between 7 and 8 am.
    2. Re:Inifinite Creates? by OpCode42 · · Score: 2, Insightful

      Time is infinitely divisible

      This may not be as true as you think. Planck time is the shortest amount of time that has any meaning.

    3. Re:Inifinite Creates? by Fractal+Dice · · Score: 4, Insightful

      The word infinite gets abused quite a bit.

      I agree ... but you really need a good catchy word for "cannot have all possible states represented even if you harnessed every grain of sand in the universe".

      According to one of the talks, a Spore world is about an 80K data structure when compressed. 2^640000 is a really big number. My fuzzy back-of-the-napkin count gives something like 2^240 hydrogen atoms in the universe. I think hard math either needs to learn to share the word infinite or it had better file a trademark :)

    4. Re:Inifinite Creates? by TheRaven64 · · Score: 2, Insightful

      If you're representing money, and doing anything important with it, you should use a binary coded decimal. This will let you maintain a fixed number of decimal significant figures of accuracy, which is generally what is needed. If you're using Java or COBOL, the language / standard library can handle arithmetic for you.

      --
      I am TheRaven on Soylent News
    5. Re:Inifinite Creates? by advance512 · · Score: 5, Funny

      Good god, you silly putties...

      Why do you bother typing in these comments? No one thinks you're any smarter now than they did before reading your message. If anything, they think you don't have a sense of humour.

  9. The obvious by Anonymous Coward · · Score: 2, Insightful

    The article author has no clue.

  10. Ad for Bona Fide Reviews by thegnu · · Score: 5, Funny

    Girl: You got Spaghetti Code in my Perl!
    Boy: You got Perl in my Spaghetti Code!
    BONA FIDE REVIEWS: our content makes as much sense as our ads.

    --
    Please stop stalking me, bro.
  11. Procedural Generation? by Asgerix · · Score: 5, Informative

    Perhaps the author is confusing Procedural Programming with Procedural Generation?

    --
    Life is wet, then you dry.
  12. want to be "evolutionary"? by SolusSD · · Score: 5, Interesting

    use a functional programming language. prove mathematically that your functions are correct. and technically, it should be fairly easy to write compilers that automatically thread the program due to the nature functions are written in a functional programming language. i encourage everyone, especially the writer of this article, to read up on it. Haskell (a programming language) is a good place to start.

  13. All you need to read is this sentence... by Anonymous Coward · · Score: 5, Insightful

    "The basics of sequential programming are all object oriented."

    That pretty much captures how well the author understands programming.

    1. Re:All you need to read is this sentence... by Krilomir · · Score: 2, Interesting

      Wasn't the Firehose supposed to weed out stuff like this? What went wrong?

  14. Vaporware by IdahoEv · · Score: 2, Insightful

    Someone with a subscription needs to tag this story Vaporware.

    I remember first getting excited about in-game videos of spore something like two years ago. It's starting to feel like we're getting nukem'd again.

    --
    I stole this sig from someone cleverer than me.
    1. Re:Vaporware by MindStalker · · Score: 3, Informative

      Oh come on, its only been 2 years. A lot of games have taken 3 years sense their first showing to the public till release. DNF is going on 11 years. No comparison really.

    2. Re:Vaporware by Movi · · Score: 2, Interesting

      Wrong. Duke Nukem Forever was first started using a heavily modified Quake 2 Engine(much like in spirit of Half-Life which used a heavily modified Quake 1 Engine), then near the end of development cycle a switch to the Unreal Engine was decided, with most of the work done scrapped.
      By the time they were anywhere close to beeing done UT2k3 was out, so they decided to use Unreal Engine 2. As far as i know they either use the updated Unreal 2 Engine (and inherited the fixes from UT2k4) or are working with Unreal Engine 3. But then again, this is Duke Nukem Forever and Ever, so who knows? Maybe they're waiting for ID Tech 5 to switch? ;]

    3. Re:Vaporware by TheLink · · Score: 2, Funny

      Wrong? He did say quake 2 first then unreal.

      Heavily modified or not it's not really that big a deal since it's heavily not here yet ;).

      --
  15. Article Sucks by jlarocco · · Score: 5, Insightful

    That article is terrible. It reads like a 9 year old trying to explain something he doesn't understand.

    1. Re:Article Sucks by pimpimpim · · Score: 2, Insightful

      Congratulations! You just summarized 99% of the internet!

      --
      molmod.com - computing tips from a molecular modeling
  16. Re:Typo in summary by Anonymous Coward · · Score: 2, Insightful

    Really, are you sure your eyes aren't just skipping over them? I don't usually think about it, but a while back I bothered to, and noticed that in real life, at least here, there really are crates and boxes everywhere in my day to day life - stacked up behind, in front, inside, and occasionally on top of shops and other buildings, on trucks, sitting on docks / side of street waiting for collection, etc. Given many games are in an "industrial" setting, where there are even more crates, I think it's fair enough.

    Now, if I lived in or was passing through an idyllic rural environment, crates would be quite out of place (hello tomb raider...), but crates are bloody everywhere in an urban or industrial environment (or even on the farm), especially early in the morning and late at night when things are being loaded and unloaded and shipped, and nefarious criminals with guns might well be running about fragging eachother in real life.

  17. Not really procedural programming by markov_chain · · Score: 3, Insightful

    More like rule-based, event-driven programming. This is what happens when people don't get a proper technical education.

    --
    Tsunami -- You can't bring a good wave down!
  18. Reminds me of Elite... by tcopeland · · Score: 3, Informative

    ...that is, this game which had an "infinite" universe. The book Infinite Game Universe has some good discussions of this sort of thing, too.

  19. Functional by hey · · Score: 5, Interesting

    *Functional* programming sometimes seems like magic. Maybe that's what they are talking about.
    Its not new but still cool.
    http://en.wikipedia.org/wiki/Functional_programmin g

    1. Re:Functional by sholden · · Score: 2, Informative
  20. Re:Typo in summary by Anonymous Coward · · Score: 4, Funny

    I kept jumping up, punching this one crate, just waiting for the gold coins or extra man to come out. Instead, one of the loading dock guys just chased me away.

  21. Re:procedural generation anyone? by thefear · · Score: 4, Funny
    From TFA:

    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
    Its not just the title, the entire article is written like that.
    --
    :(
  22. Yeah. IOW, this is a new low. by Concern · · Score: 4, Insightful

    Indeed - I'm sure you're exactly right. This looks like a new low for /. novice "tech" "writing" - and for this site for picking it up as a story.

    --
    Tired of Political Trolls? Opt Out!
  23. The review is by communications majors by whitroth · · Score: 3, Funny

    who literally know *zip*. I just dipped my toes in the article, and lines like "procedural programming is ... object oriented..." snapped any suspenders of belief I had in the article.

    Of course, it'll be smaller and faster than Objectionably-oriented software....

                mark

  24. Due date by ReallyEvilCanine · · Score: 3, Insightful

    Not before April, 2008. And it may get held up even longer since they want to release simultaneously for PC and DS even though the two versions will be different and incompatible.

  25. Re:Typo in summary by Anonymous Coward · · Score: 2, Insightful

    Crates are everywhere because they're easy to render. Only six visible triangles...

  26. Comment removed by account_deleted · · Score: 4, Interesting

    Comment removed based on user account deletion

  27. Re:Typo in summary by Anonymous Coward · · Score: 5, Informative

    Uhh... No. A 3D cube has six faces. At any given time, at most 3 are visible in a 2D projection of a 3D scene. It takes two triangles to represent a square face (many 3D toolkits "really" only using triangles underneath). So, 6 triangles. So, the original poster was correct, you lose, do not pass go, do not collect 200.

  28. creates created? by Afecks · · Score: 2, Funny

    A little help please? Does anyone have a slashdot-editor-to-enlgish translator?

    1. Re:creates created? by cowens · · Score: 2, Funny

      No, they are already speaking in enlgish. We need an enlgish-to-English translator.

  29. Re:Attention Procedural Programmers by mikael · · Score: 5, Informative
    --
    Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
  30. bzzt, wrong. by Inoshiro · · Score: 5, Interesting

    They meant procedural content generation, like L systems, used to make believable looking plants that grow and change over time.

    It's all about repeated iteration over a particular type of finite automata with a particular string.. Easily done if you've taken your 3xx/4xx graphics an theory classes, but perhaps past what most technology reporters are capable of.

    So, to summarize:
    * C is an example of procedural programming.
    * Haskell is an example of functional programming.
    * L-systems are an example of procedural content generation (content generated by a procedure, in a deterministic fashion).

    --
    --
    Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
    1. Re:bzzt, wrong. by fireboy1919 · · Score: 4, Insightful

      So, to summarize:
      * C is an example of procedural programming.
      * Haskell is an example of functional programming.
      * L-systems are an example of procedural content generation (content generated by a procedure, in a deterministic fashion). To continue the summary (and clarify):
      * Marshmallows do funny things if you lower the pressure enough.
      * Cheeseburgers are often considered delicious
      * Like the above comments, programming language type is a red herring. Procedural content generation is a misnomer. It just means that the content is mostly programatically generated on the fly instead of being simply rendered.

      It's all about repeated iteration over a particular type of finite automata with a particular string.

      And then then string is the content, isn't it? Interesting point here is that this is something of a continuum. You could make your procedures more complex, and then require less content to produce the something. On the other hand, you could go the other way and have absolutely every piece of content actually be written in your programming language.
      When you think about it that way, it becomes a lot more obvious.
      You're talking about whether most of the work is going into the content creation, or into the rendering engine.

      If most of the work is in the engine, it's really easy to make lots of new kinds of content since you don't have to do as much work to make the content. However, making a powerful engine sure requires a lot of work, doesn't it? You have to make your engine handle absolutely every special case that you could ignore if it wasn't normally applicable to a very specific content instance.
      --
      Mod me down and I will become more powerful than you can possibly imagine!
  31. Who cares?!? by IonOtter · · Score: 2, Funny

    I just wanna play God!

    Why do you abuse my games so? - Will Wright

    --
    [End Of Line]
  32. Re:The unexplored realm of dynamic content... by michaelhood · · Score: 3, Funny

    This all sounds very interesting.. have any links to your games we could look at?

  33. Where's the "Bury" button? by Doolwind · · Score: 2, Funny

    As a game programmer, I'm actually offended by this article. Why do I get the feeling it was written by a football jock who used to bash me (and other game programmers) up at high school? I was going to list the mistakes made in the article, but realized the entire article (even its name) is wrong. I spent 5 minutes looking around Slashdot for a "Bury" button, can someone contact the Slashdot President and tell him to launch a preemptive military strike on any future articles of this quality.

  34. Procedural Programming- The Secret Behind Spore by Cafe+Alpha · · Score: 2, Funny

    ... and COBOL

    Yes I noticed poster tagged the article "wrong."

  35. The article in a nutshell by Dormann · · Score: 4, Funny
    • Programs use if statements
    • The more complex the program, the more if statements
    • FF7 filled 4 CDs with if statements
    • Spore is even more complex than FF7
    • Spore must be using some new programming paradigm
    • I'm confused about what the paradigm is or what it's called, but I'm sure it uses fewer if statements
  36. Thank you! by quax · · Score: 2, Informative

    The beauty of /. is that even an absolute crap article will in most case get somebody to point out what actually was newsworthy about the item. So to summarize: It seems that the game allows the user to create their own procedural content generation through the use of editors.

  37. Re:Starflight? by GreggBz · · Score: 2, Interesting

    They used fractal algorithms to generate terrain lifeforms, minerals, and in fact the whole universe.
    Starflight I and II were written in Forth, using a custom compiler. Here is some old design documentation from Starflight.
    It's interesting stuff.

    I am in fact recreating the game (or, rather a game much like it using entirely original content) using many similar algorithms.
    Check out my webpage.

  38. The article already removed from bonafidereviews by S3D · · Score: 4, Informative
    The link form TFA no gives:

    We appreciate the honest feedback and correction regarding the content of this article. While it was well intentioned, it was inaccurate and for that we apologize. Accordingly this article has been removed.

    Something not good going with slashdot choice of article lately.
  39. Re:Typo in summary by Nazlfrag · · Score: 3, Funny

    Next time just aim for the barrel next to the loading dock guy. Kaboom!

  40. Article pulled by gatesvp · · Score: 2, Informative

    Well fellow /.ers, the article was pulled (anyone have an original for laughter purposes?) I'm oddly proud of the /. community for successfully cleaning cruft from the vast sludge of the internet. If only with could do this stuff for mainstream media... like any of us bother any more :)