View Full Version : Utility SemiRandom version 095
Ballbarian
February 14th, 2007, 03:23 AM
I have attached the latest version of SemiRandom (095) to this post. The zip includes the source files and a stand alone executable that should run on Windows & Unix systems.
There are several new provinces (138 total now), and a total of 41 list files for items and name generation. There is still plenty of room to grow, but they have already provided me with two entertaining test games. http://forum.shrapnelgames.com/images/smilies/happy.gif
If I can keep my eyes open long enough, I will upload the windows frontend version in another topic.
(Edit: The windows gui version has it's own topic HERE (http://www.shrapnelcommunity.com/threads/showflat.php?Cat=&Number=496176&page=0&view=collap sed&sb=5&o=&fpart=1).)
Edit: I could not have explained it any better than Endoperez did:
Endoperez said:For those who don't have any idea about what it is, it generates random provinces into existing map graphics. These random provinces can be similar to the unique defenders sometimes appearing in vanilla Dom3, or just little something extra. The point is, new provinces can be added to the pool just by editing the source text files. Want to add a province with King Arthur and his Knights of the Round Table, or Robin Hood, or some nasty undead, or a demon-infested wasteland? If you are willing to read through the mapedit.pdf of Dom3 and the readme of this program, you can. These provinces can appear for you and for anyone else who downloaded them any time you create a new SemiRandom map.
Thank you to everyone for your contributions to this project. http://forum.shrapnelgames.com/images/smilies/happy.gif
Ballbarian
February 16th, 2007, 03:26 AM
I think that I may have figured out a viable algorithm for placing reasonable start positions (as an option) and flagging those provinces and their immediate neighbors as off limits for modification. This is only theory right now, and I am in hopes that it won't unravel when I try to code it into the existing framework. (It is also possible that I won't be able to understand my own notes after a good nights sleep!) http://forum.shrapnelgames.com/images/smilies/happy.gif
Endoperez
February 17th, 2007, 01:01 PM
Wonderful work. It's still a bit too complicated for anyone with an interesting idea to just add a province, but at least those who are willing to read the readme can do so. I once planned to do a similar program, but it's been dead for about two years now.
For those who don't have any idea about what it is, it generates random provinces into existing map graphics. These random provinces can be similar to the unique defenders sometimes appearing in vanilla Dom3, or just little something extra. The point is, new provinces can be added to the pool just by editing the source text files. Want to add a province with King Arthur and his Knights of the Round Table, or Robin Hood, or some nasty undead, or a demon-infested wasteland? If you are willing to read through the mapedit.pdf of Dom3 and the readme of this program, you can. These provinces can appear for you and for anyone else who downloaded them any time you create a new SemiRandom map.
If you manage to figure out an algorithm for starting positions, could it also be used for kingdoms with e.g. knights/longbowmen etc in the middle, and few heavy cavalry and archers added to all neighbouring provinces?
Can the namelists be used to e.g. create a list of all non-cursed magic items, or all non-cursed trinkets, or all non-cursed, not very powerful, melee-only magic weapons?
Ballbarian
February 17th, 2007, 03:38 PM
Thank you for the feedback Endoperez.
It's still a bit too complicated for anyone with an interesting idea to just add a province, but at least those who are willing to read the readme can do so.
It feels easy to me, but just because I am so familiar with it. The ideal would be if someone like Jack with skill in programming online tools could provide a web interface which allowed building individual provinces in a SemiRandomizer script format and auto email the submissions for addition to the library. I would be able to do a windows version, but it would not be cross platform friendly. I could look at doing a yabasic province creator, but without a proper gui interface it would be a awkward to use.
If you manage to figure out an algorithm for starting positions, could it also be used for kingdoms with e.g. knights/longbowmen etc in the middle, and few heavy cavalry and archers added to all neighbouring provinces?
Certainly possible. I will keep that in mind as the next version progresses. I also like the idea of being able to have North Dakota, South Dakota and Greater Dakota (for example) as neighboring provinces with similar inhabitants.
Can the namelists be used to e.g. create a list of all non-cursed magic items, or all non-cursed trinkets, or all non-cursed, not very powerful, melee-only magic weapons?
Yes! A simple example would be if I wanted to create a list of one-handed, fire only melee weapons for a set of abysian commanders to select randomly from. I would create a text file named 1HFIREMELEE_DATA1.txt and add any items that I wanted to the list:
Fire Sword
Fire Brand
Evening Star
Demon Whip
Unquenched Sword
Ember
Then save the file to the NAME_VAULT directory and add the name of the file to NameList.txt so that the program can find it. Now when I am creating my abysian province commanders I would tell the program to assign him a random item from that list with:
@RANDOM additem 1HFIREMELEE
In the above example, I could have also done the same thing with:
@6 additem
"Fire Sword"
"Fire Brand"
"Evening Star"
"Demon Whip"
"Unquenched Sword"
"Ember"
But with a long list of items that you wanted to use with multiple commanders, or across multiple provinces, the list file is a nice solution.
A helpful tip is that Edi's databases make it easy to use the autofilter feature to quickly compile very specific lists of items, monsters, magic sites, etc.
Endoperez
February 19th, 2007, 11:53 AM
Realm of the Ape King is done. A rich province in both gold and gems. It has a castle. Outside the castle, the defenders aren't that hard to take down, but just breaching the gates to the inner castle should take you a long, long time... And the defenders inside the castle won't starve anytime soon, either.
I'll attach ENDO1_HOT_M_FST_U_R_.gan here, zipped, but there's still one problem with it. It should be able to appear in any hot or temperate forest that's medium to large. BallBarian, you seem to have done multiple versions of a single province type (even uniques), like this:
ENDO1_HOT_L_FST_U_R_.gan
ENDO1_HOT_M_FST_U_R_.gan
ENDO1_TMP_L_FST_U_R_.gan
ENDO1_TMP_M_FST_U_R_.gan
However, wouldn't that let it create four versions of the same unique province? That doesn't sound right... If you've already added in some kind of province recognition, I'd like to have the Realm appear under those four names. However, it might take a week before I have a chance to use a computer again... I won't mind anyone else adding it to the .gan lists, of course.
Wauthan
February 19th, 2007, 01:53 PM
This utility is very cool. Breathes new life into the all the tired old maps around. Thanks for sharing Ballbarian.
Ballbarian
February 19th, 2007, 04:50 PM
Thank you very much for contributing Endoperez! http://forum.shrapnelgames.com/images/smilies/happy.gif
It looks like you have found a way to allow external defenders of "independent" forts. Very cool!
It should be able to appear in any hot or temperate forest that's medium to large. BallBarian, you seem to have done multiple versions of a single province type (even uniques), like this:
ENDO1_HOT_L_FST_U_R_.gan
ENDO1_HOT_M_FST_U_R_.gan
ENDO1_TMP_L_FST_U_R_.gan
ENDO1_TMP_M_FST_U_R_.gan
However, wouldn't that let it create four versions of the same unique province?
First let me point out that you are using _M_ to denote a medium sized or otherwise "Normal" size, which should be _N_. It will still work since _M_=Multi (opposite of unique) which is just a placeholder that can be omitted, but that I include in my gan titles for clarity. The same goes for _N_=Normal which is again just a placeholder and can be omitted.
That said, currently _U_nique provinces must have a specific terrain for them to be truly unique. Creating a single unique province that can appear on a variety of terrains is not an option right now, though I feel your pain and I am looking for an alternative approach. You are right. Using your example could create four instances of the same unique province on different terrains. There should not be any existing GAN's in the current set that use the same unique province with multiple terrain types. If you see one, please point it out because it would have been unintentional. (I did a quick scan and couldn't find any.) There are however "multi" type provinces with multiple files for different terrain types.
This utility is very cool. Breathes new life into the all the tired old maps around. Thanks for sharing Ballbarian.
Your very welcome Wauthan, and thank you for the encouragement. http://forum.shrapnelgames.com/images/smilies/happy.gif
Endoperez
February 23rd, 2007, 03:01 PM
Ballbarian said:
Thank you very much for contributing Endoperez! http://forum.shrapnelgames.com/images/smilies/happy.gif
It looks like you have found a way to allow external defenders of "independent" forts. Very cool!
First let me point out that you are using _M_ to denote a medium sized or otherwise "Normal" size, which should be _N_.
That said, currently _U_nique provinces must have a specific terrain for them to be truly unique. Creating a single unique province that can appear on a variety of terrains is not an option right now, though I feel your pain and I am looking for an alternative approach.
Yeah, I'm proud of coming up with that ownership change trick. It seems to work without any problems, too.
Thanks for pointing out the "Medium"/"Normal" thing. I'll remember it for the next one. http://forum.shrapnelgames.com/images/smilies/wink.gif
Good luck on coming up with an alternative.
Gandalf Parker
February 23rd, 2007, 07:54 PM
WOW THANKS for figuring out that castle defence thing! Do you mind if I make extensive use of that immeadiately on all my map routines?
(slap head, cant believe I didnt try that long ago).
Using special monsters will be ok for awhile altho Im pretty sure that something is planned for that. Did you test 23 (independents) to see if that worked. It might not since part of what it was doing originally had to be removed. And does 25 work the same? Im not sure of the difference in how the code plays #24 Special Monsters and #25 Special Monsters but Im sure there is something.
I hope Johan doesnt fix this now that we found it. http://forum.shrapnelgames.com/images/smilies/shock.gif
Gandalf Parker
February 23rd, 2007, 08:37 PM
On the algorythm for finding a start position, here are some ideas for programs to use it.
(A) Based on a comment by someone in another thread.. a 3 age scenario. The same graphic map (RGB) but zipped up with 3 .map files. For example a scenario for abit of extended roleplaying with Ermor.
Map 1: Early Era Ermor, a set starting position with one province.
Map 2: Middle Era Ermor, same as above but start with 3 provinces.
Map 3: Late Era Ermor, same as above but 9 provinces.
If the 9 provinces were the same on each map (same poptypes and sites even though you wont see the sites on earlier maps) then it might give a real feel for a 3 game campaign And it would give a real feel for Kristoffers work in giving storyline progression on some nations.
(B) The Pipeline or Tower maps. I like the concept of the Tower map (very tall but only wide enough to have one nation stacked above the other) but the concept of starting at one end and fighting your way thru successive nations gradually getting stronger and stronger seems to require preset starting positions.
Of course both of those can be done manually (If anyone wants to, please feel free to do it for us all). But personally its going to sit on my ToDo list for ever. But if it can be programmed you could make it available for nightly generated new versions in your web directory.
Endoperez
February 24th, 2007, 05:11 AM
Gandalf Parker said:
WOW THANKS for figuring out that castle defence thing! Do you mind if I make extensive use of that immeadiately on all my map routines?
(slap head, cant believe I didnt try that long ago).
I don't mind that at all. The original idea I had for this province was just to make an example that would let others create their own castled, double-defended provinces for SemiRandom. It grew a bit from that.
Ballbarian
February 25th, 2007, 04:31 AM
It's in the early stages still, but here are a couple of examples to give a visual of the start distribution.
This one is a 103 province map with 6 players and a 4 province minimum distance buffer.
http://www.dom3minions.com/~semirand/creepycellar/R2_starts_marked_small.jpg
This one is a 145 province tower style map with 9 players and a 4 province minimum distance buffer.
http://www.dom3minions.com/~semirand/creepycellar/TOWER_START_marked_sm.jpg
Both maps were processed using the current default SemiRandom settings of 15 provinces per player & minimum neighbor count of 4 land for land starts, or 4 water for water starts.
Until this weekend, I had been too busy to work on it more than 30 minutes here and 30 minutes there. Very hard to stay focused that way. http://forum.shrapnelgames.com/images/smilies/stupid.gif
Gandalf Parker
February 25th, 2007, 09:36 PM
It looks good. Excellent coding.
Personally Im going to want more of a spread than that.
Will it evenly distribute on larger maps?
Ballbarian
February 26th, 2007, 10:47 PM
You will be able to increase the spread by specifying a smaller number of players. It seems to distribute well on your MegaMap, but I am not happy with the water start consistency. That is being corrected now. I am also working on a little fidgeter to make the start placements less "optimized" and more random on multiple generations of the same map.
Ballbarian
March 5th, 2007, 10:31 PM
It has been hard finding time for coding, but finally have enough working to sit back for a little while and enjoy a test game. Decided to use the Eventide random map that is being used in a multiplayer game. They have 18 players in that game, 16 being land and 2 being water. With the settings that I used, my distribution was a bit looser, so I ended up with 11 land & 2 water starts. Trying out a SC Gorgon with one of my favorite nations... Pangaea.
So pardon my laziness for a little while. http://forum.shrapnelgames.com/images/smilies/tongue.gif
I intend to look more at some method for supporting "kingdoms" or thematic province clusters. The base is there, but I haven't decided quite how I want to approach the format via the GAN files. Then there are those pesky multi provinces for varied terrains. http://forum.shrapnelgames.com/images/smilies/happy.gif
Jack_Trowell
March 6th, 2007, 07:20 AM
Ballbarian said:
Thank you for the feedback Endoperez.
It's still a bit too complicated for anyone with an interesting idea to just add a province, but at least those who are willing to read the readme can do so.
It feels easy to me, but just because I am so familiar with it. The ideal would be if someone like Jack with skill in programming online tools could provide a web interface which allowed building individual provinces in a SemiRandomizer script format and auto email the submissions for addition to the library. I would be able to do a windows version, but it would not be cross platform friendly. I could look at doing a yabasic province creator, but without a proper gui interface it would be a awkward to use.
[...]
I had already something like that planned for my own map randomizer, and I could indeed make it so it send new submitted province both to you and me, with appropriate formatting. (for myself I plan tu use XML, but if you want something already in your specific format, just send me the specs by e-mail and I will do it)
(I had also started working on a function to select starting province like you do, bu stopped working on it to focus on the editor)
You can contact me to the following e-mail address :
dominions _at_ realites.org
Ballbarian
March 6th, 2007, 04:17 PM
Thanks Jack. I will try to put something together tonight and send it to you. The specs are basically just normal map commands, but the wild card is the random stuff that can be added (and the file naming for terrain matching).
Jack_Trowell
March 6th, 2007, 05:00 PM
Yes, I have been thinking of a way to add you semi-random commands feature to my editor, and I think I found a way to use a similar system in XML.
It will take some work to code it, but it should be useful.
This is an exemple of a province in XML form :
(it's the central province from the map "fourmaggedon")
<PROVINCE killpop="1" poptype="61" population="45000">
<commanders name="Chalidor" mag_earth="5" mag_nature="4" unit_id="Troll King" xp="300">
<units number="35" unit_id="Troll" />
</commanders>
<commanders name="Morghal" mag_earth="5" mag_water="4" unit_id="Troll King" xp="300">
<units number="25" unit_id="Troll Moose Knight" />
</commanders>
<commanders name="Urgya" mag_fire="5" unit_id="Vaetti Hag" xp="300">
<units number="50" unit_id="Vaetti" />
</commanders>
<commanders name="Urgyuur" mag_fire="5" unit_id="Vaetti Hag" xp="300">
<units number="25" unit_id="Wolf Rider" />
</commanders>
<terrain_types>manysites</terrain_types>
<terrain_types>nostart</terrain_types>
<terrain_types>farm</terrain_types>
<terrain_types>somewater</terrain_types>
<terrain_types>large</terrain_types>
</PROVINCE>
The same province, but instead of having all the commanders, you would have one of them chosend randomly, *and* a lone normal troll king with 5 vaettis bodyguards :
<PROVINCE killpop="1" poptype="61" population="45000">
<RANDOM>
<commanders name="Chalidor" mag_earth="5" mag_nature="4" unit_id="Troll King" xp="300">
<units number="35" unit_id="Troll" />
</commanders>
<commanders name="Morghal" mag_earth="5" mag_water="4" unit_id="Troll King" xp="300">
<units number="25" unit_id="Troll Moose Knight" />
</commanders>
<commanders name="Urgya" mag_fire="5" unit_id="Vaetti Hag" xp="300">
<units number="50" unit_id="Vaetti" />
</commanders>
<commanders name="Urgyuur" mag_fire="5" unit_id="Vaetti Hag" xp="300">
<units number="25" unit_id="Wolf Rider" />
</commanders>
</RANDOM>
<commanders unit_id="Troll King">
<bodyguards number="5" unit_id="Vaetti" />
</commanders>
<terrain_types>manysites</terrain_types>
<terrain_types>nostart</terrain_types>
<terrain_types>farm</terrain_types>
<terrain_types>somewater</terrain_types>
<terrain_types>large</terrain_types>
</PROVINCE>
The "<RANDOM>" tag should be usable, when I've finished coding, with any other tag to make the function generating the map code chose randomly one of the child nodes to use in plance of the random tag.
Ballbarian
March 6th, 2007, 10:58 PM
Looks good!
If you have already downloaded SR, then you already have this, but I will paste the relevant details copied from the included readme below:
<font class="small">Code:</font><hr /><pre>
How to author GAN scripts (province files):
===========================================
It is assumed that you are familiar with map commands and map editing. The
format is pretty simple for editing GAN scripts and there are just a few rules
& suggested steps:
1. Look at existing GANs as a guide.
2. You do not need to add #nostart. This is added automatically.
3. You do not need to add #setland or #land. This is handled in the filename. (see below)
GAN FILENAME FLAGS:
-------------------
<Climates>
_HOT_ Hot Zone (southern map)
_CLD_ Cold Zone (northern map)
_TMP_ Temperate Zone (mid map)
<Patterns>
_IS_ ISLAND
_LK_ LAKE
_VC_ VOLCANO
_PN_ PENN
_VL_ VALLEY
_CO_ COAST
_LO_ LOST
<Treatment>
_R_ REPLACE - (#land) Set active prov & kill everyone in it. Used to REPLACE randomly placed units.
_A_ ADD - (#setland) Set active prov. Units added to existing.
_M_ MULTIPLE - More than one of a single province gan may be added to the map file.
_U_ UNIQUE - Once a single instance of the province gan is "picked", it can not be picked again.
<Terrain>
_S/L/N_ Small/Large/Normal
_PLN_ Plains
_SEA_ Sea
_WTR_ Some water
_MNT_ Mountain
_SWP_ Swamp
_WST_ Waste
_FST_ Forest
_FRM_ Farm
_MST_ Many Sites
_DEP_ Deep
_CAV_ Cave
_FS_ Fire Site
_AS_ Air Site
_WS_ Water Site
_ES_ Earth Site
_SS_ Astral Site
_DS_ Death Site
_NS_ Nature Site
_BS_ Blood Site
_PS_ Priest Site
_EMT_ Edge Mountain
SPECIAL GAN COMMANDS:
---------------------
@<value> <command>
->select a random line from the following <value> lines to follow this <command>.
Example #1:
@3 commander
"Minotaur Lord"
240 -- Priest
-- no commander
Result= "#commander 240 -- Priest" <- 1 in 3 chance to be printed in map file.
Example #2:
@1 landname
"Icky Swamp"
Result= "#landname <province#> "Icky Swamp" <- 100% chance to be printed in map file.
Example #3:
@2
#mag_astral 1
#mag_fire 1
Result= "#mag_fire 1" <- 1 in 2 chance to be printed. Note the space following "2 ".
Example #4:
@2 units
10 17 -- Archer
-- no Archer
Result= "-- no Archer" <- 1 in 2 chance to be printed. ie 50% chance of these units.
@RANDOM <command> <name or item list>
->select a random name or item to follow <command>.
Example #1:
@RANDOM landname FOREST
Result= "#landname <prov#> "Simple Woods"" <- Rnd name from DATA1 + rnd name from DATA2.
OR
Result= "#landname <prov#> "Ohmyg Forest"" <- Generated name + rnd name from DATA2.
Example #2:
@RANDOM comname COMMANDER
Result= "#comname "Kullray"" <- Generated name.
Example #3:
@RANDOM comname COMMANDER
@RANDOM additem HELMET
@RANDOM additem 1HANDWEAPON
@RANDOM additem SHIELD
@RANDOM additem ARMORHVY
@RANDOM additem BOOTS
@RANDOM additem MISCITEM
Result= <- Random item from the named item list.
#additem "Starshine Skullcap"
#additem "Jade Knife"
#additem "Weightless Tower Shield"
#additem "Silver Hauberk"
#additem "Boots of Stone"
#additem "Bracers of Protection"
(NOTE: I recommend only 1 or 2 MISC items as duplicates are possible!)
</pre><hr />
In a nutshell there are the flags used in the filename for pattern/terrain matching and flags for add/replace and multi/unique. Plus the following two structures:
@<value> <command>
@RANDOM <command> <name or item list>
A list of the current name & item lists can be pulled from "\LIST_CRATE\NameList.txt". The user should probably be given the option to select from the list or to enter a custom selection to allow for future additions or their own creations.
Oops, I was going to email this to you, but eh. I am a walking zombie tonight. http://forum.shrapnelgames.com/images/smilies/tongue.gif http://forum.shrapnelgames.com/images/smilies/yawn.gif
Jack_Trowell
March 7th, 2007, 10:45 AM
Thanks, I should have all needed informations there.
vBulletin® v3.8.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.