SaveState growing when using on Collision

Bugs will be moved here once resolved.

Post » Tue Mar 10, 2015 4:27 am

Problem Description
The save state increases over time when saving and loading. It seems to happen when creating objects that are then destroyed "on collision".

Attach a Capx
bug_saveload_oncollision.capx


Description of Capx
The capx creates a sprite every tick that immediatly gets destroyed on collision. Then every second the state is saved then loaded.

Steps to Reproduce Bug
Basically exactly like the capx, but...
  • Every tick create a sprite so it overlaps a second object.
  • Using the "on collision" condition check for a collison between the sprite and object and then destroy the sprite.
  • Periodically save then load the game state.

Observed Result
After a few saves and loads of the state, the save state gets bigger and bigger. Looking at the JSON string the section after "collmemory" gets longer and longer.

Expected Result
That the savestate would remain the same size

Affected Browsers
  • Chrome: untested
  • FireFox: YES
  • Internet Explorer: untested

Operating System and Service Pack
Windows Vista sp2

Construct 2 Version ID
r199

Further discussion on the bug found here:
mystery-my-savefile-gets-crazy-big-for-not-apparent-reason_t126367
You do not have the required permissions to view the files attached to this post.
B
85
S
27
G
78
Posts: 5,013
Reputation: 54,260

Post » Tue Mar 10, 2015 8:35 pm

Based on my investigation, I should add that it's the loading that is the key to reproduce the issue.

If you just save and never load, the savefile won't get larger.

As soon as you load once, you can see the savefile getting larger and larger every time you save.

The part that gets larger in the savefile is a thing called "collmemory" (for collision memory?) It becomes filled with numbers like this:

Code: Select all
"1734838404821996":{"ex":{"collmemory":{"58,2268":[58,2268,28460],"58,2578":[58,2578,32750],"58,3123":[58,3123,40578],"58,4188":[58,4188,57365],"58,4268":[58,4268,58824],"58,4742":[58,4742,66165],"58,5010":[58,5010,70619],"58,6248":[58,6248,90052],"58,6331":[58,6331,91371],"58,6544":[58,6544,94751],"58,7030":[58,7030,102474],"58,9446":[58,9446,140590],"58,9516":[58,9516,141699],"58,9572":[58,9572,142783],"58,12193":[58,12193,183862],"58,12404":[58,12404,187362],"58,12577":[58,12577,189900],"58,13907":[58,13907,210833],"58,15106":[58,15106,229678],"58,15433":[58,15433,234811],"58,15494":[58,15494,235766],"58,16088":[58,16088,245144],"58,16893":[58,16893,257748], ....
B
14
S
4
Posts: 75
Reputation: 1,114

Post » Wed Mar 11, 2015 9:00 pm

I'm getting a bug related to the "Save to Slot" system action, when I load the slot, the game is in slow-motion, everything except for music.
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Wed Mar 11, 2015 10:32 pm

Nesteris, I suggest that you follow the instructions in this post: read-first-how-to-report-bugs_t61748
and submit your bug using the template from that post as a new post instead of as a reply to this one.
B
14
S
4
Posts: 75
Reputation: 1,114

Post » Mon Apr 13, 2015 12:46 pm

Should be fixed in the next build, thanks for the report.
Scirra Founder
B
373
S
218
G
84
Posts: 23,468
Reputation: 186,208

Post » Tue Apr 14, 2015 12:43 pm

Rocking!! My players will be so happy! Thanks!
B
14
S
4
Posts: 75
Reputation: 1,114

Post » Sun May 31, 2015 5:17 pm

Ashley wrote:Should be fixed in the next build, thanks for the report.


Now that Contruct r206 has been released (which includes the fix on this issue), I did some tests and I'm not sure the situation is better.

@Ashley, is your fix supposed to "clean" a savefile that is already full of the ghost data? For example, if I use a savefile that was created on my game in Construct r200, and I load it in my game running in Construct r206, should it remove the corrupted data and reduce the savefile size?

I'm testing this right now and it doesn't seem to clean it. The savefile remains super big and seems to keep expanding as before.
B
14
S
4
Posts: 75
Reputation: 1,114

Post » Sun May 31, 2015 5:46 pm

No, the fix won't clean any existing files, but it should prevent any new files from being bloated.
Scirra Founder
B
373
S
218
G
84
Posts: 23,468
Reputation: 186,208

Post » Sun May 31, 2015 5:59 pm

So, if I understand correctly from what you're saying, the issue will continue to occurs (the savefile will get bigger) unless my players erase their savefile and start a new one?
B
14
S
4
Posts: 75
Reputation: 1,114

Post » Sun May 31, 2015 6:50 pm

@narFsnw
The fix makes the files so they won't get bigger.

You can clean the user's saves yourself using a regex expression. Here's a test of such an expression.
https://dl.dropboxusercontent.com/u/542 ... eaner.capx

Basically doing this should clean the save. After that load again with the "load state from json" action.
Code: Select all
RegexReplace(SaveStateJSON, """collmemory"":\{.*?\}", "", """collmemory"":{}")

Basically it will remove everything in the collmemory section.
B
85
S
27
G
78
Posts: 5,013
Reputation: 54,260

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests