Multihex+overlay terrain guidance please!
Moderator: Forum Moderators
- Spannerbag
- Posts: 763
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Multihex+overlay terrain guidance please!
Hi,
I'm working on initial ideas for a single player campaign and have a basic (very basic!) idea about terrain but I'm struggling here.
I have created custom villages but what I'm attempting here is much more complex and so I thought I'd ask here before I end up throwing my PC out the window...
What I want to do
Create a 2x2 custom terrain overlay (I'm using ^YSt as the terrain code).
I have created 4 separate hexes (in 72x72 pixel images) that I want to bolt together using
I have stolen the map from mountains.cfg in the hope that it will work for me (the layout of the terrain I'm working on has the same arrangement).
I.e.
The layout of the 4 hexes (A,B,C and D) in my terrain are arranged thus (just like the 2x2 mountains):
If A x-coordinate is even: A,B,D have same y-coordinate and C's is +1.
If A x-coordinate is odd: A,C,D have same y-coordinate and B's is -1.
I understand I can apply an
I also want tile D (only) to act like a village for healing but not to generate income.
So in
but for tile "D" only - if possible?
However, before I get too bogged down I have a few queries:
1. Is the above possible?
That is, have 1 tile of multi-hex terrain
If so, how would I do this (I can see a way using 2 separate terrains adjacent to each other but I'd rather not go there).
2. Lots of terrain
Questions:
What do these do/are they for?
Are they the same as
(I can live with the terrain not changing with time of day.)
3. Does the clause
4. Are the actual flag values set/tested in
Ideally if you could PM me (so I get an email alert) that would be perfect.
Thanks in advance for your time and trouble, much appreciated!
Cheers,
Spannerbag.
I'm working on initial ideas for a single player campaign and have a basic (very basic!) idea about terrain but I'm struggling here.
I have created custom villages but what I'm attempting here is much more complex and so I thought I'd ask here before I end up throwing my PC out the window...
What I want to do
Create a 2x2 custom terrain overlay (I'm using ^YSt as the terrain code).
I have created 4 separate hexes (in 72x72 pixel images) that I want to bolt together using
map=
and [tile]
.I have stolen the map from mountains.cfg in the hope that it will work for me (the layout of the terrain I'm working on has the same arrangement).
I.e.
Code: Select all
#Macro for 4-Hex mountains
#define MOUNTAINS_2x2 TERRAIN PROB FLAG IMAGESTEM
[terrain_graphics]
map="
., *, .
, *, *
*, 1, *
, 1, 1
*, 1, *
, *, *
., *, .
, ., ."
The layout of the 4 hexes (A,B,C and D) in my terrain are arranged thus (just like the 2x2 mountains):
Code: Select all
B
A D
C
If A x-coordinate is odd: A,C,D have same y-coordinate and B's is -1.
I understand I can apply an
[image]
to each [tile]
.I also want tile D (only) to act like a village for healing but not to generate income.
So in
[terrain_type]
have
Code: Select all
heals=8
gives_income=no
However, before I get too bogged down I have a few queries:
1. Is the above possible?
That is, have 1 tile of multi-hex terrain
heal
/cure
units whilst others do not.If so, how would I do this (I can see a way using 2 separate terrains adjacent to each other but I'd rather not go there).
2. Lots of terrain
[images]
have variations=
(I left them in my custom village terrain as they were in the original .cfg but I have no idea what they do or are for!).Questions:
What do these do/are they for?
Are they the same as
[variant]
?(I can live with the terrain not changing with time of day.)
3. Does the clause
heals=8
in [terrain_type]
above also cure
units?4. Are the actual flag values set/tested in
set_flag
/ has_flag
/ no_flag
/ set_no_flag
documented anywhere?Ideally if you could PM me (so I get an email alert) that would be perfect.
Thanks in advance for your time and trouble, much appreciated!
Cheers,
Spannerbag.
Re: Multihex+overlay terrain guidance please!
Hello!
I know this post is a few years old, but multihex terrain is pain, so I will try to make a nice tutorial with images. It will surely be helpful to somebody.
Quick answers:
1. Yes, using image overflow and a healing overlay. I will explain this one.
2. I do not know what you are referring to exactly.
3. Yes - Oasis overlay has this. In fact any amount of heals will also cures.
4. As far as I understand, you can make up any flag you want and it will only check for one if you ask it.
First of all, I will explain your mountain map.
., *, .
, *, *
*, 1, *
, 1, 1
*, 1, *
, *, *
., *, .
, ., ."
The "1" are hexes that have the correct terrain type. the "*" are overflow hexes. The "." are unaffected hexes (these are used to line up the others correctly). "," divides the hexes.
Like this: Now, I assume you want to create an overlay something like this: You said you have separated tiles. However, if they always go together, I suggest glueing them together into one image. This will make life simpler. I will use this method.
Step 1: Create image at the correct size.
Step 2: Determine which hexes are overflow.
Now, you don't want your southern tile to have the overlay, because you want to add a heals+8 overlay after. So it will be an overflow hex.
Like so: In fact, you can make all but one hex overflow if you want: Step 3: Crop image
Now this is important: The game will line up the top-left corner of your image with the top-left corner of a square that contains all affected hexes. So if you make a square that exactly surrounds your hexes, you won't have to worry about "centre= x,y" or anything like that.
In this example, the image is cropped to size 234x216 (3 1/4 hexes wide, 3 hexes tall). (continued)
I know this post is a few years old, but multihex terrain is pain, so I will try to make a nice tutorial with images. It will surely be helpful to somebody.
Quick answers:
1. Yes, using image overflow and a healing overlay. I will explain this one.
2. I do not know what you are referring to exactly.
3. Yes - Oasis overlay has this. In fact any amount of heals will also cures.
4. As far as I understand, you can make up any flag you want and it will only check for one if you ask it.
First of all, I will explain your mountain map.
., *, .
, *, *
*, 1, *
, 1, 1
*, 1, *
, *, *
., *, .
, ., ."
The "1" are hexes that have the correct terrain type. the "*" are overflow hexes. The "." are unaffected hexes (these are used to line up the others correctly). "," divides the hexes.
Like this: Now, I assume you want to create an overlay something like this: You said you have separated tiles. However, if they always go together, I suggest glueing them together into one image. This will make life simpler. I will use this method.
Step 1: Create image at the correct size.
Step 2: Determine which hexes are overflow.
Now, you don't want your southern tile to have the overlay, because you want to add a heals+8 overlay after. So it will be an overflow hex.
Like so: In fact, you can make all but one hex overflow if you want: Step 3: Crop image
Now this is important: The game will line up the top-left corner of your image with the top-left corner of a square that contains all affected hexes. So if you make a square that exactly surrounds your hexes, you won't have to worry about "centre= x,y" or anything like that.
In this example, the image is cropped to size 234x216 (3 1/4 hexes wide, 3 hexes tall). (continued)
Last edited by tsunami_ on March 10th, 2025, 6:42 am, edited 1 time in total.
Re: Multihex+overlay terrain guidance please!
(continuation)
Step 4: Move your image into the terrain folder.
Step 5: Code
Now, you just need to write your image in map-notation.
Hopefully, this picture makes it clear: Here is the terrain code for this particular image. (You need to change the editor group to use it of course).
Now you can add your overlay in the editor. The image will only appear if you draw the pattern that matches your "map=". In this case three "*^Yh2" tiles in a row.
As you can see, the southern tile has no overlay. So you can add a different one, in your case an invisible village or heals+8 one. Now, maybe you want to make sure that there is always a village-overlay (^Vov) in the south. In this case, you can use multiple tiles. pos=1 for the house tiles, pos=2 for the village overlay.
Here is the new map and code.
Now, the house will only appear if you have both the three house tiles and the village overlay.
(End)
I hope it makes sense!
Step 4: Move your image into the terrain folder.
Step 5: Code
Now, you just need to write your image in map-notation.
Hopefully, this picture makes it clear: Here is the terrain code for this particular image. (You need to change the editor group to use it of course).
Code: Select all
[terrain_type]
symbol_image=house-overlay
id=housebig
name= _ "house overlay"
editor_name= _ "house overlay"
string=^Yh2
aliasof=_bas # This code gives it the mov/def of the base terrain.
editor_group=HBX
[/terrain_type]
[terrain_graphics]
map="
. , * ,
, * , * ,
* , 1 ,
, 1 , 1 ,
. , * ,"
[tile]
pos=1
type=*^Yh2
set_no_flag=overlay
[/tile]
probability=100
[image]
name = house-overlay.png
layer=0
base=144, 144 # measured from the top-left corner of the image
[/image]
[/terrain_graphics]
As you can see, the southern tile has no overlay. So you can add a different one, in your case an invisible village or heals+8 one. Now, maybe you want to make sure that there is always a village-overlay (^Vov) in the south. In this case, you can use multiple tiles. pos=1 for the house tiles, pos=2 for the village overlay.
Here is the new map and code.
Code: Select all
[terrain_graphics]
map="
. , * ,
, * , * ,
* , 1 ,
, 1 , 1 ,
. , 2 ,"
[tile]
pos=1
type=*^Yh2
set_no_flag=overlay
[/tile]
[tile]
pos=2
type=*^Vov
set_no_flag=overlay
[/tile]
probability=100
[image]
name = house-overlay.png
layer=0
base=144, 144
[/image]
[/terrain_graphics]
(End)
I hope it makes sense!

- Spannerbag
- Posts: 763
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: Multihex+overlay terrain guidance please!
Wow, many thanks for your post, it must have taken some time so I really appreciate your efforts!
My own understanding of terrain has moved on somewhat and I managed to work around the particular problem that gave rise to my post... however I can certainly find a use for multihex terrain, as workarounds are tedious and often mandate significant map and code changes.
Another terrain related subject for your tutorial, if you are feeling generous, would be to summarise how (assuming this is possible) to have multiple overlays on a single hex by specifying different layers so you could have, for (trivial) example, a wooden bridge over a railway track.
Sheesh, amazing how time goes by... can't believe I posted that over 5 years ago!
The post arose from 2 separate requirements in different campaigns.
One was for my campaign Leafsea Burning (published, currently undergoing major surgery as a result of feedback and my "good ideas").
I've not had much chance to work on the other campaign since then, it's been languishing at around 50-60% complete for ages.
I will certainly give your posts a thorough perusal when I have the headspace (and time to experiment), probably next weekend.
Thanks again for taking the trouble to reply, much appreciated.
Cheers!
-- Spannerbag
tsunami_ wrote: ↑March 10th, 2025, 6:24 am ...
1. Yes, using image overflow and a healing overlay. I will explain this one.
2. I do not know what you are referring to exactly.
3. Yes - Oasis overlay has this. In fact any amount of heals will also cures.
Thanks for the clarification/confirmation.
4. As far as I understand, you can make up any flag you want and it will only check for one if you ask it.
...
- Thanks! Good work.
- I think I understand that now: if I'm right it refers to different graphics for a single terrain (e.g. villages).
Presumably which actual graphic appears is determined by the terrain rules (based on location, time of day etc.) but I'm unclear on the detail of this logic.
Below: same terrain code, different appearance. - Oh, I didn't know heals always cures also.
- I'd kinda realised that since posting but always helpful to have confirmation.
My own understanding of terrain has moved on somewhat and I managed to work around the particular problem that gave rise to my post... however I can certainly find a use for multihex terrain, as workarounds are tedious and often mandate significant map and code changes.
Another terrain related subject for your tutorial, if you are feeling generous, would be to summarise how (assuming this is possible) to have multiple overlays on a single hex by specifying different layers so you could have, for (trivial) example, a wooden bridge over a railway track.
Sheesh, amazing how time goes by... can't believe I posted that over 5 years ago!

The post arose from 2 separate requirements in different campaigns.
One was for my campaign Leafsea Burning (published, currently undergoing major surgery as a result of feedback and my "good ideas").
I've not had much chance to work on the other campaign since then, it's been languishing at around 50-60% complete for ages.

I will certainly give your posts a thorough perusal when I have the headspace (and time to experiment), probably next weekend.
Thanks again for taking the trouble to reply, much appreciated.
Cheers!
-- Spannerbag
Re: Multihex+overlay terrain guidance please!
You are welcome! It took less time to write the post than to figure all this out in the first place. So if it helps someone else skip the frustration, then it was worth it, you know?Spannerbag wrote: ↑March 10th, 2025, 12:26 pm Wow, many thanks for your post, it must have taken some time so I really appreciate your efforts!
Actually, I was looking for help with layering when I found your postSpannerbag wrote: ↑March 10th, 2025, 12:26 pm Another terrain related subject for your tutorial, if you are feeling generous, would be to summarise how (assuming this is possible) to have multiple overlays on a single hex by specifying different layers so you could have, for (trivial) example, a wooden bridge over a railway track.

Please tell me about anything unclear in my tutorial, once you've tried it, so I can make it better.Spannerbag wrote: ↑March 10th, 2025, 12:26 pm I will certainly give your posts a thorough perusal when I have the headspace (and time to experiment), probably next weekend.
Thank you!

- Spannerbag
- Posts: 763
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: Multihex+overlay terrain guidance please!
Well that's a

I have exactly the same tendency when designing campaigns... I'll create a short, concise one some day... perhaps... nah, probably not.

Roger wilco!
Look forward to reading it.

Thanks again.
Cheers!
-- Spannerbag