Page 7 of 12
Re: [Release] System Features: Rings
Posted: Wed Sep 13, 2017 8:47 pm
by gsagostinho
@cbr thanks really a lot, that looks good! But could you please confirm to me that the license of this image is compatible with the CC-BY-SA 3.0 license of this OXP?
Re: [Release] System Features: Rings
Posted: Wed Sep 13, 2017 8:59 pm
by cbr
@cbr thanks really a lot, that looks good! But could you please confirm to me that the license of this image is compatible with the CC-BY-SA 3.0 license of this OXP?
ah, good point, let me see...
I used this picture as base.
http://www.robink.ca/blog/rocks-2/
If the source material is to your liking perhaps you could mail him if minds using his image for the rings
( if he's still around... )
Re: [Release] System Features: Rings
Posted: Wed Sep 13, 2017 9:03 pm
by gsagostinho
@cbr just testing this, and while this texture look really amazing at close range the tiling is quite problematic at anything a bit further away. I will see if that can be improved by tweaking the shader, but given the choice my priority would be to have the rings looking nice from medium and far away distances than at close up ones, since that's where the player will be most of the time.
If the source material is to your liking perhaps you could mail him if minds using his image for the rings
( if he's still around... )
Many thanks. I will first see how the tiling will end up, because if that can't be improved then we don't even have to bother trying to contact the author. Really appreciate the help!
Re: [Release] System Features: Rings
Posted: Wed Sep 13, 2017 9:39 pm
by cbr
Couldn't resist, quick variant
upclose
distance
the variant
https://postimg.org/image/q5rnsp3z9/
Re: [Release] System Features: Rings
Posted: Wed Sep 13, 2017 11:14 pm
by gsagostinho
@cbr thanks, I will take a look on this new file
Coming back to the station position issue: I understand that system.mainPlanet.position and system.mainStation.position; have constant values (as expected since as far as I can tell the planets and stations only rotate but do not translate), but why on earth does system.mainPlanet.orientation; change over time? Shouldn't the orientation vector be always constant, i.e a vector going from the centre of the planet to its northern pole?
Re: [Release] System Features: Rings
Posted: Thu Sep 14, 2017 12:25 am
by phkb
I have no detailed knowledge to offer here, but could it be related to the planet rotation?
Re: [Release] System Features: Rings
Posted: Thu Sep 14, 2017 2:40 am
by RockDoctor
Hmmm, the original pix seems to relate to a station which passes through the ring plane.
Taking previous comments about Oolite being a game not a physics simulation into account ...
The basic physics of a ring require that it be in a plane passing though the centre-of-mass of the planet and perpendicular to the angular momentum vector of the planet. In short, the rings are above the planet's equator.
Now, thinking forward to a job as a station placer, one bit of orbital space I would not put a station would be in the equatorial plne. Precisely because small debris gets perturbed to that plane (if it doesn't hit the planet first), resulting in avoidable debris impact (aka "expensive damage") So, no one would do that. Twice.
For a stable orbit, one focus of the (elliptical) orbit needs to be coincident with the centre-of-mass of the planet-station system (Kepler, 1608 IIRC) For circular orbits, both foci are coincident.
However, that does not require that the "light" body, (space station, dust grain) be in an equatorial orbit. An TBH, I've seen plenty of space stations well off the equatorial plane in various versions. So, not a problem. The problem pictured seems to be, appropriately, that a station has migrated into the ring/ equatorial plane. And consequently, there is so much debris getting into the "approach lane" that the station loses traffic.
There are physics line here that coincide with possible story lines.
All stations are going to experience the "towards equatorial/ring plane" forces (that's what produces and maintains rings, after all). So, they're going to need artificial application of an out-of-plane force, in the correct direction, at the appropriate time. That, to me sounds like a mission for a [Cobra/ Anoconda/ Boa/ BigDamnShip} equipped with a fuel scoop (to "push"), or a TowBar (I forget the OXP name/s, to pull) the Station into a better orientation.
It's a maintenance job, and a station whose management is lax/ anarchic enough to let it slip to the point that docking vessels run into ring material ... it's like a motorway/ freeway/ autobanh/ autostrada station which doesn't maintain it's off-ramp. Not good.
BTW, Kepler and Newton (and Johnny-Come-Lately-Einstein) agree on the "orbit focal plane passes through centre-of-mass.)
A question - given the mass-shifting capability of a big ship like an Anaconda, how long would it have to TowBar a station to effect an appreciable orbital correction. (I'll assume that by accepting the "Station Orbit Maintenance" mission, the drive and Towbar orientation would be dealt with by Station Astrogation Dept. How many flight-hours would it take? Once you're TowBared to the station, can you Torus-sleep until mission completion?
I think there are several ideas in there for various OXPs, but one for "core" (stations should not be on the equatorial plane, permanently).
(Yes, I know it's a game, not a physics simulation. That doesn't mean that physics should be ignored, just that knowing which physics has been ignored supplies potential game-ply options.)1111
Re: [Release] System Features: Rings
Posted: Thu Sep 14, 2017 10:31 am
by gsagostinho
@RockDoctor That perhaps make sense, but as spara pointed out moving a station too far away from its original position might have some undesirable consequences. For the scope of this OXP, I believe the best solution is to simply move the station some couple of hundreds of meters up or down in relation to the ring when a collision is detected.
@phkb I really don't know exactly, but it turns out orientation is actually not a vector but rather a quaternion. I know that the 2nd, 3rd and 4th elements of a quaternion gives us a vector, and I initially thought this vector would be perpendicular to the rotation plane (like a vector going from the centre of the planet to one of its poles). But thinking about it, it's looking to me that this vector is actually pointing towards the direction of change of a reference point on the surface of the planet at a specific moment, which means that at every point in time the reference point is somewhere else due to its rotation and so this vector will be pointing to a different direction as well. spara is thankfully helping me with the maths here, and he is nearly cracking the problem and creating a formula for computing the ring-station distance. Once that's done, the problem is solved as all I need is a simple conditional: if station too close -> move it up a tiny bit, else do nothing.
Thanks to you all for the input!
Re: [Release] System Features: Rings
Posted: Thu Sep 14, 2017 12:20 pm
by Astrobe
Continuing on what RockDoctor said, one could transform the "bug" into a feature by switching the station model for the damaged model someone made (I've seen it recently here), and spawn a fallback station nearby (or even a fuel station and a capital ship, if they allow contract completion etc. - but I digress). One doesn't even have to do complicated maths to detect when station-in-the-ring happens, one can just hardcode the list of the systems where it happens.
I don't know how one forces a particular station model though.
Re: [Release] System Features: Rings
Posted: Thu Sep 14, 2017 1:08 pm
by gsagostinho
One doesn't even have to do complicated maths to detect when station-in-the-ring happens, one can just hardcode the list of the systems where it happens.
But that would involve manually checking 2048 systems. Or living with the knowledge that in some corner of some galaxy, a collision might be happening and depending on a bug report
The maths aren't actually complicated, it's rather a matter of understanding how Oolite works. We know which direction the sun is because this vector is defined on planetlist. We know the direction the station is. What I don't know is where the rotation direction is defined, and using the orientation quaternion is being a little bit trickier than I thought, but as I said spara is nearly cracking down the solution
That way there will be a formula to automatically check the systems, regardless if the solution implemented will be moving the station or anything fancier than that.
As for the damaged model, I am not sure I like the idea. First, I really think this is beyond the scope of this OXP, this should be a simple ambience OXP. But besides that, I think that a burning Coriolis inside the rings would look just as bad as a regular one does, those collisions aren't a pretty sight. Also, how could one justify that a station got there in the first place? And then there is the point already raised that moving stations too much could in principle interfere with other things, and I don't want to open a Pandora box of incompatibilities and new bugs. So in my view the simplest solution is really to came up with a maths formula to determine whether a station is too close to the plane of a ring or not, and if so move it slightly upwards.
Re: [Release] System Features: Rings
Posted: Thu Sep 14, 2017 6:40 pm
by cim
The planet orientation changes because they rotate (slowly) so their axis doesn't move but they spin around it.
So... here's how things are worked out at system creation time
- the planet is placed at its location
- the sun is placed in the sun_vector
direction
- the planet is rotated so that its axis points along a vector described by the cross product of the sun vector and the vector [1,0,0]. This ensures the axis has a consistent direction perpendicular to the sun (All Oolite main planets have an axial tilt of 0)
- the station is placed in the direction of the station_vector
So to detect all potential ring collisions in advance
- recalculate the planet axis vector as above
- take the cross product of that vector and the station vector
- if it's approximately zero, there may be a collision with the rings.
You can use JS in the debug console to iterate over all systems quickly and return potential collisions, and then reposition the stations as needed in planetinfo.plist
(Repositioning them through planetinfo.plist will cause the least interference with other OXPs, I think, compared to doing it with JS once the system is ready)
Re: Screenshots
Posted: Thu Sep 14, 2017 6:46 pm
by cim
spara wrote: ↑Wed Sep 13, 2017 5:08 pm So the shadow is done with the shader and not the game's lightning engine. In that case, tilting is not the way to go.
The lighting engine doesn't really support shadows at all. There's a basic check that allows:
- the side of an object opposite the sun to be darker (which is in the shaders handling of light sources)
- objects which have something big between them and the sun to be fully shadowed
But that second check only applies on the whole-object scale, so can't be used here.
Re: [Release] System Features: Rings
Posted: Fri Sep 15, 2017 9:12 am
by RockDoctor
gsagostinho wrote: ↑Thu Sep 14, 2017 1:08 pm
I think that a burning Coriolis inside the rings would look just as bad as a regular one does, those collisions aren't a pretty sight.
Agreed. (I'm writing this as Cassini is an hour and a half from scuttling.)
gsagostinho wrote: ↑Thu Sep 14, 2017 1:08 pm
Also, how could one justify that a station got there in the first place?
Very definitely. You wouldn't do that, at the station-location decision point, before your first Vogon Constructor fleet sets out to dig the foundations.
gsagostinho wrote: ↑Thu Sep 14, 2017 1:08 pm
So in my view the simplest solution is really to came up with a maths formula to determine whether a station is too close to the plane of a ring or not, and if so move it slightly upwards.
Ah, right. I'm getting a better idea of how the system works, I think. When the ship enters system (while the VFX is going on), the system uses the stored parameters for planet, station, rings, etc to calculate actual locations, orientations, rotation rates, etc? Then the graphics black boxes get on with drawing things. Several of the components of the standard orbital elements are lumped into a quaternion, but others (I guess the phase relations) dumped.
When you say you'd move the station upwards, do you mean northwards w.r.t. to the planet's rotation axis, or outwards from the planet centre? Outwards would work - reducing the debris impact rate. But moving the station "northwards" would be complicated because the orbit is symmetrical about the planet. So if you preserve the momentum vector but move the location 'X' northwards, the resulting orbit would go up north of the eq.plane, then sweep down, pass through the eq.plane (ring plane) and go southwards.
I can't think of an orbital situation on a ringed planet that could avoid the ring plane - that unavoidablity coupled with dynamic friction is why there
are rings. So you do what Cassini did : cross the ring/eq.plane at appreciable angle (reduces time in the firing line for a particular orbital speed) and stay outwards (latterly inwards) of the main ring debris.
Of course, the dynamical friction that pulls debris towards the equatorial plane making it a ring plane will affect the stations. But it's on a centuries-upwards time scale. The debris disc we're constructing around the Earth hasn't had anything like enough time to relax towards the equatorial/ring plane. Yet.
Re: [Release] System Features: Rings
Posted: Fri Sep 15, 2017 9:48 am
by RockDoctor
cim wrote: ↑Thu Sep 14, 2017 6:40 pm(All Oolite main planets have an axial tilt of 0)
Uranus thinks that's a bit sideways, but Venus likes the idea of un peu de soixante neuf.
The axial tilts of Uranus and Venus are 97.8 and 177.4 degrees respectively. Pluto 122 degrees. In fact, it's hard to tell if it's different from random, just using Solar System large object data. Using larger data sets (minor planets, plot data daily updated from
http://www.minorplanetcenter.net) the situation is less random
An I'm off to watch Cassini scuttle.
Re: [Release] System Features: Rings
Posted: Fri Sep 15, 2017 2:40 pm
by gsagostinho
@cim thanks for the suggestions, cim! In particular your explanation of how the rotation axis is calculated is extremely useful. I will do as you say concerning the planetinfo.plist, it sounds better than trying to do it dynamically.
@RockDoctor I do see your point about moving the stations away from the planet being better than moving it up/down parallel to the rotation axis (which is my plan), but I do not want to mess around with the distance of the station to planet, just its vector from the centre of the planet. The main issue is the following: the pretty looking rings are just a shader "illusion" but as far as Oolite is concerned the rings are actually a single solid 3D object in the form of a square plane (think of it as a transparent canvas upon which rings are painted by the shader). This is one of the reasons that detecting collisions with the ring would be nearly impossible with the current shader implementation, as for the game the gaps between the rings (or where the rings terminate between them and the planet) are all still an object, and so you could collide with "nothing" and get your ship destroyed. And please notice that this 3D object is truly huge, many times larger than the planet. So moving a station away is really not an option, but positioning it away from this plane is trivial and so that's what I am going for.