GMS 2 Render Distance Help

T

TurtleBitAlex

Guest
Hello. I currently have a 2d Randomly generating game like terraria. Currently is spawns in thousands of blocks in to the world. The larger the world the more objects there are that spawn in for example dirt. loads of dirt is causing lots of frame rate problems so i was wondering for example if my player gets 6000 pixels away from dirt the dirt will like deactivate and not be used so basically making a rendering system when i get close enough. Not when its off screen but like when its far enough away. Gamemaker 2
 
A

Advokitt

Guest
I created something similar to this render distance you are describing a few months ago. I would imagine you could use a collision circle check in your case and place it in the draw event. As in:
If object is not within the collision radius of the player { exit; }
Do code....
 
T

TurtleBitAlex

Guest
just objects because as all objects are controllable
 

Bingdom

Googledom
iirc, tiles don't get drawn when outside the view.

Use a grid (or array) to store tile information. Use a chunking system and only activate chunks where there are active entities.

Also, you're not allowed to bump the topic within 48 hours, unless you have a good reason.
 
Top