Terrain name generator discussion

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Terrain name generator discussion

Post by Simons Mith »

Not entirely sure this is the right forum for this, but can't really think of a better. See also the some older threads on this subject, going back to 2003 or so.

english.cfg contains the following placename generation code:

Code: Select all

    bridge_name= _ "$name's Bridge,$name's Crossing"
    road_name= _ "$name's Highway,$name's Pass,Path of $name"
    river_name= _ "$name River,River $name"
    forest_name= _ "$name Forest,$name's Forest"
    lake_name= _ "$name Lake"
    mountain_name= _ "$name's Peak,Mount $name"
    swamp_name= _ "$name's Swamp,$name|marsh,$name|fen"
    village_name= _ "$name|bury,$name|ham,$name|ton,$name|bury"
    village_name_lake= _ "$name|harbor,$name|port,$lake|port,$lake|harbor"
    village_name_river= _ "$name|ham,$name|ford,$name|cross,$river|ford,
$river|cross,$name on river"
    village_name_river_bridge= _ "$river|bridge,$river|bridge,$river|bridge,
$name|ham,$name|bridge,$bridge|ham,$bridge|ton"
    village_name_grassland= _ "$name|ham,$name|ton,$name|field"
    village_name_forest= _ "$name|ham,$name|ton,$name|wood,$name
Forest,$forest|wood,$forest|ham,$forest|ton"
    village_name_hill= _ "$name|ham,$name|bury,$name|ton,$name|hill,
$name|crest"
    village_name_mountain= _ "$mountain|mont,$mountain|cliff,
$mountain|bury,$mountain|ham"
    village_name_mountain_anonymous= _ "$name|ham,$name|bury,
$name|ton,$name|mont,$name|mont,$name|cliff,$name|cliff"
    village_name_road= _ "$road's Rest,$road's Waypoint,$road|bury,
$road|ham,$name|bury,$name|ham"
    village_name_swamp= _ "$name|bury,$name|ham,$name|ton,
$swamp|bury,$swamp|ham,$swamp|ton,"
I've been looking at expanding some of these entries and adding some more placename seeds to names.cfg. I was also proposing to add placeholder code for, say, desert_name=... and village_name_desert=... even though these won't do anything yet.

My first question is: in general terms (I don't need to know the technical specifics) how simple is it for the random terrain generator to identify areas of terrain not already covered above, particularly the new 'area types' listed below?

For example, valleys. A valley could be anything from half a mile wide, to wider than the entire map. (If it's only a hex or two wide, though, it's probably going to be counted as a pass or a gorge within the game.) For the purposes of the Wesnoth terrain generator, a valley is probably going to be a flat area between two large groups of mountain and hill hexes. Can the generator tell easily when it has generated one? What about a gorge or a pass?

Deserts and wastelands are presumably as easy to detect as forests and marshes. Can these be added too?

What about castles and ruins? Steppes and plains? Areas of hills? Seas? Farmland? Coastland?

Caverns? Springs? Beaches? River mouths, expecially for rivers more than one hex wide? Ridges? Towns and cities (although those probably won't be needed until multi-hex villages exist) Ports and harbours?

Any others I haven't thought to mention?


Areas:

One new possibility is to define an 'cluster', which is just a region of a few dozen hexes of any terrain type. Consider the following placename possibilities:

East X; West X, North X - requires at least two 'Xs' close together. Note that you could have 'East X' and 'North X' without necessarily having an 'X' anywhere, or you could have 'X' and 'South X'.

High, Upper and Lower X - these can be mixed in with East, North, South. 'Upper X' usually means uphill from X, rather than above X when viewed on a map. So if you had two villages within your defined 'cluster' area, one on the plains, one in the hills, you could call the plains one 'Xham', the other one 'High Xham'.

Rarer ones might include Great X, Greater X, X Town, Long X, X Market, Little or Lesser X, X Village and Old and New X which can also be mixed in with the above.

Central X is probably too modern and anachronistic, but could also be included.

These options will typically require two or three villages nearby with the same name. But as the number of random base names increases this occurence becomes increasingly unlikely. So the generator might need to give a 'cluster' of villages related names. Which means defining the occasional 'cluster' (maybe, 'a circle of 12 hexes radius spanning any terrain types') might become useful.



Compound names:

The base village names are almost all monosyllabic. But say you have 'Wy' as a base name, and 'combe' meaning wood. How could you best persuade the generator to produce North Wycombe, for example? There's also a number of what I would call 'null names', such as the Ouse. 'Ouse' just means river; 'River Ouse' is tautologous. Shall we permit null names? Or shall we just add the generic terms such as Avon, Glen, Burn, Ouse, etc. to the name list and let the generator stumble across them randonly?


Village names based on character names:

We have long lists of elf, dwarf, troll and other names. It might be nice to be able to have

Code: Select all

village_name=$person|ham

Code: Select all

village_name=$dwarf|ham
and variants, as another naming possibility.



Language:

The apocryphal Torpenhow Hill (Saxon TOR, Celtic PEN, Scandinavian HAUGR (later transposed into HOW), and the Middle English HILL, all four of them meaning "hill") combines four legitimate words for 'hill' into one memorable package, even if the existence of Torpenhow Hill itself is spurious. In Wesnoth, I could add all of these to our hill village names. I could also add words like heim, ville, burgh, pike, and others. Now, the more we do this, the more variety we see in placenames, but after a point the maps will start to look increasingly haphazard. When we consider that in Wesnoth there are elven, dwarvish and possibly even drake-dominated areas, it might make sense to try to define sets of names for 'typical elves', 'typical dwarves', 'typical humans' etc. Possibly more than one set for each race. Then when you define a map, you could set things up so that one area used 'elvish name set #1', while the rest used 'human name set #3'. That would maintain a higher level of variety while ensuring that map-naming doesn't become a complete free-for-all.

This part is the area I'm most interested in. But to implement it, there would need to be some discussion on naming practices among the different races. We might define human name set #1 as using Welsh-style names (particularly as we already have a lot of Welsh-style unit names for humans), human name set #2 as using names from, say the UK midlands, set #3 might be German-style and so on. Dwarven set #1 might be Northern Scottish; set #2 might be Yorkshire. Orcish set #1 might be based on Red Indian-style names. It really doesn't matter what gets chosen, but this isn't something I would care to start without at least some consensus.



Holy sites:

Modern placenames include quite a few Xchurches, Saint or St. X's, X Abbeys, temples, Xfriars and so on. Places named X Cross often have religious connotations to their names. I am ignoring this area for now.



Relative frequency refinements:

At present, if you want a particular class of placename to be rare, you have to double-up all the more common ones (e.g. village_name_mountain_anonymous= _ "$name|ham,$name|bury,$name|ton,$name|mont,$name|mont,$name|cliff,$name|cliff" repeats 'cliff' and 'mont' so that they appear more often than ham, bury etc.) This gets unwieldy the more possibilities there are. Any chance of a numeric frequency indicator? e.g. something like

Code: Select all

village_name_mountain_anonymous= _ "$name|ham,$name|bury,
$name|ton,3x$name|mont,3x$name|cliff"
to make 'mont and cliff appear three times as often as 'ham', 'bury' and 'ton'. I'm more concerned with making unusual names rare - for example, X-in-the-marsh should be rarer than it would be if I just altered

Code: Select all

village_name_swamp= _ "$name|bury,$name|ham,$name|ton,
$swamp|bury,$swamp|ham,$swamp|ton,"
into, say,

Code: Select all

village_name_swamp= _ "$name|bury,$name|ham,
$name|ton,$swamp|bury,$swamp|ham,$swamp|ton,$name|bury,
$name|ham,$name|ton,$swamp|bury,$swamp|ham,$swamp|ton,
$name-in-the-marsh"
But conversely, by the time every line in the name generator has a dozen entries or so, yes, you get lots of name variety, but after a point the names start to look too random. On a real-world map, you tend to get regional clusters of similar names. I think you want perhaps 80% of the names generated to use a 'common names' algorithm, and the remainder to use a 'rarer names' algorithm. This might mean splitting the generator into two or more sections. But if we were going to split the generator up into sections anyway, then the idea of having themed names for humans, dwarves, elves etc. might become more workable.
 
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Loch Aye the New

Post by Simons Mith »

*Bump*

I am interested in anyone's comments on this. In particular with the hordes of extra village variants that are being produced, I'm giving serious thought to orc-style, dwarf-style and other-style place names.

[Edit] For example, I went through a large-scale map of Scotland and broke up the major towns into their component 'phonemes'. (Not quite the right term, but it'll do.) Feeding the results into names.cfg and english.cfg and creating a 100x100 map with 50 villages per 1000 hexes, I only got about half a dozen placename repetitions, if that, and the whole feel of the map was VERY Scottish. See attachment. Also, names1.txt and names2.txt are the name lists extracted from the saved games, which saves browsing a very large map.

But, look at English.cfg in particular. It is getting rather untidy. I could get even more variety with fewer lines of code if Wesnoth served me with name1 and name2 (where name2 is just name1 in lower case), and name3 and name4, name5 and name6 (ditto and ditto) and the relative frequency indicators already discussed in my first post.

There are a few bugs and placenames I doubt we'd want. If anyone would car to venture some opinions on which ones they'd like - or not - I'd be grateful.
Attachments
names.zip
Scottish-ised village names
(61.26 KiB) Downloaded 265 times
 
Exasperation
Posts: 462
Joined: June 8th, 2006, 3:25 am

Re: Terrain name generator discussion

Post by Exasperation »

Simons Mith wrote: Relative frequency refinements:

At present, if you want a particular class of placename to be rare, you have to double-up all the more common ones (e.g. village_name_mountain_anonymous= _ "$name|ham,$name|bury,$name|ton,$name|mont,$name|mont,$name|cliff,$name|cliff" repeats 'cliff' and 'mont' so that they appear more often than ham, bury etc.) This gets unwieldy the more possibilities there are. Any chance of a numeric frequency indicator? e.g. something like

Code: Select all

village_name_mountain_anonymous= _ "$name|ham,$name|bury,
$name|ton,3x$name|mont,3x$name|cliff"
I just ran into a similar situation, and realized it can be done easily in WML. Consider:

Code: Select all

#define X2 COMMA_LIST
	{COMMA_LIST},{COMMA_LIST}
#enddef
#define X3 COMMA_LIST
	{COMMA_LIST},{COMMA_LIST},{COMMA_LIST}
#enddef
village_name_mountain_anonymous= _ "$name|ham,$name|bury,
{X2 $name|ton},{X3 $name|mont,$name|cliff}"
(I added an extra 'ton' to your list just for demonstration purposes).

You just have to define an XN macro for each multiple N that you want a shortcut for.
User avatar
Simons Mith
Posts: 821
Joined: January 27th, 2005, 10:46 pm
Location: Twickenham
Contact:

Re: Terrain name generator discussion

Post by Simons Mith »

Ah... thank you. I wonder if that same idea can be used to teach the generator to give mostly elven-style names to forests, mostly dwarven-style names to mountains, etc. I'll have a go.
 
Exasperation
Posts: 462
Joined: June 8th, 2006, 3:25 am

Re: Terrain name generator discussion

Post by Exasperation »

If you're using large multipliers, you can also define your macros iteratively, like so:

Code: Select all

#define X2 COMMA_LIST
   {COMMA_LIST},{COMMA_LIST}
#enddef
#define X3 COMMA_LIST
   {COMMA_LIST},{X2 {COMMA_LIST}}
#enddef
#define X4 COMMA_LIST
   {COMMA_LIST},{X3 {COMMA_LIST}}
#enddef
Exasperation
Posts: 462
Joined: June 8th, 2006, 3:25 am

Re: Terrain name generator discussion

Post by Exasperation »

I have since learned that in order to make this work properly, you can't afford to make it that pretty. Whitespace matters a lot here.

Code: Select all

#define X2 COMMA_LIST
{COMMA_LIST},{COMMA_LIST}#enddef
#define X3 COMMA_LIST
{COMMA_LIST},{X2 {COMMA_LIST}}#enddef
#define X4 COMMA_LIST
{COMMA_LIST},{X3 {COMMA_LIST}}#enddef
Post Reply