[3.2+] NullBot 3 ‘Reloaded’

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
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by aubergine » 05 Feb 2013, 11:06

Still trying to compile a list of what's needed, but currently swamped in bugs.

One thing that would be of great use is knowing whether eventGroupLoss() gets called before or after eventDestroyed() if a grouped droid/structure/feature is destroyed. I want to make sure I trigger events in the same order as they are in 3.2.

Also, if a droid gets transferred to/from another player (by nexus link or donateObject()) does it get removed from group? (If not, AIs will need to handle that)
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
NoQ
Special
Special
Posts: 6225
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by NoQ » 05 Feb 2013, 11:58

eventGroupLoss is triggered before eventDestroyed, every time a droid belonging to the group is destroyed (bug?).

If a droid gets transfered to another player via donateObject() or nexus link, or even transfered manually due to player being temporarily controlled by human via cheat more, it does get removed from its group.

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by aubergine » 05 Feb 2013, 12:58

NoQ wrote:eventGroupLoss is triggered before eventDestroyed, every time a droid belonging to the group is destroyed (bug?).
I wouldn't class that as a bug, as it can only pass in a single droid object to the event handler per invocation. I'm glad it happens before eventDestroyed()!
NoQ wrote:If a droid gets transfered to another player via donateObject() or nexus link, or even transfered manually due to player being temporarily controlled by human via cheat more, it does get removed from its group.
So, basically if owner changes the object is removed from whatever group the previous owner had it in? (just want to be super sure before finalising that big of code).

Also, in case of a transfer, does eventGroupLoss() happen before or after eventObjectTransfer()? And what is the .player of the object passed in to eventGroupLoss() -- the new owner or original owner?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
NoQ
Special
Special
Posts: 6225
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by NoQ » 06 Feb 2013, 19:38

Got carried away, will reply soon! :oops:

v3.0_alpha2 released.

I'm not ready to provide a complete changelog yet (too long). It now includes a Turtle AI with two subpersonalities (mg/cannons and mg/rockets). The AI also now has EASY difficulty implemented that doesn't concentrate research by choosing a subpersonality. Early game build order and micromanagement was improved, including picking up oil drums with early harass tanks. The AI now micromanages his tanks differently, depending on their weapon type (for instance, it doesn't fall back flamers behind when they're attacked, for they need to stay close to the enemy to make damage, but it does so with machineguns). Several new forms of adaptation were implemented, including more attention on separate consideration of offensive and defensive forces.

Requires the snapshot of at least 2013-02-05 (d07ea7). Will probably work on some earlier snapshots.

Has problems with saved games! Alpha1 too, actually. See #3927

User avatar
NoQ
Special
Special
Posts: 6225
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by NoQ » 06 Feb 2013, 20:01

aubergine: When transferring via donateObject() or GUI, .player is equal to the old owner in eventGroupLoss, but equal to its new owner in eventObjectTransfer which occurs later (even when the AI receives object, not gives it, hence "from" is given as the second parameter). But when transfered via Nexus Link, eventDestroyed is also triggered after these two, and in it the .player is once again equal to the old owner.

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by aubergine » 06 Feb 2013, 20:13

Urg, so eventDestroyed is being triggered due to Nexus link even though the droid isn't destroyed?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
NoQ
Special
Special
Posts: 6225
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by NoQ » 06 Feb 2013, 20:29

Yeah, seems so.

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by aubergine » 07 Feb 2013, 21:02

Ick, that's a bug IMHO - if droid not destroyed, why call eventDestroyed?

Anyway - anyone know what the body is for cyborg transport or super transport? I'm working on backporting buildDroid()'s auto-droidType from WZ 3.2 to 3.1.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by aubergine » 09 Feb 2013, 14:07

The 3.1 backport uses enhanced game objects (they have a customisable prototype chain) -- should that effect be retained if the script is run on 3.2? Using the enhanced game objects allows custom properties and methods to be added to all game objects (or specific .type of game object) with very low overheads.

Status report of backport:

Image

Progressing steadily, but taking much longer than I expected.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
NoQ
Special
Special
Posts: 6225
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by NoQ » 09 Feb 2013, 15:10

Probably backporting throughout 3.2 minor releases would also be necessary (?)

Just do whatever is easier so far. If both is trivial to implement and easy to turn on or off, we can compare productivity benchmarks later.

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by aubergine » 09 Feb 2013, 15:51

Yes, when 3.2 goes in to beta I'll do my best to smooth over changes in the betas so that the latest stuff can always be used wherever possible.
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by aubergine » 09 Feb 2013, 17:23

Does eventDroidBuilt() get called if you addDroid()? And, if so, does the event occur during the addDroid() call or some time later?

Code: Select all

var foo = false;

function eventDroidBuilt(...) {
   console(foo);
}

foo = true;
addDroid(....);
foo = false;
Would true or false get output to the console? Anyone got time to find out?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO

User avatar
NoQ
Special
Special
Posts: 6225
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by NoQ » 10 Feb 2013, 05:48

aubergine wrote:addDroid
Droid doesn't get created, silently, never :roll: whether it's an AI script or rules.js.

Even tried the following:

Code: Select all

diff --git a/data/mp/multiplay/skirmish/rules.js b/data/mp/multiplay/skirmish/rules.js
index 246aa77..c9ac8cb 100644
--- a/data/mp/multiplay/skirmish/rules.js
+++ b/data/mp/multiplay/skirmish/rules.js
@@ -61,6 +61,8 @@ function eventGameInit()
 		setStructureLimits("A0ComDroidControl", 1, playnum);
 		setStructureLimits("A0CyborgFactory", 5, playnum);
 		setStructureLimits("A0VTolFactory1", 5, playnum);
+
+		makeComponentAvailable("MG1Mk1", playnum);
 	}
 	applyLimitSet();	// set limit options
 
@@ -183,6 +185,14 @@ function eventGameInit()
 	setTimer("checkEndConditions", 3000);
 }
 
+function eventStartLevel() {
+	hackNetOff();
+	for (var playnum = 0; playnum < maxPlayers; ++playnum) {
+		debug(playnum, startPositions[playnum].x, startPositions[playnum].y, addDroid(playnum, startPositions[playnum].x, startPositions[playnum].y, "test", "Body1REC", "wheeled01", "", "", "MG1Mk1").id);
+	}
+	hackNetOn();
+}
+
 // /////////////////////////////////////////////////////////////////
 // END CONDITIONS
 function checkEndConditions()

User avatar
NoQ
Special
Special
Posts: 6225
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: [3.2+] NullBot 3 ‘Reloaded’ ~beta~

Post by NoQ » 13 Feb 2013, 16:24

beta1 released. I'm calling it beta because it now has most of the features of the original NullBot; i'm not sure i want to, at all, implement the rest the way they used to be.

This beta includes support for mobile sensor tanks and "!nb help" chat command. It also has some of the adaptation mechanisms reworked: for instance, it "understands" things like "MRAs are better than bunker busters against cyborgs, even though they're still mainly an anti-structure weapon".

User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: [3.2+] NullBot 3 ‘Reloaded’ ~alpha~

Post by Duha » 13 Feb 2013, 18:36

NoQ wrote:

Code: Select all

debug(playnum, startPositions[playnum].x, startPositions[playnum].y, addDroid(playnum, startPositions[playnum].x, startPositions[playnum].y, "test", "Body1REC", "wheeled01", "", "", "MG1Mk1").id);
Try this for debug:
https://developer.mozilla.org/en-US/doc ... /stringify
http://addons.wz2100.net/ developer

Post Reply