Has Anyone Ever Made a Sandbox Game In Construct 2

Get help using Construct 2

Post » Mon Jul 15, 2013 9:20 am

Im struggling right now finding the balance between having the right amount of objects in my game to prevent lag. I was wondering if anyone has created a digging type of game like Terraria or Growtopia.
If so i would love to see it,Im starting to feel like construct cant handle what i want to do.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Mon Jul 15, 2013 11:23 am

Well you could try making some things work only using the "is on screen" event where you can, or make sure everything that only needs updated once has the "trigger once" event on it (i miss that one a LOT)

The way most games deal with things like this is by deactivating the objects at a distance where they can't be seen. If you ever heard of LOD or level of detail, that's when 3d models will swap to lower quality versions as they get farther away to save memory. Similarly, physics objects go to sleep when they are not being acted upon to save memory.
If your game is as big as you say, I would attempt to put in memory conservation methods such as these.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Mon Jul 15, 2013 6:54 pm

@Sushin I was told by people on the forums that we could not deactivate objects that are at a certain distance.I have never seen any tutorials of Deactivating objects out of veiw for construct 2,I have seen the trigger once function before but i never used it,I would love to know how to deactivate objects at a certain distance,But at the same time have them reload when you are close again and still be in the same place.

Sorry about that i do see the event you said to use but will this work with arrays?
Or will this be better to use if im placing tiles manually?
I am just trying to figure out the ins and outs
RookieDev2013-07-15 18:58:24
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Mon Jul 15, 2013 7:29 pm

[QUOTE=RookieDev] @Sushin I was told by people on the forums that we could not deactivate objects that are at a certain distance.I have never seen any tutorials of Deactivating objects out of veiw for construct 2,I have seen the trigger once function before but i never used it,I would love to know how to deactivate objects at a certain distance,But at the same time have them reload when you are close again and still be in the same place.

Sorry about that i do see the event you said to use but will this work with arrays?
Or will this be better to use if im placing tiles manually?
I am just trying to figure out the ins and outs
[/QUOTE]

I'd have to see what you were doing, but for example:
I'm making a game with platformer AI that has line of sight and all that. I think what I would do (actually what I would do is just create the enemies when the player reaches a certain point) is put all the AI behaviors into a group, and put that group under an event such as "if distance(player.x, player.y, enemy.x, enemy.y) < 600" (the entire width of the screen)
and that way, the events would only be active if the player is 600 pixels or closer. You might have to pick and choose which events you can have this happen for though, depending on how your code works, but I think it would help save memory depending on how many objects you have and how much code each of them is using.
The alternative would be to delete and create static interactive objects when the player is close to a point, and restore values based on global variables if necessary. Seems complicated but if you don't have any other options you might want to experiment.
B
10
S
3
G
3
Posts: 234
Reputation: 3,467

Post » Mon Jul 15, 2013 7:39 pm

I will send you my capX file that i had blackhornet check out.I will send it to your PM box @Sushin because i have alot of art i dont want passed around.Thank you for your reply,and i think after you see what im trying to do it will help.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368


Return to How do I....?

Who is online

Users browsing this forum: ezgaming420, marcinkowski, plinkie and 11 guests