Oh yes. The two PRNGs being used both for procedural stuff and for random stuff, and not being reset before each procedural thing, is the stuff of nightmares. Can we start again, please?Kaks wrote:edit: yes, I am -totally- confused too... luckily we're in good company here. Ahruman seems to have had a few problems with ranrot too!
Limit abs coordinates to scripting?
Moderators: winston, another_commander
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
Last edited by JensAyton on Thu Mar 12, 2009 10:14 pm, edited 1 time in total.
E-mail: [email protected]
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
This probably boils down to x87 FP vs. SSE FP. (Oolite for OS X x86 uses SSE despite being 32-bit; this is the norm on OS X, because its behaviour is closer to PowerPC behaviour and all Intel Macs have SSE3.)_ds_ wrote:It looks like i386 is rounding down and amd64 is rounding to nearest; and amd64 is truncating the values from their internal representations to 32-bit before converting to int rather than just doing straight conversions.
E-mail: [email protected]
Ok, OS X on i386 gives exactly the same results as Linux 64-bit (confirming Ahruman's comment above), however it does give different results between PROCEDURAL and non-PROCEDURAL planet generation, confirming my earlier results. So I'm not sure how you got your results, Kaks.
In either case, I agree with Ahruman to start again, or rather, that we refactor the code to segregate the procedural 'random' functionality from the functionality which is truly supposed to be random. Whether we achieve this by resetting the seeds for the procedurally-random stuff or by running a new RNG for the truly random stuff and keeping RANROT for the legacy stuff I don't know. This would future-proof the code from further surprises such as this.
In either case, I agree with Ahruman to start again, or rather, that we refactor the code to segregate the procedural 'random' functionality from the functionality which is truly supposed to be random. Whether we achieve this by resetting the seeds for the procedurally-random stuff or by running a new RNG for the truly random stuff and keeping RANROT for the legacy stuff I don't know. This would future-proof the code from further surprises such as this.
The glass is twice as big as it needs to be.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
I’m not sure I do – it was meant as a joke. Redoing it with a clear separation of “random” and “procedural” is conceptually the right thing, but making the right decisions will be difficult and painful. For instance, the way %R random-name tokens reset under various badly defined circumstances would probably change, and I’m pretty sure there are things that depend on that behaviour.Micha wrote:In either case, I agree with Ahruman to start again
E-mail: [email protected]
Trunk does does indeed give different results between procedural and non-procedural on my system too, and I'm sure I've already said so. What I was saying is that my bracketed code & mac non-procedural was giving me the same positions. I had a bit of RL tonight, and on coming back I've done a bit more testing. As luck would have it, the planets I looked at last night were Lave(0, 0, 452760), Diso(0, 0, 677050) & Reorte(0, 0, 834470) . They show the same coordinates in 1.72.2. on a mac as they do on my homebrew 1.73 build on mac, linux & windows. On further testing, it turns out that it was an amazing string of bad luck on my part. Other systems in the neighbourhood, like riedquat(0, 0, 960450 in my homebrew 1.73 - 0, 0, 576270 in mac 1.72.2) and zaonce (0, 0, 387300 in my homebrew 1.73 - 0, 0, 464760 in mac 1.72.2) show a marked difference between the two versions!Micha wrote:Ok, OS X on i386 gives exactly the same results as Linux 64-bit (confirming Ahruman's comment above), however it does give different results between PROCEDURAL and non-PROCEDURAL planet generation, confirming my earlier results. So I'm not sure how you got your results, Kaks.
I might be repeating myself here, but using my homebrew 1.73 code there's no positional difference across formats, and procedural/non-procedural ( and confusingly, the first 3 planets I looked at were positioned identically between my code & 1.72.2 mac) .
Of course, and still more confusingly, using trunk there are differences both between platforms & procedural/non-procedural within the same platform.
Here's the patch between my homebrew 1.73 & trunk v2089, there's a couple of non-planet related things in there, but I'm sure you can safely ignore those!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
@Ahruman: Whoops, sorry, that one went straight over my head and into the stratosphere!
So I guess our biggest question moving forwards is whether or not we need to maintain backward compatibility with planet/station positions or not. And if so, to which platform do we maintain compatibility? If we fix planet positions to be consistent we'll always break compatibility with at least some pre-fix builds.
So I guess our biggest question moving forwards is whether or not we need to maintain backward compatibility with planet/station positions or not. And if so, to which platform do we maintain compatibility? If we fix planet positions to be consistent we'll always break compatibility with at least some pre-fix builds.
The glass is twice as big as it needs to be.
Wait! Let's recap the situation: so far we have 4 (or 6?) different planet/sun/witchpoint positions depending on platforms & procedural/non procedural textures.
No matter what we do, if we get to a single fixed position across platforms we will 'break' things one way or another. But are we sure there's going to be some real breakage if we do that?
We've already got 'some' drift from 1.65, so maybe keeping the planets' absolute position exactly as they were in 1.72 isn't going to be that vital, expecially if no more OXP is going to be affected one way or another.
Apart from Lave Academy, are there any other OXPs that rely on absolute positioning?
No matter what we do, if we get to a single fixed position across platforms we will 'break' things one way or another. But are we sure there's going to be some real breakage if we do that?
We've already got 'some' drift from 1.65, so maybe keeping the planets' absolute position exactly as they were in 1.72 isn't going to be that vital, expecially if no more OXP is going to be affected one way or another.
Apart from Lave Academy, are there any other OXPs that rely on absolute positioning?
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
The v1.02 doesn't rely on it, I recoded it to position everything in relation to the main station. It still spawns things using absolute, but the actual co-ordinates are calculated from the main station so moving things about in the z-axis won't hurt it.Kaks wrote:Apart from Lave Academy, are there any other OXPs that rely on absolute positioning?
Only people with v1.01 will be affected, and if it becomes a problem they can just update.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
Ok, quick emergency editing:
Are there any OXPs that rely on absolute positioning?
Are there any OXPs that rely on absolute positioning?
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
It's going to be the ones that give new oribiting entities like stations and such. And there probably just the newer OXPs as "abs" hasn't been available for that long.
Just had a quick look in Cataclysm, and some of the entities there look to be positioned absolutely. So they'll be in a different place, although whether that matters in game-play terms is another question.
Just had a quick look in Cataclysm, and some of the entities there look to be positioned absolutely. So they'll be in a different place, although whether that matters in game-play terms is another question.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
I don't think there could be many as this possibility is quite new and only a few oxp programmers worked with it. The only i can come up with is "save everywhere" from Frame. He stores the absolute position in a saved file. So when coordinate system changes and on old game is loaded there could be troubles.Kaks wrote:Ok, quick emergency editing:
Are there any OXPs that rely on absolute positioning?
But this won't be a to big problem as I assume most will only use it for a temporary saving a commander. It is still development work so I assume all players will also save a commander on the main station as backup.
None of my work uses it. All my uses of "abs" are with calculated relative coordinates.
-----
Looking through al that randomness I notice it wastes also a lot of time to repeat calculating known random numbers over and over again. It would make more sense to calculate them once on entering a system and store in an array.
I just noticed that every police asks every 10 seconds for the witchpoint location. And because that location is also a bit randomised, it does reset the seed for this calculation every time and recalculates that random location over and over again and for every ship again. It would make more sense to me to just redefine that entry point on system creation, making it a system property and only transmit that calculated coordinate on each request.
Last edited by Eric Walch on Fri Mar 13, 2009 12:41 pm, edited 1 time in total.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Not if, it does!Micha wrote:If Cataclysm current depends on ....
Cataclysm uses it on two places to add stations in space. The second is in deep space so a difference would not be noticed. However, the other is a station in Galaxy 3. This station is located at the back of enrece in "abs" coordinates.
Code: Select all
system.legacy_addShipsAtPrecisely("cataclysm_enrece_station", 1, "abs", [-99221.3, -20562.3, 453026])
UPS-Courier & DeepSpacePirates & others at the box and some older versions