How do I make objects use only a tiny amount of performance?

Get help using Construct 2

Post » Sun Jan 29, 2017 11:34 pm

I have a tiled map (not using tilemap) that has 5000 objects. It runs at 60fps (with other things going on), but I would like to make the map bigger. At 15000 tiles it runs at 8fps. I have collisions turned off but if there anything else I can do? Nothing is checking the tiles or anything.

Thanks for your help!
- Head of Tall Story Studios.

Creator of GOV, Project Abyss, Spiritlands & more!
B
27
S
12
G
2
Posts: 129
Reputation: 3,169

Post » Sun Jan 29, 2017 11:48 pm

15000 is too much.
Best option to retain that size is to split it up into different layouts.
Image ImageImage
B
171
S
50
G
179
Posts: 8,390
Reputation: 113,474

Post » Mon Jan 30, 2017 12:11 am

Any particular reason you aren't using the tilemap object?
Mistakes were made.
B
53
S
27
G
114
Posts: 1,699
Reputation: 64,446

Post » Mon Jan 30, 2017 12:38 am

I'm guessing it is because it is some kind of mining game, in which he needs so many objects to destroy. Like @newt said, use more layouts and just move the player to the new layout when they reach either side or bottom.
B
15
S
8
G
2
Posts: 68
Reputation: 2,465

Post » Mon Jan 30, 2017 8:42 am

newt wrote:15000 is too much.
Best option to retain that size is to split it up into different layouts.

Im really surprised that there is no way to lessen the cpu use from objects.
- Head of Tall Story Studios.

Creator of GOV, Project Abyss, Spiritlands & more!
B
27
S
12
G
2
Posts: 129
Reputation: 3,169

Post » Mon Jan 30, 2017 5:14 pm

Tilemap is the go to method.
It's one large texture versus 15000 small textures.
It puts the burden more on the gpu, which is what it excels at.

The only other optimisation worth mentioning is "render cells" located under the layer properties.
It tells the system not to worry about rendering objects that can't be seen.
It will lessen the load, but 15000 is still a bit much for the cpu to keep track of, even if they are static.
Image ImageImage
B
171
S
50
G
179
Posts: 8,390
Reputation: 113,474

Post » Tue Jan 31, 2017 10:47 am

Im doing isometrics and ive got most of the game coded but I wanted a larger world. Gamers love big worlds even if they add no gameplay value :P
Tilemap is terrible for iso though
- Head of Tall Story Studios.

Creator of GOV, Project Abyss, Spiritlands & more!
B
27
S
12
G
2
Posts: 129
Reputation: 3,169

Post » Tue Jan 31, 2017 3:53 pm

Well the only other option is to create, and destroy those objects based on where the view is.
Setting it up is pretty convoluted as you need a map, and creating, with destroying a bunch of stuff all the time can be just as big a draw on the system.
Then another way would be a combination of that with something like multiple layouts, but using cells on one layout instead, sort of like how the old Zelda's did it.
The trade off is that the player has to wait while the next cell is created.
Image ImageImage
B
171
S
50
G
179
Posts: 8,390
Reputation: 113,474

Post » Tue Jan 31, 2017 6:56 pm

Newts first method is the approach I would attempt, and as he mentioned it is not simple. Although I'm sure the performance would be significantly better than having 15000 objects loaded at once.

I'm assuming that the player only sees a tiny fraction of the total 15000 tiles at any given time. You'll want to create those tiles at runtime within a set range around the player. The method of generation would probably be via an array containing tile coordinate and ID information, or from a seed.

You may even be able to use exported data from a map built in program like Tiled, as isometric tile data is more or less the same as orthographic, just displayed differently.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,699
Reputation: 64,446

Post » Mon Feb 06, 2017 9:06 am

Thanks for the advice guys :) Some very interesting ideas to have a go with. Players can zoom right out and see the whole map though (especially useful for the map editor) but I will have a go.
- Head of Tall Story Studios.

Creator of GOV, Project Abyss, Spiritlands & more!
B
27
S
12
G
2
Posts: 129
Reputation: 3,169

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests