Some questions on efficiency on making platformer

For questions about using Classic.

Post » Fri May 25, 2012 11:44 pm

Hey guys!

Making a new custom platformer movement from scratch. Want to have this nailed down, BUT ALSO want it to be able to have multiple instances of said player. Maybe as many as about 50? I made a movement before, but doing detection and stuff (doing code to prevent the characters clipping through smallish floors and walls) created a performance drop (from 60fps to about 25) when about 20 characters were around (standing idle D: didn't do a good job with efficiency hah) It's definitely the code that lagged the game, so I have a few questions.

1) Where should the events go? I always do them in the event sheet for a layout, never really gone into other things.

2) How would I efficiently detect floors and walls? I use a main collision sensor which is contained with smaller sensors that are paired up with the main sensor, in which detects the floor below, walls, ect. Is there a command I don't know of that could help me here or lower usage of sprites or anything? Or does it not matter? :P

3) How would one go about slopes? Slopes (45 degree at most) are my mortal enemy, I find them a bugger to code. Best method I've made includes placing a hidden sprite over each and every slope in the stage that uses loops to stick the character to the ground (In my old example, if about 5 characters stood on a slope, the framerate would drop :[ ) High speeds worked well with this method usually. (Other methods, when a character moves at 15 pixels per tick, it wouldn't detect the slope and the character would go flying.)

4) Random other question not regarding platformer stuff, is there a way to make rope physics with the physics behaviour? Nothing fancy, don't need pixel perfect collision with the rope, but just a dangly line that I could use to make a light (the light would be connected to the end of the rope and when the light is hit, it bounces around and stuff, just a nice effect I would like ^.^ )

Man, sorry for writing an novel of a post, but any answers are greatly appreciated.! Jase002012-05-25 23:49:19
B
45
S
19
G
10
Posts: 562
Reputation: 9,543

Post » Sat May 26, 2012 7:25 am

When organizing events and event sheets, i tend to have each layout just include individual sheets, and create for example one for input, movement, collision, animations, etc
and then when the layout starts just have it load whichever sheets needed,
so each sheet affects every layout that uses it, and you only have to edit that one sheet. within sheets and layouts it's good to organize with colored comments and groups. - i dont know if that was the kind of tips you were looking for.

as for collision, i personally have some nuances with it, but i use the sprite.left/right/top/bottom/x/y expressions instead of sensor srites, in order to detect it.

hope some of that helps
B
6
S
1
G
1
Posts: 52
Reputation: 858

Post » Sat May 26, 2012 10:18 pm

[QUOTE=superpowerjoe] When organizing events and event sheets, i tend to have each layout just include individual sheets, and create for example one for input, movement, collision, animations, etc
and then when the layout starts just have it load whichever sheets needed,
so each sheet affects every layout that uses it, and you only have to edit that one sheet. within sheets and layouts it's good to organize with colored comments and groups. - i dont know if that was the kind of tips you were looking for.

as for collision, i personally have some nuances with it, but i use the sprite.left/right/top/bottom/x/y expressions instead of sensor srites, in order to detect it.

hope some of that helps[/QUOTE]

Hey man, thanks for the reply ^.^

Those tips were useful. How would I got about loading multiple event sheets in a single layout? (I just tried hunting around the forums using the search tool but failed pretty badly)
EDIT: Found a wiki and figured this out ;o

The Sprite.left and stuff seems efficient, but, - is there a way to detect if certain coordinates is overlapping another sprite? ;o

Thanks :)Jase002012-05-26 22:37:24
B
45
S
19
G
10
Posts: 562
Reputation: 9,543

Post » Sun May 27, 2012 11:31 pm

I really would love an answer for question 2, as I can't progress with my engine until I decide the routines on collision. I don't expect anyone to hold the answer, but maybe past experiences using different methods and how they turned out ;o :)
B
45
S
19
G
10
Posts: 562
Reputation: 9,543


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests