Weld joints are buggy on 0.10.2 [SOLVED]

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
Chroteus
Citizen
Posts: 89
Joined: Wed Mar 20, 2013 7:30 pm

Weld joints are buggy on 0.10.2 [SOLVED]

Post by Chroteus »

EDIT: It seems it's a 0.10.2 specific bug, not OS-related bug.

I've found a quite peculiar bug that hopefully someone can help me with.

I have a level, made up of a bunch of rectangle bodies, joined by weld joints, and revolute joint in the middle. Weld joints are represented by red wiggly dots made very carefully in Paint :megagrin:.

Here's how it looks before level's physics are turned on:
no_physics.png
no_physics.png (433.86 KiB) Viewed 3662 times

Here's how it looks like after physics are turned on, on my Windows partition:
Untitled.png
Untitled.png (176.37 KiB) Viewed 3662 times

Here's how it looks on my Android tablet and my Arch partition:
Screenshot_2017-02-13-18-37-38.png
Screenshot_2017-02-13-18-37-38.png (488 KiB) Viewed 3662 times

As you can clearly see, the bodies on the edges collapse for some reason.
Last edited by Chroteus on Tue Feb 14, 2017 12:38 pm, edited 3 times in total.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Weld joints are buggy on 0.10.1 Linux/Android

Post by raidho36 »

That's queer, box2d has no platform-specific code. Can you post a minimal example that reproduces the problem?
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: Weld joints are buggy on 0.10.1 Linux/Android

Post by s-ol »

Also, can you print the dt's that go into world:update()?

You might be able to fix this by switching to a fixed-update love.run but if that's the case you will probably expose an underlying performance problem in your game.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
airstruck
Party member
Posts: 650
Joined: Thu Jun 04, 2015 7:11 pm
Location: Not being time thief.

Re: Weld joints are buggy on 0.10.1 Linux/Android

Post by airstruck »

That last screenshot looks like the sort of thing that might have happened before reference angle was added to the weld joint constructor. Are you 100% sure these screenshots are all from the same version of Love?
User avatar
Chroteus
Citizen
Posts: 89
Joined: Wed Mar 20, 2013 7:30 pm

Re: Weld joints are buggy on 0.10.1 Linux/Android

Post by Chroteus »

airstruck wrote: Mon Feb 13, 2017 7:54 pm That last screenshot looks like the sort of thing that might have happened before reference angle was added to the weld joint constructor. Are you 100% sure these screenshots are all from the same version of Love?
That seems to be the cause. My Linux and Android version of Love was 0.10.2, which I did not notice. Now that I've upgraded Love on my Windows, same bug happens. I'll see if I can reproduce bug with a standalone simple program. Perhaps, it's just my game.

I misunderstood. It's not a bug. It's just that the angle of 0 rad is enforced between two bodies now (default values). Here's how my Weld joint initialization looks like now:

(anchor's positions are repeated, since I connect bodies in one point)

Code: Select all

joint = love.physics.newWeldJoint(bodies[1],bodies[2], x,y,x,y, false, bodies[2]:getAngle()-bodies[1]:getAngle())
Thanks for the tip, airstruck.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot] and 5 guests