Azgaar / Fantasy-Map-Generator

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

Neighbouring cells in json export #464

Closed dmecke closed 4 years ago

dmecke commented 4 years ago

Description

It would be useful for the json export to contain the neighbouring cell ids for every cell. I use the json export as the base for a browsergame. To implement something like pathfinding based on the cells or the habitat of creatures, it would be very useful to have the neighbouring cells (their ids) in the metadata next to biome, population, etc. I would be very happy to create a pull request if you like the addition.

Steps to reproduce

Create a json export of a map.

Expected behaviour

Next to the metadata like "biome", "population", etc for every cell, there is also the key "neighbours" with an array of cell ids, that are next to this cell.

Actual behaviour

No neighbours key. ;-)

.map file

Not relevant, features request.

Generator version

Not relevant, features request.

Browser version

Not relevant, features request.

dmecke commented 4 years ago

I found the change to be really easy so I went ahead and created #465. Please feel free to request changes or reject it completely if you don't want to have it in the export.

Azgaar commented 4 years ago

Hello. Yes, that's a simple change

Azgaar commented 4 years ago

Please note it's committed into Dev branch, not Prod.

dmecke commented 4 years ago

Thanks for merging! Yes, I wasn't sure whether you want new features to be in dev or master.

Azgaar commented 4 years ago

In dev, it's ok