Home       About Me       Contact       Downloads       Part 21    Part 23   

Part 22: Something Like This

June 15, 2011
Why is the area under the cursor dark?

Over the last month or so, I've been working on three different aspects of the project:

  1. How to represent my asteroid-shaped landscape. It needs to be efficiently stored, quickly drawn, and still user-modifiable.

  2. Moving through the landscape with varying levels of detail.

  3. Lighting.

My naive approach to each of these problems hasn't worked out well, so I need to go back and do a lot of reading and experimenting with different algorithms. Sigh.

I'm also seven months into this project. I've been telling myself that once I get these last three things done, I could build the real world and see it for the first time. But I'm getting impatient. I'm really tired of rendering Minecraft scenery over and over. I think you readers are getting bored as well, since the traffic has been dropping steadily. There are only so many people interested in implementation details!

Maybe polar coordinates would help?
So after another frustrating stretch of algorithm work last week, I snapped. I decided to just hack together some kind of world for fun. Actually, I built a few of them.

Please remember that these are world concepts. I know they are crude and that a lot needs to be done. This is something I threw together in a week, not the final look.

If you have suggestions for more world concepts, or basic elements in these worlds that should be done differently, please add a comment. I'd like nothing better at this point than a good discussion of the project future.

World 1: Earthlike

Looks familiar...

Here's the video.

This is a simple height-map based world, generated from Simplex noise. I wanted mountains, so I just used the noise as an exponent. In the video or the demo, you'll see that this gives very abrupt, spike-shaped mountains. This could definitely be improved.

Then I added water and colored the surface by height to suggest grass and sand. I scattered around some clip-art trees to finish off the landscape. Finally, bits of Minecraft buildings were copied to suggest what it would look like to play in the world. The same Minecraft chunks are used in all of these worlds, and could definitely use some trimming. I just chopped out ranges of x,y, and z, so they still have Minecraft water and trees attached.

In the demo, you can move around in this world and get a feel. It's a bit different than straight Minecraft because of the scenery, but still feels pretty similar.

Since the block-based objects are no longer imbedded in a block-based world, they could move. That means I could support zepplins or ships on the water, which you could build out of blocks. There's no reason it couldn't support whole floating cities, if you wanted that.

There are some implementation advantages to this world. Since it's based on a height map, I can easily summarize it at a distance. The demo world is actually built with high resolution at the initial coordinates, and gets chunkier as you go out into the distance. In a real implementation, it would keep the local area high-res as you move. In this demo, it's all just precalculated and never updated.

I can also easily support user modification of the landscape. With a shovel tool, you could level out areas for building, create moats or lakes or hills. What you can't do is build any kind of cave or underground passage. To do that, you'd excavate a large area and then fill in all the interior with blocks, similar to Minecraft. Your block structures could have all the interior spaces you like.

Finally, this is an easy landscape to light, since you can trace rays to the sun and find where they hit very simply.

Too bad this isn't the world I want to build! It looks too much like Minecraft. And I've felt since the beginning that if you are going to the trouble of building an imaginary world, it should show some imagination! Who needs another flat landscape?

World 2: Bare Asteroids

Bare Asteroid world

Here's the video.

This is the design I've been talking about for the last few months. A semi-infinite ring of asteroids (several million), each of which has a detailed landscape. Each asteroid is about 1 km in diameter. You can build on them (or inside them) with Minecraft-like blocks, plants, and perhaps other stuff. They should spin slowly in space, and you should be able to build ships in order to travel between asteroids.

What this demo will give you is some sense of having buildings at odd angles, on a world with a short horizon. In the demo, you can't change your vertical orientation, but walking around, you can still get a feel. I wanted to do an asteroid with a hollow interior, but couldn't come up with anything that looked right. The Minecraft ships really look out of place here (especially with attached water!), but imagine star ships or something instead.

These "natural-looking asteroids" are bleak places. I can make the different asteroids have different shapes, but they still don't feel interesting. If you've seen one, you've seen them all.

Without gravity, moving will be a bit of pain. You'll have to have controls for changing your orientation, and both walking and flying will take a lot more fussing around.

I'm also hung up on the details here. If these were real asteroids, there would be no gravity and no air. So no biomes or interesting landscape. It's all just bare rock. You could assume spacesuits and build structures, but it's not clear how you would realistically do more than that. Even if you added domes over your property, it wouldn't have any gravity.

To have realistic gravity, we'd need to spin the asteroid for centrifugal force. If we did that, players have to live inside the asteroid, since they would fly away from the surface. To get an atmosphere, we'd need to seal the asteroid from space. That would just create a bunch of isolated little spherical worlds with no view. That's not what I'm going for.

World 3: Green Asteroids

Green asteroid world

Here's the video.

We could solve these problems with application of back-story (BS). We could say that an ancient race colonized this solar system and left gravity generators and decaying biospheres and ruined cities in each of these asteroids. Players could collect building material and gravity generators from the existing structures.

I'm still not sure this is the way I want to go. For one thing, what is the effect of a gravity generator? Is it a point source that pulls players towards itself? They would be hard to use in that case, since local vertical would change quickly. The strength of gravity would also have to fall off pretty quickly to avoid affecting the other asteroids. I'm not sure what kind of rule there should be to make these not look like a complete hack.

If there were gravity, I could keep the avatars oriented towards the ground. That means walking and flying are natural again, although your orientation will change quickly as you move. I will give this a try soon.

If you move beneath the surface, you can see how these asteroids are constructed. Each one is a ball deformed by a heightmap. 1-4 of these balls are placed close enough to intersect, making a huge lumpy mass. I then added a sphere of water around each center. That gives lakes (with a visible curve!) where the terrain dips below the water line.

I'm not handling transparency well here, so you can find sorting errors. I also am running out of floating point precision and z-buffer precision on the distant asteroids, so the water there tends to flicker.

World 4: Generation Ship

Life in a can

Here's the video.

Since I couldn't generate a "natural" looking hollow asteroid, I decided to build a "generation ship". This is a staple of old SF, where a colony ship takes hundreds (even thousands) of years to reach its destination.

This demo will give you a feel for having scenery on the ceiling. It's very odd. Unfortunately, since you can't change your orientation in the demo, you won't be able to visit other areas very effectively. I'll put that in soon. It should be interesting to walk around inside the cylinder.

I've added large windows along the sides, but I'm not sure they are a good idea. They break up the landscape and don't really add much to the view.

I'm not sure how people enter and leave the ship. To be part of a larger community, they also need some awareness of the rest of the world (other ships.) I'm not sure how they would get that.

World 5: Gas Giant

Islands in the Sky

Someone suggested in a comment on this site (or an email) that the world could be floating islands in the atmosphere of a gas giant. If you remember suggesting this, please contact me and I'll give credit. I can't find the comment.

In this world we have an atmosphere and gravity. The floating islands are some kind of life, not magically floating rocks. Make them large enough and plants can grow on them, and players can build on them. There would be a natural day/night cycle, and the sky can have stars and a ring. At different altitudes, there can be different biomes and weather.

One nice aspect of this is design is that there is no need for space suits or space ships. There's no vacuum, so we can just allow low-tech flying machines for getting between islands. Perhaps people could just built large ships and live on those.

Unfortunately, I'm completely stuck on how the floating islands should look. The image above shows an attempt at a large tree with gas bags at the joints. It also has really ugly roots hanging down, and I was going to add a mess of leaves.

There are problems with this concept though. First, there aren't a lot of good places to build. Second, there's no obvious place for water. I could indent the tops of all the gas bags and let them have pools, but that cuts the building area even more. It's just not going in the direction I want.

I also made this rather dark and blue. I was thinking of gas giants distant from the sun and went from there. This would probably look a lot more friendly with puffy white clouds and a normal sky.

Rather than wait any longer to get some feedback, I'm releasing this now. I'm open to suggestions on how to fix this.

All Together?

After I finished these, I realized they aren't really mutually exclusive. There could be a gas giant with a ring. It could have an earth-sized moon. There could be asteroids in the ring. Some might have gravity generators and some might not. And there's no reason large generation ships couldn't be in orbit around the moon or the gas giant.

So maybe I should put all these elements together. Why not? It's just a "simple matter of programming".

You can download the demo below, plus there's a poll on which worlds you like. And of course you can comment.

The Demo

I'm not uploading source code this time, since this demo is a complete hack. If you move away from the initial point, you'll see that the world falls apart pretty quickly. But if you want to move around a bit, here it is.

Hit F5 to switch between worlds. It can take a few seconds to generate a world.

I've also added speed controls. Hit the plus key to double your walking speed. Hit the minus key to halve it. Max speed is about 1150 kph/715 mph. So even though it can take time even at max speed to move through the world, that's because the worlds are large.

Demo 22 is self-contained and does not require the world files from previous parts.

For Windows, download The Part 22 Demo - Windows.

For Linux, download The Part 22 Demo - Linux.

Vote

I will continue to add to this demo, and will be adding elements to all of the worlds. I would like to know which ones you find interesting and which you don't. Vote below to give me some idea. You can check multiple answers.

Home       About Me       Contact       Downloads       Part 21    Part 23   

blog comments powered by Disqus