Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

[Solved] wormholes in interstellar space not quite fixed yet

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

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

Re: [Solved] wormholes in interstellar space not quite fixed

Post by Switeck »

I added some .js code to my tests to make them more likely trigger CTDs:

Code: Select all

this.shipWillExitWitchspace = function()
{
	player.ship.position = [-1000000-Math.random()*1000000, -1000000-Math.random()*1000000, -1000000-Math.random()*1000000];
}

this.playerWillEnterWitchspace = this.shipWillEnterWitchspace = this.shipExitedWormhole = this.shipWillEnterWormhole = function()
{
	player.ship.position = [-1000000-Math.random()*1000000, -1000000-Math.random()*1000000, -1000000-Math.random()*1000000];
}

this.playerStartedJumpCountdown = this.playerCancelledJumpCountdown = this.playerEnteredNewGalaxy = function (jump)
{
	player.ship.position = [-1000000-Math.random()*1000000, -1000000-Math.random()*1000000, -1000000-Math.random()*1000000];
}
This code will not play nice with lots of OXPs and is only for testing!
It may crash the game for other reasons...

I figure the crashes are still something intrinsic to my setup (Windows XP + Nvidia graphics card)...though my other computer with an Intel graphics card crashes also.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: [Solved] wormholes in interstellar space not quite fixed

Post by Capt. Murphy »

Interesting that changing player.ship.position by script seems to be a factor. An old version of escort contracts did exactly that and I had reports of crashes at that point in the script from one user that I couldn't replicate. Changing the script so that player.ship.position was not changed cured the issue for that user. I had thought it was changing the NPCs position by script that was the root cause but perhaps not.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: [Solved] wormholes in interstellar space not quite fixed

Post by Switeck »

Capt. Murphy, do you recall if those crashes the 1 player had were occurring immediately before/during/after hyperspace jumps (via wormholes or otherwise) or other times as well?
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: [Solved] wormholes in interstellar space not quite fixed

Post by Capt. Murphy »

The way the OXP works the player was nearly always following an NPC through it's wormhole prior to any crashes. There would only be one jump. The OXP then has the player escorting the NPC to the station and the changing of the player.ship.position (along with the NPC's .position) was in some hand-wavium synchronised jump drive code. The user who reported the crashes seemed to have them 100% of the time on the first attempt to change player.ship.position after the jump, which could be 5-10 seconds after arriving in the system or several minutes depending on what else in hanging around the witch space beacon.

He/she was a windows user (XP) with low end graphics capabilities ( [rendering.opengl.version]: OpenGL renderer version: 1.3.0 ("1.3.0 - Build 4.14.10.3889"). Vendor: "Intel". Renderer: "Intel 865G".) As I said only one report of this problem and the OXP has always had a fairly healthy number of downloads. I couldn't replicate it on my XP machine.

The version with this problem can be downloaded from http://www.box.com/shared/2mgcfp4uihql03q4ve5n if you want to give it a go to see if it crashes on your system.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: [Solved] wormholes in interstellar space not quite fixed

Post by Switeck »

My other computer that crashes using this is also running an on-board video card made by Intel. However, it's not nearly as low-end:
02:40:07.031 [rendering.opengl.version]: OpenGL renderer version: 2.1.0 ("2.1.0 - Build 6.14.10.5303"). Vendor: "Intel". Renderer: "Intel(R) G41 Express Chipset".

I tested your Escort Contracts OXP on both of my computers. Neither crashed, even when I was cloaked while the player.ship.position was changed.

Another dead-end for the moment...but still perhaps a clue.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: [Solved] wormholes in interstellar space not quite fixed

Post by Switeck »

I am pretty sure the crash I get with this:
https://bb.oolite.space/viewtopic.php?f= ... 40#p160840
(Generation ship dying/me crashing into it causing a CTD sometimes)
...is related or the same CTD cause as the one I have here.
The alloy "pieces" that explode out seem to have extremely high velocities, perhaps sometimes too high?

I added this code to the crash-causing OXP that I've PMed around:

Code: Select all

this.shipExitedWitchspace = function()
{
	system.addGroup("thargoid", 2);
	system.addGroup("thargoid", 2);
	system.addGroup("thargoid", 2);
	system.addGroup("thargoid", 2);
	if (system.isInterstellarSpace && this.prev <0) { // this.prev recorded system.ID before the jump
		log("Arrived at interstellar space FROM interstellar space! Removing Thargoids! ", system.countShipsWithPrimaryRole("thargoid"));
		var thargs = system.shipsWithRole("thargoid");
		for (var ix = 0; ix < thargs.length; ix++) { //remove Thargoids!
			thargs[ix].position = [1000000+Math.random()*1000000, 1000000+Math.random()*1000000, 1000000+Math.random()*1000000];
			thargs[ix].remove();
		}
	}
And under:
this.jumpToDestination = function()
I edited this:

Code: Select all

	player.ship.position =[-1000000-Math.random()*1000000, -1000000-Math.random()*1000000, -1000000-Math.random()*1000000];
to this:

Code: Select all

	player.ship.position = player.ship.position.add(player.ship.heading.multiply(-20000));
My discovery was that any player.ship.position change OR thargoid .position change OR thargoid .remove() sometimes triggers the crash.
Post Reply