Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Character movement & physics  (Read 3238 times)

0 Members and 1 Guest are viewing this topic.

hayer

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Character movement & physics
« on: September 20, 2013, 12:27:25 am »
Hi,

I'm in the progress of making a 2d multiplayer platformer. So the question is; how do I get some smooth movement for my actors? Right now I'm using Box2d, but it is very.. "cluncky" and "sloppy". I want more have more control over it. It feels like it takes like hours to just change the maximum movespeed. And that is after I've written nearly 800 lines of "special physics rules" just for the player actor.

So, any tips on what to do? Do I roll my own? Do I change to something like chipmunk?



And yes, I need physics -- if I remove it, it will take too much of the game experience away.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Character movement & physics
« Reply #1 on: September 20, 2013, 04:17:25 am »
Quote
And yes, I need physics -- if I remove it, it will take too much of the game experience away.

Are you sure you really need a full blown physics engine? Or if all your after is collision detection (running, jumping, falling, colliding into walls, basic platformer stuff) you might want to consider implementing your own system.

Quote
Right now I'm using Box2d, but it is very.. "cluncky" and "sloppy". I want more have more control over it. It feels like it takes like hours to just change the maximum movespeed.

Sounds like you need to adjust the velocity that your applying to your character. Yes getting it fine tuned can take some work, but I have never experienced Box2D feeling clunky.

Quote
And that is after I've written nearly 800 lines of "special physics rules" just for the player actor

I'm not a Box2D guru, but I think you should show some of this code. As far as I know in Box2D you can define collision callbacks, adjust speed, velocity, and other properties, but I never heard of writing "physics rules". Unless your talking about callbacks that determine if objects collide or pass through each other which would not make your player feel clunky.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

hayer

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: Character movement & physics
« Reply #2 on: September 20, 2013, 11:38:45 am »
Quote
Are you sure you really need a full blown physics engine? Or if all your after is collision detection (running, jumping, falling, colliding into walls, basic platformer stuff) you might want to consider implementing your own system.

Yes, I do. As I also needs barrels rolling, explosions, walls to destroy - Removing this will take away too much from the game. I've already prototyped out explosions, walls that fall apart, the only thing I can't get right is the player movement.

Quote
Sounds like you need to adjust the velocity that your applying to your character. Yes getting it fine tuned can take some work, but I have never experienced Box2D feeling clunky.
Yea, was late last night. Clunky isn't the right word.

Tigre Pablito

  • Full Member
  • ***
  • Posts: 226
    • View Profile
    • Email
Re: Character movement & physics
« Reply #3 on: September 20, 2013, 09:45:46 pm »
Hello

you need that your character can gain speed gradually, and brake, and jump with parabollic effect, and fall, etc?  like Mario and Sonic?

in my poor Sonic, i already programmed that ... a little tedious ... but it s nice when you succeed

if it s this, then i can give you here the code fragments (i use C#)

Pablo