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
Amnaa 39 11 Oct, 2019 @ 10:15am
Clam and coral scaling
Hello!

I've recently managed to make my own clam! After putting it in the game I've realized, that there is no "scale" setting in the data for it. Is the max size dependent only on the real model size?

PS: I've noticed that the Giant leopard clam is not centered properly in the GUI.
Last edited by Amnaa; 11 Oct, 2019 @ 12:03pm
< >
Showing 1-6 of 6 comments
Twice Circled  [developer] 3 12 Oct, 2019 @ 7:31am 
Yes, it's a bit complicated. The clams and corals are like a half-way between an animal and a decoration.

They grow like an animal but they occupy the floor like a decoration. To compound things, some of them have rocks which don't scale while the rest does e.g. fish-eating anemone.

Technically, you can add a "scale" setting to a coral, I think it will probably work OK, but for simplicity I had my artist draw them at full size in game world scale, and then I use the "scaleTheseMeshes" and "scaleTransform" fields to tell the game how to make them scale down to their child size.

Hope that makes sense! :D
Amnaa 39 12 Oct, 2019 @ 11:20am 
It does make sense, but I'm still confused :D What exactly do these do?
"constantTransform" and "constantEuler"
From what I have found, the "constantTransform" just controls how much should it be buried in the ground (y) and the "constantEuler" is the placement angle of the clam. Or is there something else these constants do?
Twice Circled  [developer] 3 13 Oct, 2019 @ 1:33am 
You've got it! :)

I call them "constant" because they don't change with the size of the animal. As opposed to "linearTransform" which is multiplied by the size and added on to the position e.g. at full size it is is multiplied by 1, at half size it is multiplied by 0.5.

If you design the mesh properly so that the origin of the mesh is where the animal touches the ground/rock then you won't need to use that one. Basically it's a fudge factor in case it isn't in the right place after it is scaled with the animal size.

Welcome to game dev! :D
Amnaa 39 13 Oct, 2019 @ 2:14am 
Haha :D I've sure noticed that the leopard clam is floating when it's in the closed position, haha :D I made extra sure mine sit snug!

Ok, last question! Is there a trick to setting positions for corals on rocks (or plushies in gift shops)? I mean, is figuring out the constants for their placement pure trial and error or can I somehow calculate it?
Twice Circled  [developer] 3 14 Oct, 2019 @ 2:31am 
I'm afraid it's mostly trial and error. I have a slight advantage in that I can run the game in editor mode and actually drag them around until they look good, then copy out the coordinates. But you don't have that option unfortunately. Sorry! :(
Amnaa 39 14 Oct, 2019 @ 8:21am 
Gah, darn it!
< >
Showing 1-6 of 6 comments
Per page: 1530 50