[3.1+] NullBot: an adaptive skirmish AI
-
NoQ
- Special

- Posts: 6226
- Joined: 24 Dec 2009, 11:35
- Location: /var/zone
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
Emm, no, the problem is not in your code.
Ok, don't have time now, will try to fix later.
Ok, don't have time now, will try to fix later.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
-
aubergine
- Professional

- Posts: 3462
- Joined: 10 Oct 2010, 00:58
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
ah, nice. you might want to update slightly so it's reading:
global.scavengerPlayer=(scavengers) ? Math.max(7,maxPlayers) : -1;
What other stuff did you need to fix btw? I want to post these code segments to the wiki so others can use them.
global.scavengerPlayer=(scavengers) ? Math.max(7,maxPlayers) : -1;
What other stuff did you need to fix btw? I want to post these code segments to the wiki so others can use them.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
-
aubergine
- Professional

- Posts: 3462
- Joined: 10 Oct 2010, 00:58
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
Just noticed this in nullbot code (line 175 in nullbot-tail.inc):
How come it's using "command" custom constant instead of "HQ" js api constant?
Also, a nice trick for checking if a list is empty:
0 type coerces to boolean false (any non-zero number will type coerce to boolean true)
So would the function be nicer as:
Or maybe make more general function:
Code: Select all
// checks if we can design tanks and research towers
function iHaveCC() {
var list=enumStruct(me,command);
if (list.length == 0)
return false;
if (list[0].status == BEING_BUILT)
return false;
return true;
}
Also, a nice trick for checking if a list is empty:
Code: Select all
if (!list.length) {
// do stuff
}
So would the function be nicer as:
Code: Select all
// checks if we can design tanks and research towers
function iHaveCC() {
var list=enumStruct(me,HQ);
return (list.length && list[0].status == BUILT);
}
Code: Select all
// checks to see if we have at least one of the specified structure
function iHave(structure) {
var list=enumStruct(me,structure);
return (list.length && list[0].status == BUILT);
}
// do we have a CC?
if (iHave(HQ)) {
// do stuff
}
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
-
NoQ
- Special

- Posts: 6226
- Joined: 24 Dec 2009, 11:35
- Location: /var/zone
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
Sure you don't want an rw git account? 
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
-
aubergine
- Professional

- Posts: 3462
- Joined: 10 Oct 2010, 00:58
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
I need to get my OS upgraded so I can use some apps that make working with git and bitbucket a bit easier. So not just yet but maybe at a later date. My github userid is: aubergine10
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
-
NoQ
- Special

- Posts: 6226
- Joined: 24 Dec 2009, 11:35
- Location: /var/zone
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
And yet again i regret i'm on sourceforgeMy github userid is: aubergine10
Anyway, yeah, good point about CC. There must be a lot of stupid stuff like that all around the code.
HQ is statType, command is an exact structure. We need to build "command" rather than "HQ", so we'd need that anyway.How come it's using "command" custom constant instead of "HQ" js api constant?
P.S. You added iHave() function to your wiki, but it works only if there is a limit of only one structure of that type; otherwise list[0] may be incomplete, but we still have this structure.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
-
Per
- Warzone 2100 Team Member

- Posts: 3780
- Joined: 03 Aug 2006, 19:39
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
If you use the qslint app, errors like that would show up. (It checks that arguments are of the right type.) Should I put error checks like that in the runtime as well?
-
aubergine
- Professional

- Posts: 3462
- Joined: 10 Oct 2010, 00:58
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
@NoQ - in regards to iHave, the function I added to wiki is really intended to see if there is at least one fully built structure of the given type, not to check that all structures of the type are built.
@Per - could it be made optional? Sometimes I do strange stuff that would confuse the lint tool.
@Per - could it be made optional? Sometimes I do strange stuff that would confuse the lint tool.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
-
NoQ
- Special

- Posts: 6226
- Joined: 24 Dec 2009, 11:35
- Location: /var/zone
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
No, right now it checks if at least one was started and the first one of those that were started is fully built.aubergine wrote:@NoQ - in regards to iHave, the function I added to wiki is really intended to see if there is at least one fully built structure of the given type, not to check that all structures of the type are built.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
-
dak180
- Trained

- Posts: 288
- Joined: 01 Nov 2009, 23:58
- Location: Keeper of the Mac Builds
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
For working with git on a mac I would recommend GitX (L); if you can compile warzone then you should be able to use it without having to upgrade your OS.aubergine wrote:I need to get my OS upgraded so I can use some apps that make working with git and bitbucket a bit easier. So not just yet but maybe at a later date. My github userid is: aubergine10
User:dak180
Keeper of the Mac Builds
Keeper of the Mac Builds
-
aubergine
- Professional

- Posts: 3462
- Joined: 10 Oct 2010, 00:58
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
FixedNoQ wrote:No, right now it checks if at least one was started and the first one of those that were started is fully built.aubergine wrote:@NoQ - in regards to iHave, the function I added to wiki is really intended to see if there is at least one fully built structure of the given type, not to check that all structures of the type are built.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
-
NoQ
- Special

- Posts: 6226
- Joined: 24 Dec 2009, 11:35
- Location: /var/zone
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
v1.16.
Changes:
Changes:
- CPU optimizations! Now NullBot slows down the game much less, thanks aubergine for the exact caching idea.
- I still re-written it in the way i understand better ...
- Fixed some strange bug that made NullBot fail to start on certain very rare maps
- The initial trucks are still digged into the ground a little, and they don't seem to move out of the way properly when the structure is placed exactly on top of one of them.
- Also, remove a 5-second delay before AI start.
- Enable control of pre-placed combat units
- Won't work in 3.1_beta7 yet, see #3359...
- Fixed a little typo in scavenger AI
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
-
aubergine
- Professional

- Posts: 3462
- Joined: 10 Oct 2010, 00:58
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
What is the scav AI in nullbot? I noticed it on the downlaods page but wasn't sure if it was part of ultimate scav mod?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
-- https://warzone.atlassian.net/wiki/display/GO
-
NoQ
- Special

- Posts: 6226
- Joined: 24 Dec 2009, 11:35
- Location: /var/zone
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
Yeah, based on ultimate scav mod code, but with all the extra data removed. So it doesn't build towers and factories, capture oils or make VTOLs, but still produces more templates (made of existing models) and attacks you (at all / more intelligently). First mentioned in this changelog.
Maps | Tower Defense | NullBot AI | More NullBot AI | Scavs | More Scavs | Tilesets | Walkthrough | JSCam
-
Giani
- Regular

- Posts: 804
- Joined: 23 Aug 2011, 22:42
- Location: Argentina
Re: NullBot: an adaptive skirmish AI for Warzone 2100 v3.1+
In the map Mero_riverX whit advanced bases nullbot only takes 1 derrick from outside of his base.
My maps: http://forums.wz2100.net/viewtopic.php?f=10&t=9501