# Maps, coordinate systems and files

**URL:** <https://discourse.cataclysmdda.org/t/maps-coordinate-systems-and-files/24935>\
**Category:** The Bunker\
**Created:** [October 13, 2020, 4:33am UTC](https://discourse.cataclysmdda.org/t/maps-coordinate-systems-and-files/24935 "2020-10-13T04:33:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zan-Zun](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zan-zun/32/10126_2.png) [@Zan-Zun](https://discourse.cataclysmdda.org/u/Zan-Zun)\
**Post date:** [October 13, 2020, 4:33am UTC](https://discourse.cataclysmdda.org/t/maps-coordinate-systems-and-files/24935/1 "2020-10-13T04:33:49Z")

</div>

Does anyone **know** how the coordinate system works?  
There is three numbers in the folder name, another 3 in the file name (of the \*.map file), the array in the file has another 3 coordinates and, lol and behold, in the arrays themselves are another 2.  
None of the articles so far explain what’s goind on here and I initially just wanted to look for an item in a map file and then go there.

Please no speculation or alternative ways 🙂

Oh, and there are lots of numbers (coordinates, possibly) in the debug screen “Info” and some more in the “Teleport” screen. What’s up with those? They don’t seem to correlate to the file name/ folder numbers.

---

<div class="post-metadata">

**Author:** ![Zhilkin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zhilkin/32/3749_2.png) [@Zhilkin](https://discourse.cataclysmdda.org/u/Zhilkin)\
**Post date:** [October 13, 2020, 7:10am UTC](https://discourse.cataclysmdda.org/t/maps-coordinate-systems-and-files/24935/2 "2020-10-13T07:10:40Z")

</div>

> <https://github.com/CleverRaven/Cataclysm-DDA/blob/c3caa74656bec138ce56ac6688f1c1dc92f34928/doc/POINTS_COORDINATES.md>

---

<div class="post-metadata">

**Author:** ![GiggleGrassGatherer](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/gigglegrassgatherer/32/7743_2.png) [@GiggleGrassGatherer](https://discourse.cataclysmdda.org/u/GiggleGrassGatherer)\
**Post date:** [October 13, 2020, 8:48am UTC](https://discourse.cataclysmdda.org/t/maps-coordinate-systems-and-files/24935/3 "2020-10-13T08:48:16Z")

</div>

And the short answer is in [this topic](https://discourse.cataclysmdda.org/t/how-do-coordinates-in-a-save-relate-to-om-coordinates/24594).

---

<div class="post-metadata">

**Author:** ![Zan-Zun](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zan-zun/32/10126_2.png) [@Zan-Zun](https://discourse.cataclysmdda.org/u/Zan-Zun)\
**Post date:** [October 13, 2020, 12:46pm UTC](https://discourse.cataclysmdda.org/t/maps-coordinate-systems-and-files/24935/4 "2020-10-13T12:46:11Z")

</div>

Not really. The point\_coordinates file seems to talk only about the maths and not the storage, and even after 2 times reading it, I still don’t get it at all.

The other topic only talks about it very shortly, does address only one of the MANY places coordinates are mention and there is guesswork going on again.

Maybe this game is only meant for people fluent in C? ☹ /s

Here are just a few places, where some coord-like numbers are mentioned:  
Debug/Edit Map  
 ![Debug_EditMap](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/9/98285beee513471c977e7ec071d35ff143fd4bac.png) !

Debug/Info  
 ![Debug_Info_1](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/c/c2bdda917fb67141fbedf447caa02312a4f06132.png) ![Debug_Info_2](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/0/065331321711f9d9754977dd64bead1fe1e31cc7.png) !

Overworld Map  
 ![map_coords](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/a/ac1467e39bade6a3b3519e3e36646c311216a9b3.png)

---

<div class="post-metadata">

**Author:** ![Valase](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/valase/32/6972_2.png) [@Valase](https://discourse.cataclysmdda.org/u/Valase)\
**Post date:** [October 13, 2020, 11:53pm UTC](https://discourse.cataclysmdda.org/t/maps-coordinate-systems-and-files/24935/5 "2020-10-13T23:53:30Z")

</div>

> [@Zan-Zun](#):
>
> […] I initially just wanted to look for an item in a map file and then go there.

> [@Zan-Zun](#):
>
> Maybe this game is only meant for people fluent in C? ☹

Well, don’t understand me wrong here, but (from the gameplay’s perspective) the game doesn’t intend for you to open up the save file, search for a specific item and then go to that location in the game or - for that matter - use the debug menu at all.  
To reaffirm: It’s not “wrong” to use the debug menu. But the debug menu is more or less designed for programmer, so yes, to make use of some of the values you might need some programming experience. It’s not (or shouldn’t be) part of the “normal” gameplay.

It will take me a moment, but I’ll go through your screenshots and explain what means what.  
I’ll also have an other look at the save game files and add my findings to the topic that GiggleGrassGatherer has linked.

> [@Zan-Zun](#):
>
> There is three numbers in the folder name, another 3 in the file name (of the \*.map file), the array in the file has another 3 coordinates and, lol and behold, in the arrays themselves are another 2.

I get what you’re talking about, up until the `in the arrays themselves are another 2`… I can guess what you mean, but I’d like to make sure…: Can you provide an example of such a situation?

---

<div class="post-metadata">

**Author:** ![Zan-Zun](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zan-zun/32/10126_2.png) [@Zan-Zun](https://discourse.cataclysmdda.org/u/Zan-Zun)\
**Post date:** [October 14, 2020, 12:50am UTC](https://discourse.cataclysmdda.org/t/maps-coordinate-systems-and-files/24935/6 "2020-10-14T00:50:46Z")

</div>

Hey there and first of all thanks for the answer and sorry if I came across a little rude. I actually do know a little C (although I prefer it a little _sharper_, i ya know what I mean 😉 )and that statement wasn’t really meant serious. I thought it might come across due to the ‘fluent’.

Thank you for the great answer and I am so happy to bring that part of my brain (understanding the coordinates) in order.  
Yeah, that _array_ was _a little_ vague :-]

In the `items` array of a map file, the items look like

```
	5,
	4,
	[{
		"typeid": "novel_scifi",
		"snip_id": "scifi1_37",
		"last_rot_check": 0,
		"last_temp_check": 0,
		"relic_data": null
	}]],

```

and I meant the `5,4,` in this example. Might not even have to do anything with the coordinates 🤔

---

<div class="post-metadata">

**Author:** ![Valase](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/valase/32/6972_2.png) [@Valase](https://discourse.cataclysmdda.org/u/Valase)\
**Post date:** [October 14, 2020, 5:41am UTC](https://discourse.cataclysmdda.org/t/maps-coordinate-systems-and-files/24935/7 "2020-10-14T05:41:44Z")

</div>

> [@Zan-Zun](#):
>
> Hey there and first of all thanks for the answer and sorry if I came across a little rude.

Don’t worry, I didn’t consider your answer “rude”… I just wanted to clear things up, before we run into some missunderstandings 😉 .

I use the definitions from [the document linked by Zhilkin](https://github.com/CleverRaven/Cataclysm-DDA/blob/c3caa74656bec138ce56ac6688f1c1dc92f34928/doc/POINTS_COORDINATES.md) for my descriptions in combination with your screenshots (a bit out of order).  
I’ll go through everything, even the “easy” ones, just so I can refer back to stuff here. So, let’s get started…

![map_coords](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/a/ac1467e39bade6a3b3519e3e36646c311216a9b3.png)

These represent the **overmap** coordinates. The `LEVEL 0` is the current z-axis of your marker, the `0'`(173) is the current overmap coordinate of the x-axis, the (0’)`173` is the **overmap terrain** currently marked by your cursor in the x-axis of that overmap, the `-1'`(173) is the current overmap coordinate of the y-axis while the (-1’)`173` is the current overmap terrain (or _overmap tiles_, as I’ll call them from now on) of the y-axis.  
So, from the “middle” of the game, the `overmap 0'0, 0'0`, you moved or started one overmap higher, and on that overmap you’re 173 overmap tiles to the right and just as many tiles down from it’s left- and uppermost point. And you’re also on the surface, since the Level is 0.

![Debug_EditMap](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/9/98285beee513471c977e7ec071d35ff143fd4bac.png)

The `<60,67>` are the coordinates of your cursor, relative to the **Local** coordinates. It starts with `<0,0>` at the left upper edge of the reality bubble (the part of the world that is currently loaded and calculated by the game).  
So your marker is 60 **map squares** (I’ll call them just _tiles_) to the right on the x-axis and 67 down on the y-axis from the start of the reality bubble. The z-axis is not shown here.

![Debug_Info_1](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/c/c2bdda917fb67141fbedf447caa02312a4f06132.png)

The `60:67` is again your position in the reality bubble (as described above), which starting point is located in `341:-19`. The `341:-19` are the coordinates of the **submap** your reality bubble is currently in. From what I can tell, these are **Absolute** coordinates.  
So, based on the overmap coordinates of `0'0, 0'0`, you’re 341 submaps to the right on the x-axis and -19 “down” (since it’s negative, it’s actually “up”) on the y-axis.  
So, let’s check these values…:

- 1 submap is half an overmap tile.
- So 341 submaps mean 170.5 overmap tiles to the right from 0’0 on the x-axis and -9.5 up from 0’0 on the y-axis.
- Now we end up with 0’170(.5) and 0’-9(.5) (or -1’170(.5)) in overmap coordinates.
- Pretty close to the 0’173, -1’173 you’ve got on the overmap, but not quite… but, as written, this is the start of the reality bubble.
- Your position is shifted 60 tiles to the right and shifted 67 down, so (1 overmap tile is 24 map squares) +2.5 overmap tiles to the right and +2.5 overmap tiles (and 7 map squares) down; we’re spot on where you’re standing.

![Debug_Info_2](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/0/065331321711f9d9754977dd64bead1fe1e31cc7.png)

`Your local position: 60, 67, 0` is once again the coordinates relative to the start point of the reality bubble, this time with the z-axis also represented.  
Your noble steed “Horseratio” is (again relative to the start point of the reality bubble) on the coordinates `68, 87, 0`, or 8 tiles to the east of you and 20 tiles south, on the same z-axis as you are.  
`Your overmap position: 173, -7, 0` are straightforward your overmap tiles, this time in absolute coordinates (relative to the 0’0, 0’0 overmap tile).

* * *

> [@Zan-Zun](#):
>
> In the `items` array of a map file, the items look like [example] and I meant the `5,4,` in this example.

Ah, yes. Thank you for your explanation. I thought you were talking about the number that you can find next to terrain, for example the **4** in `[...],["t_grass",4],"t_dirt","t_grass",[...]`. Good thing I asked 😄 .  
Short answer; I think these are indeed coordinates (relative to the submap), but I have to test a bit. Luckily I’ve found my “[older post](https://discourse.cataclysmdda.org/t/save-corruption-proble/23688/3)” mentioned in that other topic, so it should be easier to figure it out again.

I do have to do some other work though (and probably also sleep a bit), so I’m going to add the explanation for the coordinates of the save system tomorrow… I hope the wait isn’t too dramatic.

---

<div class="post-metadata">

**Author:** ![Zan-Zun](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zan-zun/32/10126_2.png) [@Zan-Zun](https://discourse.cataclysmdda.org/u/Zan-Zun)\
**Post date:** [October 14, 2020, 5:55am UTC](https://discourse.cataclysmdda.org/t/maps-coordinate-systems-and-files/24935/8 "2020-10-14T05:55:25Z")

</div>

Thank you for the very detailed answer! I read it once and already a lot of questions got answered, I am sure on the second reading, I might even get enlightened 👻 🐚
