NoQ wrote:-- Fixed a small glitch that caused NullBot 2.0 to occasionally build a Power Generator prematurely upon game startup.
Well, if you show me where this bug was, that'd be great (:
I added a simple check to the start of the keepBuildingThings() function, turning it from this:
Code: Select all
// expand the base by building more labs and factories
function keepBuildingThings() {
var labCount = enumStruct(me, lab).length;
var factoryCount = enumStruct(me, factory).length;
var ccCount = enumStruct(me, command).length;
var genCount = enumStruct(me, generator).length;
var cbCount = enumStruct(me, cbtower).length;
var detectorCount = enumStruct(me, detector).length;
var derrickCount = enumStruct(me, derrick).length;
...
to this:
Code: Select all
// expand the base by building more labs and factories
function keepBuildingThings() {
if (earlyGame(personality.PEACE_TIME) && difficulty != EASY) //Don't do this at the start of the game!
return;
var labCount = enumStruct(me, lab).length;
var factoryCount = enumStruct(me, factory).length;
var ccCount = enumStruct(me, command).length;
var genCount = enumStruct(me, generator).length;
var cbCount = enumStruct(me, cbtower).length;
var detectorCount = enumStruct(me, detector).length;
var derrickCount = enumStruct(me, derrick).length;
...
Since a build order wasn't defined for the EASY difficulty level, it should still use keepBuildingThings to build up its base. However, since you may wish to use a PEACE_TIME variable that's higher than 3 (minutes), you may want to use a different kind of check to accomplish this task.
Some of these i like (eg. AA and AB cyborgs do make some sense even in the base game; effective small-body-light-weapon support is even nicer),
Thanks. Glad you liked those.
some of these i disagree with (eg., completely disabling regroup on EASY makes the AI completely dummy (much worse than Nexus in this sense), since NullBot runs attacks every few seconds rather than every few minutes, so units will be completely ungrouped;
Yeah. I had a feeling that our ideas on how our AIs should behave would have some differences. Oh well, that's just the nature of a fork I guess.
there are some other tweaks you made against some already very well-tested stuff, which may be good for contingency, but break the base game, eg. lab per power count), some of these i'd better have implemented some other way
Understandable, since NullBotSW started off as a heavily modified NullBot 2.0 AI designed specifically for use in Contingency. We should probably consider adding, say, a DERRICKS_PER_LAB variable in the future.
(eg., i won't ever put windmill code into -main, but rather make it part of the personality's build order;
Other mods in the future could make use of alternate power sources (sometimes even more than 1 of them), so I'd personally want to keep the code in place, and maybe even expand upon it. Although, we could leave it blank for vanilla Warzone 2100.
random switches from borgs to tanks i'd rather replace with direct adaptation to enemy weapons when it becomes available on the API side).
I feel the same way. However, until that time comes, this seems the next best thing.
But it is pointless to discuss particular changes now. If you proceed doing things this way, our code will soon become completely incompatible, and no sharing will be possible at all. If it's ok for you, then i stop bothering you.
I may not have much experience with git, but the method that I recently used to identify what was causing NullBotSW to not send out harassers to attack enemy Oil Derricks was to create a copy of NullBotSW's code, revert it to NullBot 2.0's code, then gradually copy/paste the code from NullBotSW's that worked for other things back to the reverted code, leaving out the code that dealt specifically with producing dedicated harassers, and assigning units to different groups.
There is one last change that I forgot to mention earlier about NullBotSW: that all Cyborg templates now had a propulsion component defined in addition to a body and weapon/system component. This is in case mods (such as Contingency) feature more than 1 propulsion system for Cyborgs to use.
themac wrote:Oh my god, he has completely messed up NullBot. Maybe he should give it a new name after so many changes. xD
I wouldn't say "messed up". I'd rather say "heavily modified", since its code is organized mostly the same as NullBot 2.0's code (although some pieces of code, such as the SetTimers() function, were moved to different .inc files, which I personally felt were a better location for them).
Even then, there's still the possibility that code from NullBotSW would be incorporated into future versions of NullBot.