2.5D platform

Forum for plugin, effect and behavior programmers. Please use the Help & Support forum for help using Construct.

Post » Wed Nov 11, 2009 10:42 pm

Okay, I finally have some time to get this done (2.5D platform plugin, for RPGs, brawlers and whatnot).

EDIT: The latest demo will always be at [url:v27yzlmt]http://octavoarte.cl/25d_concept.exe[/url:v27yzlmt] while I'm working on this.

Since this time is limited to about a month TOTAL, I figure I'd better throw ideas and get feedback right before even starting.

My first idea would work something like this:
[list:v27yzlmt]
[*:v27yzlmt]Everything (with the behavior) is a cylindrical platform with a sloped top. This means players could stand on top of each other if desired.[/*:m:v27yzlmt]
[*:v27yzlmt]The top has the same profile as the base (regardless of slope) and profile needs to be specified separately (Feedback here: separate objects? frames? collision mask?).[/*:m:v27yzlmt]
[*:v27yzlmt]Everything on top of something stays there unless moved, regardless of slope.[/*:m:v27yzlmt][/list:u:v27yzlmt]

I've settled on the following attributes:
[list:v27yzlmt]
[*:v27yzlmt]W=faux height[/*:m:v27yzlmt]
[*:v27yzlmt]RY=real y.[/*:m:v27yzlmt]
[*:v27yzlmt]RX=real x.[/*:m:v27yzlmt]
[*:v27yzlmt]DyDt=real y speed.[/*:m:v27yzlmt]
[*:v27yzlmt]DxDt=real x speed.[/*:m:v27yzlmt]
[*:v27yzlmt]DwDt=w speed.[/*:m:v27yzlmt]
[*:v27yzlmt]DwDx=top slope on real x[/*:m:v27yzlmt]
[*:v27yzlmt]DwDy=top slope on real y[/*:m:v27yzlmt]
[*:v27yzlmt]T=W Climbing Threshold, for stairs and such.[/*:m:v27yzlmt]
[*:v27yzlmt]WY= offset on Y for each unit of W[/*:m:v27yzlmt]
[*:v27yzlmt]WX= offset on X for each unit of W[/*:m:v27yzlmt]
[*:v27yzlmt]Ignore collision= toggles whether the object will react to collision or its absence.[/*:m:v27yzlmt]
[*:v27yzlmt]Player= sets the player that controls this object.[/*:m:v27yzlmt]
[*:v27yzlmt]Unmovable= toggles whether the object is controlled by a player (Feedback: is this needed?)[/*:m:v27yzlmt][/list:u:v27yzlmt]

Collision would be as follows:
IF platform profiles collide at equal W AND platforms sprite collide, THEN platforms are colliding.

Movement would be as follows:
[list:v27yzlmt]
[*:v27yzlmt]Y=RY+(WY*W)[/*:m:v27yzlmt]
[*:v27yzlmt]X=RX+(WX*W)[/*:m:v27yzlmt]
[*:v27yzlmt]Falling modifies W only.[/*:m:v27yzlmt]
[*:v27yzlmt]Sprites are sorted according to RY and its sign.[/*:m:v27yzlmt]
[*:v27yzlmt]On collision, an object is placed on top of another object only if doing so doesn't move the object more than T. Otherwise it gets pushed out in the angle of its speed. If speed is 0, nothing happens. Height is determined by measuring the distance between the profile aligned at the bottom and at the top of the sprite.[/*:m:v27yzlmt][/list:u:v27yzlmt]

Expressions would be as follows:
[list:v27yzlmt]
[*:v27yzlmt]Is above[/*:m:v27yzlmt]
[*:v27yzlmt]Is below[/*:m:v27yzlmt]
[*:v27yzlmt]Is falling[/*:m:v27yzlmt]
[*:v27yzlmt]is on top of[/*:m:v27yzlmt]
[*:v27yzlmt]get (any) attribute[/*:m:v27yzlmt][/list:u:v27yzlmt]

Actions would be as follows:
[list:v27yzlmt]
[*:v27yzlmt]Set position to (real x, real y,w)[/*:m:v27yzlmt]
[*:v27yzlmt]get/set attributes[/*:m:v27yzlmt][/list:u:v27yzlmt]

[u:v27yzlmt]So far the only undecided issues are:[/u:v27yzlmt]
[list:v27yzlmt]
[*:v27yzlmt]Profile storage. Where to store the profile image for a platform?[/*:m:v27yzlmt]
[*:v27yzlmt]Are slopes necessary? They could bring issues in the math for movement.[/*:m:v27yzlmt]
[*:v27yzlmt]Controls by multiple players. I don't know how this works. Is a separate toggle needed for objects that are not player-controlled?[/*:m:v27yzlmt][/list:u:v27yzlmt]

Feedback and implementation tips are very welcome! This will be my first plugin, only done fx so far.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Nov 12, 2009 9:28 am

What about z displays? Like if player goes behind an obstacle.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Thu Nov 12, 2009 5:07 pm

object_depth = -object_x

:P
B
2
S
1
G
3
Posts: 193
Reputation: 1,486

Post » Thu Nov 12, 2009 5:49 pm

Very cool Madster, can't wait.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Thu Nov 12, 2009 7:28 pm

[quote="Madster":8k37x5x0]
[*]Are slopes necessary? They could bring issues in the math for movement.[/quote:8k37x5x0]Maybe they could be turned off?
B
14
S
2
G
5
Posts: 37
Reputation: 2,777

Post » Thu Nov 12, 2009 7:36 pm

Well distort maps are tilable now. I haven't checked but it might be possible to use the z heights for slopes. Course you cant get collision detection from that, but would it actually be needed?
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767

Post » Thu Nov 12, 2009 8:24 pm

[quote="newt":2x3t864y] I haven't checked but it might be possible to use the z heights for slopes. Course you cant get collision detection from that, but would it actually be needed?[/quote:2x3t864y] Yes, collision detection would be needed. And z height for slopes isn't a very good idea. No one should be forced to use z height.

And Madster, I'd like a bit more clarification on what exactly your plugin does. Are we talking battletoads style 2.5d, or isometric platforming? You didn't really explain. :mrgreen:
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Thu Nov 12, 2009 11:26 pm

[quote="Davioware":1o63ynsi]Are we talking battletoads style 2.5d, or isometric platforming? You didn't really explain. :mrgreen:[/quote:1o63ynsi]

True, I didn't. This should cover both, as the difference between them (AFAIK) is just the controls and shape of the platforms. Also, there's control over how height is represented, so you could adapt to many styles.

No, there are no plans to involve z or distort maps. This is not 3D, it's 2.5D as seen in Golden Axe, Cadillacs & Dinosaurs, Final Fantasy III (american) and other 2D games that allowed you to walk in 8 directions and also jump on top of stuff.

To turn off slope you'd just leave the default 0 values for dwdx and dwdy. Slopes are useful for marble-madness type games and any others that may need sloped platforms. (most 2.5D games have only flat planes).
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Wed Dec 16, 2009 11:51 pm

I've been scouring the nets for info on how other games do it.
Has anyone any kind of reference?
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Dec 17, 2009 7:08 pm

So this came up while chatting... I'll write it down for later when I can work on this thing.

Collisions: use the mask editor to create a mask for the base of the object. Objects are assumed cylinders, so the same mask is used for both top and base, only displaced by a new object_height parameter.

Hotspot: the hotspot would be the measured position of the object in the base plane. This would be the point used for setting height according to slope.

W versus height: when setting W, you'd be setting the faux-vertical distance from the zero plane to the base of the object. When setting height, you'd be setting the faux-vertical distance from the base of the object to its top.

Slopes: With all of the prior, height in a slope is calculated around the hotspot, displaced by w and height, using dwdx and dwdy and the w-displaced hotspot of the object on top.

wheeee! sounds doable now!
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Next

Return to Construct engineering

Who is online

Users browsing this forum: No registered users and 0 guests