Author Topic: Zombiepirate's LUA AI micromanagement demo scenario  (Read 1308 times)

jda

  • Guest
Zombiepirate's LUA AI micromanagement demo scenario
« on: 28 April 2010, 16:58:55 »
On the GAE forum, zombiepirate started a thread about future plans for LUA.

He also kindly provided his Lua Play scenario for testing newly implemented / to be implemented features:
XML: http://www.mediafire.com/?f2qnmgmknxj
Maze map I was using to test: http://www.mediafire.com/?mwzmzzindnx

It's a 9v9 battle, horsemen vs drake riders. I managed to get 8/9 drake riders to survive a wave of horsemen with some micro-management strategies. The actual position of the units during the battle is extremely touchy though so in order to generalize the strategy significantly more code would be needed. As well as functionality that the GAE LUA currently doesn't support.
Do note this is intended for GAE only, as it takes advantage of GAE specific LUA features. ;)

I gave it a go and ... I kinda diverted the discussion to the scenario's "gameplay" (which BTW is supposed to be none, you're just supposed to watch :P) instead of keeping the discussion on the real subject: the LUA features...  :o

So, I'm starting this post just to discuss some "gameplay" possibilities demonstrated by that scenario.
Here's a short_brief/my_last_post of what was discussed already:
There isn't an end game condition unless the horsemen all die. The scenario was just meant to demonstrate some basic micromanagement rather then to be playable to an end. If anyone wants to use parts of the script or the map to make a fully playable scenario then by all means do so.
I didn't assume it was playable to an end, but I did think it might be. But I really only mentioned that as a warning for anyone who might want to play it too. And I actually only played it before looking at the code because I don't really know LUA so I wanted to see what happens in the game to understand better what is scripted in the XML. ;)
And thank you for the permission to reuse the script and the very nice map. :) I won't be doing any such thing soon myself but it's good to know for the future.  8)
Thanks. :)

Quote
Did you manipulate the horsemen when you tested or did you just let them do their own thing? The drake riders are the ones that are actually micromanaged by the LUA while the horsemen are given a blanket "attack" command at the magic's home location. If everything is left alone then 8/9 drake riders should usually survive the attack.
Yes, I certainly did manipulate the horsemen, that's how I beat and killed all the drake riders! :O
I did assume that though it might not be fully playable it would certainly not be fully hands-off demo-mode! :O That's interesting. That got me curious to look at the script (haven't yet) and check whether that "Here's the target!" thing I mentioned earlier acutally is necessary to give that order or if you added it as to give that very effect.

I also didn't realize what you just said, that the horsemen attack was automatic; I sent one horseman to scout around and almost immediatelly after all the other horsemen "followed" the first one. I selected them all (including the scout) and gave them the Stop command. Then I sent the first one out again and the others followed it again! By my second Stop order they stopped that for good. So I guess that was just coincidence?... (I think that, on my second atempt to stop them,  they might be stuck in a narrow which they couldn't cross because the first one was in front of them.)

I did notice the drake riders micromanagement on two levels:
1. Ingame as they all of a sudden "disappeared" all at once (the fog of war that was lifted before also came back). When I got to the location they were supposed to be in, they weren't there.
2. But it was specially on the output to terminal I posted before, I noticed some interesting stuff:
- There was a Unit Critical condition that, made a call to be made for  "jumping back in 14" (I assume that's either a retreat command or more likely a "replace said unit in that position with another fresher one", which would be very nice! :thumbup: ). I'll look at it.
- There was also a "done maneuver" command being issued from time to time I'm curious about. :)
- I also assume the one time only issued "killing invaders" is the start for micromanagement of the expected slaughter of the enemy.

Heck, I didn't mean to do it today as I have no time but you got me curious to watching the demo hands off and looking at the XML... Darn you! :P

If you want to get more technical about it (LUA features themselves), I suggest you discuss it on the original thread: https://forum.megaglest.org/index.php?topic=5344.0

zombiepirate

  • Guest
Re: Zombiepirate's LUA AI micromanagement demo scenario
« Reply #1 on: 28 April 2010, 18:21:51 »
Now I'm not sure this relates to LUA but the outcome you predicted (8/9 drake riders surviving) was almost completelly reversed: I got 7/9 horsemen surviving on two different runs (both without any intervention from me).
So... maybe you last ran the scenrio on GAE release other than current 0.2.13 and there are changes between my currently installed version (official 0.2.13 32 bit Linux binaries and data) and whatever you might be running (earlier, SVN?)?
Or ... for a different hipothesis... Do floating point calculations actually affect the drake rider's actually delievered damage? If so, maybe different builds will give different results?
Am I just being silly?  :look:

Interesting. I'll re-test it on a few different builds and try to find out why...
EDIT: Tested on the 64 bit linux binaries, 5/9 drake riders survived. Tested on my latest build from the trunk, 8/9 survived. I don't think floating point calculations on just damage would account for a difference as extreme as that.

As far as game-play goes hopefully there's some LUA masters out there who can turn some of these possibilities into realities. By the way, jda do have any programming/scripting background? LUA is easy to learn (This is actually the first LUA I've writen) if you were interested. If not, I'll still play around with it and see what kind of performance I can get.
« Last Edit: 28 April 2010, 18:53:44 by zombiepirate »

jda

  • Guest
Re: Zombiepirate's LUA AI micromanagement demo scenario
« Reply #2 on: 28 April 2010, 19:28:04 »
As far as game-play goes hopefully there's some LUA masters out there who can turn some of these possibilities into realities. By the way, jda do have any programming/scripting background? LUA is easy to learn (This is actually the first LUA I've writen) if you were interested. If not, I'll still play around with it and see what kind of performance I can get.
Last programming I did was almost 20 years ago, writing a graphics library for EGA and VGA cards in C (and I was at the very begining of learning C++ too but never actually coded anything on it AFAIR), on DOS!  :o  ;D
I've been kicking out an ocasional and simple DOS batch file (maybe some 15 years since the last one) and Linux shell script for my own.
I guess I could learn LUA without too much mind effort but I just don't have the time. All the time I have for "Glest development" is going to the Dwarf faction. I'm doing a plain vanilla version now, but once that one is finished I'll get to make a GAE one and maybe possibly even sketch a couple scripted scenarios... ;D
But this will take long... Just so you get an idea, I haven't even looked at your .xml...  :(

But sure what you have here can be perused by many others much faster and much more eficiently, yourself definitelly included! ;)