Widget that use interesting concept, please try! :)

Widget that use interesting concept, please try! :)

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
msafwan
Posts: 38
Joined: 16 Dec 2010, 14:44

Widget that use interesting concept, please try! :)

Post by msafwan »

I learnt something on pathfinding last year that I decide to make this widget. This is soo cool! (IMO), it give unit an equivalent of a 'brain' that avoid enemy and at same time move to target, and it work with all numbers of enemy (left right, or front & back). The best thing is: it is not a pre-programmed behaviour but something of a 'crank & gears' that work and make unit behave in such way.

Try this: http://springfiles.com/spring/lua-scrip ... nce-widget
I made it for games because it is soo working! I hope everyone has it too because it is not intrusive and is really working.

Please try :P

P/S: If widget can read heatmap maybe it could even replace pathfinding! :wink: :lol:
User avatar
Petah
Posts: 426
Joined: 13 Jan 2008, 19:40

Re: Widget that use interesting concept, please try! :)

Post by Petah »

Screenshots or it didnt happen
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: Widget that use interesting concept, please try! :)

Post by Google_Frog »

This is quite interesting, I've wanted some smart enemy avoidance AI for cloaked units for a while.
msafwan
Posts: 38
Joined: 16 Dec 2010, 14:44

Re: Widget that use interesting concept, please try! :)

Post by msafwan »

As you will see here: 50+ Sycthe move pass 3 bantha without any unit loss. Normally they will get shot because they bumped into one of the bantha... But here they avoided it.
Image
--Unit move onward, without knowing there's enemy waiting for them.
Image
--Unit steer away from enemy, maintain distance and cloaking ability.
Image
--Unit pass thru those bantha, some stuck at terrain.

This is the latest version, but there will be more feature I think.
Attachments
cmd_dynamic_Avoidance_onlyCloakCons.lua
v1.11 only Cloak and Cons
(38.58 KiB) Downloaded 20 times
cmd_dynamic_Avoidance.lua
v1.11 all ground unit
(38.56 KiB) Downloaded 127 times
luckywaldo7
Posts: 1398
Joined: 17 Sep 2008, 04:36

Re: Widget that use interesting concept, please try! :)

Post by luckywaldo7 »

That's pretty cool. :D
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Widget that use interesting concept, please try! :)

Post by knorke »

interessting indeed.
must try later :-)
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Widget that use interesting concept, please try! :)

Post by knorke »

interessting because enemy avoiding is something i was looking to add to the AI in spring tanks.
Playing around with the widget I noticed that it is almost an AI on its own, just needs iniative to go towards enemy flags.
The (neutral gaiea) butterflies seemed to confuse it though and sometimes it gives move orders onto unpassable terrain (cliffs)
Some units also get very off-target and end up someplace far away from their original destination. But I think that can be tweaked by the variables?
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Widget that use interesting concept, please try! :)

Post by PicassoCT »

Download and looking...


Sneaksy .. will unbalance most mods who have comando units though. Suddenly effectivness goes up like spiderman on roofies..
msafwan
Posts: 38
Joined: 16 Dec 2010, 14:44

Re: Widget that use interesting concept, please try! :)

Post by msafwan »

interessting because enemy avoiding is something i was looking to add to the AI in spring tanks.
Playing around with the widget I noticed that it is almost an AI on its own, just needs iniative to go towards enemy flags.
The (neutral gaiea) butterflies seemed to confuse it though and sometimes it gives move orders onto unpassable terrain (cliffs)
Some units also get very off-target and end up someplace far away from their original destination. But I think that can be tweaked by the variables?
Nice game! :-)

Yes, the widget consider the butterflies as enemy, and those variables control how far the unit flees. All this can be fixed.

But the widget need some more work before are able to work with flag/enemy-base, cliff and butterflies. Currently it only avoid enemy.

But, I dunno... :|
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Widget that use interesting concept, please try! :)

Post by knorke »

But the widget need some more work before are able to work with flag/enemy-base, cliff and butterflies. Currently it only avoid enemy.
Would it be possible to give "negative repulsion" to enemy flags so that units are attracted by them?
Also set up some more rules like "try to stay near allies" and "do not avoid enemies if full health."
That would produce an AI that works similiar to boids (http://en.wikipedia.org/wiki/Boids)
Kind of "boids with a destination"
msafwan
Posts: 38
Joined: 16 Dec 2010, 14:44

Re: Widget that use interesting concept, please try! :)

Post by msafwan »

Would it be possible to give "negative repulsion" to enemy flags so that units are attracted by them?
Also set up some more rules like "try to stay near allies" and "do not avoid enemies if full health."
Yes, this is do able. At this present moment I already use the move-command as the attractive point (this is why units move forward), and maybe it could work with multiple object too: like a flag and ally. I will try this...

I'll get back to you after I make it work...
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: Widget that use interesting concept, please try! :)

Post by PicassoCT »

Ill tried it, it has some issues with terrain it can get stuck. Maybee if a unit gets stuck, it could place a virtual enemy there, thus warning its allys, and pushing itself out and away from the trap.
Post Reply

Return to “Lua Scripts”