Primitive Generator
Moderator: Forum Moderators
Primitive Generator
This is the first steps towards a new random Scenario generator. It is extremely primitive at the moment, but it at least generated a map that worked (when replacing the filename in tutorial).
http://www.theinquisition.net/mapgen/
Code was done in MSVC (yuck) but it *should* compile with GCC, didn't test it, though. It's more for ideas and a placeholder for updates. Any feedback is welcomed.
It doesn't actually do much random generation, yet. I'm looking for a more organic, fractal way of building. I have new respect for the other (perl) generator already.
http://www.theinquisition.net/mapgen/
Code was done in MSVC (yuck) but it *should* compile with GCC, didn't test it, though. It's more for ideas and a placeholder for updates. Any feedback is welcomed.
It doesn't actually do much random generation, yet. I'm looking for a more organic, fractal way of building. I have new respect for the other (perl) generator already.
Re: Code
We will probably move toward embedding maps directly in .cfg files.Bazarov wrote:It would be nice if maps had a default extension, I think. Or am I dreaming? I am using .map, but apparently we don't have one.
Any game data files should be in WML format.Bazarov wrote: I should probably change my .cfg files to something different since they aren't in the established WML format. Or do we need them to be in that format?
Good start on the generator
David
Update
Second generation a lot more working, should be fully useable as a generator now. Still more adding to be done to the map engine.
http://www.theinquisition.net/mapgen/
Compiled Windows executable, as well.
Changed file format from .cfg (which was confusing) to .gen
Next stage is the scenario generator.
My concept is to use a series of 'words' to define what it should build 'challenging, overrun, islands, mysterious'
Or some such, where each word can alter what is built (obvious things like island or desert, mysterious would mean have temples with things inside them, etc.
http://www.theinquisition.net/mapgen/
Compiled Windows executable, as well.
Changed file format from .cfg (which was confusing) to .gen
Next stage is the scenario generator.
My concept is to use a series of 'words' to define what it should build 'challenging, overrun, islands, mysterious'
Or some such, where each word can alter what is built (obvious things like island or desert, mysterious would mean have temples with things inside them, etc.
Bazarov,
Looking good! Your concept is interesting.
I'm writing an interface behind which all map generators can go, so that the game can easily be switched between map generators. (Different generators will likely be useful in different circumstances, for instance underground vs above ground is very different).
David
Looking good! Your concept is interesting.
I'm writing an interface behind which all map generators can go, so that the game can easily be switched between map generators. (Different generators will likely be useful in different circumstances, for instance underground vs above ground is very different).
David
Okay, here's my initial half-assed list of traits, I am sure lots more can be come up with. Players will be able to list what they want, or a generator may pick 'crowded island orcs' : 'this scenario takes place on an island where there are are great many villages and there are enemy orcs'.
Suggestions highly desired.
{"island","takes place on an island",0},
{"forest","the area is heavily forested",0},
{"desert","the area area is a desert",0},
{"field","occurs on a field",0},
{"snow","the region is snow-covered",1},
{"mountain","there are mountains",1},
{"sparse","there are a few villages",2},
{"settled","there are many villages",2},
{"crowded","there are a great many villages",2},
{"orcs","there are enemy orcs",3},
{"undead","there are enemy undead",3},
{"men","there are enemy men",3},
{"elves","there are enemy elves",3},
{"orcish","there are orcish allies",4},
{"undying","there are undead allies",4},
{"human","there are human allies",4},
{"elven","there are elven allies",4},
{"multiple","there are many armies",5},
{"complicated","there are sides and alliances",5},
{"survive","you must resist to win",6},
{"travel","you must reach a certain position to win",6},
{"find","you must find an object to win",6},
{"ambush","there are enemies waiting in ambuscades",0},
{"assistance","there are allies waiting to help",0},
Suggestions highly desired.
{"island","takes place on an island",0},
{"forest","the area is heavily forested",0},
{"desert","the area area is a desert",0},
{"field","occurs on a field",0},
{"snow","the region is snow-covered",1},
{"mountain","there are mountains",1},
{"sparse","there are a few villages",2},
{"settled","there are many villages",2},
{"crowded","there are a great many villages",2},
{"orcs","there are enemy orcs",3},
{"undead","there are enemy undead",3},
{"men","there are enemy men",3},
{"elves","there are enemy elves",3},
{"orcish","there are orcish allies",4},
{"undying","there are undead allies",4},
{"human","there are human allies",4},
{"elven","there are elven allies",4},
{"multiple","there are many armies",5},
{"complicated","there are sides and alliances",5},
{"survive","you must resist to win",6},
{"travel","you must reach a certain position to win",6},
{"find","you must find an object to win",6},
{"ambush","there are enemies waiting in ambuscades",0},
{"assistance","there are allies waiting to help",0},
Just a few off the top of my head:
{"islands","there are many islands",0},
{"river","there is a river in the area",0},
{"rivers","there are multiple rivers in the area",0},
{"road","a roadway is a prominent feature of the terrain",0},
{"ambush","enemies lay waiting in ambush",0}, //see scenario 'crossroads' for an example of this
{"surrounded","the player is toward the center of the map, surrounded by enemy forces",0},
{"resist","the player must resist the enemy until the end of turns to become victorious",0},
{"islands","there are many islands",0},
{"river","there is a river in the area",0},
{"rivers","there are multiple rivers in the area",0},
{"road","a roadway is a prominent feature of the terrain",0},
{"ambush","enemies lay waiting in ambush",0}, //see scenario 'crossroads' for an example of this
{"surrounded","the player is toward the center of the map, surrounded by enemy forces",0},
{"resist","the player must resist the enemy until the end of turns to become victorious",0},
-
- Posts: 73
- Joined: November 23rd, 2003, 5:31 pm
- Location: Nödinge in Ale in Sweden.
- Contact:
Random maps...
I have an idea..
For every random map you generate there should be a file named
random_map-X.X_# (or something)
where X.X is the version of Wesnoth and # is map number(incresing with every random map).
For example: random_map-0.6_13
The files should be placed in data/random_maps(or something).
For every random map you generate there should be a file named
random_map-X.X_# (or something)
where X.X is the version of Wesnoth and # is map number(incresing with every random map).
For example: random_map-0.6_13
The files should be placed in data/random_maps(or something).
|----------------------|
| The Lion is Back |
|----------------------|
| The Lion is Back |
|----------------------|
Progression and Problems
Okay, back from Morocco and back on the job.
The first primitive campaign/scenario generator is working and is (sortof) playable within the game, but a couple problems have arisen and I was hoping for easy solutions (I did look through the Wiki but didn't find anything).
1) The enemies summon units, but then the units attack the summoning leader (and each other). Perhaps my aggression number is low and causing this? (0.5) Or is this some other known quirk?
Is there a list of the total AI scenario weights?
2) It seems you can only 'move' one square at a time, but otherwise the movement rates work. What causes this? Is my map not in agreement with the path-finding-feet-drawing code? (the number of squares that highlight seem fine).
The first primitive campaign/scenario generator is working and is (sortof) playable within the game, but a couple problems have arisen and I was hoping for easy solutions (I did look through the Wiki but didn't find anything).
1) The enemies summon units, but then the units attack the summoning leader (and each other). Perhaps my aggression number is low and causing this? (0.5) Or is this some other known quirk?
Is there a list of the total AI scenario weights?
2) It seems you can only 'move' one square at a time, but otherwise the movement rates work. What causes this? Is my map not in agreement with the path-finding-feet-drawing code? (the number of squares that highlight seem fine).
Re: Progression and Problems
In 0.6.1 and earlier versions, you have to specify an 'enemy' attribute for each side.Bazarov wrote: 1) The enemies summon units, but then the units attack the summoning leader (and each other). Perhaps my aggression number is low and causing this? (0.5) Or is this some other known quirk?
Is there a list of the total AI scenario weights?
For instance, if you have three sides, 1,2, and 3, who are enemies of each other, you would put
Code: Select all
[side]
side=1
enemy=1,2
...
[/side]
for side 1,
Code: Select all
[side]
side=2
enemy=2,3
...
[/side]
Code: Select all
[side]
side=3
enemy=1,2
...
[/side]
However this has been made much more usable in CVS since Jan 5, with the 'enemy' attribute becoming obsolete. See http://wesnoth.whitevine.net/forum/phpB ... .php?t=548 for details.
I don't know what's causing this. If you can send me the scenario file, I'll look into it.Bazarov wrote: 2) It seems you can only 'move' one square at a time, but otherwise the movement rates work. What causes this? Is my map not in agreement with the path-finding-feet-drawing code? (the number of squares that highlight seem fine).
David
“At Gambling, the deadly sin is to mistake bad play for bad luck.” -- Ian Fleming
That fixed both
One count of idiocy. I had the tag 'enemies=2' instead of 'enemy=2' - I just thought in the plural.
And that fixed the movement problem, too. Apparently you couldn't 'command' your own units as well. Thanks for the quick answer.
And that fixed the movement problem, too. Apparently you couldn't 'command' your own units as well. Thanks for the quick answer.
Generator is coming along nicely.
I need to know some things I can't find in the WIKI, though...
First off, what is the total list of 'recruit_pattern' things? (What does 'mixed' mean?) without a 'pattern' will it just recruit randomly?
Aggression: what is the minimum and maximum values?
I see in the new scenario files things like this:
{GOLD 100 200 300} Can I assume that's a macro for easy/medium/hard?
{INCOME 10 20 30} Assumption for income?
Is there somewhere this is listed that I have just missed?
Here is my 'recruit list' for each 'race' (the 1-5 is the 'threat level'):
Any comments?
There can be multiples for each threat level, making possible multiple 3rd tier armies per group, etc.
const recruit_type recruit[]={
{"Cavalry, Soldier, Spearman",1,HUMAN},
{"Cavalry, Soldier, Fencer, Swordsman, Spearman",2,HUMAN},
{"Cavalry,Swordsman,Spearman,Red Mage,Ogre,Duelist",3,HUMAN},
{"Swordsman,Heavy Infantry,Pikeman,Red Mage,Ogre",4,HUMAN},
{"Royal Guard, Halbardier, Great Mage, Dragoon, Duellist",5,HUMAN},
{"Wolf Rider, Orcish Grunt",1,ORC},
{"Wolf Rider,Orcish Grunt,Troll Whelp,Orcish Archer",2,ORC},
{"Orcish Warrior,Orcish Assassin,Orcish Crossbow,Goblin Knight, Troll",3,ORC},
{"Troll,Troll Warrior,Ogre,Goblin Knight,Wolf Rider,Troll Whelp",4,ORC},
{"Troll Warrior, Goblin Knight,Orcish Slayer",5,ORC},
{"Elvish Archer, Elvish Fighter",1,ELF},
{"Elvish Archer, Elvish Fighter, Horseman, Mage, Elvish Scout, Elvish Shaman",2,ELF},
{"Elvish Ranger, Elvish Outrider, Mage, Elvish Druid, Elvish Hero",3,ELF},
{"Elvish Ranger, Paladin, Red Mage, Elvish Captain, Elvish Shyde",4,ELF},
{"Elvish Avenger, Paladin, Great Mage, Elvish Marshal, Elvish Shyde",5,ELF},
{"Vampire Bat,Walking Corpse",1,UNDEAD},
{"Dark Adept,Ghost,Walking Corpse,Vampire Bat,Skeleton,Skeleton Archer",2,UNDEAD},
{"Walking Corpse,Wraith,Bone Shooter,Revenant,Skeleton,Necromancer",3,UNDEAD},
{"Ghoul,Revenant,Chocobone,Wraith,Bone Shooter,Necromancer",4,UNDEAD},
{"Wraith,Chocobone,Revenant,Lich",5,UNDEAD},
{"Dwarvish Fighter, Dwarvish Thunderer",1,DWARF},
{"Dwarvish Fighter, Dwarvish Thunderer",2,DWARF},
{"Dwarvish Fighter, Dwarvish Thunderer, Dwarvish Steelclad",3,DWARF},
{"Dwarvish Steelclad, Dwarvish Lord",4,DWARF},
{"Dwarvish Lord, Dwarvish Runemaster",5,DWARF},
{"Giant Spider",1,OTHER},
{"Giant Spider",2,OTHER},
{"Gryphon",3,OTHER},
{"Giant Spider, Gryphon",4,OTHER},
{"Giant Spider, Gryphon",5,OTHER}
};
I need to know some things I can't find in the WIKI, though...
First off, what is the total list of 'recruit_pattern' things? (What does 'mixed' mean?) without a 'pattern' will it just recruit randomly?
Aggression: what is the minimum and maximum values?
I see in the new scenario files things like this:
{GOLD 100 200 300} Can I assume that's a macro for easy/medium/hard?
{INCOME 10 20 30} Assumption for income?
Is there somewhere this is listed that I have just missed?
Here is my 'recruit list' for each 'race' (the 1-5 is the 'threat level'):
Any comments?
There can be multiples for each threat level, making possible multiple 3rd tier armies per group, etc.
const recruit_type recruit[]={
{"Cavalry, Soldier, Spearman",1,HUMAN},
{"Cavalry, Soldier, Fencer, Swordsman, Spearman",2,HUMAN},
{"Cavalry,Swordsman,Spearman,Red Mage,Ogre,Duelist",3,HUMAN},
{"Swordsman,Heavy Infantry,Pikeman,Red Mage,Ogre",4,HUMAN},
{"Royal Guard, Halbardier, Great Mage, Dragoon, Duellist",5,HUMAN},
{"Wolf Rider, Orcish Grunt",1,ORC},
{"Wolf Rider,Orcish Grunt,Troll Whelp,Orcish Archer",2,ORC},
{"Orcish Warrior,Orcish Assassin,Orcish Crossbow,Goblin Knight, Troll",3,ORC},
{"Troll,Troll Warrior,Ogre,Goblin Knight,Wolf Rider,Troll Whelp",4,ORC},
{"Troll Warrior, Goblin Knight,Orcish Slayer",5,ORC},
{"Elvish Archer, Elvish Fighter",1,ELF},
{"Elvish Archer, Elvish Fighter, Horseman, Mage, Elvish Scout, Elvish Shaman",2,ELF},
{"Elvish Ranger, Elvish Outrider, Mage, Elvish Druid, Elvish Hero",3,ELF},
{"Elvish Ranger, Paladin, Red Mage, Elvish Captain, Elvish Shyde",4,ELF},
{"Elvish Avenger, Paladin, Great Mage, Elvish Marshal, Elvish Shyde",5,ELF},
{"Vampire Bat,Walking Corpse",1,UNDEAD},
{"Dark Adept,Ghost,Walking Corpse,Vampire Bat,Skeleton,Skeleton Archer",2,UNDEAD},
{"Walking Corpse,Wraith,Bone Shooter,Revenant,Skeleton,Necromancer",3,UNDEAD},
{"Ghoul,Revenant,Chocobone,Wraith,Bone Shooter,Necromancer",4,UNDEAD},
{"Wraith,Chocobone,Revenant,Lich",5,UNDEAD},
{"Dwarvish Fighter, Dwarvish Thunderer",1,DWARF},
{"Dwarvish Fighter, Dwarvish Thunderer",2,DWARF},
{"Dwarvish Fighter, Dwarvish Thunderer, Dwarvish Steelclad",3,DWARF},
{"Dwarvish Steelclad, Dwarvish Lord",4,DWARF},
{"Dwarvish Lord, Dwarvish Runemaster",5,DWARF},
{"Giant Spider",1,OTHER},
{"Giant Spider",2,OTHER},
{"Gryphon",3,OTHER},
{"Giant Spider, Gryphon",4,OTHER},
{"Giant Spider, Gryphon",5,OTHER}
};
May as well post these, too:
Leader unit type, per race, per difficulty rating (1-5)
const recruit_type leader[]={
{"Fighter",1,HUMAN},
{"Fighter",2,HUMAN},
{"Commander",3,HUMAN},
{"Princess",4,HUMAN},
{"Lord",5,HUMAN},
{"Orcish Warrior",1,ORC},
{"Orcish Warrior",2,ORC},
{"Orcish Warlord",3,ORC},
{"Orcish Warlord",4,ORC},
{"Orcish Warlord",5,ORC},
{"Elvish Fighter",1,ELF},
{"Elvish Captain",2,ELF},
{"Elvish Lord",3,ELF},
{"Elvish Marshal",4,ELF},
{"Elvish Marshal",5,ELF},
{"Dark Adept",1,UNDEAD},
{"Necromancer",2,UNDEAD},
{"Necromancer",3,UNDEAD},
{"Lich",4,UNDEAD},
{"Ancient Lich",5,UNDEAD},
{"Dwarvish Fighter",1,DWARF},
{"Dwarvish Steelclad",2,DWARF},
{"Drarvish Steelclad",3,DWARF},
{"Dwarvish Lord",4,DWARF},
{"Dwarvish Runemaster",5,DWARF},
{"Giant Spider",1,OTHER},
{"Giant Spider",2,OTHER},
{"Gryphon",3,OTHER},
{"Gryphon",4,OTHER},
{"Gryphon",5,OTHER},
};
IF there is enough water on a board to merit it, this is appended to the recruitment list for each:
const recruit_type aquatic[]={
{"Merman",1,HUMAN},
{"Merman",2,HUMAN},
{"Merman",3,HUMAN},
{"Merman, Merman Lord",4,HUMAN},
{"Merman Lord",5,HUMAN},
{"Naga",1,ORC},
{"Naga, Sea Orc",2,ORC},
{"Naga, Sea Orc",3,ORC},
{"Naga, Sea Orc, Sea Hag",4,ORC},
{"Sea Hag, Sea Orc",5,ORC},
{"Merman",1,ELF},
{"Merman",2,ELF},
{"Merman",3,ELF},
{"Merman, Merman Lord",4,ELF},
{"Merman, Merman Lord",5,ELF},
{"Vampire Bat",1,UNDEAD},
{"Vampire Bat",2,UNDEAD},
{"Vampire Bat",3,UNDEAD},
{"Vampire Bat",4,UNDEAD},
{"Blood Bat",5,UNDEAD},
{"",1,DWARF},
{"",2,DWARF},
{"",3,DWARF},
{"",4,DWARF},
{"",5,DWARF},
{"",1,OTHER},
{"Cuttle Fish",2,OTHER},
{"Cuttle Fish",3,OTHER},
{"Cuttle Fish, Sea Serpent",4,OTHER},
{"Cuttle Fish, Sea Serpent",5,OTHER},
};
Leader unit type, per race, per difficulty rating (1-5)
const recruit_type leader[]={
{"Fighter",1,HUMAN},
{"Fighter",2,HUMAN},
{"Commander",3,HUMAN},
{"Princess",4,HUMAN},
{"Lord",5,HUMAN},
{"Orcish Warrior",1,ORC},
{"Orcish Warrior",2,ORC},
{"Orcish Warlord",3,ORC},
{"Orcish Warlord",4,ORC},
{"Orcish Warlord",5,ORC},
{"Elvish Fighter",1,ELF},
{"Elvish Captain",2,ELF},
{"Elvish Lord",3,ELF},
{"Elvish Marshal",4,ELF},
{"Elvish Marshal",5,ELF},
{"Dark Adept",1,UNDEAD},
{"Necromancer",2,UNDEAD},
{"Necromancer",3,UNDEAD},
{"Lich",4,UNDEAD},
{"Ancient Lich",5,UNDEAD},
{"Dwarvish Fighter",1,DWARF},
{"Dwarvish Steelclad",2,DWARF},
{"Drarvish Steelclad",3,DWARF},
{"Dwarvish Lord",4,DWARF},
{"Dwarvish Runemaster",5,DWARF},
{"Giant Spider",1,OTHER},
{"Giant Spider",2,OTHER},
{"Gryphon",3,OTHER},
{"Gryphon",4,OTHER},
{"Gryphon",5,OTHER},
};
IF there is enough water on a board to merit it, this is appended to the recruitment list for each:
const recruit_type aquatic[]={
{"Merman",1,HUMAN},
{"Merman",2,HUMAN},
{"Merman",3,HUMAN},
{"Merman, Merman Lord",4,HUMAN},
{"Merman Lord",5,HUMAN},
{"Naga",1,ORC},
{"Naga, Sea Orc",2,ORC},
{"Naga, Sea Orc",3,ORC},
{"Naga, Sea Orc, Sea Hag",4,ORC},
{"Sea Hag, Sea Orc",5,ORC},
{"Merman",1,ELF},
{"Merman",2,ELF},
{"Merman",3,ELF},
{"Merman, Merman Lord",4,ELF},
{"Merman, Merman Lord",5,ELF},
{"Vampire Bat",1,UNDEAD},
{"Vampire Bat",2,UNDEAD},
{"Vampire Bat",3,UNDEAD},
{"Vampire Bat",4,UNDEAD},
{"Blood Bat",5,UNDEAD},
{"",1,DWARF},
{"",2,DWARF},
{"",3,DWARF},
{"",4,DWARF},
{"",5,DWARF},
{"",1,OTHER},
{"Cuttle Fish",2,OTHER},
{"Cuttle Fish",3,OTHER},
{"Cuttle Fish, Sea Serpent",4,OTHER},
{"Cuttle Fish, Sea Serpent",5,OTHER},
};