Optimizing procedural terrain

For questions about using Classic.

Post » Mon Apr 11, 2011 1:34 pm

So I finished my randomly generated platformer terrain.

http://www.moddb.com/members/figalot/images/caverns

But unfortunately when I generated the maps to the size which is needed to make the game fun makes the game lag. I tried optimizing it by making all blocks outside the camera invisible but i think the game is still rendering them. Any idea how i can make the game run better?

I actually have a pretty powerful computer so rule that out.
B
3
G
1
Posts: 20
Reputation: 540

Post » Mon Apr 11, 2011 2:27 pm

ou don't have to make them invisible offscreen, it will automatically not render them.
If you have physics on them, disable when off screen
If you have per pixel collision on them change it to bounding box
My guess is the per pixel collision thing

If neither of those things, I guess post back unless someone else has helped by then
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Apr 11, 2011 2:46 pm

Neither of those things did any thing major, another thing I noticed (If you look at the picture you can see that there are 2 characters) It only gets a drop in fps when both my characters jump. I deleted 1 character and tested it with 1 guy and it ran 20-30 frames better. Btw its a direct x 9 game with no motion blur or any special stuff.

Edit: Also the screen is always shaking (not on purpose) i think this is because i have both main characters with the attributes center view.
B
3
G
1
Posts: 20
Reputation: 540

Post » Mon Apr 11, 2011 2:57 pm

Hmmm
Hard to say without a cap filethen, which I couldn't do anything with until later today, then maybe someone else couldhelp.

Only other thing I could see was trying the non per pixel collisions on your characters
But really, it should only be a problem with very large images or very large amounts of images
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Apr 11, 2011 3:09 pm

Hopefully this helps
Well its 1 in the morning here so ill be back in 6-9 hours
heres the cap
http://www.mediafire.com/?c5g5f5th825jai8

Thx for your help
B
3
G
1
Posts: 20
Reputation: 540

Post » Mon Apr 11, 2011 3:42 pm

Hmm this looks familiar. :P

Your biggest issue is too many tiles. Just about any computer is going to have issues when you go over a couple thousand.
Your options are:
1: Reduce the size of the layout.
2: Only create a set amount of tiles when they are within a certain area, and then destroy those tiles when they aren't needed.
3: A combination of 1 & 2, smaller layouts connected to other layouts.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Mon Apr 11, 2011 3:51 pm

Could Could you explain the answer 3 a little more ? like different maps?
B
3
G
1
Posts: 20
Reputation: 540

Post » Mon Apr 11, 2011 3:59 pm

Take your big map and split it up into equal parts. The first layout would be quadrant 1, second layout quadrant 2, etc.
You can then add triggers to each layout that tell it when to go to a particular layout.
Like if player x is > 600 go layout 2, if player y is greater than 600 got to layout 3.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Mon Apr 11, 2011 4:30 pm

2 is how id do it if dealing with 1000's of tiles
As long as its not too important to keep track of offscreen enemies navigating the terrain or anything
Spriter Dev
B
87
S
21
G
12
Posts: 3,240
Reputation: 16,461

Post » Mon Apr 11, 2011 11:51 pm

Is there any way i can make prefabs and instead of on start up randomly generating tiles it creates these prefabs?
B
3
G
1
Posts: 20
Reputation: 540

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests