Wanted: Retreat!

Wanted: Retreat!

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

Moderator: Moderators

Post Reply
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Wanted: Retreat!

Post by Argh »

Here's a challenge, LUA people:

Can you make a script that causes a Group to retreat to the previous waypoint, if the total hitpoints of the Group go below 50%? That'd be really, really handy, as a model for making meta-behavioral scripts, if nothing else.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

this is borderlining on a cheat LUA, usually it takes micro and concentration to retreat and repair units..
It wouldnt be hard to make a lua widget that makes units move so they are always engaging the enemy target from their maximum range, a lua widget which makes units jinx randomly making projectiles miss etc.. I just dont think we should..
User avatar
NOiZE
Balanced Annihilation Developer
Posts: 3984
Joined: 28 Apr 2005, 19:29

Post by NOiZE »

i wonder how we can control the "wildgrow" of lua "cheat" widgets...
User avatar
Ishach
Posts: 1670
Joined: 02 May 2006, 06:44

Post by Ishach »

Ive had really good ideas for a bunch of almost cheating widgets but I cant be bothered coding them myself and dont want to get anyone else to make them cause then they'd know my secretz
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

What if Argh was trying to implement some sort of morale system, eh?
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

i wonder how we can control the "wildgrow" of lua "cheat" widgets...
I don't think lua cheatish automation widgets are bad by itself, but if people don't know how to get them it you get unfair situations.
I think for 0.75b1, lua UI should be enabled by default and new installers should include popular lua widgets..
User avatar
Ishach
Posts: 1670
Joined: 02 May 2006, 06:44

Post by Ishach »

I think the controlling factor is its very hard to code something that will reduce micro without trading off effectiveness
Tim-the-maniac
Posts: 250
Joined: 22 Jul 2006, 19:58

Post by Tim-the-maniac »

Cheat widgets need to be enabled by host next version I think (?)
Torrasque
Posts: 1022
Joined: 05 Oct 2004, 23:55

Post by Torrasque »

1v0ry_k1ng wrote:this is borderlining on a cheat LUA, usually it takes micro and concentration to retreat and repair units..
It wouldnt be hard to make a lua widget that makes units move so they are always engaging the enemy target from their maximum range, a lua widget which makes units jinx randomly making projectiles miss etc.. I just dont think we should..
I don't think IA would to this better than a human, the will always retreat when you don't want, or not as you want etc..
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Post by smoth »

jcnossen wrote:
i wonder how we can control the "wildgrow" of lua "cheat" widgets...
I think for 0.75b1, lua UI should be enabled by default and new installers should include popular lua widgets..
+9001
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

This is about better automation of large-unit behavior, and giving players better control over their forces when they get really huge. In the game I'm building, players will routinely have fairly big forces, on larger maps, and it'd be great if they could be controlled better when the player is not concentrating on them, instead of simply getting slaughtered when the player looks away.

It's in the category of, "players do this manually all the time, I just want it to be automated, like it already is in most modern game engines (using morale systems and other things)".

Second off, the use of this is not at all confined to just one scenario. It'd be great, for example, to be able to put units "on alert", and they would engage the next found enemies (imagine being able to do this with a group of fighters or gunships, for example).

The examples of possible meta-behavioral stuff are endless. If we had a number of these, and could hook AIs into LUA, then we could take a lot of the burden off of AI designers to build these themselves, and then AIs would both be easier to maintain, and the designers could concentrate on things that are more important (economy control, base design, strategic combat planning, scouting).

However, I need some example code to work with, because I'm still too tied up in what I'm getting done. Whatever code it is, needs to only check the status of the Group every 5 seconds or so, and it needs to go quickly- so I'd suggest instead of brute-force polling every Unit in the Group, it just counts the number of Units in the Group now as opposed to the initial number when the call is invoked (reset every minute or three).
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

No need to poll, there's an event which fires when a unit is damaged; use this one instead. Just don't check everything on every event, rather look whether that check has been called in the last second or so.

Event driven architecture ftw.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

But it has to look at a local group or a Group (as defined by the interface). That's the tricky bit. You don't want everybody everywhere retreating- you want a local group to retreat. It's not the check-for-things-that-have-died part that's hard... it's finding which are relevant to this group.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

this would be better as a groupAI by the sound of it.
my idea for a retreat widget would be you place markers manually on the map "retreat". the LUA widget then moves any unit on less than 50% HP to the nearest marker. at that marker you could set up some conbots with a repeat repair area command.
this seriously would be haxx though.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

Argh wrote:Second off, the use of this is not at all confined to just one scenario. It'd be great, for example, to be able to put units "on alert", and they would engage the next found enemies (imagine being able to do this with a group of fighters or gunships, for example).
Set their moveorder to Roam?

EDIT: I also hear that moveorders can be set via cob script. If you tied this into 1944's suppression / morale script, you could probably do quite a bit
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Post by imbaczek »

1v0ry_k1ng wrote:this seriously would be haxx though.
Dunno. It feels more like 'prepared commander' than 'haxx' ;p This alone won't win games for you.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Set their moveorder to Roam?
Roam has hard-coded limitations on the area that a Roaming unit can cover. If that distance was flexible and settable via COB, then that particular wrinkle could be achieved. However, what I'm looking for is practical methods and software solutions for a variety of these kinds of problems, not just a single solution for a single problem. Solving the "retreat" puzzle makes a lot of other things possible.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

jcnossen wrote:I think for 0.75b1, lua UI should be enabled by default.
I think so.
Post Reply

Return to “Lua Scripts”