Lerp Development Thread


benjymous said:
Yeah - I have a feeling it's that the force I'm applying to the player character to make it move is also getting applied to the gear, rather than the player character pushing against the gear. Oddly I've seen it working properly when standing on non-pivoted surfaces, so there may just be something odd in the gear setup
Wouldn't it make more sense to add something like invisible "wheels" to the character? Because if you only apply impulses to the actual character body, it is physically impossible to make the gears behave the correct way ("the correct way" being that you get a "treadmill effect"). You have to simulate walking somehow, where a force is applied backwards to make the character move forwards (Newton's third law).

Just my 0.02€
 
Last edited by a moderator:
dflemstr said:
Wouldn't it make more sense to add something like invisible "wheels" to the character?

Yeah, I've been considering doing something like that - I've only just got box2d's joints system integrated nicely into my engine, so I haven't had any better way to get him to move before. For something that's primarily designed for games, you'd have thought they'd have built in something to have a simple user controlled player sprite, but it seems there's no straightforward ("proper") way.

Also I'll have to find a way to make the wheels work without him zooming uncontrollably around the level like a cat on rollerskates!!
 
Last edited by a moderator:
benjymous said:
dflemstr said:
Wouldn't it make more sense to add something like invisible "wheels" to the character?

Yeah, I've been considering doing something like that - I've only just got box2d's joints system integrated nicely into my engine, so I haven't had any better way to get him to move before. For something that's primarily designed for games, you'd have thought they'd have built in something to have a simple user controlled player sprite, but it seems there's no straightforward ("proper") way.

Also I'll have to find a way to make the wheels work without him zooming uncontrollably around the level like a cat on rollerskates!!
Well, for games with aligned characters (you know, that aren't supposed to be knocked over/rotate), I always tend to write my own physics engine just because it's so damn difficult to make an existing physics engine obey your rules. For example, what if you wanted to add ladder climbing to your game; how would you do that with Box2D? The number of workarounds required is quite astounding.

My tips to you, if you want to stay with Box2D, would be to
1. lock the rotation of the main character while (s)he walks; it looks like you're using impulses to stabilize the character at the moment, which breaks contact with the floor etc. But for all I know, you might already be doing this; it's hard to tell from the videos.
2. increase the mass of the character, or alternatively to increase the friction coefficients, to make it stick to the floor more easily
3. add a wheel system, with one wheel (if you lock the rotation, that's not a problem) to move the character
4. don't accelerate the wheel, but rather control its rotation speed manually.
 
Last edited by a moderator:
^ Whilst I have never forgotten about this I share you excitement.

Very cool concept. Puzzle games are my thing and the Pandora will make a superb venue.

May I encourage you, benjymous, to lock yourself in a darkened room and only emerge once Lerp has matured to a thing of beautiful.
 
Back
Top