Random Map Generation

Posted in Art, Programming, Tips on August 24th, 2009 by Manuel
No Gravatar

Designing an appealing and huge game world from scratch will take even really fast designers a looooong time: valuable time that can be spent in better ways. This is where generated content comes in handy. With the push of a button a designer can create a whole world (oceans, land, forests, deserts, mountains, cities, … ) in an instant. So this is what we decided to do for our game … and here is how we got to the finish line:

On the bumpy road to an actual working map generator we decided to split all map generation tasks into small modules: heightmap generator, water generator, forest generator, desert generator, and so on. In the map-generator GUI the designer can put these modules into a task list and define the order in which they are executed. Each module also has parameters that affect the characteristics of the generated map. Even though it is supposed to be a random map generator it is especially important to have deterministic behavior. Consequently, each module that actually generates content has at least a “seed” parameter for the random number generator. With the same seed the generator will create the same results every time. Changing the seeds will create a different map.

map generation steps
In the little animation above you can see the output of some of the modules.

Heightmap Generator
At first we create a heightmap. We use Perlin noise since it is built into the AS3 BitmapData class and it is amazingly fast. In the beginning we experimented with our own implementation of the diamond-square algorithm, but it was way too slow.

Water Fill
In the next step we apply water to the world. We simply declare everything below a certain height level as being under water.

Mountains
By looking for local peaks we detect mountains and flag the areas accordingly.

Humidity Map
By defining a water contingent that grows over water and decreases over land we can flag dry and wet zones on the continents. To make things easier we define our whole world as a west-wind zone. The centers of most bigger continents will be dry (yellow), coast regions will be mostly humid (green) and continental areas lying east of a big stretch of water will be very humid (dark green).

Climate Zones
Next we define climate zones in the world: tropical areas, temperate zones and polar regions. With this information we can easily place polar caps in the world.

Forest Generator
Using the information from the climate zones and the humidity map makes it possible to place different types of forests into the world. Jungle (purple) will be found in the hot and wet regions around the equator, while coniferous forests will be found close to the polar caps.

Desert Generator
The desert generator also uses the information from the humidity map to detect dry regions and place desert areas into them.

Well, now you had a look at some of the modules in our map generator. They are not only capable of creating earth-like maps (like the small sample map above) but also completely different maps by changing the parameters: a lake landscape, a waste land, a desert or whatever our games may need. With this we are able to quickly create new game content of any size for the players to explore.

Cheers,
Manuel

Popularity: 100% [?]

  • Share/Bookmark
Tags: , , , , , , , , , ,

Combining 2-D and 3-D techniques

Posted in Art on August 17th, 2009 by Peer
No Gravatar

Hi, my name is Peer. When I am not studying Media Design at the DHBW Ravensburg, I’m one of the busy artists working on Rough Sea Games’ premiere browser game. I have known the majority of the people here for years and I very much enjoy being part of this great team. This is my first blog post.

What if you wanted to create a lot of 2-D graphic assets, like for a map, which need to be very detailed and have a painterly look?

There are two ways. One is to paint; the second is to do it in 3-D and use the pre-rendered graphics. Sadly, pre-rendered objects in browser games tend to look very lifeless, sterile and, well, pre-rendered. The result is reminiscent of mid-nineties PC games.

Painted objects often carry more expression, more color, and more variation. To achieve that in a 3-D model would require a lot of small detail work. To get a highlight or a crack at exactly the location you want it to be is quite cumbersome in 3-D (it is also like shooting sparrows with cannons  if the final graphic asset won’t be very large). But painting everything while keeping a good amount of detail and coherence would be an enormous task.

Both approaches have their advantages, so why not combine them? What you are after when you need to produce dozens of objects is:

- Detail
- Coherence
- Reusability
- and of course, it needs to be done fast.

Over time you produce a huge amount of reusable assets. Those can be used in other objects to quickly add detail while maintaining a coherent style. By using the same lighting setup and materials you ensure a coherent style, even if you have to create dozens of models. Because of the similar ‘base’ for each model, it’s also very easy to split work between several artists.

Another important aspect is that, during the 3-D phase of the workflow, it’s very easy and quick to rotate, scale and retexture objects to create variations before deciding on the one you want to finalize.

Let me demonstrate my workflow with an example: Lighthouse_final
(The small lighthouse used in this post doesn’t have anything to do with our title; I did it tonight for demonstration purpose only)

1) First, you build a 3-D model while keeping in mind the camera position and scale it will have in the game. Don’t try to be too exact in the 3-D model. Everything can be quite rough and blocky. Details like surface imperfections, interesting highlights and minor details come later, in the painting stage. Very faint textures can be mapped onto the objects to create some ‘meat’ for the paintover. Don’t be too perfect with the mapping: simple boxmapping is often quite enough.

2) The first stage in painting over is to get some more variation in the shading. Because of the small scale, a very simple brush is enough. I just picked up some colors from the render and tried to get rid of perfect shading and all too straight edges. Then I painted some small details like cracks, dents and highlights. The 3-D rendered base model is a solid foundation, because the perspective and the lighting is already there. You can also experiment with blending textures of the picture to dirty up some areas.

3) The final stage is the color correction. Always do some color correction afterwards to make some areas pop, or to mute some others. I added some levels and selective color corrections with layer masks to further emphasize the lighting direction and to get some more bluish tint into the shadows. Then I selectively sharpened some areas to increase the contrast.

building_workflow
The lighthouse took me a little more than 1 1/2 hours from start to finish.

I hope you enjoyed my debut as a blogger : )

Best regards,
Peer

Popularity: 80% [?]

  • Share/Bookmark
Tags: , , , ,

New 2D/3D Workshop!

Posted in Art on August 11th, 2009 by Chris
No Gravatar

I have finished a new workshop (part 3 of a series) on how to map a 3D model and how to create and paint a texture for this model.BadAss Rabbit 2D/3DYou can find the workshop in the new issue of the German game developer magazine Making Games 03/09, which will be out soon.

Chris

Popularity: 73% [?]

  • Share/Bookmark
Tags: , , , , , , , , , , , ,

R&D goes iPhone

Posted in Company, Programming, Tips on August 3rd, 2009 by Thomas
No Gravatar

Hello out there,

my name is Thomas and I am the first programmer in our new R&D department. Like most of the other guys here at Rough Sea, I’ve worked on games for consoles (Nintendo DS and Wii) and PC before. I’m very excited to develop sophisticated software that helps us to make state-of-the-art games. Of course this is only technically, but I’m pretty sure that Rafael and Jan will assure this for the design part too.

I assume you’ve read the headline already, so you know what the R&D department will work on in the coming months. We’ve decided to do some research on the iPhone, because we think the way you use the iPhone is almost the same as how you play a browsergame. You get your iPhone out of your pocket, use it for a few seconds and put it back again. You have nearly the same procedure with browsergames: you open your browsergame window/tab, change a few settings and go back to work.

So the first thing to do is getting your working environment running. The only legal way to do this is to buy a Mac. I’m not really happy about that, because I’m a Windows guy and there are some differences in using MacOS instead of Windows. Maybe Apple only invented the app store to sell some of their Macs to iPhone developers. Nevertheless after some adjustments the Mac became usable. The nextStep (pun indended) was the installation of the iPhone SDK and all the tools that belong to it. It’s quite easy to get from the installation of the SDK to the first Hello World on the simulator (especially if you compare this to console development).

We at Rough Sea use test driven development and continuous integration to assure that we always have  a deliverable product at hand. Unit Tests are already integrated into the SDK and it was easy for Ole to set up a build server on a Mac Mini with hudson and the makefile-like shell tool xcodebuild. You don’t have a makefile: the tool just uses the settings of the project file to know how to build. Another thing is that you can add and change text macros for the XCode IDE. Text Macros are very useful to write code much faster. For example, you can add an alloc-init call [[class alloc] init] simply by typing the letter a and then escape. There are macros for if, for and while too. Because we have different coding guidelines than the apple guys, I had to change some of the macros. You find them in /Developer/Applications/Xcode.app/Contents/ PlugIns/TextMacros.xctxtmacro/Contents/ Resources. Copy the TextMacros.xctxtmacro folder to Library/Application Support/Developer/Shared/Xcode/Specifications in your home directory. Just open the *.xctxtmacro files with a text editor to change the macros. You can add your own file and project templates too. This is very nice, because you can set up a default project with many settings, like Unit Test Targets, already in place, and use this project to create new ones with only one click. To add a new project template, create the project the way you like it and copy the whole project folder to Library/Application Support/Developer/Shared/XCode/Project Templates/GROUP_NAME/PROJECT_NAME. For file templates you should just copy the File Templates folder from /Developer/Library/Xcode/ to Library/Application Support/Developer/Shared/XCode/ and change or add the files you like.

Next time I will write about Objective-C and libraries from the iPhone SDK like UIKit.

Popularity: 64% [?]

  • Share/Bookmark
Tags: , , ,