Solution to the mapping problem
Posted: Sat Dec 22, 2007 1:30 pm
So I've spent a few hours analyzing the issue at hand here. The problem is that it's a pain in the bum to create large maps inside of a map editor. Granted, if I made the map editor really fancy schmancy and allowed you to zoom, modify/create brush types, have some nifty randomization algorithms associated with the brushes and what-not, it could be made a lot easier--however, this would take time. It would be nifty for the future, but for now we need an easy way to create maps that's intuitive, simple and just plain works.
So here's what I've come up with. There are two types of map layers currently--the ground-type layer, which lets you specify what the ground looks like (including walls), and the scenery layer, which places objects in the world. The passability layer (determines whether or not something is solid, or is a pit, for example) is implied by these layers.
These types of layers can easily be specified using a 1-bit image: zero (black) for no entry, or 1 (white) for an entry. For example, you can make a map layer for "water" and give it an image mask where white is painted wherever you want water. Even better--for grass, for example, you can paint a region white where you want grass and tell it to randomly pick grass from a random set of grass textures (different orientations, etc) so it doesn't look repetitive.
Similarly for scenery: you can spray-can some white pixels randomly onto the map, and tell it to "put scenery from this group here"--trees, or shrubs for example.
This is great for templating the world as a whole, but obviously not the way you'd want to go about creating complex maps with lots of different types. Because each layer only specifies one group of ground or scenery, it would be difficult to create a castle, for example--you'd have to make a ton of different layers. That would be a huge pain. So that's where the map editor comes in--you'll be able to "draw" specific points of interest on top of the map layers, which will be stored individually. You'll have exact control over these points, and the ability to specify all kinds of information about them (whether or not they're spawn points, for example).
Now, this is just the editor itself--when the project is compiled and saved, the project compiler will finalize the map (so every client's map will be the same) optimize it, and split it into chunks so the whole thing doesn't have to be loaded all at once.
I'm hoping by the end of next week I'll have some sort of demo posted on the SVN. Expect intermittent updates between now and then, though!
So here's what I've come up with. There are two types of map layers currently--the ground-type layer, which lets you specify what the ground looks like (including walls), and the scenery layer, which places objects in the world. The passability layer (determines whether or not something is solid, or is a pit, for example) is implied by these layers.
These types of layers can easily be specified using a 1-bit image: zero (black) for no entry, or 1 (white) for an entry. For example, you can make a map layer for "water" and give it an image mask where white is painted wherever you want water. Even better--for grass, for example, you can paint a region white where you want grass and tell it to randomly pick grass from a random set of grass textures (different orientations, etc) so it doesn't look repetitive.
Similarly for scenery: you can spray-can some white pixels randomly onto the map, and tell it to "put scenery from this group here"--trees, or shrubs for example.
This is great for templating the world as a whole, but obviously not the way you'd want to go about creating complex maps with lots of different types. Because each layer only specifies one group of ground or scenery, it would be difficult to create a castle, for example--you'd have to make a ton of different layers. That would be a huge pain. So that's where the map editor comes in--you'll be able to "draw" specific points of interest on top of the map layers, which will be stored individually. You'll have exact control over these points, and the ability to specify all kinds of information about them (whether or not they're spawn points, for example).
Now, this is just the editor itself--when the project is compiled and saved, the project compiler will finalize the map (so every client's map will be the same) optimize it, and split it into chunks so the whole thing doesn't have to be loaded all at once.
I'm hoping by the end of next week I'll have some sort of demo posted on the SVN. Expect intermittent updates between now and then, though!