godip icon indicating copy to clipboard operation
godip copied to clipboard

How to generate state maps?

Open fiatjaf opened this issue 4 years ago • 1 comments

Hello and thank you for this awesome project.

I'm trying to understand exactly what this library does. I've managed to get the basic adjudication functionality from the examples and reading the code at /gae and that alone is very useful.

However I see that there are maps involved in the codebase and I don't understand their function. Are they there because you extract variant movement possibilities from the maps themselves by reading each SVG and determining which province touches each other and what is sea/land etc.? Or are the maps there so the library can print maps for a given described state? Or both?

In that case, how should one proceed to generate a map? (I'm trying to write a game client that would generate static images of each state/season.)

fiatjaf avatar Jun 21 '20 20:06 fiatjaf

The maps are there as a convenience for services using this adjudicator - it's very hard to make a useful service with only the adjudicator and no maps, so godip provides both.

If you look at the only service I know of that uses this adjudicator, https://github.com/zond/diplicity, you can find e.g. https://github.com/zond/diplicity/blob/master/static/js/dippymap.js that helps client applications use these maps to render game states. You can also look at https://github.com/zond/dipact/blob/master/resources/js/dip_map.js that is the map-drawing class of the current production client for that service, and see how it draws the maps.

zond avatar Jun 21 '20 21:06 zond