[behavior] rex_LJpotential (attracting or rejecting objects)

Post your completed addons to share with the community

Post » Fri Sep 26, 2014 12:45 pm

@rexrainbow
Here's the capx, but it doesn't work and events are kind of stupid/redundant.
https://www.dropbox.com/s/8knf66mys6n6cgh/AttractReject.capx?dl=0
B
45
S
11
G
4
Posts: 515
Reputation: 7,389

Post » Fri Sep 26, 2014 4:36 pm

@xoros

Try this fix.
https://onedrive.live.com/redir?resid=7 ... ile%2ccapx
And I also found a bug, please download this behavior again.

The key is the configuration of (A,n,B,m). I use try & error.
I usually fix the attracting force to 1 (A=1, n=0, B=0, range = 0),
and rejecting force changed by distance (B=500, m=1, A=0, range = 100), push out when too closed.


Thanks for sharing this capx.
B
108
S
26
G
260
Posts: 4,435
Reputation: 146,195

Post » Fri Sep 26, 2014 7:19 pm

Thanks! That's what I'm trying to achieve. After some configuration tweaking it will be magic.
B
45
S
11
G
4
Posts: 515
Reputation: 7,389

Post » Fri Sep 26, 2014 7:52 pm

Added distance checks - it attracts within some distance, and if it's very close it starts rejecting. This plugin is fun.
https://www.dropbox.com/s/8knf66mys6n6cgh/AttractReject.capx?dl=0
B
45
S
11
G
4
Posts: 515
Reputation: 7,389

Post » Mon Sep 29, 2014 4:04 pm

This is pretty neat. Gj.
B
73
S
10
G
6
Posts: 105
Reputation: 7,577

Post » Mon Sep 29, 2014 7:50 pm

Actually it's a very interesting topic - crowd behaviour simulation. I was not aware of it before.
B
45
S
11
G
4
Posts: 515
Reputation: 7,389

Post » Tue Sep 30, 2014 4:41 am

@xoros
@Index

This behavior is referenced from "Potential FunctionBased Movement".
B
108
S
26
G
260
Posts: 4,435
Reputation: 146,195

Post » Wed Oct 01, 2014 6:57 pm

@rexrainbow

why are you so awesome??? you are having your name really big and flashing on the credits of my game XD
B
23
S
6
G
3
Posts: 316
Reputation: 3,461

Post » Thu Oct 02, 2014 9:17 am

@Lunatrap

You are welcome, could you please share the link of your game for us?
B
108
S
26
G
260
Posts: 4,435
Reputation: 146,195

Post » Mon Dec 15, 2014 5:54 am

Thanks so much for this! One of my projects is a tribute/clone of a treasure game (Bangai-o Spirits), in which there are these little enemies which have a very strange movement pattern. Pretty sure they are being driven by this algo; the example capx looks just like what they do. This will be invaluable for recreating them.

Thanks again! :)
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,187

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest