Shard 0.4/dev - Page 3

Shard 0.4/dev

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14552
Joined: 17 Nov 2005, 02:43

Re: Shard

Post by Forboding Angel » 30 Mar 2010, 02:06

Shard absolutely pwns in Evolution RTS. Replay for proof: http://replays.adune.nl/?2385

If you don't have the game, you'll need to grab Evo/test/322 using springdownloader.
0 x

User avatar
AF
AI Developer
Posts: 20667
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF » 30 Mar 2010, 02:07

I think it's safe to make a release now lol
0 x

Google_Frog
Moderator
Posts: 2432
Joined: 12 Oct 2007, 09:24

Re: Shard

Post by Google_Frog » 30 Mar 2010, 11:58

Kerr or AF, does it know when and where to construct additional pylons?
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14552
Joined: 17 Nov 2005, 02:43

Re: Shard

Post by Forboding Angel » 30 Mar 2010, 12:03

Dunno about CA but in Evo the AI's are provided with unlimited mapwide power.

Another replay from a game earlier. It's pretty long. Me and a shard vs 2 other shards.

http://replays.adune.nl/?2386
0 x

User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: Shard

Post by Licho » 30 Mar 2010, 13:32

I watched it play CA, it tries to cover map with random mix of structures, bulilds factories with blocked entrances and keeps units sitting idle around.

Carpet mix consist of HLT, defenders, winds and other things - it builds it everywhere, i saw this mix extend from water to steep hills around :)

Because this mix also contains pylons, it sometimes manages to connect mex.
0 x

luckywaldo7
Posts: 1397
Joined: 17 Sep 2008, 04:36

Re: Shard

Post by luckywaldo7 » 30 Mar 2010, 16:04

Licho wrote:Because this mix also contains pylons, it sometimes manages to connect mex.
So it supports pylons by means of implementing the infinite monkey theorem!



Really, cool stuff though. Hopefully I'll get some free time so I can play around with it too.
0 x

User avatar
AF
AI Developer
Posts: 20667
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF » 30 Mar 2010, 22:10

Its a crude means but yes thats how pylons in kerrs current shard work. Thats not to say Kerr couldnt write pylon placement code in Shard.

I'd also mention that latest shard has modified minimum distancing code, after I noticed it built things way too close together in evo, resulting in as you said, the factory opening blockage issue
0 x

User avatar
AF
AI Developer
Posts: 20667
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF » 31 Mar 2010, 18:16

0.2RC1
  • EvoRTS overrides
  • Ported kernel panic NTai config
  • Support for The Cursed
  • Empty overrides for S44
  • EvoRTS now has behaviours for rebuilding factories that have been destroyed, and making engineers throw up light defence towers when under fire
  • Spacing code adjusted to account for unit size and increased to prevent factory entrance blockage
  • Attack handler bug fixed regarding MoveAndAttack ( Its MoveAndFire!)
  • Attack groups are now initially smaller but the desired group size will now grow and shrink as new gorups are built and units die
  • Attack behaviour and task queue behaviour modified to allow deactivation and activation.
  • Units now have behaviours and can elect a primary active behaviour. For examples of adding custom behaviours, look at the EvoRTS folder.
  • API Units can now attack repair and reclaim other units
  • API Units can return max weapons range now, amongst other things
  • One can now check if A can build B, also incorporated into taskqueuebehaviour
  • Extra safety checks in the API on parameters
  • Added a UnitDamaged Callin
And more I've probably forgotten but will add when I get back to it

edit: fixed forum markup
Last edited by AF on 31 Mar 2010, 23:47, edited 1 time in total.
0 x

User avatar
Jazcash
Posts: 5301
Joined: 08 Dec 2007, 17:39

Re: Shard

Post by Jazcash » 31 Mar 2010, 19:19

Cool an AI that works. Just played a game of BA against it, it surprised me that it actually did stuff instead of just being idle the whole game, spamming Solars and Jethro or making labs everywhere.

I'm willing to help you as much as you like from a players perspective to help you to make this AI 1337 in terms of BA.

I know nothing of AI coding, but I can at least express a few simple formulas I think a good AI should follow for BA.

Here's one messy diagram I threw together for just a small particular example:

Image
0 x

mcgoo
Posts: 33
Joined: 09 May 2008, 07:31

Re: Shard

Post by mcgoo » 31 Mar 2010, 22:13

download link don┬┤t work ?!

edit :
ah, edited it an now it works :)
0 x

User avatar
AF
AI Developer
Posts: 20667
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF » 01 Apr 2010, 00:03

Ninja foo a eee

Azaremoth has sent me a pm with updates for The Cursed, and thanks Jazcash, that little diagram should have been posted a long time ago!

As for morphing, (as asked by a few), Shard does not natively support morphing at the moment, BUT this can easily be added in overrides.

How would this be added?

Shard supports communication with lua gadgets via a callout named SendToContent (I think, but its something that sounds like that, refer to api.lua). Thus, one can communicate directly with the morphing gadget using it!!

Code: Select all

local replyString = game:SendToContent("OHAI DER, JOO CAN HAS MESSAGE, JOO IS GADGET YAH? O RLY?")
So far Im unaware of the measures and steps necessary to contact the morphing gadget, especially since the CA gadget doesnt have the necessary callins implemented to react to AI queries. That and there are various implementations that do it differently from CA.

Also if you're using that api method, refer to class.lua where I have included a handy helper method to serialize a lua table, so implementing a SendTableToContent() should be easy, and will probably be done in class.lua in the next release if I can remember.

If anybody needs examples, refer to the bundled overrides, or if anybody has any improvements, feel free to send me the new versions so long as you tell me what you changed so that I can document and reference it in my report correctly.
0 x

User avatar
KaiserJ
Community Representative
Posts: 3113
Joined: 08 Sep 2008, 22:59

Re: Shard

Post by KaiserJ » 05 Apr 2010, 20:14

i call him... shart.
Attachments
Shard_kj3.7z
shard w. my configs
(1.83 MiB) Downloaded 49 times
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14552
Joined: 17 Nov 2005, 02:43

Re: Shard

Post by Forboding Angel » 06 Apr 2010, 13:20

AF I really need to get a new build from you. I was about to subvert the factory building issue, but attacker behavior is throwing an error.
0 x

User avatar
AF
AI Developer
Posts: 20667
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF » 06 Apr 2010, 22:07

Sorry, I went for that lay down and fell asleep and woke up with the most horrible head cold, Im dosed up on paracetamol now. Ill sort out a quick release in an hour or two.

Most notably, I've added a behaviours.lua so that adding new behaviours doesn't require overriding the entire behaviour factory, or endless if else statements per unit.

That and I modified attack behaviour as it wasnt erroring but it wasnt attacking either.

That and a tonne of other changes and API additions
0 x

User avatar
AF
AI Developer
Posts: 20667
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF » 07 Apr 2010, 01:09

0 x

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7009
Joined: 16 Nov 2004, 13:08

Re: Shard

Post by zwzsg » 07 Apr 2010, 12:59

Tried Shard (0.21) a bit, with KP 4.0:
  • On the bright side, it didn't crash, and instead of staying idle, it build some stuff, including two sockets, kept all factories busy, and tried to attack. Which is way better than the vast majority of Spring's AI.
  • On the greyer side:
    • KP shortname is not anymore KP.n, just KP now.
    • Any way to make Shard keep quiet? As a user I don't need to be told ten times a second the AI found a function.
    • The Shard AI build two sockets fairly quickly, then it let assemblers idle for the rest of the game. Needless to say, it lost the match.
    • You're going to hate me for not being more specific, but I felt the CPU drain was huge, despite the low unit count.
    • I tried with Network and Shard did nothing. I looked into the .lua configs and saw only tasklists for System and Hacker faction. I know I wrote support for every faction (even some hidden ones) in my NTai config. Here's it in case you missed it: http://pastebin.org/139838 Btw, do you have automated tools to convert NTai's tdf into Shard's lua, or must it be done by hand?
    • Can I configure Shard to tell it to use custom commands when using some units? Would help with KP's Network's dispatch, but would also help with the morphing support that was mentionned few posts ago: Instead of requesting every morphing gadget to be modified to add a new interface specifically for your Shard AI, the AI should be able to issue any custom command, and so it'd morph using the same interfacing as a player.
So, overall, Shard's not as good as NTai. Then NTai was broken most of the times. But when it wasn't, NTai could play KP pretty well, including beating KP's Lua AI. Shard's not there yet. Then I don't know, maybe a couple bugfixes and it will? Or if you feel my post is too negative, then I could just shut up and ignore Shard altogether. Having more AI able to play KP would be nice, but I don't need it as desperatly now.

Edit: Ported KP 4.0 NTai XE10.1 config to Shard, but I still need a way to issue custom commands in taskqueues.
0 x

User avatar
AF
AI Developer
Posts: 20667
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF » 07 Apr 2010, 19:16

Eh I'm sorry but your going to have to go down the modifying gadget route. Being able to assemble commands from scratch would be a rather large implementation detail to have to account for which would then need to be explained in the write up, and so onandon etc etc

I've a version with a tonne of debug messages removed, and Ill look into the other problems after I've had some sleep.

And there's no conversion utility, I converted them by hand!
0 x

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7009
Joined: 16 Nov 2004, 13:08

Re: Shard

Post by zwzsg » 07 Apr 2010, 19:53

It's like Shard is shy and only build on datavents close to already built ones, and would rather let cons idle than move them to unclaimed far datavents.

Attached below are more complete KP configs, to be put into \AI\Skirmish\Shard\0.21\ai\KP\
Attachments
taskqueues.lua
(22.95 KiB) Downloaded 30 times
attackers.lua
(194 Bytes) Downloaded 29 times
0 x

User avatar
AF
AI Developer
Posts: 20667
Joined: 14 Sep 2004, 11:32

Re: Shard

Post by AF » 07 Apr 2010, 20:23

Could it be explained by the closestbuildsite only searching within 1000 clicks?
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14552
Joined: 17 Nov 2005, 02:43

Re: Shard

Post by Forboding Angel » 08 Apr 2010, 23:12

The orb is still reclaiming everything in sight as of the latest dev build that I got. I have removed ally reclaiming again (the way it was for a loooong time until I tried to help the orbs in shard out a bit -- failed miserably), so at least now they won't be reclaiming my units. However, I would recommend figuring out a way for shard to figure out if something is a unit or a feature, and only reclaim features.

Additionally, units should be given a move order a little ways away from the factory before being assigned any tasks. The reason for this is that orbs for example, get created and don't move, thereby blocking the factory so that it cannot build.
0 x

Post Reply

Return to “AI”