Import town data from JSON file

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Post Reply
ebla71
Route Supervisor
Route Supervisor
Posts: 495
Joined: 14 Apr 2021 21:48
Location: Earth

Import town data from JSON file

Post by ebla71 »

Just saw this new and very nice feature added to the latest nightly build :lol:

However, it seems like with the deletion of the "geodata branch" also the documentation disappered on how the *.json file coordinates are calculated :o

Would be nice to get that back somewhere to further play around with it ...
User avatar
jfs
Tycoon
Tycoon
Posts: 1867
Joined: 08 Jan 2003 23:09
Location: Denmark

Re: Import town data from JSON file

Post 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
User avatar
2TallTyler
Director
Director
Posts: 573
Joined: 11 Aug 2019 18:15
Contact:

Re: Import town data from JSON file

Post 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.
ebla71
Route Supervisor
Route Supervisor
Posts: 495
Joined: 14 Apr 2021 21:48
Location: Earth

Re: Import town data from JSON file

Post by ebla71 »

jfs wrote: 19 Sep 2024 09:42 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
Thanks for the link :)

Just to confirm - the bottom is the coordinate system for a 2-tuple format (x y) ?!?

Image
Attachments
coordinate_system.png
(41.48 KiB) Not downloaded yet
ebla71
Route Supervisor
Route Supervisor
Posts: 495
Joined: 14 Apr 2021 21:48
Location: Earth

Re: Import town data from JSON file

Post 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 8)
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Import town data from JSON file

Post 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.
ebla71
Route Supervisor
Route Supervisor
Posts: 495
Joined: 14 Apr 2021 21:48
Location: Earth

Re: Import town data from JSON file

Post 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?!?
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 3 guests