[RELEASE] System Features: Sunspots and Rings OXPs

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

Moderators: another_commander, winston

User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by cim »

System Features: Rings is now updated to 1.1 with a much more effective ring texture provided by ZygoUgo. Download links in the first post have been updated.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16060
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by Cody »

Cool!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6311
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by Diziet Sma »

Cody wrote:
Cool!
Seconded!
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by Commander McLane »

Got this in the log:

Code: Select all

  11:31:33.095 [shader.compile.failure]: ***** ERROR: GLSL fragment shader compilation failed for systemfeatures-sunspot.fragment:
>>>>> GLSL log:
ERROR: 0:33: 'assign' :  cannot convert from 'const int' to 'float'
ERROR: 0:53: 'switch' : Reserved word. 
ERROR: 0:53: 'switch' : syntax error syntax error


11:31:33.095 [shader.load.fullModeFailed]: ----- WARNING: Could not build shader systemfeatures-sunspot.vertex/systemfeatures-sunspot.fragment in full complexity mode, trying simple mode.
  11:31:33.096 [shader.compile.failure]: ***** ERROR: GLSL fragment shader compilation failed for systemfeatures-sunspot.fragment:
>>>>> GLSL log:
ERROR: 0:33: 'assign' :  cannot convert from 'const int' to 'float'
ERROR: 0:53: 'switch' : Reserved word. 
ERROR: 0:53: 'switch' : syntax error syntax error


11:31:33.097 [shader.load.failed]: ***** ERROR: Could not build shader systemfeatures-sunspot.vertex/systemfeatures-sunspot.fragment.
  11:31:33.191 [shader.compile.failure]: ***** ERROR: GLSL fragment shader compilation failed for systemfeatures-sunspot.fragment:
>>>>> GLSL log:
ERROR: 0:33: 'assign' :  cannot convert from 'const int' to 'float'
ERROR: 0:53: 'switch' : Reserved word. 
ERROR: 0:53: 'switch' : syntax error syntax error


11:31:33.191 [shader.load.fullModeFailed]: ----- WARNING: Could not build shader systemfeatures-sunspot.vertex/systemfeatures-sunspot.fragment in full complexity mode, trying simple mode.
  11:31:33.192 [shader.compile.failure]: ***** ERROR: GLSL fragment shader compilation failed for systemfeatures-sunspot.fragment:
>>>>> GLSL log:
ERROR: 0:33: 'assign' :  cannot convert from 'const int' to 'float'
ERROR: 0:53: 'switch' : Reserved word. 
ERROR: 0:53: 'switch' : syntax error syntax error


11:31:33.192 [shader.load.failed]: ***** ERROR: Could not build shader systemfeatures-sunspot.vertex/systemfeatures-sunspot.fragment.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by Eric Walch »

No problems on my MacBook

Code: Select all

12:07:56.195 [rendering.opengl.version]: OpenGL renderer version: 2.1.0 ("2.1 NVIDIA-8.10.44 304.10.65f03"). Vendor: "NVIDIA Corporation". Renderer: "NVIDIA GeForce 320M OpenGL Engine".
Correction. McLain's log is about the old sun spots oxp and not about the new ring release. (I never installed the sunspots)

The ring looks great, less dense than the previous one.
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by Commander McLane »

Eric Walch wrote:
Correction. McLain's log is about the old sun spots oxp and not about the new ring release. (I never installed the sunspots)
Yep. I only now downloaded the sunspots, together with the new rings.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by cim »

Commander McLane wrote:
Got this in the log:
Thanks for the report. Sunspots 1.4 is now released to fix this.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2412
Joined: Mon May 31, 2010 11:11 pm

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by Switeck »

I was wanting to create a large Saturn-like gas giant planet in every other system (I'll reduce probability later), but I can't seem to work out the logic to do so.

Code snippet time again:

Code: Select all

if( (system.ID & 1) == 0) {
	GasGiantJ = system.addPlanet("GasGiantJ");
	GasGiantJ.isGasGiant = true;
	GasGiantJ.solarGasGiant = true;
	GasGiantJ.orientation = system.mainPlanet.orientation;
	var ring = system.addVisualEffect("systemfeatures-rings", GasGiantJ.position);
	ring.position = GasGiantJ.position;
	ring.orientation = GasGiantJ.orientation;
	ring.orientation = ring.orientation.rotate(ring.orientation.vectorRight(),Math.PI/2);
}
The gas giant planet is created, placed in the spot I want it to be (via planetinfo.plist ), and rings are added...but the rings are around the main planet instead of the gas giant.

I'm utterly clueless yet again. :?
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by cim »

Switeck wrote:
I was wanting to create a large Saturn-like gas giant planet in every other system (I'll reduce probability later), but I can't seem to work out the logic to do so.

Code snippet time again:

Code: Select all

if( (system.ID & 1) == 0) {
	GasGiantJ = system.addPlanet("GasGiantJ");
	GasGiantJ.isGasGiant = true;
	GasGiantJ.solarGasGiant = true;
	GasGiantJ.orientation = system.mainPlanet.orientation;
	var ring = system.addVisualEffect("systemfeatures-rings", GasGiantJ.position);
	ring.position = GasGiantJ.position;
	ring.orientation = GasGiantJ.orientation;
	ring.orientation = ring.orientation.rotate(ring.orientation.vectorRight(),Math.PI/2);
}
The gas giant planet is created, placed in the spot I want it to be (via planetinfo.plist ), and rings are added...but the rings are around the main planet instead of the gas giant.

I'm utterly clueless yet again. :?
Probably you want to edit the effectSpawned event handler in the rings script so that it doesn't put it back around the main planet.

(You'll then probably also need to edit the script a bit more so that it uses the gas giant, not the main planet, as the reference for visibility and shadowing tests. I can't remember offhand if you'll need to edit just the script or the fragment shader as well)
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2412
Joined: Mon May 31, 2010 11:11 pm

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by Switeck »

While I can't say yet if the fragment shader needs editing as well, I can definitely say I need to edit the effectSpawned event handler in the rings script so that it doesn't put it back around the main planet.
I tried creating my own .js code sections that do the effectSpawned event handler in my OXP instead of modifying the original one/s, but of course that didn't work...it was fighting with the original script over where the rings should be. Main planet won.

Extending this Ring OXP to support additional planets in System Redux-type OXPs is proving somewhat hard. I'm not even sure there can be more than 1 ringed planet in a system. Lots of video cards won't like it in any case. :lol:
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by cim »

Switeck wrote:
Extending this Ring OXP to support additional planets in System Redux-type OXPs is proving somewhat hard. I'm not even sure there can be more than 1 ringed planet in a system. Lots of video cards won't like it in any case. :lol:
Yeah, they're expensive graphics-wise, at least by Oolite standards. If you wanted more than one you'd need to put some variables in the effect script, so that effectSpawned could know which planet to target, and then set those variables as you add the rings objects.

Note that as currently written the rings have to be in the equatorial plane of the planet, and the centre of the sun also has to be on that plane. That's always the case for the main planet, but will need work to be true for additional planets.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2412
Joined: Mon May 31, 2010 11:11 pm

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by Switeck »

Ok, I got it working...rings are now around the gas giant!
I replaced "system.mainPlanet." with "GasGiantJ." in the systemfeatures-ring.js script.
GasGiantJ should already be oriented the same as the main planet and my planetinfo.plist should be placing it in the equatorial plane of the system at:
position = "spm 800000 0 3000000";
...so the rings should line up nicely. If the tilt's a little off, it'd probably just be more realistic.

The method I used places rings either around this particular gas giant (if it's even added) or around the main planet...but not both.
With effort, it looks like I could redo my code changes so it can do both...but as pointed out the graphical load would be considerable.

There may still be some shader issues with the rings -- the planet's shadow is in the right place but the other parts of the rings seem "dimmer" if more distant from my ship even if that side is closer to the sun, but that's possibly due to my video card.
Duggan
---- E L I T E ----
---- E L I T E ----
Posts: 496
Joined: Sat Dec 31, 2011 2:58 pm

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by Duggan »

Ok, I got it working...rings are now around the gas giant!
I replaced "system.mainPlanet." with "GasGiantJ." in the systemfeatures-ring.js script.
Hello Switeck,

Is the above all I need do in order to relocate rings to the Gas Giants in System redux ? I have replaced all occurences of the text "system.mainPlanet." with "GasGiantJ." in both j script files within the oxp ,as far as I understood your guidance.

Is there anything else I need to do (e.g, adjust populater values....is if I would have the first idea how to do that :) ) as I have not encountered any ringed Gas Giants in System Redux as yet.

Any help and advice would be greatfully recieved. Thank you.


edit, ah, I see this is perhaps a little more complex than first I thought :)
Flying Python Class Cruiser, Chapter & Verse IV
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2412
Joined: Mon May 31, 2010 11:11 pm

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by Switeck »

GasGiantJ was just the created variable name for the planet my code added:
GasGiantJ = system.addPlanet("GasGiantJ");
This also includes GasGiantJ reference in planetinfo.plist, which is what addPlanet("GasGiantJ") pulls its info from.

I used the arbitrarily-created name GasGiantJ because I deemed it unlikely to conflict with existing variable names and assignments (such as .isGasGiant).

Oolite has to retain the gas giant's info in memory as a variable to make it "easy" to give it rings.
You also have to tell Oolite that the large planet is in fact a gas giant, though I'm not sure if both these 2 lines are needed to do so:
GasGiantJ.isGasGiant = true;
GasGiantJ.solarGasGiant = true;
Duggan
---- E L I T E ----
---- E L I T E ----
Posts: 496
Joined: Sat Dec 31, 2011 2:58 pm

Re: [RELEASE] System Features: Sunspots and Rings OXPs

Post by Duggan »

Thank you for your kindness Switeck,

Am I to follow these instructions within the System Redux oxp or do I have to go into the innards of the game itself?

Please Forgive my density, I am naturally quiet loath to start altering,adding to code without being certain of what I am doing, having said that , I would quiet like to see planetary rings around one of the larger extra planets in system redux. say every 4th or 5th system I visited.

If this is doable, I think it would further add to the immersion of the game, personally speaking.

Thanks again Duggan.
Flying Python Class Cruiser, Chapter & Verse IV
Post Reply