minetest-mapserver / mapserver

Minetest realtime mapserver, written in go
Other
101 stars 22 forks source link

Question about Layers #366

Closed acmgit closed 9 months ago

acmgit commented 9 months ago

How does the mapserver work with Layers?

I have defined 2 layers, one from -10 to 100 (id 0) and the next from (id 1) 1000 to 1100. When i take a look at the map, layer 0 (Ground) shows at it have to do it. Layer 1 (Orbit) is empty and stay empty but ... At layer 0 (ground) i can see the objects from the Orbit?

Do i something wrong?

Map

This is a piece of the ground-map and the big round object on it is in a height off 1000 blocks.

        "layers": [
                {
                        "id": 0,
                        "name": "Ground",
                        "from": -10,
                        "to": 100
                },
                {
                        "id": 1,
                        "name": "Orbit",
                        "from": 1000,
                        "to": 1100
                }
        ],
BuckarooBanzay commented 9 months ago

I have defined 2 layers, one from -10 to 100 (id 0) and the next from (id 1) 1000 to 1100.

Due to technical issues and for performance reasons this value is defined in mapblocks :smirk:

See: https://github.com/minetest-mapserver/mapserver/blob/master/doc/config.md#layers

from and to are in mapblocks (16x16x16 blocks) Don't reuse the id after the tiles are generated. If you make more substantial changes here you may have to remove all existing tiles and start rendering from scratch.

I could change it to nodes but i'd have to divide it by 16 and round it anyway, this might not be exactly what the user wanted

acmgit commented 9 months ago

No, it's ok, i haven't really checked that this are mapblocks. Thanks for your help.