New analytical AI for Contingency (Work in progress)

Did you create a mod, map, music, or a tool? Present them here and earn feedback!
Note: addon requests do not belong here.
Note, everything uploaded to this forum, MUST have a license!
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: New analytical AI for Contingency (Work in progress)

Post by NoQ »

Just cycle through all truck groups on every eventStructureBuilt. If a group is busy (indicated by .order properties of the trucks, which may be DORDER_BUILD or DORDER_HELPBUILD or DORDER_LINEBUILD), then it wasn't this group that ended construction. If it is free, then it should anyway proceed with its orders.
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: New analytical AI for Contingency (Work in progress)

Post by Per »

Shadow Wolf TJC wrote:I've been struggling to get the oil-hunting construction droids to not only seek out the closest available oil (which would be typical for an EASY AI difficulty), but to ONLY seek out oil that is not already being pursued by another truck.
Here's how I'd do it. Grab two lists, one of oils and one of trucks. Cycle through all trucks first, if any are targeting an oil, add a property to that oil (eg .busy) to mark it, or just remove that entry from the list, and throw any idle trucks into a free list (or just remove busy trucks from the truck list). Then sort the oil list, and cycle through it again to assign trucks from the free list to build oils that are not yet taken. The algorithm used in Semperfi JS is a more primitive version of this.
User avatar
Shadow Wolf TJC
Regular
Regular
Posts: 1047
Joined: 16 Apr 2011, 05:12
Location: Raleigh, NC

Re: New analytical AI for Contingency (Work in progress)

Post by Shadow Wolf TJC »

It's been a while since the last post, but I've decided to put ShadowBot's development on hold in favor of modifying NullBot so that it would be a bit more flexible, competent, aggressive, and moddable than it is now (in my opinion). (That, and I've been taking a break from Warzone 2100 altogether over the Christmas holidays.)
Creator of Warzone 2100: Contingency!
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100
User avatar
aubergine
Professional
Professional
Posts: 3462
Joined: 10 Oct 2010, 00:58

Re: New analytical AI for Contingency (Work in progress)

Post by aubergine »

Could you upload the ShadowBot source to github? At least then it has a holiday home. :)
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO