Megaquarium

Megaquarium

What will you create?
Access an ocean of content for Megaquarium created by players like you. New animals, decorations, tanks and more are available to expand your game and tailor it to your liking.
Learn More
new mod codes, how do they work?
i'm curious about some of the new stuff in the data, like layers, especially how do they work?

i have noticed that layers 0 and 1 seem to work fine but the other numbers(below or above) dont.
also noticed that layer 0 work fine in any tank but layer 1 only works fine in sunken tanks

i can also place 2 objects on the same spot on the floor if 1 object is labeled as: layer 1, and the other on: layer 2, however in tanks they cant placed on the same spot.
< >
Showing 1-5 of 5 comments
Twice Circled  [developer] 3 11 Nov, 2021 @ 12:26pm 
Good questions. :)

Layers allow multiple objects to occupy the same floor tiles. Ideally the objects are designed so that they don't intersect with any objects that occupy the same layer.

In general:
Layer 0 is for objects that sit on the floor and occupy the space up to around 2m high (whatever top of a wall is).
Layer 1 is for objects above this. E.g. bridges, roofs, archways.
Layer -1 is for underground e.g. sunken tanks and tunnels.

Objects can occupy multiple layers. So the tunnel, for example, occupies layer -1 everywhere, but also layer 0 where the steps are (otherwise you could place objects on this).

If you look in the "map" behaviour, you can assign layers to individual tiles.

A layer 1 object can overlay a layer 0 or -1 object.
A layer 0,1 can only overlap with a -1.
A layer -1,0,1 cannot overlap anything.

I haven't tested it, but you should be able to define your own layers. A layer 2 should be able to be built anywhere there is a floor tile.

The funny behaviour you are noticing may be because I have assigned default behaviour to tanks to make them back compatible.
- all tanks are auto assigned layer 0
- sunken tanks are auto assigned layer -1 as well
- anything taller than a deep tank is assigned layer 1 as well. This is identified via the "accessHeight" variable. Basically anything with a value of 2 or higher.

You can override these behaviours by setting the layers variable manually, this is just the default behaviour so that all existing mod tanks will work in an intuitive way for players (hopefully!).
rickreptile 58 11 Nov, 2021 @ 2:13pm 
Originally posted by Twice Circled:
Good questions. :)

Layers allow multiple objects to occupy the same floor tiles. Ideally the objects are designed so that they don't intersect with any objects that occupy the same layer.

In general:
Layer 0 is for objects that sit on the floor and occupy the space up to around 2m high (whatever top of a wall is).
Layer 1 is for objects above this. E.g. bridges, roofs, archways.
Layer -1 is for underground e.g. sunken tanks and tunnels.

Objects can occupy multiple layers. So the tunnel, for example, occupies layer -1 everywhere, but also layer 0 where the steps are (otherwise you could place objects on this).

If you look in the "map" behaviour, you can assign layers to individual tiles.

A layer 1 object can overlay a layer 0 or -1 object.
A layer 0,1 can only overlap with a -1.
A layer -1,0,1 cannot overlap anything.

I haven't tested it, but you should be able to define your own layers. A layer 2 should be able to be built anywhere there is a floor tile.

The funny behaviour you are noticing may be because I have assigned default behaviour to tanks to make them back compatible.
- all tanks are auto assigned layer 0
- sunken tanks are auto assigned layer -1 as well
- anything taller than a deep tank is assigned layer 1 as well. This is identified via the "accessHeight" variable. Basically anything with a value of 2 or higher.

You can override these behaviours by setting the layers variable manually, this is just the default behaviour so that all existing mod tanks will work in an intuitive way for players (hopefully!).


true you can make more layers simply by using 2 or higher though in my experience with scenery those lose their function, also wont sink in sunken tanks, i presume the layer coding is more designed for building stuff like the roofs instead of scenery :P

the only thing i find weird is, i can place a -1, a 0 and a 1 object on the same spot on the floor but it i cant do that inside a tank, only 1 of them will count(the 0) for the values the rest will pretty much act like tileless

sorry if i sound complicated, simply trying to have 2 or more scenery on the same spot and make their values still count, i thought the layer system would be ideal for it
Last edited by rickreptile; 11 Nov, 2021 @ 2:27pm
Twice Circled  [developer] 3 12 Nov, 2021 @ 1:18am 
Ah I understand, honestly I just hadn't considered that use case. The layer system was designed for placing stuff outside of tanks. But I understand why you thought it would work in tanks too.

I'll consider adding layer functionality here too. :)
rickreptile 58 12 Nov, 2021 @ 5:50am 
Originally posted by Twice Circled:
Ah I understand, honestly I just hadn't considered that use case. The layer system was designed for placing stuff outside of tanks. But I understand why you thought it would work in tanks too.

I'll consider adding layer functionality here too. :)
if you could manage to make it work in tanks aswel, that would be great :) thanks for considering it
Last edited by rickreptile; 12 Nov, 2021 @ 5:54am
rickreptile 58 15 Nov, 2021 @ 10:17am 
i also noticed that 2 tanks above each other despite 1 of them is labeled as layer 1 that they cant be placed on top of each other
Last edited by rickreptile; 15 Nov, 2021 @ 10:17am
< >
Showing 1-5 of 5 comments
Per page: 1530 50