[BEHAVIOR] Sonic Physics

Post your work in progress addons and get feedback

Post » Sat Mar 12, 2016 8:56 am

@pixelmonkey fancy trying a Mario behaviour? 😄 Nothing could be as tricky as sonic but would be fun to have cape Mario/floating Mario/mini and super Mario switchable movements
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,253

Post » Sat Mar 12, 2016 11:19 am

@TheAmazingApple:
I think I'm following a bit more clearly. Sounds like an existing issue that I've been trying to redo the angle system for regardless, so hopefully when I fix the issue I know of it'll fix yours by extension. The behaviour doesn't cope well yet with more complex surfaces and intersections between multiple angled sprites, since it currently all boils down to choosing a single segment to stick to, which doesn't always act as you'd expect it to. Working on this has given me a fair bit of insight as to how complicated this can get, even if not yet how to actually make it work, haha.

@Zebbi
Actually, I'm pretty sure the standard Platform behaviour could get you a close match to Mario physics via events. I'm not as familiar with the Mario games as I am with Sonic, so there could be some subtleties that'd need to be mimicked, but sounds to me like it'd be more waiting on someone to make a capx than a behaviour. I do recall briefly looking for a Mario equivalent to the Sonic Physics Guide a while back, though, but I didn't have any luck. Anyone know if something along those lines exists?
B
74
S
27
G
12
Posts: 126
Reputation: 11,738

Post » Sat Mar 12, 2016 2:42 pm

Ok.

Anyways, the Sonic Engine thing is going somewhat great so far. I got to add the elemental shields from Sonic 3. I also added spikes into the game. When a playable demo is released, I will credit you for making the Sonic Physics addon.

Well, it's time for me to listen to Never Gonna Give You Up by Rick Astley on loop for 24 hours while I stare at an image of Thomas The Tank Engine running over a teenager.
B
28
S
10
Posts: 7
Reputation: 2,136

Post » Sun Mar 13, 2016 11:12 am

Im looking forward to trying this out thanks :)
B
10
S
2
G
1
Posts: 23
Reputation: 693

Post » Sun Mar 13, 2016 10:28 pm

Message: Poxnixles can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
PixelMonkey wrote:You'll want basically just:
Sonic: On collision with Bumper:
-Set Vector X to 420 * cos(angle(Bumper.X, Bumper.Y, Sonic.X, Sonic.Y))
-Set Vector Y to 420 * sin(angle(Bumper.X, Bumper.Y, Sonic.X, Sonic.Y))
The http://info.sonicretro.org/Sonic_Physics_Guide Sonic Physics Guide, particularly the Springs and Things page, gives some more numbers and info, but you'll want to update most values from pixels per frame to pixels per second.

^ That said, though, I tried it out myself, and I've recreated TheAmazingApple's bug in the process. Unless you're holding down the jump button, it caps your speed to Min Jump Strength. So the above example events currently won't work unless the jump button is being held down.
If you wanted a really hacky workaround, you could simulate jump button under certain conditions to stop the behaviour from limiting the jump, but I realize that's pretty terrible.

This has been a big help for quite a few things on what I'm working with, thanks!

Anybody in this thread experienced with making online games in Construct? My project's aiming to have online co-op with a lot derived from this Sonic Physics behavior. Seems like one of the tougher things could be camera focusing on individual players.
B
8
S
1
Posts: 58
Reputation: 570

Post » Mon Apr 18, 2016 12:37 am

I discovered another minor problem. The double jump option doesn't work. You should fix that.
B
28
S
10
Posts: 7
Reputation: 2,136

Post » Mon Apr 18, 2016 4:07 am

@TheAmazingApple
I believe that's on the todo list, but noted, thank you. Worth clarifying, though, that I've deliberately removed the double jump functionality for the sake of not filling the properties section with more than is necessary, since double jump functionality is fairly straightforward to implement. I see that I missed the actions/conditions related to that, though, and I assume that's what you're referring to?
B
74
S
27
G
12
Posts: 126
Reputation: 11,738

Post » Sat Apr 23, 2016 1:54 am

The only action/condition related to the double jump is "set double jump" and "is double jump enabled", (the set double jump doesn't work. I haven't tried out the "is double jump enabled" event, though.)



P.S you should also add a "On roll" animation trigger as I am trying to add the rolling sound effect when Sonic, well, rolls.
B
28
S
10
Posts: 7
Reputation: 2,136

Post » Sun Apr 24, 2016 12:49 am

This is great, I'm using this for my project but I have a question, how can I detect collisions and simulate jumping?
B
15
S
6
G
3
Posts: 11
Reputation: 2,707

Post » Sun Apr 24, 2016 6:42 am

@patchester
As far as I know, the behaviour shouldn't really change the way either of those things work in comparison to the Platform behaviour. The standard events for collisions and overlaps should still trigger under the same circumstances, and if you have a "is key down" condition followed by the "simulate control: jump" action, that should mimic the default controls.
B
74
S
27
G
12
Posts: 126
Reputation: 11,738

PreviousNext

Return to Work in Progress Addons

Who is online

Users browsing this forum: No registered users and 0 guests