## Gravicles (SIM)

Show off your games, demos and other (playable) creations.
SirRanjid
Prole
Posts: 37
Joined: Sun Nov 19, 2017 1:44 pm
Contact:

### Gravicles (SIM)

Wanted to make a little doodle where objects attract/repel each other based on their color. But then I wanted it to be interactive so middle mouse drags the objects, right click inverts their color and I added parts of my gui lirary to control the values in real time and more...

Basically you can watch those glowy balls form polarized clusters in an organic looking manner while playing around with the rules.
I'd say its more of a relaxing thing but also interesting to watch how small changes in some variables make them behave completely different.

__________________________________________________________________________________________
Update 3:
-made the balls appear seamless on the edges
-fixed window not really being resizable
-fixed gravicles bugging out of the simulation on resizing or when they get too fast
-added a slider that controls the attract/repel force multiplier for linked gravicles
-added a simple function to copy and paste the settings you have (just press ctrl+c to copy and ctrl+v to paste in the settings; it also gives a little effect on the gravicles as indicator)

On copying it will give text like this which is easily editable. Try pasting if you like:

Code: Select all

#gv#learn_rate:0.42|unlearn_rate:5|acceptance:-1|GC:-100|damp:10|connt:1|linkbias:-10|spdm:1|

Copying and pasting:

__________________________________________________________________________________________

This is what I came up with:
v22: https://i.imgur.com/5zUIZRs.gif
old: https://i.imgur.com/s5cYjDE.gif

Now they not only attract/repel each other. They change the color based on who they touch and light up more based on how many touching. On touching they link and stay linked for a set duration after they lost contact.

The color-values also dictate their physical properties:
Red: Restitution (more red = more bouncy)
Green: Mass (more green = more mass)
Blue: Friction (more blue = more friction)
(white would have all)

The values:
PhysSteps/Tick: How many physics updates per tick. (more = more accurate sim, slower)
Sim Speed: Multiplier except it doesn't affect the learn rate.
Remember: Link decay time. (affected by sim speed)

Drag: Drag force multiplier.
Gravity:
Attraction force multiplier. (positive = attract same color, negative = repel same color)

Tolerance:
1 means everyone attracts every other equally. Anything less makes them act on their color.

Forget Rate: How fast a ball returns to its original color. (indicated by the little dots on each ball)

More gifs (also some with artifacts):
https://imgur.com/a/d0LfEgF
Attachments
grav32.love
grav31.love
grav22.love
Last edited by SirRanjid on Tue May 19, 2020 11:53 pm, edited 11 times in total.

ReFreezed
Party member
Posts: 161
Joined: Sun Oct 25, 2015 11:32 pm
Location: Sweden
Contact:

### Re: Gravicles (SIM)

Fun little toy.
Tools: Hot Particles, LuaPreprocess
Games: Momento Temporis: Light from the Deep, Momento Temporis: Arena, Energize!
"If each mistake being made is a new one, then progress is being made."

SirRanjid
Prole
Posts: 37
Joined: Sun Nov 19, 2017 1:44 pm
Contact:

### Re: Gravicles (SIM)

Thanks!

I updated the visuals a bit and rebalanced the values to give a rather nice scene at startup.

https://i.imgur.com/eqyQMNp.gif

update2:
Improved and optimized visuals, fixed bugs and more improvements.

[Edit: the attachments are all the same it just failed on me to remove old, and even display attached files so they are double]

Attachments
grav22.love
grav22.love

SirRanjid
Prole
Posts: 37
Joined: Sun Nov 19, 2017 1:44 pm
Contact:

### Re: Gravicles (SIM)

Update 3:
-made the balls appear seamless on the edges
-fixed window not really being resizable
-fixed gravicles bugging out of the simulation on resizing or when they get too fast
-added a slider that controls the attract/repel force multiplier for linked gravicles
-added a simple function to copy and paste the settings you have (just press ctrl+c to copy and ctrl+v to paste in the settings; it also gives a little effect on the gravicles as indicator)

On copying it will give text like this which is easily editable and sharable. Try pasting if you like:

Code: Select all

#gv#learn_rate:0.42|unlearn_rate:5|acceptance:-1|GC:-100|damp:10|connt:1|linkbias:-10|spdm:1|

This way you can edit the values outside the bounds the simulation sets with the sliders. Maybe you get something interesting

Copying and pasting:
Attachments
grav32.love

### Who is online

Users browsing this forum: No registered users and 14 guests