I love this.
I've been a bit of a lurker on this forum for a while but this project is so awesome it has prompted me to action. I made a map and tested it. I had to pick a scenario first, then the map appeared. Once I started play there was a mission generated. About 30 seconds into play I crash after and event pops up. The event looks like it may be the mission completing. It was the same for any nation I tried playing. I can't seem to find the "God's will" string anywhere in localization or any other events pages
About the map itself, I noticed in most spots the coasts look nice. However it sometimes doesn't come out smooth. I also noticed that rivers have the same issue, being crooked in places and straight other times. Also, would there be any way to make borders contour rivers?
Also, have you seen this Mod before? It may be cool to include artificially generated nations, maybe have a slider to determine historical to randomized percentage of nations?
Let me know what's important to solve first, have you been having that same event problem?
I'm also trying to make sense of the map scripts, that stuff really interests me but it does seem pretty complicated, all can gather is that most of those scripts store coefficients for some perlin noise algorithm? It does look very hard.
Hope I can be of good service. Cheers
The weird contours are related to the terrain.
I did some province modding on England once and I got the same thing.
Also, I'm getting "unexpected end of archive" error when I try to open the Beta4 file.
Last edited by Saphe; 27-02-2012 at 12:47.
Any tips for getting rivers to work for those who have problems doing so in the beta version?
It seems that I always crash when EUIII gets to "creating rivers". I have tried numerous random maps with various degrees of rivers (the river slider set to none, some, a lot, etc.) and they all seem to crash. I have tried the "one river" approached as previously suggested, but that doesn't work either.
What I really want to do is create a fantasy map of my own design. I've gotten it to the same place as the completely randomly generated maps, the "Creating rivers..." screen.
If I have overlooked any known errors regarding rivers or if anyone has some advice, that would be great. Thank you.
EDIT: It appears that continued trial and error resulted in a perfectly working map. Thanks.
Last edited by Orago; 27-02-2012 at 18:41.
I gave up on this because it seemed people weren't really that interested in random maps at the time and I didn't want to gather all the data myself. That, and the fact that I moved on to other projects.
Currently I want to get real map parts up and running before I start improving the functionality. That also requires a lot of data gathering from someone.
It's actually not that hard to understand the scripts once you get into it. The problem is to get something good looking out of it. Basically, what the script does is create a number of noise maps with certain properties and combine them in specific ways. If you want I can write a detailed description of how it works.
If you come across another problem with rivers, can you please open the rivers.bmp file and check if it fails in any of these ways. I have worked a lot on scaling the map up by a factor of three and still keep the one-pixel width and getting the connections right, but there might still be a bug somewhere in the code there.
I want to help, I can start with the events & missions. I tried cancelling a mission but the game crashed anyway. I also tried making a variety of maps but only one of them initialized successfully. It was using the 1492/default setup with a small map size. Any other scenario I try crashes before reaching the DW menu screen. I'll send screenshots tonight when I'm home.
Random countries as a variable percentage would be really cool and fun in my opinion, but that's something that can be worked out after things are much more stable.
And I would be thrilled if you wanted to explain how the perlin noise map scrips work! I used to make planet-art using randomized terrain in Terragen, and even have averaged out noise before in astronomical imaging, so I've used or removed noise before but never created it!
Anyway, I'll focus on getting my build more stable and then going through events. Maybe a lot of the stuff popping up is from IN or httt and there will be a way to transplant a lot. How many game assets if any are in the dll for the generator?
The comprehensive guide to map scripting
First of all I use libnoise for all my map generation so for more in-depth information you can look here.
Now, the first thing you need to know is that the final map is created by a series of modules. A module can either create a map, modify a map or combine two maps. All modules have certain things in common in the scripts. They start with the definition of the name
baseTerrain = newModule("baseTerrain")
followed by the definition of the type of the module
baseTerrain.type = "Billow"
then a number of parameters is set, and finally the module is saved through
The last module to be saved is the one used in the game.
Billow, Perlin: Used to create standard perlin noise. I honestly don't remember the difference between these two.
RidgedMulti: Used to create more ridged terrain like mountains and chains of islands.
These takes the following parameters:
seed - sets the seed for the random number generation. I normally use a factor of the seed value given in the generator to get reproducible results.
frequency, persistence, octavecount - used to change the appearance of the maps. I recommend to look at the pictures here to get an idea about what they do.
lacunarity - I don't use it and have no good idea what it does.
Voronoi: Used to create voronoi cells for province creation. Takes the parameters frequency, controls size of provinces, and displacement, which is related to coloring and should be 10.0.
ScaleBias: Used to scale the maps. Normally the colors are in the range -1 to 1, with the sea level at 0. Takes the parameters scale and bias that do exactly what it sounds like. Setting scale to 0.5 and bias to -0.5 would change the color range of a map to -1 to 0, i.e. put it underwater.
Turbulence: Used to give maps a more realistic appearance. Also used to give provinces more realistic shapes. Takes the parameters frequency and power. To get an idea what they do take a look at the pictures at the bottom of this page. Also takes the parameter roughness, but I don't know what that does and I don't use it.
RotatePoint: Rotates earth. Used with a rotation angle set in the generator to rotate the maps to avoid a good looking continent being split in half by the edge of the map. Takes the rotation angle as a parameter.
All the modifier modules take the parameter source1 which specifies the name of the module that should be modified.
Select: Combines two modules. Uses a third noise map to specify how the modules should be combined.
Takes the following parameters:
source1 - the name of the first module
source2 - the name of the second module
control - the module to use to define how to combine
minbound, maxbound - if the colorvalue of control is between minbound and maxbound use source2 otherwise use source 1. Normally maxbound is set > 1.
edgefalloff - controls how smooth the boundary between the two modules should be.
This might help in understanding the parameters.
To give an example let's take a look at the default map script default.lua. I should say that the names of modules regularly have nothing to do with what they do since I've been copying back and forth. Remember the map color go from -1 to 1 with 0 being the sea level.
1. It starts off by creating a billow terrain to use as a base. (baseTerrain)
2. baseTerrain is scaled to the range 0 to 0.5, i.e. regular flat dry land (flatPlain)
3. A new RidgedMulti map is created as a base for mountains. (mountainBase)
4. mountainBase is scaled to the range 0 to 0.9 (mountainTerrain)
5. A bit of turbulence is added to the mountains (finalMountains)
6. A perlin noise map is created to act as a separator between flat land and mountains. (valleys)
7. A mountain rich terrain type is created by combining flatPlain and finalMountains, using valleys as a guide. The minbound is 0 so there will be an equal amount of mountains and plains. (ridges)
8. A perlin noise map is created to act as a separator between mountain rich regions and plains. (landType)
9. The base land terrain is created by combining ridges and flatPlain using landType as a guide. The minbound is 0.3 so 65% of the map will be flat, and 35% mountain rich. (landTerrain)
10. baseTerrain is scaled to the range -0.75 to -0.25 to give a base for oceans (baseOcean)
11. mountainBase is rescaled to -1 to 0 to give some structure to the ocean floor. (oceanIslands)
12. A new perlin noise map is created to control type of ocean. (oceanType)
13. The final ocean is created by combining baseOcean and oceanIslands, using oceanType as a guide. (finalOcean)
14. A new perlin noise map is created to separate land from sea. (continents)
15. finalOcean and landTerrain is combined with continents as a guide. (finalTerrain)
16. The final terrain gets a bit of turbulence. (turbulenceTerrain)
17. Finally the map can be rotated if necessary (rotatedTerrain)
And that's the story of how the map is created.
To do your own map I would recommend starting small, adding one module at a time. Remember that the last one saved is the one seen in the generator. Setting the map size smaller and removing the rivers makes testing a lot quicker. Especially remember to turn off rivers if you're making test maps without any water.
Would it be possible to use this with a premade bitmap? I am working on a custom provinces.bmp and I am dreading having to create all of the history files, assigning province IDs to colors, localizations, etc... all at once to get it running. There seem to be so many undocumented requirements to make sure that it runs without a crash. If I could just have these created even with random data I could then edit that bit by bit, while having a working map at all times. So basically I want to be able to give your program a provinces.bmp and have your program generate the rest so that the map is working.
Wow, I'm very impressed. This is all so incredible. You've managed to keep me distracted from work all day! When I looked at the complexity of the planet renderer my brain melted a little bit: http://libnoise.sourceforge.net/exam...plexplanet.png
But you're using a much more approximately scaled set of modules to render here. You just have two source modules and the control module? I'd say your continents look great in game with just those few, it's not like you're rendering a full sized world for 3D landscape software.
And Voronoi diagrams! I've never heard of that before, although I had heard the story of John Snow using mathematical geospatial models to track cholera. That's some very awesome geometry! It very much reminds me of some of the stuff covered in an economic geography class I took once. How do you determine the placement of the random points? Is there any preference towards coastline, rivers and/or latitude? Would the distribution be able to create low density areas (Siberia/Sahara) and high density (Most of Europe)? Also, have you loaded an Earth map before to test the province scripts? I'd be willing to try tonight. I'd think that being able to reproduce good/believable provinces on an Earth map would be the best litmus for applying it to random maps.
Thanks for sharing though! Truly fascinating stuff!
I'll finish my map up in a few weeks and then I'll see about importing it. Thanks.
I've tried to progress with my own imported map, but it crashes at river unless I put them to the bottom and at provinces.
Could you make it possible for the resizing to work on imported maps aswell? That'd be neat actually.
Because the problem is memory.
Firstly, I haven't had any problems with the map generator but I have run into issues getting the game to play.
I've been trying to start a play test to look into events, but I have had issues getting the game to start. The only scenario I can get to start is 1453 Vanilla. When the game starts, it crashes after the first day. I don't think its related to events. I have no idea what's causing it and can't find any pattern other than the time passing by for a day. I tried to debug in visual basic, this is all it spit out:
[Frames below may be incorrect and/or missing, no symbols loaded for eu3game.exe]
Has anybody else encountered the same problem? Or have any idea where/how to start debugging something like this? Maybe it has something to do with the histories.
Or would it be best to try and migrate assets from DW or a simple mod. I'm a little fresh with this stuff but will try things slowly
I don't control anything more than the density of the Voronoi cells. The map is spherical as well so the provinces at the top and bottom tends to be a little bit larger because of the projection.
If you take a look at land.lua you can see that there are two different modules with different density for the provinces to get the effect of densely and sparsely populated areas of the world.