Page 1 of 1
Import town data from JSON file
Posted: 18 Sep 2024 22:56
by ebla71
Just saw this new and very nice
feature added to the latest nightly build
However, it seems like with the deletion of the "geodata branch" also the
documentation disappered on how the *.json file coordinates are calculated
Would be nice to get that back somewhere to further play around with it ...
Re: Import town data from JSON file
Posted: 19 Sep 2024 09:42
by jfs
You don't need to look for the documentation any further than in the master branch, because it was merged in along with the rest of the change.
https://github.com/OpenTTD/OpenTTD/blob ... wn_data.md
Re: Import town data from JSON file
Posted: 19 Sep 2024 19:55
by 2TallTyler
Ah, right, the documentation was on my PR branch that I deleted after merging into OpenTTD master. I have changed the link in the PR to point to the merged documentation in the master branch.
Re: Import town data from JSON file
Posted: 19 Sep 2024 20:54
by ebla71
Thanks for the link
Just to confirm - the bottom is the coordinate system for a 2-tuple format (x y) ?!?

Re: Import town data from JSON file
Posted: 19 Sep 2024 21:01
by ebla71
Just played around with it a little bit and works nicely and very intuitively once you know the orientation of the x- and y-axis.
Would be beautiful to have similar features to place signs to indicate "positions of interest" and also industries

Re: Import town data from JSON file
Posted: 20 Sep 2024 03:18
by PikkaBird
ebla71 wrote: 19 Sep 2024 20:54
Just to confirm - the bottom is the coordinate system for a 2-tuple format (x y) ?!?
The standard TTD coordinate system starts from the top corner, with x going down to the left and y down to the right. But you can rotate heightmaps on importation, which presumably rotates the town data too.
Re: Import town data from JSON file
Posted: 20 Sep 2024 10:12
by ebla71
PikkaBird wrote: 20 Sep 2024 03:18
The standard TTD coordinate system starts from the top corner, with x going down to the left and y down to the right. But you can rotate heightmaps on importation, which presumably rotates the town data too.
That's not a heightmap in the above picture but a "blank canvas" from the scenario editor ...
So it seems like in this routine, the coordinate system is rotated by 90° counter-clockwise?!?
Bug or feature?!?