Azgaar / Fantasy-Map-Generator

Web application generating interactive and highly customizable maps
https://azgaar.github.io/Fantasy-Map-Generator
Other
4.62k stars 664 forks source link

Burg data not explicitly included in .map file (breaking FVTT addon) #848

Closed Hoserdud closed 1 year ago

Hoserdud commented 2 years ago

Problem When exporting map files for the FVTT importer, there is no size attribute for burgs, amongst other missing data. This results in certain burgs being much smaller when loaded into the FVTT addon. This essentially means that when using the exported .map data, there's not an easy way to reconstruct the burg generator url to make the same exact burg.

for example, this is the information for a burg in my test map export:

{"cell":2722,"x":1103.5,"y":577.5,"state":0,"i":32,"culture":10,"name":"Harmouth","capital":0,"feature":9,"port":1,"population":17.305,"type":"Naval","coa":{"t1":"azure","charges":[{"charge":"mascle","t":"argent","p":"jlh","size":0.7}],"shield":"fantasy1"},"citadel":0,"plaza":0,"walls":1,"shanty":0,"temple":0}

And the map url gives it a size of 38. If you don't include that size variable, the burg generator defaults to size 15.

Solution Include all data that is in the url of the burg generator.

Alternatives An explanation for how the generator comes up with the burg size attribute so it can be implemented in the FVTT importer.

Azgaar commented 2 years ago

Hello, I'm don't know a lot about the FVTT. Will you be able to raise a Pull Request? Out data model is stated here: https://github.com/Azgaar/Fantasy-Map-Generator/wiki/Data-model

Hoserdud commented 2 years ago

The out data doesn't include the "?size=38" or the "&sea=0.52" part of the burg generator url, so I'll see about raising a pull request, but I think that's needed to get a 1:1 import.

full url for example : https://watabou.github.io/city-generator/?size=38&seed=7490941330032&name=Harmouth&population=17305&greens=0&farms=1&citadel=0&urban_castle=0&plaza=0&temple=0&walls=1&shantytown=0&coast=1&river=0&gates=-1&sea=0.52

Hoserdud commented 2 years ago

I guess I'm asking if all these const's could be included in burg out data

const sizeRaw = 2.13 Math.pow((burgPopulation populationRate) / urbanDensity, 0.385); const size = minmax(Math.ceil(sizeRaw), 6, 100); const population = rn(burgPopulation populationRate urbanization); const river = cells.r[cell] ? 1 : 0; const coast = Number(burg.port > 0); const sea = coast && cells.haven[cell] ? getSeaDirections(cell) : null;

With that I could fix the FVTT importer

Azgaar commented 2 years ago

It would be nice if you can raise a pull request.

Azgaar commented 1 year ago

Closing as I don't really know what to do...