Legacy GM One large object or many small objects?

B

Bhreno

Guest
Which one reduces fps the least?

I need to create force fields around the game map so that objects don't leave the room, and I can't use the room bourdary for that. Is it better to create an object that covers the entire space of the room, solid only on the sides, or multiple 32x32 objects to lock space by space?

I want to make my game as light as possible.
 

TheouAegis

Member
He said the objects were 32x32, so that would suggest he'd want something more like

x = clamp(x,32,room_width-32);
y = clamp(y,32,room_height-32);
 
R

robproctor83

Guest
You will if course get better fps with fewer collision objects so if you can use fewer walls it would be better. But if your boundaries are simple rectangles you can just store the coords and test against those instead of an actual object, but either way works. Personally I recently did something similar and it's a pain trying to merge 32x32 walls into larger encompassing walls.

Not sure if this will help but... Was my solution
https://forum.yoyogames.com/index.php?threads/how-to-convert-grid-walls-to-long-walls.68306/
 

Yal

šŸ§ *penguin noises*
GMC Elder
Rectangles have the fastest collision checking, place 4 objects along the sides (two vertical ones, two horizontal). A single hollowed-out one would force you to collision check EVERY PIXEL of the room to see if there's a collision... with EVERYTHING in the room that collides with the border.
 
Top