Desktop game crashes when saving

RKL Design

  • *
  • Posts: 6
The game crashes on the desktop export everytime it attempts to save.  I normally have the save function right before a scene transition, or on a confirm action button but no matter where I move it the game crashes. It seems to work fine on flash but crashes in desktop.

Has anybody else run into this issue? Am I messing up somewhere?
I attached my logs.

Thanks in advance for any help.

Justin

  • *
  • Posts: 3980
If you run the game in debug mode in 3.5, you should get more information related to the crash.
For normal testing and for 3.4, here's a guide that can help.

http://community.stencyl.com/index.php?topic=49211.msg272307#msg272307

For Live Support: Join our discord channel and ping me @justin.

rob1221

  • *
  • Posts: 9156
Quote
Cannot add listener function to null region
I don't remember which event this error is for, but the region needs to be set either by default or in "when created" else the event won't work.  If it's a region created later in the game, you'll have to change your code to not use that event.

Quote
Warning: Behavior does not exist - Simple Minimap
I'm not sure if this causes any problems for your game but it's the only other notable error I see.

RKL Design

  • *
  • Posts: 6
I think I did this right. I ran the game in debug Desktop/Mac/Linux, then exported the logs.

Quote
I don't remember which event this error is for, but the region needs to be set either by default or in "when created" else the event won't work.  If it's a region created later in the game, you'll have to change your code to not use that event.
I turned off everything in that behavior but I think the null region error still pops up. Do you have any links or info I could read over to figure out what's causing it?

rob1221

  • *
  • Posts: 9156
Quote
Error in scripts.Design_365_365_Shop: Cannot add listener function to null region.

RKL Design

  • *
  • Posts: 6
Update: I've tested the game on my laptop as well and the same thing happens. When trying to save the program crashes.

I've also just tested a very old version of the game that didn't have any of the behaviors the null regions are referring to.  Still crashes when trying to save. Here are the logs from that version.

Justin

  • *
  • Posts: 3980
Please refer to my post. It's the most direct way to pinpoint exactly why your game is crashing.

For Live Support: Join our discord channel and ping me @justin.

RKL Design

  • *
  • Posts: 6
I ran the game through Visual Studio 2015, game crashes.

First I get:  Unhandled exception at 0x01CDC86B in Airlock_321.exe: 0xC00000FD: Stack overflow (parameters: 0x00000001, 0x008C2F60).

This is the next line of code that the program would run but I've actually gotten a different result every single time I've run the program but I've gotten a line that looks like this a couple times.

HX_STACK_FRAME("haxe.Serializer","serialize",0x3cea866c,"haxe.Serializer.serialize","C:\\Program Files (x86)\\Stencyl\\plaf\\haxe\\std/haxe/Serializer.hx",227,0x9f72c445)

When I click stopped at Exception a link that says Go to source code appears under it for a split second then I get an error above that says "The Diagnostic tools failed unexpectedly. The Diagnostic Hub output in the Output window may contain additional information. "

I also copy pasted the Call Stack and Miscellaneous Files, not sure if that helps. I'm pretty clueless at deciphering this stuff.





Justin

  • *
  • Posts: 3980
Code: [Select]
Airlock_321.exe!haxe::Serializer_obj::serialize(Dynamic v) Line 1026 C++
  Airlock_321.exe!haxe::Serializer_obj::serializeFields(Dynamic v) Line 282 C++
  Airlock_321.exe!haxe::Serializer_obj::serialize(Dynamic v) Line 1026 C++
  Airlock_321.exe!haxe::Serializer_obj::serializeFields(Dynamic v) Line 282 C++
  Airlock_321.exe!haxe::Serializer_obj::serialize(Dynamic v) Line 1026 C++
  Airlock_321.exe!haxe::Serializer_obj::serialize(Dynamic v) Line 536 C++
  Airlock_321.exe!haxe::Serializer_obj::serializeFields(Dynamic v) Line 282 C++
  Airlock_321.exe!haxe::Serializer_obj::serialize(Dynamic v) Line 1116 C++
  Airlock_321.exe!haxe::Serializer_obj::run(Dynamic v) Line 1289 C++

It keeps on repeating the same lines at the top until the end, so it's highly likely that the stack overflow here is caused by a circular object reference being serialized. In other words, some object is referring back to itself somehow, and that object is being saved. For example, if you placed a map inside itself as one of the values, this could happen.

If this gives you an idea of where the problem is but you're still not sure, feel free to share some of your code. If you're still completely lost, you can send me your game and I can find the problem for you.

For Live Support: Join our discord channel and ping me @justin.

RKL Design

  • *
  • Posts: 6
Thanks, and sorry for such a delay between my posts. I don't get to work on this game as much as I wish I could.

Is this an issue somewhere in my Stencyl code or in the C++. Is there any way to pinpoint the cause besides just combing through all the behaviors and code?

Justin

  • *
  • Posts: 3980
Assuming I'm right about the cause, it's an issue in your code in Stencyl.

All you need to look at is your game attributes. Do you have any map game attributes? What kinds of values are placed in those maps? Putting a list inside itself is also something that could cause this problem. Are you putting any complex objects, such as actors, joints, regions, etc., into game attributes? Try to keep game attributes limited to simple things that can be written out to a file, such as number, text, boolean, list, and map. Your lists and maps should also be composed of the same simple writable objects.

Having a list or map made of others lists or maps is okay, just make sure that you don't refer back to one of the parent lists or maps. Here's a more visual example of what I mean.

Let's say you're trying to save Map A, which is a map of maps.
Map A: [key: "Embedded map", value: Map B]
Map B: [key: "Embedded map", value: Map C]
Map C: [key: "Embedded map", value: Map A] <--- this would cause it to try saving map A again, which it's already in the process of saving, causing an infinite loop.

Again, this is assuming that I'm correct about the cause.

For Live Support: Join our discord channel and ping me @justin.