RPG movement

For questions about using Classic.

Post » Sat Sep 18, 2010 5:40 pm

Hello everyone,

i'm currently playing around with construct building the basic movement patterns for some sort of RPG prototype, in fact i'm trying to build a 2d prototype of an already existing 3d game but as the coders are bound to strict crunchtimes its hard to get moving in 3d, so to test basic gameplay features and develop vertains things i'd like to use construct.
Of course some things will change when moving to 3d, but basic stuff such as dialogues, shops, and riddles can still be planned in 2d.

So far so good, what i have is the basic 8 direction movement working with animations, i have some plateaus working so i collide with them the player stops.

As our 3d game is heavily based on a feeling of air, space, wind etc. jumping around on small plattforms is a huge part of the game. so what i have to be able to do is jump from one plateau down to another for example.

basicly the 8 directions movement doesn support jumping as the plattformer does. I tried pluggin in the plattformer movement as well but it didn't work out as the player is falling down to the next blocking sprite.

So what i need the jump to do is take the direction of the current movement and the current speed, then play some sort of jump animation (a sine or something, just a jump arc basicly). read the direction of the player out, toggle the collision of platforms to let the player pass through when standing in the right direction and if he jumps from a plateau not just move him horizontally but also move him down by X blocks (height of plateau).

here is a quick demo graphic, i for now am using simple zelda sprites, once the base works i can exchange them with our actual content


http://nonpublic.airborn-game.com/wip/neox/jump.png
link for full size

hope someone can help me

thanks in advance :)
B
3
G
2
Posts: 12
Reputation: 699

Post » Sat Sep 18, 2010 6:38 pm

RPG movement that allows for jumping is actually quite a complicated task because essentually you're dealing with 3d.

Anyway, heres is one way of getting it done:

http://dl.dropbox.com/u/939828/RPG%20Movement.cap

Basically, rather than using 8 direction movement, I used the 'custom movement' behaviour as it allows me greater control of what I collide with.

The plateau has a custom collision mask that represents the shape at the base of the plateau, which the little red object collides with.

Then I use some maths to simulate jumping and falling

Unfortuantly tho, the player is always rendered above the plateau, so you need to do some maths to determine when you need to change the z order of the player so is sometimes behind the platoe, and I'm out of time to help you further :(
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Sat Sep 18, 2010 6:38 pm

This thread might be relevant to your interests: viewtopic.php?f=4&t=7180
B
4
S
2
G
5
Posts: 641
Reputation: 3,011

Post » Sat Sep 18, 2010 7:17 pm

Here's a way to get the correct z ordering:
[code:1cvfo1zk]+ System: Always (every tick)
-> Sprite4: Send to front
-> Terrain: Set collision mode to Bounding box

+ Sprite4: Sprite4 overlaps Terrain
+ Sprite4: Value 'z' Less than Terrain.Value('z')
+ Sprite4: Y Less than Terrain.Y
-> Sprite4: Place behind of Terrain

+ System: Always (every tick)
-> Terrain: Set collision mode to Per Pixel
-> Sprite3: Place in front of Sprite4
[/code:1cvfo1zk]
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Sat Sep 18, 2010 11:21 pm

thanks guys for the fast backup!
i don't think sorting will be much of an issue as i right now am planning on doing it pretty much the same way zelda did with minish cap http://gotymedia.gamespy.com/2005/image ... ishcap.jpg i guess they added this border basicly because of removing the need for sorting the platforms

but the jumping part definitely gives me some good pointers, i already thought of another way of doing it, i will play around with both ways further

thanks again!
B
3
G
2
Posts: 12
Reputation: 699

Post » Sun Sep 19, 2010 2:07 pm

Hmmm are there any documents that go a bit deeper into custom movement? i found a very small text about it in the wiki, but thats pretty much it :?
B
3
G
2
Posts: 12
Reputation: 699

Post » Sun Sep 19, 2010 7:51 pm

Ok i have it pretty much working, and already stumbled in the next problems. :oops:
I feel really silly for asking that much of you guys as this tool is supposed to be very easy and i feel stupid for not getting along that much with it :?

I can jump now and tweaked to a more or less "realistic" scale, its more of a hop but works when in movement, i don't want the player to be able to jump like 5 meters high and 10 meters wide. So what he does right now is jump pretty much as highas he is, 16px high platforms or no problem, 32px high should be a problem.
But what happens right now is, i guess pretty much because of the lack of sorting and the needed smaller collision volume, is that the player can move way too far over the ledge of a surface.

But see your self:

http://nonpublic.airborn-game.com/wip/neox/jumping.exe


http://nonpublic.airborn-game.com/wip/neox/jump2.png


of course one sort of fix would be to stop the player from jumping, pretty much like nintendo removed it from zelda atfer the links awakening i guess. but i can't take the air out of airborn, jumping, height and a windy feeling is part of the world and even if its just a small 2d prototype to get some planning done for the 3d version, it should somehow work out. And i feel pretty bad for not finding a way on my own :?

The next issue is that i can't find a way to a: rotate the base like the 8direction behaviour does and b: then read that out to apply the according animations to the player sprite, i did this with the 8direction behaviour and i worked out really nice but i really have problems finding a way to do that with the custom movement behaviour.

I played aroudn a lot more with some of the other premade premade plugins, and i have to say so far its a great piece of software you created here, if only i'd just be a bit more technically oriented :oops:

-----------

Edit

hmmm just thinking as i don't have the need to sort the plateaus right, might it not be a more elegant/simple solution to just place some triggers around the plateaus rim, when on the trigger, looking in the right direction play some sort of generated animation that ignores the collision for the time of the animtion? so i don't have to care for depth based 3d fake solution?
So is there a way to play some sort of anim, moving the base dependent on the trigger, X units to the side and Y Units down? same would work with jumping "up" a plateau, just playing the anim ignoring the collision of the rim of a plateau for the time of the animation?
B
3
G
2
Posts: 12
Reputation: 699

Post » Mon Sep 20, 2010 11:06 pm

I would suggest you check the landing spot before the jump with an offset collision check. Then check if the landing plateau matches a height.

For example, you want to allow to jump down or up one level and no further. So upon the jump command the offset collision checks for the landing spot and if that plateau object has a "level" (or something) suitable to be jumped to, if not just discard the command and do not execute the jump.

No 3D, no sorting, no triggering, no border trickery. Just an integer level attribute for both plateaus and objects and bottom floor too (you could even assign 0=botomless pit or something).
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Tue Sep 21, 2010 7:14 am

there we come to the next problem, airborn takes place in a world of flying islands - so i don't only have to be able to jump into the world and then die or respawn or whatever, i need to be able to jump between two floating islands. but so far i'd be happy to get the basic jumping done, which i am right now a bit of clueless :(
B
3
G
2
Posts: 12
Reputation: 699


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests