Swarm OXP

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Swarm OXP

Post by Thargoid »

Galcop Military Intelligence wrote:
Urgent Notification to Civilian Commanders

Recent military intelligence and combat encounters have identified a new and potentially worrying evolution in Thargoid technology It appears that the recent appearance of space-borne "wasp-like" creatures within Galcop space (see the report by K. Wolf et al - Galcop Science Network #359-1701) has not gone unnoticed by our alien adversaries, who have also seemingly encountered them and their hive "stations".

As a result of this, a new type of Thargoid combat craft has now been sighted which has been nicknamed the Swarmer. Similar in design to their familiar octagonal motherships, these new vessels are distinguished byexternal protrusions used to carry small drone craft. These secondary vehicles seem to have replaced the conventional "Thargon" robot fighters, but if anything are more of a threat. Whilst they appear slightly weaker in individual weapon power, they are far more numerous with reports of up to 16 being released by a single mother vessel. But the most worrying aspect is that the craft appear to have taken the wasp swarming mentality, with co-ordinated attacks on individual vessels within a target fleet being reported.

One notable encounter with three of the mother vessels took all of the skill, bravery and cutting edge military technology of an entire wing of specialised Raptor anti-Thargoid destroyers to counter and repulse. Sadly this was not without losses of several of our brave heroes, leading to the decision to issue this wideband warning to civilian ships.

The increased numbers of the drone craft combined with their small size and faster speed has led to this new type of mother vessel being classification as an extreme threat to civilian and all but the most powerful of Galcop craft. We strongly suggest that discretion is the better part of valour in case of an encounter, and a wise Commander should consider using his fuel injectors rather than his weaponry to survive. However if combat is undertaken, notification to the local Galcop Intelligence directorate at the system main station should be made to assist in countering this terrible new threat.

Fleet Major J deLance.
Galcop Intelligence.
Based on a chat with ClymAngus during the recent meet-up (the kind of thing that should probably be banned under the Geneva Convention), I would like to introduce a new concept variation of the Thargoid mothership and Thargons.

These are somewhat tougher than their vanilla bretheren, in that they swam attack rather than just work individually. When the motherships hunt in packs, they should be a challenge for even the most hardened battle veteran.

Note that currently under the current 1.76 trunk code, there is a minor issue with a ship script event (see here for details) which means that the Thargons are currently defined with a missile scan class. This means that they can trigger certain OXPs into trying to ECM them (amongst other things). The fix for this glitch should be in 1.76.1 when it is released, at which point the OXP will also be updated.

- - = = Download Here = = - -
Last edited by Thargoid on Wed Jan 11, 2012 10:43 pm, edited 1 time in total.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Swarm OXP

Post by Switeck »

My log fills up with this now:

Exception: TypeError: this.ship.subEntities is null
Active script: swarm_thargoid 1.00
swarm_thargoid.js, line 45:
if(this.ship.subEntities.length === 0) { return; } // if we've run out of sub-ents before we run out of missiles

This may have something to do with huge hordes of "missiles" fired at my ship at once?
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Swarm OXP

Post by Thargoid »

Hmm, that's a new one - that bit of the code hasn't changed at all since the first version of the OXP that was out for testing. And I would have thought it should perhaps always exist if the ship is valid, but I can work around that - I think the problem is not the lack of subEntities when the error happens, but more likely the ship itself has ceased to exist at that point.

The "missiles" are the thargons, as mentioned in the readme (and in the post above). I can't work around that until 1.76.1 (or trunk once Kaks' fix goes into the daily).

OK - v1.01 uploaded which should fix that, plus another small error in the script that I noticed whilst making the modification.
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2279
Joined: Tue Jan 02, 2007 12:38 pm

Re: Swarm OXP

Post by Killer Wolf »

Pics, dammit.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Swarm OXP

Post by Thargoid »

Killer Wolf wrote:
Pics, dammit.
OK.
Image
Close-up.

Image
Let's go visit the planet :twisted:

Image
Thargons away!
User avatar
Gimi
---- E L I T E ----
---- E L I T E ----
Posts: 2073
Joined: Tue Aug 29, 2006 5:02 pm
Location: Norway

Re: Swarm OXP

Post by Gimi »

That looks kind of scary. Impressive, but scary.
"A brilliant game of blasting and trading... Truly a mega-game... The game of a lifetime."
(Gold Medal Award, Zzap!64 May 1985).
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Swarm OXP

Post by Thargoid »

Gimi wrote:
That looks kind of scary. Impressive, but scary.
Somewhat by design, and also by reputation :twisted:
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Swarm OXP

Post by Switeck »

For whatever reason, the main ships sometimes have bounties of <10 credits.

They are also getting placed/displaced by "something" so far from my ship that LongRangeScanner OXP reports their distance as NaN!
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Swarm OXP

Post by Thargoid »

Switeck wrote:
For whatever reason, the main ships sometimes have bounties of <10 credits.

They are also getting placed/displaced by "something" so far from my ship that LongRangeScanner OXP reports their distance as NaN!
Hmm, odd on both cases.

The bounty is set as 100 in the shipdata (same as the core ships), and it's all dealt with by the trunk code.

And equally there is displacement code on the ship, but only a short distance when they get energy low.

I would have to wonder if you've got another OXP installed that's screwing around with them?
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Swarm OXP

Post by Thargoid »

Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Swarm OXP

Post by Switeck »

When I edited the "ATTACK_SHIP" =
section of swarm_thargoidAI.plist from this:
ENTER = ("sendScriptMessage: startWeave", "sendScriptMessage: validateTarget");
EXIT = ("sendScriptMessage: stopWeave");
to this:
ENTER = ("sendScriptMessage: validateTarget");
...I no longer saw them getting displaced to "NaN" distances.

log(this.xOffset,this.yOffset,this.ship.position);
at a strategic point in swarm_thargoid.js just after this line 211

Code: Select all

this.ship.position = this.ship.position.add([this.xOffset, this.yOffset, 0]);
...dumped this strange data to log:

Code: Select all

05:33:20.609 [-0.2742952836258672]: -0.8995144098388058, (-1809.17, 18088, 2672.74)
05:33:20.687 [-0.2553895963040844]: -0.4191174528271077, (-3021.75, -582.806, -2605.16)
05:33:20.687 [-0.2553895963040844]: -0.9123700111834215, (-1809.42, 18087.1, 2672.74)
05:33:20.687 [NaN]: NaN, (1.#QNAN, 1.#QNAN, 7719.14)
05:33:20.687 [NaN]: NaN, (1.#QNAN, 1.#QNAN, 769.879)
05:33:20.687 [NaN]: NaN, (1.#QNAN, 1.#QNAN, 1211.39)
05:33:20.687 [NaN]: NaN, (1.#QNAN, 1.#QNAN, 802.378)
05:33:20.687 [NaN]: NaN, (1.#QNAN, 1.#QNAN, 1016.76)
05:33:20.687 [NaN]: NaN, (1.#QNAN, 1.#QNAN, 611.067)
05:33:20.687 [NaN]: NaN, (1.#QNAN, 1.#QNAN, 1105.08)
05:33:20.687 [NaN]: NaN, (1.#QNAN, 1.#QNAN, -16294.9)
05:33:20.687 [NaN]: NaN, (1.#QNAN, 1.#QNAN, 13285)
For whatever the reason, this.xOffset and this.yOffset seems to have undefined/NaN values at the time of the check. I do not know why, but I don't think OXPs are to blame. :(
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Swarm OXP

Post by Thargoid »

That could certainly be the problem (it's not an external OXP thing you are correct), although I can't reproduce it. If I add similar logging:

Code: Select all

this.startWeave = function()
	{
	if(this.callbackID) { return; }
	
	this.weaveTime = clock.absoluteSeconds;
	this.phase = Math.random() * 2 * Math.PI;
	this.callbackID = addFrameCallback(this.performWeave.bind(this));
	};

this.performWeave = function()
	{
	if(!this.ship.isValid || this.ship.AIState !== "ATTACK_SHIP") 
		{ 
		this.stopWeave(); 
		return;
		}
	
	this.xOffset = (this.ship.speed/this.ship.maxSpeed) * this.weaveX * Math.sin(clock.absoluteSeconds - this.weaveTime);
	this.yOffset = (this.ship.speed/this.ship.maxSpeed) * this.weaveY * Math.sin(this.phase + clock.absoluteSeconds - this.weaveTime);

log(this.name, "xOff = " + this.xOffset + " yOff = " + this.yOffset);	
	
	this.ship.position = this.ship.position.add([this.xOffset, this.yOffset, 0]);	
	};
I get the following:

Code: Select all

13:46:16.745 [swarm_thargoid]: xOff = 0.012370197962726148 yOff = -0.03389004303680325
13:46:16.970 [swarm_thargoid]: xOff = 0.043623250045165034 yOff = -0.0785703878071445
13:46:17.022 [swarm_thargoid]: xOff = 0.053586527694179154 yOff = -0.09058689859232093
13:46:17.060 [swarm_thargoid]: xOff = 0.060299606901794506 yOff = -0.09833365923358123
13:46:17.110 [swarm_thargoid]: xOff = 0.07161460335538844 yOff = -0.11086002410264466
13:46:17.158 [swarm_thargoid]: xOff = 0.07867422104385852 yOff = -0.11837980885614431
13:46:18.798 [swarm_thargoid]: xOff = 0.08948366773084762 yOff = -0.12950598173872244
13:46:18.837 [swarm_thargoid]: xOff = 0.1537296705188512 yOff = -0.18782555626725733
13:46:18.880 [swarm_thargoid]: xOff = 0.1655331128100091 yOff = -0.1972677250313746
13:46:18.914 [swarm_thargoid]: xOff = 0.17493903607115652 yOff = -0.2045228373262259
13:46:18.947 [swarm_thargoid]: xOff = 0.18493932970458224 yOff = -0.21197273589799578
13:46:18.983 [swarm_thargoid]: xOff = 0.19439715682352524 yOff = -0.21876464152675884
13:46:19.014 [swarm_thargoid]: xOff = 0.20301017535474736 yOff = -0.2247302296624881
13:46:19.062 [swarm_thargoid]: xOff = 0.21490460667917527 yOff = -0.23261269718659233
13:46:19.101 [swarm_thargoid]: xOff = 0 yOff = 0.08621947134293054
13:46:19.150 [swarm_thargoid]: xOff = 0.013601375046470623 yOff = 0.10265144453556929
13:46:19.191 [swarm_thargoid]: xOff = 0.02302057473133914 yOff = 0.11371540498856413
13:46:19.236 [swarm_thargoid]: xOff = 0.03463823927095269 yOff = 0.12705712823278054
13:46:19.281 [swarm_thargoid]: xOff = 0.050244730343870836 yOff = 0.14451707843910916
13:46:19.329 [swarm_thargoid]: xOff = 0.06645229003129606 yOff = 0.162158873495526
13:46:19.361 [swarm_thargoid]: xOff = 0.0770536978322341 yOff = 0.1734564673676196
13:46:19.407 [swarm_thargoid]: xOff = 0.08970496341405593 yOff = 0.1867089873652349
13:46:19.443 [swarm_thargoid]: xOff = 0.10490859404175976 yOff = 0.20232754971673722
13:46:19.483 [swarm_thargoid]: xOff = 0.11950290762390706 yOff = 0.2170248448417471
13:46:19.520 [swarm_thargoid]: xOff = 0.13411948616447722 yOff = 0.23147125395180299
13:46:19.558 [swarm_thargoid]: xOff = 0.14714921824524546 yOff = 0.24412919589829934
13:46:19.589 [swarm_thargoid]: xOff = 0.16121146433406086 yOff = 0.25756600437455146
13:46:19.624 [swarm_thargoid]: xOff = 0.1743199128565646 yOff = 0.26988789407384295
13:46:19.655 [swarm_thargoid]: xOff = 0.1888320727035297 yOff = 0.2833055412163964
13:46:19.694 [swarm_thargoid]: xOff = 0.20189521675625147 yOff = 0.29518578729792827
13:46:19.728 [swarm_thargoid]: xOff = 0.21716319980574433 yOff = 0.3088366208366647
13:46:19.756 [swarm_thargoid]: xOff = 0.22881516937829094 yOff = 0.3190852786374792
13:46:19.792 [swarm_thargoid]: xOff = 0.24305446714244122 yOff = 0.3314109365349316
13:46:19.826 [swarm_thargoid]: xOff = 0.25863382528227224 yOff = 0.3446449347408278
13:46:19.857 [swarm_thargoid]: xOff = 0.27215233795697086 yOff = 0.3559130375010729
13:46:19.888 [swarm_thargoid]: xOff = 0.2856881678111863 yOff = 0.3669919745167414
13:46:19.923 [swarm_thargoid]: xOff = 0.2996407738570649 yOff = 0.3781944101929087
13:46:19.955 [swarm_thargoid]: xOff = 0.31314049777212644 yOff = 0.3888175215868063
13:46:19.988 [swarm_thargoid]: xOff = 0.3270059004406224 yOff = 0.39950057144379103
13:46:20.022 [swarm_thargoid]: xOff = 0.340788315876663 yOff = 0.4098823884861644
13:46:20.057 [swarm_thargoid]: xOff = 0.35569809285945586 yOff = 0.4208350373103787
13:46:20.091 [swarm_thargoid]: xOff = 0.3696290303618146 yOff = 0.4307936061123326
13:46:20.120 [swarm_thargoid]: xOff = 0.3817759092998072 yOff = 0.4392476834443231
13:46:20.156 [swarm_thargoid]: xOff = 0.39614313336373347 yOff = 0.4489539309884786
13:46:20.187 [swarm_thargoid]: xOff = 0.40791801110638287 yOff = 0.4566558643605153
13:46:20.233 [swarm_thargoid]: xOff = 0.4233012777701255 yOff = 0.46634610231994267
13:46:20.265 [swarm_thargoid]: xOff = 0.43791008846484564 yOff = 0.4751212011096594
13:46:20.302 [swarm_thargoid]: xOff = 0.451015119647673 yOff = 0.48259923576649866
13:46:20.331 [swarm_thargoid]: xOff = 0.4616318720592042 yOff = 0.4883537107423267
13:46:20.366 [swarm_thargoid]: xOff = 0.4716121229335907 yOff = 0.49348790669102194
13:46:20.395 [swarm_thargoid]: xOff = 0.48293534648606357 yOff = 0.49895183759397727
13:46:20.431 [swarm_thargoid]: xOff = 0.4953869175487668 yOff = 0.5044539170247367
13:46:20.467 [swarm_thargoid]: xOff = 0.5057429162412533 yOff = 0.5085595821385658
13:46:20.502 [swarm_thargoid]: xOff = 0.5158874830498593 yOff = 0.512091122827011
13:46:20.538 [swarm_thargoid]: xOff = 0.5241441752984343 yOff = 0.5145411846290335
13:46:20.569 [swarm_thargoid]: xOff = 0.5332398006391834 yOff = 0.5167085399257637
13:46:20.606 [swarm_thargoid]: xOff = 0.542428761444288 yOff = 0.5181977032430507
13:46:20.636 [swarm_thargoid]: xOff = 0.5498024884986293 yOff = 0.5187436920435737
13:46:20.671 [swarm_thargoid]: xOff = 0.5561950369389087 yOff = 0.5186104848995865
13:46:20.714 [swarm_thargoid]: xOff = 0.5639974350076263 yOff = 0.5174115253702989
13:46:20.762 [swarm_thargoid]: xOff = 0.5712159949181037 yOff = 0.5148003209165395
13:46:20.803 [swarm_thargoid]: xOff = 0.5774411327125576 yOff = 0.5105786057299762
13:46:20.843 [swarm_thargoid]: xOff = 0.5813616251151815 yOff = 0.5061631125225304
13:46:20.877 [swarm_thargoid]: xOff = 0.5843908942489795 yOff = 0.5007729308932255
13:46:20.916 [swarm_thargoid]: xOff = 0.5864600006541564 yOff = 0.4945835613923902
13:46:20.949 [swarm_thargoid]: xOff = 0.5876211380320534 yOff = 0.4876655477586327
13:46:20.985 [swarm_thargoid]: xOff = 0.5879215650462312 yOff = 0.4796178537927379
13:46:21.025 [swarm_thargoid]: xOff = 0.5872031927191264 yOff = 0.4698281356739203
13:46:21.055 [swarm_thargoid]: xOff = 0.5857320934711427 yOff = 0.4606719109288465
13:46:21.090 [swarm_thargoid]: xOff = 0.5835379390374488 yOff = 0.45102852472483174
13:46:21.128 [swarm_thargoid]: xOff = 0.5803674860745076 yOff = 0.43995806481878164
13:46:21.165 [swarm_thargoid]: xOff = 0.5752421206244875 yOff = 0.4251131930474756
13:46:21.207 [swarm_thargoid]: xOff = 0.5707541083893487 yOff = 0.41372152753884694
And so on, which is more or less what I expect to see. I tried five or six different spawnings, and they all did that - no NaN's. Indeed from the definition of the functions (in the code at the top) I can't see how you're getting a NaN at all?

I wonder perhaps if this is showing up something a little more fundamental? What OS are you running? It can be got-around by removing the weaving (basically the modification you made, plus removing the then-redundant code) but I'd like to understand why there is this difference in the first place between your results and mine.[/color]
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Swarm OXP

Post by Switeck »

I'm on Win XP Pro SP3.

I'm getting these results by repeatedly misjumping between 2 systems. It (NaN errors) doesn't happen every time, but happens too much to be coincidence.
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Swarm OXP

Post by Thargoid »

Just tried doing the same for about 10 minutes, and still can't reproduce the NaN's at all (with the roles tweaked so almost all I'm getting is swarm thargoids, plus targets via Behemoth Spacewar). The only things I see in the log are

Code: Select all

18:26:50.352 [bigShips_populator]: 1 big trader(s) added to the Soxeorza system.
18:28:10.157 [aquatics_populator]: System platform added in interstellar space by populator script.
18:30:40.434 [bigShips_populator]: 1 big trader(s) added to the Soxeorza system.
18:32:28.358 [script.javaScript.unrootedTimer]: ----- WARNING: Timer <OOJSTimer 0xbe15218>{nextTime: 359.218, one-shot, running, function: anonymous} is being garbage-collected while still running. You must keep a reference to all running timers, or they will stop unpredictably!
18:33:45.679 [bigShips_populator]: 1 big trader(s) added to the Soxeorza system.
18:35:09.541 [script.javaScript.unrootedTimer]: ----- WARNING: Timer <OOJSTimer 0xbe0ff68>{nextTime: 513.958, one-shot, running, function: anonymous} is being garbage-collected while still running. You must keep a reference to all running timers, or they will stop unpredictably!
18:35:54.912 [aquatics_populator]: System platform added in interstellar space by populator script.
18:35:59.482 [script.javaScript.unrootedTimer]: ----- WARNING: Timer <OOJSTimer 0xbe07ee0>{nextTime: 560.221, one-shot, running, function: anonymous} is being garbage-collected while still running. You must keep a reference to all running timers, or they will stop unpredictably!
18:35:59.487 [script.javaScript.unrootedTimer]: ----- WARNING: Timer <OOJSTimer 0xbe10bc8>{nextTime: 541.22, one-shot, running, function: anonymous} is being garbage-collected while still running. You must keep a reference to all running timers, or they will stop unpredictably!
That's using the normal max-pitch method of ending up in interstellar space.

I'm not sure what to do for the best here - to leave things as-are, to put in a .isNaN check on the offsets and if so just replace them with a random number or to remove the weaving functionality completely. It seems to be your specific example of doing unusual stuff in interstellar space that is influencing things. I'm on similar kit (Win7 64-bit + 1.76 release) so it shouldn't be anything to do with the trunk code itself I would say.[/color]
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Swarm OXP

Post by Switeck »

I'm using Oolite v1.76 -- I haven't updated to the latest trunk version yet.
Post Reply