Yet another map generator (removed)

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

SlowThinker
Posts: 876
Joined: November 28th, 2008, 6:18 pm

Re: Yet another map generator (version 0.7)

Post by SlowThinker »

pyrophorus wrote:@slowthinker. I haven't the slightest idea of the Conquest map format and use. So I can't say nothing. My algorithms are general enough to produce any kind of map (hexes or squares), but terrains use is particular to Wesnoth, and I doubt we could find their exact peer in other game softwares.
Conquest is an add-on of Wesnoth, but maps require some specialities (I listed them in my previous post, and I could explain in details if you agreed to adjust your tool) in order to be playable.
I work on Conquest Minus • I use DFoolWide, Retro Terrain Package and the add-on 'High Contrast Water'
I moved to Nosebane's corner (Doc Paterson's signature); I am spending my time there, so PM me if I don't answer your post in forums
User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

Re: Yet another map generator (version 0.7)

Post by pyrophorus »

SlowThinker wrote:Conquest is an add-on of Wesnoth, but maps require some specialities (I listed them in my previous post, and I could explain in details if you agreed to adjust your tool) in order to be playable.
I would suggest you first try the generator as it is, adjusting existing parameters to see if it fit your needs. Road activation always creates paths to every 'burg' or castle and 'burgs' are yet villages agglomerations, and you can suppress completely lonely villages if you want. Another type of agglomerations can be created if needed, but, for now, I would prefer to minimize customization.
MetalKing wrote:I didn't use it due to License reps. this open Source is not open to me...
I already *do know* you don't want to use it because those principles which look rather ridiculous to me. Insisting on this will probably finally convince me you have very little knowledge of how works a computer.
I'm not much interested in vague and general ideas but in users feedback you know, because I have already a lot of equally vague and amazing ideas of what could be done with this and I don't need more at this point.

Friendly,
User avatar
Lord-Knightmare
Discord Moderator
Posts: 2359
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: Yet another map generator (version 0.7)

Post by Lord-Knightmare »

No version for Mac? This is unfair....
Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

Re: Yet another map generator (version 0.7)

Post by pyrophorus »

Maybe you'll have one soon...
Wait and see.
Friendly,
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Yet another map generator (version 0.7)

Post by AI »

I also haven't downloaded it due to lack of sources, but that's just because I'm more interested in the algorithms than in the output.

Regarding the integration, would it be useful to go the other way instead? That is, generalize your current interface so it will also work for wesnoth's mapgen. You could describe the parameters using some kind of WML which we could later use to automatically generate a configuration UI.
Spoiler:
User avatar
Alarantalara
Art Contributor
Posts: 786
Joined: April 23rd, 2010, 8:17 pm
Location: Canada

Re: Yet another map generator (version 0.7)

Post by Alarantalara »

pyrophorus has generously allowed me to create a OS X binary.

I have not changed it other than making compile successfully, so it is a command line program. Therefore, in order for it to read the configuration file, you must run it through the Terminal while in its directory. If you really want to open it from the Finder, both files must be placed in your home folder, and not in any containing folder. If this is not done, it will create a default map called wesmap.map in your home folder.

In addition, the configuration file does not support spaces in the map file name, so you will be unable to have it save maps in the Wesnoth user directory if you use the official package.

It requires OS X 10.5 or later and an Intel processor.
Attachments
MapGen.zip
(25.82 KiB) Downloaded 546 times
User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

Re: Yet another map generator (version 0.7)

Post by pyrophorus »

Alarantalara wrote:pyrophorus has generously allowed me to create a OS X binary.
Well... I would rewrite this as: "Thanks to Alarantalara, you can download now a MacOSX version. OSX has some particularities I know not, and his help was precious here."
Alarantalara wrote:I have not changed it other than making compile successfully, so it is a command line program. Therefore, in order for it to read the configuration file, you must run it through the Terminal while in its directory. If you really want to open it from the Finder, both files must be placed in your home folder, and not in any containing folder. If this is not done, it will create a default map called wesmap.map in your home folder.
Of course, Alarantalara wouldn't say a word about the embedded trojan horse which shall open wide a large backdoor to let the undeads invade your computers. He secretly helped me in designing it ! :lol2:
AI wrote:Regarding the integration, would it be useful to go the other way instead? That is, generalize your current interface so it will also work for wesnoth's mapgen. You could describe the parameters using some kind of WML which we could later use to automatically generate a configuration UI.
As you like... Many things are possible. I had in mind to make the generator inherit from the 'map_generator' class. I have no problem implementing its virtual methods except create_scenario (I don't clearly see what it is supposed to do). The create_map method could then receive the WML-like block as the first (and single one) element of the vector<string> parameter. Is this what you have in mind ?
AI wrote:I also haven't downloaded it due to lack of sources, but that's just because I'm more interested in the algorithms than in the output.
I really wonder why you want to read the sources ignoring the result. If the result proves to be dull or bad, then why looking into the sources ?
BTW, The program works correctly but there are still some inconsistencies in it I want to fix before giving away the sources. It should be soon I think.

Friendly,
User avatar
Iris
Site Administrator
Posts: 6798
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Yet another map generator (version 0.7)

Post by Iris »

pyrophorus wrote:If the result proves to be dull or bad, then why looking into the sources ?
To propose improvements in the form of patches, clearly.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
AI
Developer
Posts: 2396
Joined: January 31st, 2008, 8:38 pm

Re: Yet another map generator (version 0.7)

Post by AI »

pyrophorus wrote:
AI wrote:Regarding the integration, would it be useful to go the other way instead? That is, generalize your current interface so it will also work for wesnoth's mapgen. You could describe the parameters using some kind of WML which we could later use to automatically generate a configuration UI.
As you like... Many things are possible. I had in mind to make the generator inherit from the 'map_generator' class. I have no problem implementing its virtual methods except create_scenario (I don't clearly see what it is supposed to do). The create_map method could then receive the WML-like block as the first (and single one) element of the vector<string> parameter. Is this what you have in mind ?
My idea was more of a vague suggestion, looks like you have everything well in hand.
As for create_scenario, it's supposed to wrap the map in a [scenario], so you can place labels and units, or assign villages, if you want to.
pyrophorus wrote:
AI wrote:I also haven't downloaded it due to lack of sources, but that's just because I'm more interested in the algorithms than in the output.
I really wonder why you want to read the sources ignoring the result. If the result proves to be dull or bad, then why looking into the sources ?
BTW, The program works correctly but there are still some inconsistencies in it I want to fix before giving away the sources. It should be soon I think.
Well, from what I can tell it works quite well, but I don't really have a use for randomly generated maps at the moment. (unless you could include specific features, like "mountain range in the northwest, castle in the east, road from here to there....)
I am interested in procedural world generation though, and I'm wondering what kind of techniques you're using. Are you using plausible rules of thumb or do start with elevation and then work with climate, drainage basins and such to determine the actual terrain types?
User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

Re: Yet another map generator (version 0.7)

Post by pyrophorus »

shadowmaster wrote:To propose improvements in the form of patches, clearly.
Sorry, I wasn't thinking yet about patches and integration. In my mind, the program would have to be improved and tested as a standalone utility before thinking of this.
AI wrote:As for create_scenario, it's supposed to wrap the map in a [scenario], so you can place labels and units, or assign villages, if you want to.
OK.
AI wrote:Well, from what I can tell it works quite well, but I don't really have a use for randomly generated maps at the moment. (unless you could include specific features, like "mountain range in the northwest, castle in the east, road from here to there....)
These features exist not, but it is possible to draw or redraw parts of the map, or add things like roads or buildings. These features are not difficult to add, but the main problem is UI. How the user will specify a 'mountain range in the northwest' ? This said, it is a very interesting features idea, and I think I can do something of the like.
AI wrote:I am interested in procedural world generation though, and I'm wondering what kind of techniques you're using. Are you using plausible rules of thumb or do start with elevation and then work with climate, drainage basins and such to determine the actual terrain types?
The second is true: I create a 3D mesh first and work with elevations. But since Wesnoth maps are not a very accurate model of landscape ( :) ), actual procedures are more some kind of voodoo than realistic algorithms. The more realistic algorithm computes drainage basins, and IMO, is the worst of all :)
That's why I asked for feedback. There is no "truth" here, only users interest and opinion.
But I will end the sources cleaning this week, and then you'll know everything about it.
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Re: Yet another map generator (version 0.7)

Post by Boucman »

Just for the people interested, pyrophorus has sent me his source code and we are working to integrate it into wesnoth proper...

he and fendrin are working on it.

Boucman
Fight key loggers: write some perl using vim
User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

Re: Yet another map generator (version 0.7)

Post by pyrophorus »

Some months later... and no feedback... the software must be perfect ! :lol2:

Anyway, here is a suggestion for the generator tag, allowing to call the generator from WML:

Code: Select all

[generator]
	name=yamg # this is the only mandatory tag. All others can be omitted, but you probably at least set maps dimensions

# these are the basic landscape shape settings (altitudes)
	seed= 1-???? # this value identify a basic landscape. Calling the generator with the same seed (and different settings) will give variations of the same map.
		a value of 0 stands for a random seed (i.e. like the default generator: each time a different map)
	map_width= 10-200 # these are reasonable values, but the generator have no intrinsic limits
	map_height= 10-200
	roughness= 1-100 # high values give a more chaotic map. Low values a smooth landscape. Values around 10 are recommended. Around 50 give results much like the default generator.
	altmiddle= 0-100 # how much map centre is higher than corners. High values will create islands in the sea. Default is 0 for land maps.
	
# these define how altitudes determines final terrain codes. 
	dryness= 1-500 # this adjusts rivers and lakes frequency. High values give dry landscapes.

	# actual altitudes are sorted in eight layers. Layers thickness can be adjusted to get more or less terrain of each type. Thicknesses are percentages and their sum must be equal or slightly greater than 100.
	deepsea= 0-100 # default 10 : deep water terrains
	shallowsea= 0-100 # default 10 : shallow water terrains
	beach= 0-100  # default 5 : sand
	swamps= 0-100  # default 5 : swamps
	fields= 0-100  # default 35 : flat ground
	hills= 0-100  # default 15 : hills
	mountains= 0-100  # default 15 : mountains
	peaks= 0-100  # default 10 : impassable  mountains
	
# these define variations of base terrain codes.
	season= s,e,a or w # affects mainly forests and flat lands which have a season variation
	type= p(olar),t(empered),m(id desertic),d(esertic),e(quatorial) # affects all terrains types
	snowlevel= 1-9 # it's a layer number. All layers higher or equal to this one will be covered with snow. Affects forests, castles and villages too. 9 means no snow at all.
	
# these are decorations on base terrains
	forests= 0-100 # percentage of tiles covered with forests, only on layers 4 (flat ground) and 5 (hills)
	villages= 0-??? # number of villages to place. Villages types are set according to layer, (no village on deep water and impassable mountains) map 'type' and snowlevel.
	burgs= 0-??? # villages groups (3-7 houses) with some decorations (fields, place). Burgs are targets for roads.
	castles= 0-9 # i.e. players. Castle type are derived from layers.
	castlehexes= 0-12 # number of hexes per castle (not including the keep). 0 means a random value.
	roads=yes/no # draw roads linking castles and burgs (no road if there is none).
	bridgecost= 10-100 # High values keep the roads crossing rivers and lakes (they wind around).
	# note on bridges: values higher than 100 for bridgecost are possible, but never prevent a road to cross the sea. More of it, bridges overlays are not used by the generator because it gives bad results. It draws a road on water instead. 

# Terrain codes customisation: it is possible to implement this (overriding the 'type' key). I give here the real default values as an example.
	[convert]
		base_terrain=Wo,Ww,Ds,Ss,Gg,Hh,Mm,Mm^Xm # a list of exactly eight terrain codes, one for each layer.
		snow=Wo,Ai,Ds,Sm,Aa,Ha,Ms,Ms,^Xm # a list of exactly eight terrain codes, for each layer covered with snow (or frozen)
		roads=Rr,Rp,Rr,Rr # terrain codes for roads, roads in forest, road crossing burgs, burgs' central places

		[forests] # these are defaults giving a forest ranging from deciduous to pine when climbing the hills. Note forests have three level but spread only on layer 4 and 5
			level1=Fds,Fdf,Fdw,Fda # four terrain codes forests in spring/easter, fall, winter, and snowy
			level2=Fms,Fmf,Fmw,Fma
			level3=Fp,Fp,Fp,Fpa # this one is for higher hills
		[/forests]
		[villages]
			water=Vm,Vaa # village on layer 1 (shallow water) and its snowy variation
			sand=Vhs,Vca
			swamp=Vhs,Vca
			ground=Vh,Vha
			forestground=Ve,Vea # in forest on layer 4
			hill=Vhh,Vhha
			foresthill=Vl,Vla # in forest on layer 5
		[villages]
		[castles]
			water=Khw,Khw,Chw,Chw # four terrain codes for keep and castles hexes with their snowy variation (if any). Sand castle are the same than water.
			swamp=Khs,Khs,Chs,Chs
			ground=Ke,Kea,Ce,Cea
			hill=Ko,Koa,Co,Coa
			mountain=Ch,Cha
		[/castles]
		... and more.
	[/convert]
[/generator]


All comments on this or the generator are welcomed (except licensing discussions :mrgreen: ).

Friendly,
User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

Re: Yet another map generator (version 0.7)

Post by pyrophorus »

Hi !
After all, the generator could be improved. :mrgreen:
I had a hard time with rivers/lakes and bridges management, but finally, I think I have reached a rather good result.
For those who fear not large maps (200 x 200), here is an example of the current results. The same landscape in five different flavours.
Have fun !
bigmaps.zip
(127.13 KiB) Downloaded 577 times
User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

Re: Yet another map generator (version 0.9)

Post by pyrophorus »

New version... See first post...
User avatar
pyrophorus
Posts: 533
Joined: December 1st, 2010, 12:54 pm

Re: Yet another map generator (version 0.9)

Post by pyrophorus »

Last step is on progress...
Next version will allow to set which terrain codes to use instead of default values. Tests are not yet complete, but this example shows how a standard map...
Map-1.jpg
... can be turned into a cave map.
Map-2.jpg
Of course the generator was not designed to create cave maps, but ... it will allow any strange and wonderful creations.

Friendly,
Post Reply