Shard 0.4/dev - Page 27

Shard 0.4/dev

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

Moderators: hoijui, Moderators

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

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF » 27 Nov 2012, 11:07

For build facing, how about an additional Build method taking the form:

Code: Select all

engineunit:build(type,position,facing)
Where the values of facing are predefined e.g.

Code: Select all

build_facing.north
Suggestions?
0 x

User avatar
yuritch
Spring 1944 Developer
Posts: 1018
Joined: 11 Oct 2005, 07:18

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by yuritch » 27 Nov 2012, 11:25

Looks good to me.

While we're at it, maybe facing should be added to CanBuildHere as well, since buildings can have non-square footprints?
0 x

User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by 1v0ry_k1ng » 27 Nov 2012, 16:34

this working (in the form of a standalone downloadable file that I can insert into spring and immediately play against) with any major mods atm?
0 x


User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by Erik » 27 Nov 2012, 22:19

This is working with Void but with an older version of shard.
0 x

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

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF » 28 Nov 2012, 20:42

FindClosestBuildSite and CanBuildHere in the C++ part now have counterparts FindClosestBuildSiteFacing and CanBuildHereFacing.

Build now also takes a facing parameter on the end if provided. It also does more checks on the type of units validity and tests if the structure can actually be built at the target before issuing the build order
0 x

User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by Erik » 27 Jan 2013, 16:03

ExecuteCustomCommand is not working over here, is there a version that has it implemented already?
0 x

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

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF » 27 Jan 2013, 22:41

It's always been marked as experimental, since I don't have an appropriate test case to test against. If I wanted to know, I'd most likely ask yourself.

If it doesn't work at the moment I'd err on the side of saying it never worked and I had no way of knowing
0 x

User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by Erik » 30 Jan 2013, 16:08

Also shard seems to randomly fail building anything on these maps: Titan-v2, Titanduel.
Not sure why.

Edit: Did some more testing and now can rule out any mistakes:
Theres a factory on perfectly flat terrain on Titan-v2 where it never builds and the same factory on similar terrain at a slightly different position works.
Also the same factory works with the same units on all my other maps except those two and whenever i command the same factory at the same spot to build the exact same thing.
0 x

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

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF » 31 Jan 2013, 00:53

Given the spacing dynamic, it could be that the closest possible position that fits the spacing parameters is outside the search radius.

What is your factories footprint and what's the spacing parameters and search radius?
0 x

User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by Erik » 31 Jan 2013, 00:59

Code: Select all

	FootprintX = 12,
	FootprintZ = 12,
	MaxSlope = 10,	
	YardMap ="oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo oooooooooooo ooooccccoooo ooooccccoooo ooooccccoooo ooooccccoooo ooooccccoooo ooooccccoooo",

I don't think this is the problem because the same factory:
-produces a mobile unit(terrain problems should usually show up after construction is finished but it doesn't even start)
-works fine on all other maps so far
-works fine on some spots
-works fine if i enable godmode and start construction manually

edit: Pictures of the spots in case it helps
non working spots
Image
working spots
Image
0 x

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

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF » 31 Jan 2013, 16:14

So basically there must be a minimum distance of (12 footprint square*spacing value) between the tested position and the nearest unbuildable spot.

It's very likely that the nearest valid position is outside the radius of the search area.

Can I see your current code grabbing the location? Keep in mind that Shard relies on the engines building placement callback and what say I have in the matter is dependent on the search radius and spacing values ( which can be passed in yourself, not passing them in will use my heuristics which are far from optimal ).

It's my longterm goal to abandon the engines API closestbuildsite API call as it's a pain in the arse. Until I can do so there isn't a lot i can do to help other than advocate you use the canbuildhere APIs to do your own tests to implement your own algorithm. Shouldn't be too hard to do but i don't have a test environment right this moment ( clean machine install a week ago, no visual studio or compilers, no spring install )
0 x

User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by Erik » 31 Jan 2013, 20:27

Its building mobile units within its perimeter, so no code for location grab at all.
0 x

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

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF » 01 Feb 2013, 00:28

Mobile unit footprints are not the same as factory footprints.

Also a factory can build whatever the hell it wants, closestbuildsite will not have an impact.
0 x

User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by Erik » 01 Feb 2013, 11:03

So why on earth does it fail on some locations? It only seems to fail on "Titan" maps and only on some spots on that "outer plains" terrain.
0 x

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

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF » 01 Feb 2013, 16:33

I don't know. A widget that visualised this would be useful but I wouldn't know where to begin. Closestbuildsite has always been a finnicky suboptimal solution, and a replacement has long been on my todo list
0 x

elias79
Posts: 57
Joined: 11 May 2008, 23:29

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by elias79 » 07 Mar 2013, 02:02

Is shard the only actively developed AI for spring ?
How do i put some distance between the building my units get stuck.
0 x

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

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by AF » 07 Mar 2013, 11:20

Since the building placement is something that crops up every few months, I wrote a blog post on the subject:

http://darkstars.co.uk/2013/closestbuildsite-shard/

It goes into why it fails so badly and what needs to be done. Right this moment I don't have a spring or development environment set up at home to test this with ( new Windows 8 install, moving flat, I don't have any dev tools installed yet, just sublimetext and an svn/git client ), but when I do I'll want to look into this
0 x

elias79
Posts: 57
Joined: 11 May 2008, 23:29

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by elias79 » 08 Mar 2013, 06:23

Image

Power plants block both defense and units from the factories.
0 x

User avatar
Erik
Posts: 283
Joined: 20 Aug 2009, 20:49

Re: Shard 0.35RC2 & 0.31.1 Not So Ballsey

Post by Erik » 08 Mar 2013, 10:53

Woot Tiberian Dawn!

Also i was kinda working on a way to make the AI place defenses in a way that makes sense, perhaps i'll finish that some time.
0 x

Post Reply

Return to “AI”