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
Bug V2.0.3 with mods - MQ Crash, system hangs
User mentioned issue using one of my megatunnel tank mods.

Reproduce - load mod (I did all 3), start new game - SandBox - Select Tank Menu (Upper Left)-Game hangs.

User said it didn't happen in campaign mode. (I didn't try).

Tried to look at MQ log file while it was hung - System showed 0 bytes but then entire OS became unresponsive. No ctrl-alt-delete or any method worked. Forced Hard reboot (not my favorite).

Log file now 72kb but ends with:
-----
cornerCount = 4

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)

sectorCount = 4

(Filename: C:\buildslave\unity\build\Runtime/Export/Debug.bindings.h Line: 45)
----
(probably not helpful).
< >
Showing 1-15 of 16 comments
stlnegril9 32 3 Jun, 2020 @ 9:59am 
tried again with only 1 mod: "Mega_L_Tunnel_Tank"
Tank window opened then game hung. Task Manager showed extremely high MQ memory usage before I killed it.
Log showed nothing new (same/similar as above).
stlnegril9 32 3 Jun, 2020 @ 10:29am 
// "menuTag":"huge"
Fixed that mod (or at least, it doesn't crash the game now).

But possibly just because it removed it from the menu. Will test putting it in "large"
Last edited by stlnegril9; 3 Jun, 2020 @ 10:30am
stlnegril9 32 3 Jun, 2020 @ 10:44am 
"menuButton":"tanks",
"menuTag":"large",
(not under multi-size) crashes game again - memory increasing rapidly (i.e. leak)
Twice Circled  [developer] 3 3 Jun, 2020 @ 11:20am 
=== moved to workshop forum ===
I've added some code which caches all the vert data of the smallest size a tank comes in. My guess is that is what is causing this. This is to improve the performance of drawing the portrait for each tank in the GUI. It can draw it in one mesh instead of all the individual ones.

However it works fine for all the included tanks so something specific about this model is throwing off the routine. Moreover, it appears to create a cache which crashes the game, rather than just fail. If it just failed to create a cache, it would fall back to the old method which would be preferable. I could try including a limit on the size of the cache but that would be a sticking plaster rather than a cure.

All the cache does it run through each of the tiles, adding ones that use the same materials to the same mesh. Do any of your models/tiles have multiple materials per mesh? That would cause a problem.
Last edited by Twice Circled; 3 Jun, 2020 @ 11:34am
stlnegril9 32 3 Jun, 2020 @ 11:55am 
Originally posted by Twice Circled:
=== moved to workshop forum ===
...
. Do any of your models/tiles have multiple materials per mesh? That would cause a problem.
Wouldn't think so. The mod doesn't even have any textures - it uses vanilla tank textures (and just has models for new geometry).

But I'll check I C4D. Just realizing that mod didn't include the FBX files (just the t3cd). Not sure if you can reverse-engineer those.
Twice Circled  [developer] 3 3 Jun, 2020 @ 11:57am 
Hey again, I've downloaded the mod and taking a look now. :)
stlnegril9 32 3 Jun, 2020 @ 12:02pm 
mod has 12 FBX files - checked all 12 and either see a single texture or none(the water) for each

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2117994544&fileuploadsuccess=1
Last edited by stlnegril9; 3 Jun, 2020 @ 12:07pm
Twice Circled  [developer] 3 3 Jun, 2020 @ 12:11pm 
Ah I have it (most of it!).

I added three new codes for tank maps in this update:
'w' is used to tell the game that this tile should be counted as water for calculating volume, even if it is blocked.
's' is used to tell the game that this is a sunken tile even if it is not blocked e.g. the walkable bits of the small tunnel tank.
'W' is like an inverse 'w' it removes the water from a tile that would normally be counted from the volume calculation.

I thought I had been so clever because by having these additional codes I made sure everything was back-compatible. I didn't change the rest of the mechanics/calculations.

However I didn't foresee one very obvious thing - if people were already using the codes 's' and 'w' in their code maps it would treat every water tile as a 'w' code and put whatever tile that corresponds to there.

In other words, it's drawing an extra tile on every water tile!

I sort of fixed it by swapping the s and w codes out for * and /:

https://pastebin.com/wsU3pNE9

It got me this far. It still looks a little messed up maybe I did the edit sloppily, but at least it's running so you can see a bit better how to fix it from here:

https://pasteboard.co/JbpRfuZ.png

As for the bug, I believe we hit the maximum number of verts for a mesh (hard limit) once we combined all of the tiles into a single mesh. It shows that we're running pretty close to the max number of verts with this tank, obviously pushed up quite a bit by the additional 'w' tiles.
Last edited by Twice Circled; 3 Jun, 2020 @ 12:28pm
Twice Circled  [developer] 3 3 Jun, 2020 @ 12:13pm 
Sorry should have mentioned: apologies for this issue. It was sloppy of me to add extra codes without communicating it to you guys. I did it a few months ago and it slipped my mind. Sorry for the inconvenience, hopefully we can get it sorted now. :)
Last edited by Twice Circled; 3 Jun, 2020 @ 12:14pm
Twice Circled  [developer] 3 3 Jun, 2020 @ 12:18pm 
Just had a look through all the tanks. I think these are the only codes you need to stay clear of when defining the multiCodes:
x
.
c
v
b
s
w
W
>
^
o

As in these are the codes which have special meanings in the game. Most of them you know already. Any other ASCII char can be used to define a multicode/tile.
Last edited by Twice Circled; 11 Jun, 2020 @ 6:22am
stlnegril9 32 3 Jun, 2020 @ 12:26pm 
Got it. Makes sense. Will make sure mod community knows and shouldn't be too hard to scan through tanks to find any that use those multiCodes (can only think of a few that use many).
Thanks!
sidduu 4 Jun, 2020 @ 1:01am 
So unsubscribing from all tunnel tank mod solved my issue
stlnegril9 32 10 Jun, 2020 @ 4:00pm 
Originally posted by Twice Circled:
...

However I didn't foresee one very obvious thing - if people were already using the codes 's' and 'w' in their code maps it would treat every water tile as a 'w' code and put whatever tile that corresponds to there.

In other words, it's drawing an extra tile on every water tile!

...

Important to remember this part. A mod subscriber complained a tank was showing "ugly white stripes". I verified it was true but wasn't sure why (haven't touched this in months).

But, this mod use more characters in tank map than any ever seen, including "s", "w", and "W".
Now it makes sense! One of those three is being drawn on every water tile.

I'm out of characters now. Double checking but not sure what to do.
Interestingly it doesn't crash, but it does this:

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2126446387



Last edited by stlnegril9; 10 Jun, 2020 @ 4:00pm
Twice Circled  [developer] 3 11 Jun, 2020 @ 1:33am 
Have you used all of these?
*
/
-
+
.
,
;
:
=
_
$
£
%
^
&
!
`
¬
|
~
#
@


After that you can move onto capital letters. These are counted as separate chars. It's a little more confusing but does work. I would personally stay away from capital versions of special characters like C, V, S, O and obviously W. But you're safe with most of them.

Maybe I'll reserve the following in case I need to add more chars later:
Q, E, A, S, D, Z, X, C, V

But use any others you like.
stlnegril9 32 11 Jun, 2020 @ 5:55am 
Mod was fixed. Thanks for the list. All of those were used, (with exception of "£" and "¬", good to know for future use if needed). including Uppercase.

Had used "(" and ")" previously but then abandoned so those with "0" (zero) made it work.
Was hesitant on "0" because of visual similarity to "o" - which, btw, should perhaps be on that "don't use list", or rather, "use it, but has special meaning"?
< >
Showing 1-15 of 16 comments
Per page: 1530 50