Showing posts with label game design. Show all posts
Showing posts with label game design. Show all posts

Tuesday, December 25, 2012

Musing on Procedural Generation


Wow - this blog is still here. 

It's been a while since the last post, and it's going to be of an entirely different character. I'm writing this blog mainly as an exercise to flesh out some thoughts I've had tonight about coding. Suffice it to say that in the time between Cairo and now, I've founded an indie game studio (Send More People) and started to get into the language C#.

The Gist of It

Space sometimes poses a challenge for game designers. Space is big - our own galaxy has something close to 100 billion stars in it, and many of these stars have orbiting planets. Generating billions of systems can be tricky for reasons of scale - storing the data, and, from a design standpoint, ensuring that each system is built properly.

Spore supplied players with a vast procedurally generated Galaxy
Minor segue: games like Escape Velocity had a few hundred star systems and hand-crafted each one. Usually there were only a handful of planets in each given scene, and their qualities were pre-determined. Compare that to a games like Sins of a Solar Empire - where each game is set in a procedurally generated star system - and the scripted feel is exchanged for variable gameplay. And it occurs to me now, Spore did a great job at generating a galaxy... although it didn't give you much to do in it.

Anyway, I'm thinking that it would be fun to procedurally generate a universe for a player to explore. Here's how I might organize the variables in a such a system, and the variables they might produce. Each of these variables should be derived with the others in mind; for example, planets closer to the star  would likely be warmer than those further, etc. The relationships would be complex, though - surface temperature would also be influenced by, axis rotation, atmospheric content, day length, etc.
  • Stars
    • Number of (Integer, likely 1-2)
    • Type (name)
      • Brightness (Float, Scale 1-10)
      • Size (Float, Diameter km)
      • Mass (Float, Whatever the Unit of measurement is for stars...)
  • Planetary Bodies
    • Number of (Integer, Probably between 0-15?)
    • Size (Float, km)
    • Atmospheric content (Array, Chemicals and % of Atmosphere)
    • Mass (Float, kg?)
      • Gravity (Float, Unit is "G" for earth gravity.)
    • Surface Composition 
      • Chemical (Array, Elements and %)
      • Liquid on the surface (Boolean)
        • Size of Bodies of water (Integer, percentage of surface area)
    • Life 
      • Exists? (Boolean)
      • How Many forms (Integer)
      • Intelligent (Boolean)
        • Hostile (Yes/No/Neutral)
        • Technological Development (Array, Stone-age to space god)
      • (Many, Many other variables possible)
    • Moons Orbiting
      • Same variables for planets
    • Orbit period
    • Revolution period
    • Axis Rotation
  • Asteroid Belts
    • Number of asteroids (Integer)
    • Size of asteroids
    • Speed 
    • Composition

Look at your watch, dude.

Its nearing 1am and it's Christmas day, so I'm calling it a night. But in closing, it occurs to me that there are multiple levels of complexity that are possible for procedurally generating a star system, and each level of complexity seems to exponentially increase the difficulty in creating system. Likely I'll want to hit some middle ground between just randomly generating a number of planets and moons, and meticulously generating individual characteristics of said bodies.

Something to consider. Over and out.

Tuesday, March 10, 2009

I am a world famous videogame programmer! ... of sorts.


How many of you were like me and taught math using a TI-83 graphic calculator? My school required that we all pick oneup in 8th grade (this, says my father, doomed my left brain forever) and supposedly it was going to revolutionize the way that my generation learned about mathematics. As it turns out, all that they really revolutionized was our ability to play games in class- to this day nobody has managed to beat Sean Kennedy's tetris score, which is all he and everyone else played in the first week they were released.
Being the coolest kid in the class I naturally began programing for the calculator. By the time we finished high school I was actually pretty handy with the thing - my teacher-mode application that hid all programs (i.e. games) had become quite popular in some circles. But my true pride and joy was a program which I developed in secret for almost a month. It was an application called Archmage Arena, and it was a text-based brawler in which you faced off against a computer opponent and used a variety of spells to deal damage. Different spells did more or less damage and were more or less likely to hit. It was pretty simple, but I and a few of my friends enjoyed it. After a few weeks of playing it on the bus I ended up posting it on the TI program-sharing website and forgot all about it.
Flash forward to the present - I googled my name yesterday and browsed through my internet existence. Most of them had to do with the other Derek Gildea out there (apparently my doppleganger is a genetist who fights prostate cancer in Sweden) but on the third search page I ran across this link.
It was my old Archmage Program! And what is more shocking, the file seems to have done fairly well for itself in the near-decade since I released it. Apparently it has been downloaded 10,042 times, making it the single most viewed thing I have ever created on the internet. Out of something close to 30,000 programs, Mage Arena ranks 1353 in total downloads, easily within the top 3%. There is even a little blurb of a site review, and although it's just one line, it makes me happy: "No animation, but it's achieved a high rating in our sources."
It's a bit of a shame that I never finished the sequel. A few weeks after I published the first game a friend took my calculator at the bus stop and as a prank deleted everything off of it, including the nearly-complete Archmage 2.0, which featured five levels of difficulty and images of opponents. That one incident was the first and only time I have ever hit someone out of anger. I went to a C++ camp the summer after high school but never took my programming skills any further.
Well, all that is about to change! I'm pleased to announce that I have begun work on a new project - this time for the PC. At present it is still in the design phase, and I'll publish more information soon, but at present let me say that it is a 2d platformer with an emphasis on creative story-telling.
Maybe I'll write a port for the TI-83, though, for old time's sake.