You must be logged in to post messages.
Please login or register

AI & RM Scripting
Moderated by Sebastien, Leif Ericson

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: RMS Mountain Making Tips
posted 02-01-10 12:31 PM CT (US)   
Making mountains was a sore spot for me. It probably is for your too, especially if you're new to RMS. The problem lies in the two directives --

number_of_clumps
number_of_tiles

These two directives tell the script how many hills to build and how many tiles to use. If you get the numbers wrong, you'll end up with what you don't want. You can end up with a large elevated plain of elevation 6 instead of a number of hills that are elevation 6. What you need is a balance between the number of clumps and number of tiles.

number_of_clumps -- this tells the script how many hills you want.

number_of_tiles -- this tells the script how many tiles to use, and it seems to be a total for all hills, not each individual hill.

Unfortunately, there is no way to tell the script WHERE to place the clumps, or how far apart to keep them. You will end up some plateaus. This is unavoidable.

Clearly, if the number of tiles is too high, you'll end up with plateaus of that elevation you're making. Generally, this isn't what you're after. You want hills, not plateaus. So basically, start with the number of clumps you want and keep it reasonable -- say 16 hills -- and start with a low number of tiles, a good guess would be 256.

Each hill is going to take X many tiles. I can't ell you how many tiles each elevation takes, but the lower the elevation, the less number of tiles is necessary for ONE hill, and conversely, the higher the hill, the more tiles are necessary for ONE hill. But you're not wanting ONE hill. You want a few, so that number of tiles is difficult to decide on. Unfortunately, the_number_of_tiles_for_one_hill times the_number_of_hills ISN'T the correct answer. Don't ask me why! I dunno why! This is very frustrating, but there is a way to get where you want to be.

Your best approach is to start will low tile numbers and work your way up. Use the "I can Guess any number between 1 and 100 approach".

The I Can Guess Any Number in X Many Tries Technique
Lets say you need to guess somebody's number and he's going to tell you if your guess is low or high. And again, lets assume that your range is 1-100. Your first guess is dead center between 1-100 -- 50. If you're told that the number is higher or lower, your next guess is dead center between the differnce, and that difference is 25. So if it's higher, you add 25 to your original guess, and the result is 75. If it's lower, the next guess is 25 (you subtract the difference instead of add). Now, your told once again, if your guess is higher or lower. You then, again, take the difference (which is now 12) and either add or subtract. The next difference is 6. The difference after that is 3. You'll get where you want to be in 9 tries or less, every single time!

Back to elevations
Do the same with your elevations. Open your script. Fire up the game. Run the game with any civs, and then look at the map. Are your hills right? If you see too many high plateaus, then the number of tiles is too high. If you don't see enough hills, then the number of tiles is too low. Use the "Guess any number" method.

If your numbers are wrong, press ALT+TAB to leave the game and go back to your RMS. Edit the number of tiles, then ALT-TAB back to your game, and restart the game with the same map. If again, your numbers are wrong, ALT-TAB back to your script and make the appropriate change, then save it, then ALT-TAB back to the game and open a brand new map.

When you think you're there, restart your map numerous times to check and recheck and recheck, to ensure that it is right.

USE ONE ELEVATION AT A TIME!

PLACE YOUR ELEVATIONS BEFORE YOU PLACE YOUR TERRAINS, so that you can easily see them. After you've got your hills, then proceed with the rest of your map.

Once you get your first elevation correct, add your second. Repeat the above procedure for this elevation. When these two are correct, add your third. Repeat for your fourth, if you have one. Four is generally on the difficult side. Five is overkill, and unecessary.

Perhaps you want plateaus. If you do, add tiles. If you just want peaks, keep your 'hill numbers'.

Through experimentation (and lots of time), I have discovered that it is best to start with your higher elevations first. Then work your way down. Also, don't use adjacent elevations. Make the next elevation at least 2 heights lower. This gives you your best hill effect. So, your elevations section might look something like this --



/* ********** Mountains *********** */
<ELEVATION_GENERATION>
create_elevation 6
{
base_terrain GRASS3
number_of_clumps 12
number_of_tiles 256
set_scale_by_groups
}

create_elevation 4
{
base_terrain GRASS
number_of_clumps 12
number_of_tiles 192
set_scale_by_groups
}

create_elevation 2
{
base_terrain GRASS
number_of_clumps 12
number_of_tiles 100
set_scale_by_groups

}


A close look at the number above gives you an idea of how many tiles per clump is needed per hill of a given height. However, the randomization often causes plateaus, even with these low tile counts, so I'm not going to tell you that the above numbers are hard and fast. The randomization does not allow spacing between the hill points. Honestly, the above numbers work SOMEWHAT well for me for a particular RMS I built. I'm still not entirely happy with it, but m'thinks this is good enough.

Also, set_scale_by_ has two options,

set_scale_by_groups
set_scale_by_size

I have not figured this one out. 'Groups' worked well for this map, and I only play the medium (6 player) map, so I have not tested the set_scale_by options and their effects. But I can tell you that using groups seemed to be a little less random -- I ended up with more peaks than plateaus. Then again, I'm sure there's nothing hard and fast about this. These are RANDOM map scripts, and even when you think you've got your numbers right, you can test and test and test and still be unsure.

Also, note that in my above example, each elevation is placed on GRASS. This is because it seems to work better if you place your elevations section immediately following your create_land and create_player_lands sections. In the above examples, both of these land types were GRASS. Placing the elevations section later, after the terrain generation section, was most confusing! It seems that elevation uses the base land, not terrains, for generation of the elevations. So, do it this way



<LAND_GENERATION>

base_terrain XXXX

/* The lands that the players will start on */
create_player_lands
{
.....
}

/* ********** Mountains *********** */
<ELEVATION_GENERATION>
....

<TERRAIN_GENERATION>
.....



One great thing about this, is that your forests will fall on the hills. One caveat, though. If you place water in your terrain generation section, use



create_terrain WATER
{
.....
set_flat_terrain_only
}



This ensures that your water is on flat land. Note, however, that your ponds may fall on plateaus! Also, the number of ponds needs to correspond to the number of hills. If you have too many ponds, the result will be a mess. Also, forests seem to take precedence over water. I dunno why or what is really going on, and this is quite confusing -- the forests write directly over ponds. But I can advise this -- if you want rivers, make your base terrain WATER in your LAND_GENERATION section.

Anyway, the best I can tell you is

1. Use the "I can guess any number in so many tries" technique. This saves a load of time!

2. Work your way down in elevation, not up.

3. Place water using, set_flat_terrain_only

4. Have both your script and your game open at the same time, and ALT-TAB between them so that you can make changes to the script, then re-run a new map to see the effect. This last tip will also save you a lot of time. You don't need to exit the game to edit your RMScript.

5. TEST, TEST, TEST, TEST, and TEST until you're blue in the face!


I hope this helps. It is my feeble attempt at a minor contribution. If you find it helpful, send me FOOD PLEASE, and some stone and gold would be nice too! 8-)

.

[This message has been edited by Lengo67 (edited 02-01-2010 @ 12:38 PM).]

Replies:
posted 02-02-10 06:23 PM CT (US)     1 / 1  
This is a good article Lengo, though I was confused at first when you used the word mountain instead of elevation. If I make a random map scripting thread I'll make sure to link to this.

~`o´~|\  Join the fresh and exciting AI Ladder for its fourth season!
´ `  |_\
       |    Learn the joy of AI scripting in my guide: The World of AI Scripting
______|______
 \        /
   .....Hinga Dinga Durgen! - SpongeBob
  `-=<.__.>=-´
Age of Kings Heaven » Forums » AI & RM Scripting » RMS Mountain Making Tips
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Kings Heaven | HeavenGames