On first blush, one might think this is a pretty simple problem. Random name generators are numerous, after all.
The issue comes in how Mythruna worlds are generated. Ideally, if you and I pick the same seed then we should get the same starting world... right down to the towns, etc.. If we both play seed 42 and talk about some town "Shadowcastle" then we should be talking about the same town.
At least that has been my goal all along.
This works well for the terrain and related data because these are based on fractals that have a seed value. Change the seed, you get a different fractal. Use the same seed you get the same "random" fractal every time. Even the tree and flora placement is predictable because they use a combined local seed that is predictable from one world to the next.
Names are harder.
The same random approach would easily lead to neighboring towns having the same or extremely similar names. If you are picking random names out of a hat, you run the risk of picking the same name twice. It's inevitable... and common enough that it has actually happened in my testing. (My current test world has two Icestons right next to each other.)
And I can't just check for duplicates because that would mean that town names are dependent on the order you visit the world. So in the seed 42 example, if I head west and encounter Iceston and you head east and encounter a different Iceston... then deduping would mean we no longer have the same town names in our world (my version Iceston will be called something different in your world.)
This is why I have stubbed in a fairly stupid random name generator so far. It had a list of 40-50 town names and just randomly picked one.
However, to do anything clever I had to write my own... so I did.
Here are 100 random town names from the generator:
Bywyvern
Fairmere
Shadebrook
Whiterose
Lynbury
Erishaw
Mossfield
Llanburgh
Bluecrystal
Bradcaster
Havenwyn
Lochport
Maplegold
Deepwheat
Polwater
Magesummer
Aberden
Swynsummer
Rocklake
Roseworth
Clearbrook
Winterbrook
Barrowshade
Gilllake
Fayloch
Westermarble
Aberness
Strongdeer
Wyvernwind
Newstoke
Snowmeadow
Lyngfog
Tillysage
Fallcrystal
Bradcaster
Merrowfoss
Pytmoor
Faywheat
Clearhollow
Wheatmarsh
Southcester
Castlekeep
Valfog
Sudforth
Aberton
Kinmere
Polstoke
Tillyspring
Morbury
Norflower
Whitedragon
Ghyllspring
Elfglyn
Coldedge
Stanworth
Moormarsh
Tillykael
Dellbury
Newchester
Glyncaster
Belspell
Wyvernwood
Shoreley
Marshsage
Fieldwater
Glynghyll
Castlewych
Waterton
Fallbeech
Hedgeloch
Marshdale
Fairbeech
Byriver
Westerburn
Meadowwick
Llanwater
Northbay
Fieldloch
Lyngfay
Fairice
Bushdale
Starrythorp
Ashmeadow
Lhanmere
Freyport
Valborough
Wellhythe
Swynweald
Ostton
Fieldcaster
Pytwich
Aldthwaite
Shadowway
Mapleport
Violetberg
Shadeden
Ostgill
Janwych
Elfmist
Marshwardine
This pieces names together from stems which should give me a little more flexibility. (Interestingly, many of the stems are derived from actual town word stems like on here:
http://en.wikipedia.org/wiki/List_of_generic_forms_in_place_names_in_the_United_Kingdom_and_Ireland and here:
http://www.englishplacenames.co.uk/ ...and since these stems have actual meanings it might one day be possible to have names generate that actually match the town... that would actually solve my problem but is too complicated for today)
Anyway, given how this algorithm works, I believe I can use location as an input in such a way to both prevent duplicates and avoid nearby towns always having similar stems. (ie: Goldwich, Goldchester, Goldwyn... gee, we must be in the 'gold' area... lame.)
We'll see how it goes but I liked the names I was getting so I thought I would post at least that much progress.
This weekend is all about fixing my town placement and town naming to be predictable and repeatable for a world seed. Both of my previous approaches changed depending on the order you visited the world.