physics on tilemap crash which i dont understand why

Bugs will be moved here once resolved.

Post » Sat Aug 20, 2016 3:52 pm

Problem Description
____ my sprites have physics and my titlemap i added physics so the sprite wouldn't fall though the titles but when i remove a title with physics or place a title the game would crash and say Physics_behavior.js:1888:9)
If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.
Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 33554432, (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.
Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 33554432, (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.
Uncaught abort() at Error
at Error (native)
at fb (http://localhost:50000/Physics_behavior.js:31:26)
at ua (http://localhost:50000/Physics_behavior.js:417:61)
at Function.o (http://localhost:50000/Physics_behavior.js:17:91)
at nc (http://localhost:50000/Physics_behavior.js:167:483)
at NB (http://localhost:50000/Physics_behavior.js:196:40914) ____



Steps to Reproduce Bug
  • remove titles
  • place titles

Observed Result
____ game crashes ____

Expected Result
____ game will come up with a error and game will stop working ____

Affected Browsers
  • Chrome: (YES)
  • FireFox: (YES)
  • Internet Explorer: (YES)

Operating System and Service Pack
____ windows 10 ____

Construct 2 Version ID
____construct2-r233 ____
B
11
S
2
G
1
Posts: 3
Reputation: 2,226

Post » Sat Aug 20, 2016 4:36 pm

Tilemaps aren't made to work with physics since they don't move.
You could try using the Chipmunk Physics behavior, but I would guess the outcome would be the same.
What can be done is using the Platform behavior on a sprite, and the Solid behavior on your tilemap.
Image ImageImage
B
171
S
50
G
179
Posts: 8,382
Reputation: 113,458

Post » Sat Aug 20, 2016 5:13 pm

@newt

newt wrote:Tilemaps aren't made to work with physics since they don't move.
You could try using the Chipmunk Physics behavior, but I would guess the outcome would be the same.
What can be done is using the Platform behavior on a sprite, and the Solid behavior on your tilemap.


I am confused by this since physics behaviour on tilemaps seems to work fine for me (set to immovable of course) and provides a barrier for physics objects?
B
18
S
12
G
1
Posts: 45
Reputation: 2,340

Post » Sat Aug 20, 2016 5:21 pm

A tilemap is one object, so it's like a sprite with a complex collision polygon, which is fine, until you change the collision polygon.
Image ImageImage
B
171
S
50
G
179
Posts: 8,382
Reputation: 113,458

Post » Sat Aug 20, 2016 5:23 pm

(newt) Oww i see i didnt know titlemap didnt work with physics thanks :) and i try using the Platform behavior then and i see what happens.

(DankP3) my Tilemap is set to immovable but after a certain amount of titles remove or placed it would just crash it has confused me a lot xD .
B
11
S
2
G
1
Posts: 3
Reputation: 2,226

Post » Sat Aug 20, 2016 5:44 pm

Ok, so I reread, you are changing tiles in gameplay!
With static tilemaps I haven't had a problem.
B
18
S
12
G
1
Posts: 45
Reputation: 2,340

Post » Sat Aug 20, 2016 5:47 pm

You should be able to fix it by selecting the non asm.js physics setting in the project properties. That error is cased by asm.js only being able to use a fixed amount of memory and when you create a lot of new physics objects (like changing a tile does) then eventually it will run out of that fixed amount of memory.

Now it could be argued that the memory management of the asm.js version of physics is broken, since even if all the physics objects are recreated every frame, then the total amount of memory needed should be the same.
B
94
S
33
G
114
Posts: 5,357
Reputation: 73,775

Post » Sat Aug 20, 2016 6:06 pm

Thanks that seem to have worked. that issues was really annoying so thanks :) and thanks everyone that has tried to help :) i appreciate the help normally i try to fix it my self but asking is a lot faster than doing that :).
B
11
S
2
G
1
Posts: 3
Reputation: 2,226

Post » Sun Aug 21, 2016 8:59 am

Having said what I said, I have just found a browser specific fail with key presses when physics tilemaps are present - will make a capx and file.
B
18
S
12
G
1
Posts: 45
Reputation: 2,340

Post » Wed Aug 24, 2016 1:58 pm

Closing as nothing we can do without a .capx. That error should not normally happen unless you use a great many physics objects, though.
Scirra Founder
B
399
S
236
G
89
Posts: 24,525
Reputation: 195,382


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests