How do I create screen-by-screen system to reload sprites?

Get help using Construct 2

Post » Tue May 06, 2014 5:53 pm

Hi guys, I'm looking a best practice to create screen-by-screen system to reload sprites then set state their current values as persistent, then if they aren't on screen, destroy or disable sprites, then we are returned to old position, recreate sprites.

It's a method is used for super nintendo games like super metroid when the enemies aren't on screen, their AI are disabled, probably destroyed, otherwise on screen again, reactivate enemies.


Thanks!
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Tue May 06, 2014 7:18 pm

Joannesalfa wrote:Hi guys, I'm looking a best practice to create screen-by-screen system to reload sprites then set state their current values as persistent, then if they aren't on screen, destroy or disable sprites, then we are returned to old position, recreate sprites.

It's a method is used for super nintendo games like super metroid when the enemies aren't on screen, their AI are disabled, probably destroyed, otherwise on screen again, reactivate enemies.


Thanks!


Mostly, what I do (exemple with one ennemi type, also It is more the theoric part, you might have to tweak it):

-First if no instance of them exist deactivate the group containing the AI (you do this by having a "Compare two values : Sprite.Count = 0, disable group" inside the groups itself)., just below the group, add an Else and a subevent that tell "if ennemy is created, activate group"
-Have a boolean "Activated".
-You check if the ennemi is Active and not on screen, if it is not on screen, change the "Activated" boolean variable to False.
-You check the on screen ennemies, if one of them has "Activated" to false, you set it to true
-then if the value is true you do stuffs, if false, you can deactivzte behaviors and collisions.

I think that will help beginning.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Tue May 06, 2014 10:23 pm

@Aphrodite I had to do something like that. It can be considered good advices, but we need complete.


In this scirra forum, no one could explain how to implement "culling" for "screen-by-screen"
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Tue May 06, 2014 11:43 pm

If you're going for a metroidvania like SM then you just have to treat individual layouts as rooms and learn how to use the persist behavior & global objects. It's not that hard, really...just not a very good way of going about it. You don't really have a choice with C2 though.
Image
B
242
S
29
G
13
Posts: 1,787
Reputation: 18,685

Post » Wed May 07, 2014 5:27 pm

@MadFactory That's not I mean to use the "persist" behavior for enemies, Imagine C2 editor in layout has more than 200 objects, then runtime would appear 20 objects using culling screen-by-screen.

Actually, is that true we don't really have a choice?
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361

Post » Wed May 07, 2014 5:53 pm

Eh it sounds like something that would have to be built into C2. Here is how I handle metroidvanias (overview in the video description)
Image
B
242
S
29
G
13
Posts: 1,787
Reputation: 18,685

Post » Wed May 07, 2014 8:35 pm

@MadFactory That's really nice!

I was wondering how you did design the effect from room to room as layout by blue door.

I've read youtube description, it seems no info about culling objects, I thought your original post comes a feature culling objects.
B
97
S
35
G
29
Posts: 3,139
Reputation: 28,361


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], leandrogenske, R0J0hound, TylerJS and 9 guests