Loveballs, A love2d Softbody lib

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: Loveballs, A love2d Softbody lib

Post by ArchAngel075 »

I actually wonder if passing a polygon (series of points) then having the constructor iterate and project points along the polygon perimeter would work. though depends on the way it tessellates maybe?

Ill play around, is there some way to attain your wip arbitrary shapes version for fiddling, so that I can make sure i fiddle in features that would be valid for both circles and polygons?

Otherwise ill work on my own constructor etc and see if i can perhaps produce a good outcome..
Connorses
Citizen
Posts: 63
Joined: Fri Sep 06, 2013 7:02 am

Re: Loveballs, A love2d Softbody lib

Post by Connorses »

I'VE DONE IT
I DON'T KNOW HOW, BUT I'VE DONE IT
I'VE BLATANTLY COPIED THE MECHANICS OF SOMEBODY ELSE'S STUFF

...Seriously, though, I would love to make my own unique game based on these platforming mechanics. They're fun.

IndieRetro
Citizen
Posts: 51
Joined: Mon Apr 15, 2013 8:21 pm
Contact:

Re: Loveballs, A love2d Softbody lib

Post by IndieRetro »

ArchAngel075 wrote:I actually wonder if passing a polygon (series of points) then having the constructor iterate and project points along the polygon perimeter would work. though depends on the way it tessellates maybe?

Ill play around, is there some way to attain your wip arbitrary shapes version for fiddling, so that I can make sure i fiddle in features that would be valid for both circles and polygons?

Otherwise ill work on my own constructor etc and see if i can perhaps produce a good outcome..
I'll be putting the arbitrary one on github soon enough, I'll let you know when I do ^^
Connorses wrote:I'VE DONE IT
I DON'T KNOW HOW, BUT I'VE DONE IT
I'VE BLATANTLY COPIED THE MECHANICS OF SOMEBODY ELSE'S STUFF

...Seriously, though, I would love to make my own unique game based on these platforming mechanics. They're fun.
Looking great! Would be awesome to see a complete game using this :D
irc.freenode.org ##oodnet
http://exez.in/
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: Loveballs, A love2d Softbody lib

Post by ArchAngel075 »

i am resisting the urge to link a AMVHell snippet of sticky-sticky-sticky ehem...

Oh about the arbitrary shapes, im working with your current release to see if i can make a constructor that takes any polygon and spits out a node table...
IndieRetro
Citizen
Posts: 51
Joined: Mon Apr 15, 2013 8:21 pm
Contact:

Re: Loveballs, A love2d Softbody lib

Post by IndieRetro »

Awesome ^^

This is coming along pretty well, really only a few small bugs left to fix.

irc.freenode.org ##oodnet
http://exez.in/
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: Loveballs, A love2d Softbody lib

Post by ArchAngel075 »

I attempted the arbitrary shapes as well! :
[github fork below]


Fork :
arbitraryShapes Fork

Fun fact, my constructor has a *small* issue with node placement.
When creating the nodes' position there is a annoying case where the last node between any two lines will be awkwardly offset.
I am aware of whats the cause but unsure how to combat it, though i saw in your example you have no such issue with node placement...

Also if you notice that the one shape is concave and renders incorrectly. Seems that the tessellation isn't happy with concave shapes.
The moment i edit to make it convex it draws perfectly.

Anyhow, im going to now fiddle with raytracing and my setRadius again so that teleportation through bodies doesn't occur perhaps...
If it works out ill fork it personally
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: Loveballs, A love2d Softbody lib

Post by ArchAngel075 »

apologies for double post, but i think the post topic is valid enough?

third branch from my fork now shows setRadius feature fully functioning and FAR less buggy than my original github attempt

features :
1. Used shorefire master branch latest as the base, so its more likely to fit into newer shorefire master branch builds..

2. conserves physics data between changes, the center body/shape/fixture is not modified except for a radius change on the centerShape
This means a falling softbody wil continue to fall smoothly while changing radius. Previously the softbody would freeze in mid air during rapid changes.

3. raytraces now ensure absolutely 0 clipping (except one rare, unavoidable case)
A trace between the centerShape and node position gets the first/closest fixture to contact and instead places the node there.
The node raytrace is separated from actual node creation, it is possible (not yet added/didnt bother) to make a softbody insist on not using ray tracing for node placement (comment one line and you disable it completely)

5. Somehow i have less of a hit to performance than before, so in other words. This version is around 5fps faster...

EDIT :

Sadly there is one major bug :
The nodes repositioned by a raytrace lock their distance joint to THAT repositioned point, fixed by setting the "would be/unpositioned" point as where the distance joint connects and creating the body at the repositioned point.

Another fix is to create at unpositioned point and then use a setPosition() call to reposition after the joint is made. But this can and will result in clipping.

Lastly a bug/issue is setRadius() for circlesShapes doesnt do anything if the circleShape is used by a fixture. no workarounds other than destroy/recreating circleShape though this causes wierdness.

branch setRadius
Connorses
Citizen
Posts: 63
Joined: Fri Sep 06, 2013 7:02 am

Re: Loveballs, A love2d Softbody lib

Post by Connorses »

I think I noticed the same drawing bug with the circular soft bodies as well. It's possible to squish them inward so that they become concave, and the polygon border draws over the concave spot.
IndieRetro
Citizen
Posts: 51
Joined: Mon Apr 15, 2013 8:21 pm
Contact:

Re: Loveballs, A love2d Softbody lib

Post by IndieRetro »

ArchAngel075 wrote:I attempted the arbitrary shapes as well! :
[github fork below]


Fork :
arbitraryShapes Fork

Fun fact, my constructor has a *small* issue with node placement.
When creating the nodes' position there is a annoying case where the last node between any two lines will be awkwardly offset.
I am aware of whats the cause but unsure how to combat it, though i saw in your example you have no such issue with node placement...

Also if you notice that the one shape is concave and renders incorrectly. Seems that the tessellation isn't happy with concave shapes.
The moment i edit to make it convex it draws perfectly.

Anyhow, im going to now fiddle with raytracing and my setRadius again so that teleportation through bodies doesn't occur perhaps...
If it works out ill fork it personally
It's looking pretty good! One thing I think you should change, you've got both of the distanceJoint anchors at the position of the outerNode. This works fine for circles, but with arbitrary shapes it bugs out like insane, I found setting one anchor point on the center and the other on the node works much better.

Here's the latest video, half way through I draw the softbodies at runtime and create them.


Connorses wrote:I think I noticed the same drawing bug with the circular soft bodies as well. It's possible to squish them inward so that they become concave, and the polygon border draws over the concave spot.
Yeah this is a known issue, I'll try to figure out a work around soon.
irc.freenode.org ##oodnet
http://exez.in/
User avatar
ArchAngel075
Party member
Posts: 319
Joined: Mon Jun 24, 2013 5:16 am

Re: Loveballs, A love2d Softbody lib

Post by ArchAngel075 »

to be honest here im more keen on seeing how you pulled off spacing of your outer nodes on arbitrary shapes since mine is just not worth it at times - outer nodes get placed so awkwardly at times.

I am more focused on setRadius as i really wanted to fix (and did) some bugs.

Im going to wait for arbitrary shapes to be implemented and then add a scaling feature (like setRadius)

After that i badly want to see if i can pull of a lerp between shapes (become a square from a triangle and back..for soft bodies?!)


##EDIT##

Patched my radiusSet branch to now change the self.centerShape radius correctly. This points to a hopefully final part of the branch (there are 0 bugs that i am aware of)
loveballs - setRadius.love
controls :
z and x - increase and decrease radius of softBody
a and d - roll left and right
(9.77 KiB) Downloaded 120 times
controls :
z and x - increase and decrease radius of softBody
a and d - roll left and right
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 226 guests