 |
|  |
 |
|
primemover
|
 |
Houston, TX, USA
Nov 2001 time: 23:30
|
|
Hey, this is primemover, looking in after a long recess (forgive the pun). I got bogged down with school and I was so burned out when school was finally over (being it was my first year teaching and being in a difficult district) that I just took the summer off free of thinking. I have switched districts and this *may* be a less stressful year.
But I'm in the mood to do something with this civ effort today and thought I would get started on an attempt at the random map generator I offered to do. Provided that school doesn't get me over stressed again, I am more likely going to be able to follow through this time. I would like to start a C++ attempt at the map generator (to find a good algorithm for our needs) that can be translated into Java at a later time (I.E. the only thing that should need to be dealt with are differences in pointers, objects and the GUI if one is necessary) We could also potentially use the generator as a separate executable that creates a scenario.
Keep in mind, that I will need to do this as I have time. Weekends like this one where nothing pressing is to be done are ideal, but there will be periods when I will not be able to work on it. Also keep in mind that since the Call to Power II source code is about to be released, I may eventually join that coding team, as it is very close, playwise, (with some significant additions/modifications) to the kind of game I have in mind. That being said, I am ready to do some work.
I have a general idea of how the map generator is going to work (if we are still using local maps) and I don't anticipate a local version being too difficult to do (a global one, however, is a significant task). As it is, it looks as though, we are still dealing with local scenerios so I am assuming we want a randomly generated local map. So now I am looking for any comments regarding the generator, specs on map layout, and current environmental model.
So here are my questions:
1. What is the current map size and characteristics that I need to know overall in order to generate the maps?
2. Any significant changes made since I last posted? (back in Jan or Feb I believe)
3. What are the current types of landscapes, weather, vegetation models, currently in use?
4. ID numbers, DEF's, constants and specification/header files would also help in issues with item in question #3 (eg... assignments such as DESERT_TERRAIN_ID).
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:30
|
|
Hi,
The best thing to look at is the scenarios folder in the jar file. Therein, there is a map section where you have basically all the information.
I think a good map size would be around the size used fro Jericho or a bit bigger (12 x 32). You may want to make it bigger, or as an input of the program. There are no hard limits on map size, but memory becomes a problem (far too) fast with big maps.
The model currently in use is still very simple:
You should check the dataformat.html file if you have it for the data format, but here is the list of terrains currently coded:
o
- ocean
c
- coastal
f
- flat
p
- plain
r
- rolling
b
- broken
m
- mountain
d
- dunes
s
- swamp
F
- forest
j
- jungle
t - tundra
I think the easiest thing to do would be to generate a scenario xml file, with stubs for the constant parts, and generating the map part. You actually don't have to put any civ in the game for it to show the map, but that may be easier by copying everything but the map part from another scenario and changing the map. Beware there are square references in the scenario that you may have to change too in order to get it to work.
|
|
|  |
 |
|
primemover
|
 |
Houston, TX, USA
Nov 2001 time: 23:30
|
|
quote: Like Laurent said, it is Very simple at this point. |
Should I expand on it? Make it a bit more complex? (Althought we would have to come up with more graphics if I did that)
Is vegetation separate (an overlay?) from terrain? (yet?). Keep in mind that they *are* two different things! (Swamps generally occur on flat terrains for obvious reasons, but forests, rain forests, grass, etc... can occur on mountians, planes, hills, etc...)
If we decide to make things more complex (such as separating the concepts of terrain and vegetation) we will need to make some graphics to accomodate.
Matthew
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:30
|
|
Vegetation should be separate, but is not yet. The graphics aren't really the hard part (forests can be an overlay quite easily), but I think we must accomodate the code to take these into consideration.
Terrain currently is just (vegetation + terrain type) a la civ, with the additional possibility of having rivers and coastlines on the sides, and special features (like gold ore, etc.).
The terrain.xml file really contains everything we can do with terrains now. Adding something like separate vegetation/topography is feasible, but just takes time.
Also, we don't have a xml description for rivers now.
All these things can be done, but I'm too busy with the ai right now to tackle them soon, and don't think anyone else has time for it.
|
|
|  |
 |
|
primemover
|
 |
Houston, TX, USA
Nov 2001 time: 23:30
|
|
remember my lack of experience with XML (my second posted message in this thread). I will have to become more familiar with it as I go.
Few more questions... I think I'm getting a good idea now (minus the actual details) of how this will work.
So are rivers and coastlines overlays? I am wondering this for a number of reasons. Here are some thoughts that have to do with this and some questions:
1. Call to power II uses a unique system of graphics that integrates with bordering graphics using a specific algorithm to figure out which graphic is to be used. It works out so that the transition between land types is not so cut and dry and so that it looks relatively natural. The advantage is that it has nice transitions (not so modular/blocky). The disadvantages are the complex algorithm, number of graphics, and time it takes to create them all. So my basic question is, how does the COC system work?
2. Since it seems you desire a separation between landscape and vegetation, and perhaps even soil (might help with what I'm about to say), maybe we could come up with an easier system of overlays so that the entire nature of the land was done using overlays. As long as we are on a cartesian map, we could even cache the layout of the land every so often so that we don't have to do too much of the overlaying (other than tile improvements). That way, we can speed up scrolling etc. (we could bit blit instead of contantly drawing overlays other than units, cities, and goods).
Anyway, these are just some ideas I am throwing into the pot.
Here are the questions I would like answered now (thanks for answering the previous ones):
1. It really would help to get the general idea of how the water/land/vegetation works together before I develop a graphic interface to this whole thing.
2. I can go ahead and implement a model that separates landform, vegetation, and even soil type and then we can work with whatever we have (simplifiying it for now, but still having the mechanism for later use). Is that something that you want me to do?
Matthew
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:30
|
|
quote: So are rivers and coastlines overlays? |
Yes they are.
quote: Call to power II uses a unique system of graphics that integrates with bordering graphics using a specific algorithm to figure out which graphic is to be used. |
I know that system. It's quite nice, but the blending requires lots of art, in particular if you want to add new terrain types. I don't think we're going that way because of the amount of art needed. Picking the right tile wouldn't be that much of a computation problem, since it can be done when terrain is determined, i.e. usually only once at the beginning of the game.
quote: Since it seems you desire a separation between landscape and vegetation, and perhaps even soil (might help with what I'm about to say), maybe we could come up with an easier system of overlays so that the entire nature of the land was done using overlays. | Yes. I agree that we could have everything as overlays. Currently, the map draws its terrain, coastlines, roads, units, walls, and then there is an additional overlay for showing planned movement, roads and forts. So one or two more overlays won't change much.
quote: 1. It really would help to get the general idea of how the water/land/vegetation works together before I develop a graphic interface to this whole thing. |
I don't know what kind of answers you expect here. Except looking at the ecology model. As far as what's coded, a terrain has movement and economics features, which should probably be a function of landscape + vegetation, and rivers should have a movement cost (plus maybe some military defense value).
quote: 2. I can go ahead and implement a model that separates landform, vegetation, and even soil type and then we can work with whatever we have (simplifiying it for now, but still having the mechanism for later use). Is that something that you want me to do? |
I think having the three separate types would be the best, that way, we can simplify it for now, and remove the simplifications when we enrich the code to manage the various layers.
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:30
|
|
I looked at the existing code. Gary coded a fractal map generator, which gives big mountain masses instead of ranges. As I didn't know what to do on tuesday evening, I coded another algorithm which is a very simple division of the map into polygons (tiles), which I then ram into one another to get some mountains.
The algorithm I used makes it ok for square maps, but maps that have one dimension much bigger than the other will look stretched that way.
Anyway, it took me only one evening to code it, so it's neither very good nor something I plan to use. The code is simple enough, though, so primemover, if you are ineterested, I can send it to you. It would show you how the map interfaces with the rest of the game.
Anyway here's a set of screnshots showing the results of the current algorithms (vegetation is not computed).
The left shows my algorithm (tiles), the right is the fractal algorithm Gary coded. There are 2 screens for each setting. Settings top-down are lots of land, islands, plains:
Attachment: voronoi-fractal.png
This has been downloaded 76 time(s).
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:30
|
|
I played a bit more with the map generator.
I realised that the plcament of the initial seeds is very important. Grouping the land seeds together results in better results for instance. This means that land plates and sea plates shouldn't be distributed randomly over the map. Land plates should be grouped together in order to avoid weird lakes or inner seas to be too common.
I also tried to add some vegetation based on wind patterns and humidity (drier after rugged terrain), but my algorithm is not very good, as you may see.
If someone has detailed algorithms to propose, they're welcome.
Attachment: clashrandommap.png
This has been downloaded 69 time(s).
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:30
|
|
quote: It appears your doing a general west-to-east flow of winds |
Actually, there are several stripes east-west and west-east, but it doesn't show much here.
The code uses 8 zones for wind directions, which alternate EW/WE, and equal zones for polar/temperate/tropical/equatorial bands. In each band, there are 3 types of terrain (wet/normal/arid). I use random numbers to decide if I get drier after rough terrain (mountains blocking humidity) and also if I go drier/wetter just at random, starting wet near water under the wind.
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:30
|
|
quote: Laurent - I would be interested to see the alternative code you used. |
Well, you should have got it if my mail reached you. Check the classes in game.geography.generator :VoronoiMapGenerator and VegetationGenerator.
I won't pretend the code is nicely formatted, and there's probably a lot of things that could have been shared with your initial class. But I did this mostly in one evening when I had nothing better to do, so at that hour I mayn't have given the best out of myself.
Mostly, the map is generated by a set of seeds, with a setting that let you choose to group land seeds together (I found this got better results). The number of seeds depends a lot on the size of the map if you want good results. Plates are built using a Voronoi cell like program, hence the name of the class. Then I move plates once, and adjust the sizes.
More interesting is the vegetation part. To have stripes of vegetation (polar/temperate/tropical/equatorial) requires a really big map (each stripe needs at least 2 y's in order for the isometric view to prevent tropical to touch polar), and probably 4 or 5 in order to be seen by the player. With both hemispheres, this makes about an height of at least 30, better 40 or 50, if you want to see good results. The code generates wind patterns, which probably double the figures, as wetlands are under the wind from the sea until you reach a higher altitude, afterwards you tend to get dryer.
Removing most (or all) of the random factors gives a better idea of the capabilities of the algorithm but slightly less interesting maps.
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:30
|
|
quote: so you're talking a map of only 50x100 ? |
You can generate a map of any size, but since I haven't put any people on the map after creating the geography, it's not very useful to make huge maps. Anything less than that size would likely not be realistic in terms of climates.
The point in terms of map size is what economics, unit, etc. are on the map, as these are what drives the performances (speed and memory consumption) of the program. It's hard to give any figures about size and speed until everything is coded and then optimised if needs be.
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:30
|
|
You've got to ask Gary for the polygons.
Overlays are needed for vegetation.
The map generator I made uses altitude and soem vegetation thing. River overlays would also be needed, though for the moment we could reuse the coast overlays if needed.
There is a problem with terrain, which is I'm not sure of the while set of terrain we want. Also I'm not sure that all vegetation can be an overlay (forest is, plains/desert is not).
|
|
|  |
All times are GMT. The time now is 05:30. Apolyton Time is 00:30. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|