July 23, 2008

Pictures, Moving, and Stars

HBD1_7_1slant.jpg

And in 3D...

HBD1_7_1_3D.jpg

And a clip of some of the effect in action -

Download Clip(~4MB)

and a slightly older clip, with a stationary city/creature:

Download Clip (~2MB)

I've been giving myself a series of contradictory goals - Abstract imagery with accurate, viewable stars. It's odd to have the far away objects detailed and the near ones out of focus. That said, it's an interesting challenge, and plays with how I want the world(s) to work.

Posted by todd at 2:02 PM | Comments (0)

July 11, 2008

From Void to Vegetation, Vacations and Videos Verify Voluminous Vistas

Image from the top of Orcas Island...
OrcasMt.jpg

Spent a week in the San Juan Islands up in Washington - very interesting place. Relevant to this discussion is that the islands seem to have an excellent "balance" in terms of level design - a nice mix of water, land, meadows, forests, and towns. You could do worse than start from its USGS data to make a terrain-based RPG or MMO.

A few games and projects I've been keeping tabs on:

Spore - A lot of the planetary simulation is getting me interested, actually. Some decent adaptation of planetary and interstellar theory, if you believe the rumors. The creature editor is impressive, and quite a bit of fun. I'm mainly modeling critters from my own mental spaces. The whole affair has made me value my own internal muse. Trying to do creatures from others sources is also fun, but this being a wired world, odds are several people have beaten you to the punch. At day two after release I already found 3 instances of Opabinia, and some of the spare parts given seem like they were made for creating an accurate Anomalocaris - don't even get me started on other things.
Spore encapsulates a lot of things you'd want in a typical universe - From that, I'm immediately searching for the things it doesn't do. The outliers and freak points suddenly become much more interesting.

LoveMMO - Not only procedural, but also impressionistic. A little abstraction goes a long way. Some interesting observations on his blog about narrative, open-ended gameplay, and procedural methods.
The game is certainly taking the strategy of fun dynamics - For instance, there's a tectonic system that will shift things around over time. Adding such a device may seem like paying too much attention to detail, but adding geologic processes will probably occur to a lot of people building a dynamic world. There's a Tao to building systems that will last. If you model erosion (i.e. destructable environments) into a world (from rain, wind, or grenade launchers) eventually the whole place will smooth out to nothing or sink into a dead mire. As system for making things go down needs another one to provide upheaval. Indeed, our own physical world platetectonics do exactly this - it's a crucial ingredient for life as we know it.

Dwarf Fortress - I've talked about this one before, and it's the only one on the list that's accessible to play at the moment. I've played a ton of this (strangely enough, about the same time everyone else was playing GTA4). The single player mode, actually. Running around mucking up an incredibly detailed procedural world can be quite fun, even with faux-ASCII graphics. It's got me thinking about text again. The combat, for instance, is an incredible amount of fun because it's described in text. A picture may be worth a thousand words, but a word can be worth a million models, animations, and texture assets. The whole affair can come off as fun, absurd, and incredibly useful, yet any form of graphical representation would be almost prohibitively complicated. The text hides what would otherwise be considered goofy graphical gaffes, while allowing the player's own imagination and sense of disbelief to take over.

cypress_airfield.jpg
Abandoned airfield on near a peak of Cypress Island

Posted by todd at 6:36 PM | Comments (1)

June 26, 2008

Proce55ing a world simulator

Using a series of different cellular comparisons (none of them, on their own, particularly complex) I've thrown together a quick world simulator that models heat, wind, clouds, rain, and erosion, in roughly that order, in real time:

clouds_all.gif

I have a "sun", a heat source that moves across the world map. It heats up the water and land, and the heat dissipates away otherwise (simulating night or winter). Water absorbs and dissipates heat slower, and keeps a generally cooler temperature than land. This creates a cyclical oscillation in temperature...

heat.gif

...which is how we create wind! Air moves from high pressure to low pressure (or from hot to cold, trying to achieve equilibrium). With the heat map we can create a wind map:

wind.gif

The wind in turn directs the heat, creating a little feedback loop. The terrain also effects the wind, slowing down or redirecting it. Differences in shading from the terrain also produce differences in heat throughout the day - A side of a mountain is cold in the shade, but can the warm up as the sun travels through the day (the grey band is "high noon", where I assume no shadow):

shading.gif

Heat + water = moisture. Moisture + lower pressure = rain. Very simplified, but it produces interesting, cloud-like motions and behavior, from rain shadows to foggy marine layers. Blue = moisture, green = rain. Cyan is a lot of each:

moisture.gif

Rain or moisture on land will produce greenery in this simulation. The shots above or only from the start. Erosion (rain and wind) will smooth out the terrain eventually.

I'll have to make a little nod to the makers of Dwarf Fortress (read the dev blog, it's an awesome experiment in world building), it generates rainfall in a similar fashion as a matter of course. I had been thinking about this sort of dynamic for a long time before stumbling on DF, but reading the specs and playing the game made me sit down and give the simple algorithms an honest try myself.

This relates back to Here Be Dragons and how agent behaviors need motivation. With classical genetic programming you typically have a direct fitness function - how well does something do "x"? Another way is to model an ecosystem you need a dynamic, sustainable world. Even in the simple setup above, situations are chaotic and change enough to keep its inhabitants on their toes - needing food, water, and the right amount of heat.

After two days of work I intuitively understand weather better than I have after years of study (although it necessarily took years of study to learn the concepts). I find myself looking now at the Coriolis effect to get more earth-like weather patterns, and figuring out some form of plate tectonics in order to counteract the erosion. Otherwise all the dirt will sink into the water eventually.

Design for these systems is interesting, and really not too hard - you can mess with variables endlessly, just remember that idea of achieving some equilibrium - add and remove, and conserve.

Posted by todd at 12:06 PM | Comments (2)

April 24, 2008

Woodcuts (or Old School Rasters), special glasses optional...

A lot of woodcuts, monochromatic printing techniques, and indeed old rasters are simply one color, and simulate value by varying the width of the lines that pass through the image. I was curious how this would look in a realtime 3D engine. Taking the original "control" image for reference:

rasterControl.jpg

I sampled the values of a given frame and varied their width based on the value of the given pixel. This is a single result:

rasterBW.gif

The whole thing is vaguely reminiscent of the classic Sierra Online logo. The image itself is hard to read, but moving through the space is interesting - persistence of vision is a very important part of our senses when it comes to understanding spaces. I'll try to get some movie captures of the effect online.

Oh, and there's no reason it can't work in 3D:

raster3D.gif

This adds another element to the eyes when it comes to understanding the space, and creates some rather strange volumes.

The following shots are cheating a little bit - I added in the actual values of the sampled pixels. This makes a static screenshot a little easier to read, but kind of defeats the purpose of a true 1-bit, black and white image - it looks a little more like I'm blocking an image with lines instead of creating detail with them:

rasterGrey.gif


And in anaglyph 3D - in this push button age, why not?

rasterGrey3d.jpg

I'll have to follow my own advice and post some movies - Non-Photoreal Rendering, if you have the goal of making it real time, needs to be seen in motion.


Posted by todd at 11:05 AM | Comments (0)

August 28, 2007

Lunar Eclipse 8.28.2007, ~ 1am-5am

LunarEclipse_A.jpg

LunarEclipse_B.jpg

LunarEclipse_C.jpg

LunarEclipse_D.jpg

LunarEclipse_E.jpg

LunarEclipse_F.jpg

Wonderfully strange night. The ocean tide was at one of its uncannily low points - I mean really low, you could almost wade out to the end of the pier. Also saw what must have been a late Perseid shooting star.

Wrote a time lapse program in Processing that takes a video feed and saves an image every (n) seconds - I have over 500 images (some samples shown above) taken 30 seconds apart from last night I'll try baking into a video clip.

Posted by todd at 12:16 PM | Comments (1)

April 11, 2007

/Let me see what the declination is/ on Jupiter and Mars...

Cliffs notes: Modeling the planetary motions in the night with reasonable accuracy given a date and location on the earth. From this, I can potentially create a number of different night skies in different solar systems (fictional or non).

Full post: Working on modeling, among other things, the motions of planets in the sky. Taking a lot of the data and math from this site ,
Now, given a date, latitude and longitude I can track the sun, moon, and planets in the sky. There's no reason this could not be done in real time either, although I personally like to speed back down, up, and then forward through the centuries. You can get a good sense of how the sky looks, retrograde motion and all. Here’s a picture of mars and the moon:

marsAndMoon.jpg

And here is a time lapse (using additive burn-in) of 11am over the course of about two years, with the moon, sun, and mars. Notice how Mars (the red dot) does a "loop". This is retrograde motion, due to relative speeds of the Earth and Mars. Before Copernicus and Galileo the "epicycle" was a term that was used to try to describe this activity. Also, the term "Planet" means "Wanderer" - The ancients found it understandably odd that "planets" were the only "stars" in the sky to visibily do this sort of thing.

timelapse_mars_moon_sun.jpg

I'm also waiting for someone to point out an error (I'm still fearful I "flipped" a direction, and the latitude and longitude code is still quite coarse).

I also linked a directional light to the position of the sun, so you get dynamic shading throughout the day. Another consequence is seasons – near the poles you can get a midnight sun or high noon night.


sunDirection.jpg

I also calculate the arc length (i.e. the relative size) of a planet, moon or star given its size and how far away from the earth you are. I do “cap” the size, mainly so OpenGL doesn’t have a cow (and why Mars appears so big in the first screenshot). Here is what the moon would look like if it was hovering around the Roche limit (the minimum distance it could orbit before being torn apart by gravity):

rocheLimit.jpg

Also, while there is a process to calculate the phases of the moon, right now it's not really necessary since the directional light of the sun in the 3D scene basically does it for me.

All that said, I didn't really do this to make my own accurate model of this solar system (although that in and of itself is useful and fun). This is basically just a test case, a good way to look at existing data and making sure the math is working. Given what I have learned, I can model quite a number of other solar systems, real or imaginary, and see how they would look from a theoretical world. I could change moon number, star size and color (and I'm gonna). I can model sun and moonlight (from multiple suns and moons), altering its strength depending on stellar energy, moon phase, etc.

Since I can also dynamically alter field of view, I can simulate a telescope.

mag1.jpg

mag2.jpg

mag3.jpg

mag4.jpg

That last pic has a real time filter added to it to blur it a bit. I actually like it kind of blurry – fully sharp it provides all the excitement of looking at a jpeg. One aspect of this project is to simulate what the great stargazers first saw. Galileo thought Saturn was originally three planets, it took awhile before Saturn was determined to have rings. Having the “Martian canal”-like illusions could prove very engaging. Mystery is something precious that needs to be rationed – Advocates of narrative take heed!

Why bother modeling the night sky, either fictional or non? After all, an accurate planetarium in a game is hardly new.

I've been thinking of a number of elements and dynamics that could affect story, game mechanics, and immersion that might be possible with fully working sky. A sky complete with seasons, eclipses, alignments, and the ability to view distant, functioning worlds separate from the space you normally (virtually) occupy.

A lot of this does come from a perverse desire to be able to walk around inside a simulation. I like to see how things look “from the ground” (literally, in this case). It gives a very different experience from a privileged third-person view.

I’ve learned quite a bit from researching and programming all of this. A lot of it was meant not only to have a neat digital resource, but also to get a better grip on how this world (and universe) works. While there are some existing resources and code already out there, I would have spent three days looking at C++ visual studio compile errors and learning which DLLs I needed. Building it on my own I spent three days learning about planetary motion, different calendar systems, the dynamics of seasons, the history or stargazing, why different stars are different colors, the dimensions of an eclipse, extrasolar planets, and many, many other things.

Next on the list – skies and sunsets. I’m looking at the workings of Rayleigh scattering (the primary reason the sky is blue), although mainly to see what it would do on planets orbiting distant, alien suns.

Posted by todd at 2:48 AM | Comments (1)

March 23, 2007

One more (really big) screenshot...

I've been revisiting code to used take screenshots. With stereoscopic viewing, you need to be playing with the camera's view frustum a lot. Combine the math and coding behind the two dynamics, and you're able to take friggin' huge images.

I rendered out a 5120x3840 image (Five times the 1024X768 realtime resolution I was running at), and there's not much reason you can't make the screenshots bigger (although that shrieking sound you hear is Adobe Photoshop's scratch file).

HBD_Poster_Thumbnail.jpg
This is a thumbnail - you can download the entire 5120 X 3840 image here.

Posted by todd at 10:29 PM | Comments (2)

Screenshots

HBD_1_5a.jpg

HBD_1_5b.jpg

HBD_1_5c.jpg

HBD_1_5d.jpg

HBD_1_5e.jpg


Posted by todd at 1:31 AM | Comments (0)

March 1, 2007

Golden Oldies Part 2

Just rummaging through some old stuff - This one is ancient (from undergrad days, last millenium). To get an idea of how old this one is, I originally outputted to VHS. Better video codecs have made it a little more portable.

"Vogeltanz" - You'll need the DivX codec to play it.

DOWNLOAD MOVIE HERE (5.21 MB)

Vogel1.jpg

Vogel2.jpg

Posted by todd at 10:17 PM | Comments (1)

February 5, 2007

eejiss prototype test

Still a work in progress - the next stage is to revamp (or simply create) the artwork - the vast majority of what you see are temp assets.

"eejiss" is a shooter where you technically don't shoot - you simply redirect enemy fire back on your antagonists using your shield.

W, A, S, and D move the ship, the mouse directs the shield. The shield is ineffective if it touches an enemy. You can change the mouse sensivity in the Bios.txt file (my personal setting is .35).

This is mainly to test the basic mechanics, and see what people think. That's why I default to 999 lives, so you don't have to worry too much about getting to level 6 (press 'v' to reset the game with 3 lives, if you want).

Again, still a ton of work to be done: Art, sound, as well as a menu system - I plan to have the usual options and settings plus a few extra all selectable in the game.

eejiss_feb5.jpg
Download eejiss prototype here


Posted by todd at 11:51 PM | Comments (0)