[SOLVED]: Retro pixel-quantized platform engine using loops

Get help using Construct 2

Post » Wed Apr 29, 2015 8:30 pm

@Magistross :S hmm not with smaller xSpeed values. I may have to rethink this, damn

@BACLog sounds interesting! I'm not sure how to implement this in the engine's current form
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Post » Thu Apr 30, 2015 10:18 am

Fixed this by making the player's bounding box shorter and adding a head collider, so you can't jump and wiggle if you have a wall right above your head

Here's the CAPX
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Post » Thu Apr 30, 2015 11:42 am

@christina : ah true! I thought you could - well, I haven't been using c2 for a while, sorry ;)
B
79
S
22
G
4
Posts: 311
Reputation: 12,774

Post » Thu Apr 30, 2015 7:11 pm

No problem @Valerien. Loops seem the only way to get C2 to do what we need for a proper retro engine.

It's ready!! Please playtest it and tell me what you think. I added jump-through platforms, and everything is behaving great! @Ashley a RetroPlatform behavior like this would really serve everyone who tries to work in low resolutions and doesn't need slope detection but does need super-tight retro platformer controls.

Image

CAPX
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Post » Fri May 01, 2015 9:16 am

@christina isn't it framerate dependent though? You can create super tight controls with floating point values as well, and use pixel rounding to only render at integer positions. All in all, we're only speaking of an error margin of +/- 0.5 px. I don't see a case where you'd absolutely need corridors that are of the exact size of the character's collider. And I highly doubt that any modern pixel art game uses such an approach - raycasting, captors or C2's collision polys work just very well.

No offense meant though, you achieved a nice demo! Congrats :)
B
79
S
22
G
4
Posts: 311
Reputation: 12,774

Post » Fri May 01, 2015 9:20 am

@Valerien at such small sizes, where a character is 16x16px (or an even cooler 8x8), you absolutely can't rely on +/-0.5px

Why would you call it framerate dependent? It clearly isn't, dt is taken into account during the loop. Check it yourself by making the timescale = 0
I'm not ignoring C2's collision polys, I'm using them.

Also, I'd like to see a movement with pixel rounding using the default platform behavior. Can you show me?
All my experiments result in jerky movement


By the way the main fix of this engine is the platform behavior's floor gap problem. There's hacky solutions to it, like spawning a wall in front of you, but they don't always work and have problems with corners.
In this custom engine there's no code to make you "climb" back on a platform if you're already falling, and there is some code to make sure that you fall no matter how small the gap is, before drawing. And integer positions make sure that there won't be a +/- 0.5 pixels obstructing your fall
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Post » Fri May 01, 2015 11:03 am

Yes it's true, that error margin does matter. Sorry, I wrote back before testing!

In this custom engine there's no code to make you "climb" back on a platform if you're already falling, and there is some code to make sure that you fall no matter how small the gap is, before drawing. And integer positions make sure that there won't be a +/- 0.5 pixels obstructing your fall


It's true, though what I meant is that when you design a platformer, you don't absolutely have to make the character the exact size of one of your tilemap's cell. So I doubt that Ashley will add a unique behavior for this specific kind of game.
B
79
S
22
G
4
Posts: 311
Reputation: 12,774

Post » Fri May 01, 2015 11:46 am

Well, even well-designed platformers with plenty of space between the gaps have this problem. A 10-pixel sprite clearing a 16-pixel gap is not minor, it's a big headache.

Have a look:
how-do-i-fall-between-blocks_t125214?&hilit=platform+gaps

My engine removes guesswork, that's all. I'd be very happy if you could find a way to do the exact same without using loops. Please feel free to try
B
28
S
12
G
4
Posts: 193
Reputation: 4,581

Post » Fri May 01, 2015 1:45 pm

christina wrote:Well, even well-designed platformers with plenty of space between the gaps have this problem. A 10-pixel sprite clearing a 16-pixel gap is not minor, it's a big headache.

Have a look:
how-do-i-fall-between-blocks_t125214?&hilit=platform+gaps

My engine removes guesswork, that's all. I'd be very happy if you could find a way to do the exact same without using loops. Please feel free to try



I solved it in my game by adding in an event that checks if the player is overlapping the tilemap at two offsets (left and right) and is not on the floor, if this proves true then the player falls down. I saw something very similar in your .capx but it used a separate sprite object.

I swear to god though, I was looking at your thread last night :D


IMHO @R0j0hound should take a look at the Platformer behaviour and just eliminate the lines that contain slope detect and save it a "Retro Platformer", as it would solve the problem completely.

You should make a Behaviour similar to Platformer that eliminates the slope detection.
The moderators are corrupt and ban for no reason, especially that condescending neckbeard asshole Kyatric. The forums are filled with fanboys.
Banned User
B
22
S
7
G
1
Posts: 558
Reputation: 2,925

Post » Sun Jun 04, 2017 8:40 pm

@christina do you still have the file? seems like Dropbox deleted it :(
B
13
S
4
Posts: 22
Reputation: 1,146

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, ItsAstro, kellehk and 39 guests