Early Platform Shooter

Post your own tutorials, guides and demos.

Post » Tue Oct 20, 2009 9:52 pm

Hey People...

I'm making a small game in order to learn Construct, I intend the game to be a platform shooter. First of all, I'm amazed by Construct -- coming from MMF (actually I started out way back in ZZT.. But I digress) it definitely seem more robust and more agile... However, that also makes me weary in regards of if I'm doing stuff in an effiecent , sane or "right" way. So, I have a small question to you well-seasoned .cap-jackers; could you take a quick look at my .cap to come with some feedback, no-no's or general tips on doing the stuff I attempt on doing? Basically, I'm leeching on your expertise for a sanity check:)

Lastly a question -- How is the in-built platform movement working with regards to Time Delta and V-synch? Is it bulletproof to FPS drops?

Warm Regards,
Julmusten
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Wed Oct 21, 2009 6:00 am

[quote="Julmust":3o557hwn]Lastly a question -- How is the in-built platform movement working with regards to Time Delta and V-synch? Is it bulletproof to FPS drops?[/quote:3o557hwn]

All of the built-in movements in Construct use timedelta, and no it's not bulletproof to FPS drops:

http://sourceforge.net/apps/mediawiki/c ... #Drawbacks

But the good news is that if you're careful about how you design things and you don't go crazy with shaders then FPS drop shouldn't be too much of a problem. Here's a page on optimization that should help you out a bit:

http://sourceforge.net/apps/mediawiki/c ... ation_tips
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Wed Oct 21, 2009 8:17 am

Thanks for the reply, so basically I don't have to worry that much about using events 100% logically as long as they work as intended? Because the things that will make the fps drops are most likely shaders or GPU heavy operations?

Thanks,
Tomtedricka
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Wed Oct 21, 2009 7:03 pm

Things that drop fps in my experience (Cpu items/events):
1. Very heavy collision checks. (by this I mean hundreds,sometimes even thousands, per frame. Overlapping at offset is one of the heaviest events.)
2. Intensive loops. (usually when collision checks are involved.)
3. Thousands of sprites on screen. (construct is extremely fast with this, so don't worry about it unless you have over 1000-2000 objects.)

Shaders are the main culprit for slowdowns in most cases, but large and complex games without shaders often have to be careful with events. By shaders, I mean fx files that require a pixel shader version-greater-than-0 compatible graphics card. PS 0.0 effects don't slow down games and can be abused. :mrgreen:

Tips:

-Avoid large sprites as much as possible (i.e., over 512x512)

-When dealing with massive amounts of objects with complex movement properties, try to incorporate behaviors as much as possible, as they are faster than events.

I took a look at your cap, and it seems logical. At first I couldn't understand the player object lol, it's so confusing. Only one circle moves, so I thought it was three circle sprites, but then I realized you were precisely rotating a single sprite with three dots. I would say that's a bit confusing, but if it works for you, then go for it. Also you don't need to set the bullet angle to the player angle upon creation because spawn object does that automatically. Also, you should use sub events instead of needlessly repeating conditions like "up arrow is down".
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed Oct 21, 2009 8:10 pm

[quote="Davioware":1ssrsfej]PS 0.0 effects don't slow down games and can be abused. :mrgreen:[/quote:1ssrsfej]
Actually, this isn't entirely true. Sprites with PS 0.0 effects do take longer to render. I've done some tests and I've found that the engine can render on the order of about 2.5 times more sprites without effects before the framerate drops below the VSYNC rate.
Moderator
B
99
S
38
G
19
Posts: 1,584
Reputation: 17,942

Post » Thu Oct 22, 2009 2:01 am

[quote="linkman2004":5lejtpd5]Actually, this isn't entirely true. Sprites with PS 0.0 effects do take longer to render. I've done some tests and I've found that the engine can render on the order of about 2.5 times more sprites without effects before the framerate drops below the VSYNC rate.[/quote:5lejtpd5]
Hmmm, interesting. I assumed they just used a renderstate so they didn't affect performance. I never noticed a slowdown using many of them, but i'll take note of your test results, thanks Linkman.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Thu Oct 22, 2009 5:09 pm

Davioware - Thanks for you run down! It will definitely benefit me a lot!!:) As far as my cap goes, maybe a brief explanation is in place -- The body and legs are supposed to be different meshes so the legs can run forward while you aim around with the arms. So the three dots represents head and arms, basically ;) The subevents you show makes sense, it's a different way of thinking I need to get my head around!:) Thanks again, your tips are invaluable!

Thanks!
~Julmust
B
16
S
6
G
6
Posts: 100
Reputation: 4,840


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests