Physics help request! [Gorewörm]

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
IndieLöver
Prole
Posts: 29
Joined: Mon Jun 10, 2013 8:49 am

Physics help request! [Gorewörm]

Post by IndieLöver »

Hi,

I've been working on a project called Gorewörm - a fighting game where each player controls a wörm, trying to eat the other players while avoiding their heads. Each wörm will have their own special abilities and passives and stuff.. neat, huh?

Then I realized that what the game needed was physics, and I desided to use the Löve's physics system. Because of this dramatic change I started recoding the whole game. This is what I have at the moment:
Gorewörm.love
(6.24 KiB) Downloaded 99 times
Controls:
w / up to accelerate
a & d / left & right to rotate head
q to cut the other worm (debug)
e for screenshake (moar debug)
Also, try changing the window size!

There are a number of issues with it.

1) After you boost forward, the body whips around. Put some inertia in maybe? How?

2) Physics are inaccurate, resulting in wörms getting stuck at themselves, I know setMeter is the solution, I'm just not sure what the correct value would be.

3) setting vsync off affects physics, even though I'm using deltatime. Workaround?

I know it doesn't have graphics at the moment, my friend is working on it :awesome:
The old version had pixel art by me, but it looked kinda terrible. And it isn't anywhere near finished, I've just been working on the new build for maybe a week, while still doing a lot of other stuff.

Once I get these things fixed and there are graphics and I put all the gamey stuff in I'll post a demo here.
Thanks :)
User avatar
rmcode
Party member
Posts: 454
Joined: Tue Jul 15, 2014 12:04 pm
Location: Germany
Contact:

Re: Physics help request! [Gorewörm]

Post by rmcode »

While I can't answer your questions I found it a bit odd that there is gravity.

Maybe a top-down approach would feel more natural?
User avatar
Azhukar
Party member
Posts: 478
Joined: Fri Oct 26, 2012 11:54 am

Re: Physics help request! [Gorewörm]

Post by Azhukar »

IndieLöver wrote:1) After you boost forward, the body whips around. Put some inertia in maybe? How?
You're applying force only to the first segment, which causes the whip motion. Spread the force over each segment equally.
IndieLöver wrote:2) Physics are inaccurate, resulting in wörms getting stuck at themselves, I know setMeter is the solution, I'm just not sure what the correct value would be.
This is where you need to experiment, I usually start with meter the size of my smallest object and work around that.
IndieLöver wrote:3) setting vsync off affects physics, even though I'm using deltatime. Workaround?
Use a fixed time step for physics update and do as many updates as are currently needed to catch up. I.e. use 1/60 as deltatime, keep track of how much time has passed for your simulation and call physics update until you run out of time or up until x times so you prevent a death spiral (updates taking longer than deltatime resulting in an infinite loop).
User avatar
IndieLöver
Prole
Posts: 29
Joined: Mon Jun 10, 2013 8:49 am

Re: Physics help request! [Gorewörm]

Post by IndieLöver »

rmcode wrote: Maybe a top-down approach would feel more natural?
Well, it will have different terrain, like water, air and ground and they all affect the worm gravity.

Many thanks @Azhukar, the whip motion fix was so obvious! :)
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 2 guests