Page 85 of 160

Re: Griff's normalmapped ship remakes

Posted: Wed Jun 15, 2011 9:41 pm
by DaddyHoggy
Svengali wrote:
DaddyHoggy wrote:
Could it be modded to work with OXPConfig? So that a player could keep nudging the variable up so that they got an acceptable amount of fab debris for an acceptable level of performance drop?
The current way of splitting the exploding wreckage handling from the main OXP is faster and easier though - I think it is a sensible solution. Good job, Griff .-)

And yes, it is absolutely possible to make it configurable.

A suggestion for the exploding wreckage. It could be a nice thing to spawn the wreckage only if the player is nearby.
:roll: OK, I meant - once Griff splits the wreckage out of the all-in-one OXP would it be good/useful/nice to have the wreckage configurable, so super-dooper machines can have tons and lesser machines can have "a bit"?

Checking for range to the player would be sensible too!

Re: Griff's normalmapped ship remakes

Posted: Wed Jun 15, 2011 10:55 pm
by Svengali
The check for distance is a simple one line addition to the scripts

Code: Select all

if(this.ship.position.distanceTo(player.ship.position) > 50000) return;
The range is not based on drawdistance and needs to be adjusted.

The configuration can be done pretty easy too and there are a few possible ways. But this is something Griff has to decide.

Re: Griff's normalmapped ship remakes

Posted: Thu Jun 16, 2011 7:37 am
by Griff
The distance check sounds like a great idea, where does it need to go in the scripts? I presume somewhere near the start, that's the full extent of my scripting capability :lol: Thargoid wrote these for me

"griff_spawn_wreckage.js" - spawns the bigger chunks of stuff

Code: Select all

this.name = "griff_spawn_wreckage"; 
this.author = "Thargoid"; 
this.copyright = "© 2008 the Oolite team."; 
this.description = "Spawn wreckage and sparks from dead ship"; 
this.version = "1.0"; 

this.shipDied = function() // event that occurs when the entity (ship) whose script this is dies
	{
	this.largeCount = (Math.ceil(Math.random() * 3)); // between 0-3 pieces of wreckage
	this.tinyCount =  (Math.ceil(Math.random() * 10) + 5); // between 5-10 tiny spark fragments
	this.sparkCount =  (Math.ceil(Math.random() * 20) + 10); // between 10-20 spin spark fragments
	this.ship.spawn("griffspark", this.tinyCount); // spawn the tiny spark fragments

	if(this.largeCount > 0) // if there is large wreckage
		{
		this.ship.spawn("griffwreckage", this.largeCount); // spawn the larger wreckage
		this.ship.spawn("spinspark", this.sparkCount); // spawn the spin sparks
		}

	}
griff_spawn_sparks.js - spawns the cloud of tiny glowing polygon 'bits'

Code: Select all

this.name = "griff_spawn_sparks"; 
this.author = "Thargoid"; 
this.copyright = "© 2008 the Oolite team."; 
this.description = "Break-up of griff wreckage into a tiny spark cluster"; 
this.version = "1.0"; 

this.shipDied = function()
	{
	this.tinysparkCount = (Math.ceil(Math.random() * 8) + 2); // between 2-10 tiny spark fragments
	this.ship.spawn("griffspark", this.tinysparkCount); // spawn the tiny spark fragments
	}

Re: Griff's normalmapped ship remakes

Posted: Thu Jun 16, 2011 9:52 am
by Svengali
Griff wrote:
The distance check sounds like a great idea, where does it need to go in the scripts? I presume somewhere near the start,...
Yes, in both scripts as first line in the handler.

Code: Select all

this.shipDied = function()
{
  if(this.ship.position.distanceTo(player.ship.position) > 50000) return;
  // other code
}

Re: Griff's normalmapped ship remakes

Posted: Thu Jun 16, 2011 4:37 pm
by Thargoid
Svengali wrote:
Griff wrote:
The distance check sounds like a great idea, where does it need to go in the scripts? I presume somewhere near the start,...
Yes, in both scripts as first line in the handler.

Code: Select all

this.shipDied = function()
{
  if(!player.ship || !this.ship || this.ship.position.distanceTo(player.ship.position) > 50000) return;
  // other code
}
I would amend it very slightly to the above (just to save possibilities of log errors in a few specific cases).

The other option is just to tone down the numbers for lower spec machines, so things still get spawned but not so many of them.

Re: Griff's normalmapped ship remakes

Posted: Thu Jun 16, 2011 7:40 pm
by Svengali
Thargoid wrote:
I would amend it very slightly to the above (just to save possibilities of log errors in a few specific cases).
Good point. Checking for validity will avoid errors.

Re: Griff's normalmapped ship remakes

Posted: Sat Jun 18, 2011 8:46 am
by Griff
Thanks guys! :D I've added in the distance check code into the script and re-uploaded the OXP!

Re: Griff's normalmapped ship remakes

Posted: Sun Jun 19, 2011 10:12 am
by DGill
Seem to be getting log errors (Oolite 1.75.2 - windows 7):

0:34:06.251 [files.notFound]: ----- WARNING: Could not find texture file "griff_wreckage_diffuse.png".
10:34:06.253 [files.notFound]: ----- WARNING: Could not find texture file "griff_wreckage_normal.png".
10:34:06.257 [ai.load.failed.unknownAI]: Can't switch AI for <ShipEntity 0xbbc0438>{"Wreckage"} to "griff_wreckageAI.plist" - could not load file.
10:37:04.866 [files.notFound]: ----- WARNING: Could not find texture file "griff_wreckage_diffuse.png".
10:37:04.869 [files.notFound]: ----- WARNING: Could not find texture file "griff_wreckage_normal.png".
10:37:40.894 [files.notFound]: ----- WARNING: Could not find texture file "griff_wreckage_diffuse.png".
10:37:40.897 [files.notFound]: ----- WARNING: Could not find texture file "griff_wreckage_normal.png".
10:37:54.076 [gameController.exitApp]: .GNUstepDefaults synchronized.

Closing log at 2011-06-19 10:37:54 +0100.

Re: Griff's normalmapped ship remakes

Posted: Sun Jun 19, 2011 10:36 am
by Griff
Hmm, i'm not sure what's causing that, if you've got the newer bundle oxp (v1.2 which i uploaded the other day) is everything OK with your install of the griff_alloys_and_wreckage.oxp, all those missing files are now inside that and not the shippack bundle.

I've just noticed a bug in the all-in-1 bundle v1.2 upload, it's in the shipdata-overrrides.plist file in the config folder, it's removing the standard oolite alloys but doesn't replace them with anything anymore (since these items are now in their own oxp) i'll try and get a fixed version uploaded soon, but in the meantime you'll need to edit the shipdata-overrides.plist file in a text editor (on Microsoft Windows don't use notepad to edit the file but wordpad is OK to use) and take out the lines

Code: Select all

	"alloy" = 
	   { 
	   roles = "unused"; 
	   }; 

	"scarred-alloy" = 
	   { 
	   roles = "unused"; 
	   };
just delete them out and resave the file, then start Oolite with the shift key down to refresh the oxp cache, this will allow the default oolite alloys to be created again

edit: Ok, i've started uploading a fixed bundle oxp to Cmd. Cheyd deephorizons site, it's going to take a while for my slow internet connection to shift the file over, i've also got to fix the griff_alloys & wreckage oxp on my box.net site too
upload on hold for the moment while i sort out just how much of a blunder i've done!

Re: Griff's normalmapped ship remakes

Posted: Sun Jun 19, 2011 10:47 am
by DGill
I loaded the Griff_alloys_and_wreckage.zip dated the 18th June from http://www.box.net/shared/rpkms25cc9

I noticed the folder "textures" does not contain the wreckage pngs - should it?

Re: Griff's normalmapped ship remakes

Posted: Sun Jun 19, 2011 10:54 am
by Griff
oops, yes! sorry i'll get everything sorted and fixed!
edit:
I'm busy re-uploading fixed versions of the oxp's but it's going to take about an hour, in the meantime the fixes are as follows if you want to sort them out yourself if you already have the files downloaded.
In griff_shipset_all_in_1.oxp (v1.2 - version number is in the .zip file name) remove the following lines from shipdata-overrides.plist...

Code: Select all

	"alloy" = 
	   { 
	   roles = "unused"; 
	   }; 

	"scarred-alloy" = 
	   { 
	   roles = "unused"; 
	   };
	   
	"wreckage-component" = 
	   { 
	   roles = "unused"; 
	   }; 
   
	"more-wreckage2" = 
	   { 
	   roles = "unused"; 
	   };   

	"more-wreckage3" = 
	   { 
	   roles = "unused"; 
	   }; 

	"more-wreckage4" = 
	   { 
	   roles = "unused"; 
	   }; 

	"more-wreckage5" = 
	   { 
	   roles = "unused"; 
	   };

..and paste them into the shipdata-overrides.plist of the griff_alloys_and_wreckage.oxp, next move two texture files griff_wreckage_diffuse.png & griff_wreckage_normal.png from the Textures folder in griff_shipset_all_in_1.oxp and put them in the Textures folder of griff_alloys_and_wreckage.oxp

Re: Griff's normalmapped ship remakes

Posted: Sun Jun 19, 2011 12:53 pm
by Lone_Wolf
Griff, i just realised it's the textures that makes this oxp so big.

Maybe you could split the oxp ?

criteria could be : player-selectable ships, non-player ships, dockables, other ?

Re: Griff's normalmapped ship remakes

Posted: Sun Jun 19, 2011 12:55 pm
by Thargoid
Wouldn't that rather defeat the "all-in-one" objective?

Re: Griff's normalmapped ship remakes

Posted: Sun Jun 19, 2011 12:56 pm
by Zireael
Lone_Wolf wrote:
Griff, i just realised it's the textures that makes this oxp so big.

Maybe you could split the oxp ?

criteria could be : player-selectable ships, non-player ships, dockables, other ?
I quite agree. The weight of the oxp makes it less appealing to some people...

Re: Griff's normalmapped ship remakes

Posted: Sun Jun 19, 2011 1:00 pm
by Griff
I'm not sure about splitting up the oxp, a lot of the textures are shared between NPC and player ships, plus all the ships are available as individual downloads on my box.net site, each one of those is about 2-4Mb to download so you could collect the set a bit at a time if the 90Mb bundle oxp hammers your internet connection a bit too much (like it does mine :lol: )
It might be worth me putting together a lower resolution texture version, scaling all the textures down 50% should make some real savings in memory use and download size