• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

DS_grid collisions and delta timing regarding physics

Zerb Games

Member
Hey guys, so I just delve into some optimization with my project that uses Box2D and right away my immediate solution was to turn all my wall objects into a ds_grid. As I've noticed drastic improvements with this system in terms of ease of use and better overall control. I'm have big issues with this however and I was wondering if there was a way to create vertexes for a larger physics object using a ds_grid, because I don't really see a way of having physics objects interact with it in any other way.

Another issue I've been having is delta timing with the physics, it's a pretty daunting issue because how inconsistent and weird it seems to be.

TT;DR Too Tired; didn't read. Shouldn't be posting this late and should go to bed. I'm just now posting this cause it's the end of my day.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Okay, so you should use objects on the create event of the room, adding them into the ds_grid first, and then use them to define the area you want as the physics fixture by "merging" them to create a series of consistent large areas (have each instance check around it, then expand it's xscale/yscale to fill the area, deleting the other instance in the process). Once you have expanded the wall instances, use their bbox positions to create box fixtures. You can see an example of what I mean by "merging" the instances from the screenshots of this marketplace asset:

https://marketplace.yoyogames.com/assets/188/optimise-objects

This will work fine and is something I recently used in this exact same scenario for a Jam game I was working on. :)
 

Zerb Games

Member
Okay, so you should use objects on the create event of the room, adding them into the ds_grid first, and then use them to define the area you want as the physics fixture by "merging" them to create a series of consistent large areas (have each instance check around it, then expand it's xscale/yscale to fill the area, deleting the other instance in the process). Once you have expanded the wall instances, use their bbox positions to create box fixtures. You can see an example of what I mean by "merging" the instances from the screenshots of this marketplace asset:

https://marketplace.yoyogames.com/assets/188/optimise-objects

This will work fine and is something I recently used in this exact same scenario for a Jam game I was working on. :)
Thanks, I'll be sure to try something like this when I get home.
 
Top