Excel Wikipedia Data to Pioneer LUA code calculator

Pioneer is an open-ended space adventure game. Explore the galaxy, make your fortune trading between systems, or work for the various factions fighting for power, freedom or self-determination.
Homepage: http://pioneerspacesim.net/
IRC: http://pioneerspacesim.net/irc
Downloads: https://pioneerspacesim.net/page/download/
trumpet
Private
Posts: 96
Joined: Tue Jul 05, 2011 2:33 am

Excel Wikipedia Data to Pioneer LUA code calculator

Post by trumpet »

Ages back I pushed to get Charon added to Sol. RobN was like 'great idea! add it yourself'.. and I was like Moe Syzlak going 'Whaaaa?????!!!!!' :lol: The LUA for systems is easy to grasp and with some help on the numbers I was able to dial in a half-way decent Charon (and then for my own sol.lua file added nyx and hyrda (not quite as accurate)). Anyone who wants to add those two distant satellites can search this forum for 'Charon' and find the thread 'thanks from a mac user'..the main problems I had were working out the numbers! I mean, Wikipedia has such great data to dial in and for the most part - mars for instance you can work it out.. but I dunno.. I've never been really able to quite work out how the numbers work... Why is mars 533,1000 radius and Jupiter 11, 1... and how do you know when to do what??? Anyway, Earth's data is the control data right? Earths radius is 1, 1 for example. And the atmosphere is 1, 1 too, semi axis major blah blah...What if I build an excel spread sheet where you could dial in the data from wikipedia and it'd convert it'd output lua code for you??And that's what I'm starting to do... It's a bit of a fail at the moment[url]https://www.yousendit.com/download/QlVpRm95SWVsamRjR01UQw[/url] still can't work out what the numbers mean though. For instance how do you know to put 1000 or 1 or 10000 as the 2nd number in radius for example? I have a firm grasp of programming logic, recursion and could embellish this quite significantly if anyone is able to help be get past my main weakness: which is the numbers side of things.
Ziusudra
Private
Posts: 61
Joined: Tue Aug 02, 2011 10:49 pm

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by Ziusudra »

Different platforms (windows, linux, OSX, etc.) can have slight differences in their floating point number systems. To work around that, numbers are stored as fractions. So Mars' radius(f(533,1000)) is 533/1000 or 0.533 and Jupiter's mass(f(3178,10)) is 3178/10 or 317.8.The units for radius and mass of planets is in Earth radius and mass. Thus Earth's radius(f(1,1)) and mass(f(1,1)) both equal 1. While Mars' radius is 0.533 times Earth's radius and Jupiter's mass is 317.8 times Earth's.The units for radius and mass of stars is in Sol radius and mass. Thus Sol also has radius(f(1,1)) and mass(f(1,1)).As for what numbers to use in the f(x,y): both have to be whole numbers, so mass(f(317.8,1)) would be wrong. Although f(3178,10) could be reduced to f(1589,5) the first is easier for humans to understand.
trumpet
Private
Posts: 96
Joined: Tue Jul 05, 2011 2:33 am

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by trumpet »

hmmn. I was never any good at fractions but I think there is just enough info in what you've said there for me to do another pass. thanks heaps!
Brianetta
Private
Posts: 863
Joined: Sun Apr 03, 2011 6:12 pm

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by Brianetta »

On a vaguely related note, Charon is already in the game - Hydra and Nix are missing.Adding satellites to a dwarf planet is all very noble, but there are four other dwarf planets in Sol which have not been added at all yet.
ollobrain
Private
Posts: 561
Joined: Tue Jan 04, 2011 9:40 am

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by ollobrain »

this mission should u choose to accept it is to add the noble dwarf planets that are missing and their companion orbiting moons into pioneer
trumpet
Private
Posts: 96
Joined: Tue Jul 05, 2011 2:33 am

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by trumpet »

...No s&&t Brianetta - I pushed for Charon to be added back in build 20. (and was excited when it was) And also- that's pretty much the first thing I wrote in my post. Your tone is always so... Off putting.But yes mate, sure- As for other celestial bodies , man if I can get that excel calculator to work for me so I can dial in stats from wiki then I'd love to add Huamea, makemake and eris. Wtf not?
trumpet
Private
Posts: 96
Joined: Tue Jul 05, 2011 2:33 am

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by trumpet »


ollobrain wrote:
this mission should u choose to accept it is to add the noble dwarf planets that are missing and their companion orbiting moons into pioneer
I accept! I'd love to add them once I've got a handle on the fraction thingys
spazeman
Private
Posts: 37
Joined: Mon May 21, 2012 1:44 pm

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by spazeman »

You guys are legends!Have a biscuit...
trumpet
Private
Posts: 96
Joined: Tue Jul 05, 2011 2:33 am

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by trumpet »

that was a great docco!took me a few days to get through it cause of work but it was great.think I might fly to Titan tonight and watch Saturn rise. (have done that from Frontier once before)
trumpet
Private
Posts: 96
Joined: Tue Jul 05, 2011 2:33 am

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by trumpet »

I'll admit I am pretty dumb at maths and as a result I still can't see the pattern/work out the equation that is used to determine how you use which fraction when...Here's a list of radius data from wikipedia, that data divided by earth's radius and the pioneer code lifted directly from sol.luawikipedia data data/6378.1km pioneer lua coderadius (jupiter) | 71,492.00km | 11.2089807309 | :radius(f(11,1))radius(earth) | 6,378.10km | 1.0000000000 | :radius(f(1,1))radius (mars) | 3,396.20km | 0.5324783243 | :radius(f(533,1000))radius (proteus) | 210.00km | 0.0329251658 | :radius(f(310,10000))radius (phobos) | 11.10km | 0.0017403302 | :radius(f(21,10000))So if a value is bigger than earth it should be x over 1? If a value is less than earth but over 1000, it should be x over 1000 (I'm guessing to represent the 1st 3 values (10th, 100th, 1000th) after the decimal point)But why are both proteus and phobos over 10000? Should phobos be over 100000? And why is it 21/10000 not 11/100000 ?Is there an equation at work here to get the Km value (or mass, semi major axis etc) converted to the appropriate (f(f1,f2)) value?I so confuse :oops:
Brianetta
Private
Posts: 863
Joined: Sun Apr 03, 2011 6:12 pm

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by Brianetta »


trumpet wrote:
Is there an equation at work here to get the Km value (or mass, semi major axis etc) converted to the appropriate (f(f1,f2)) value?
It's a fraction of Earth's radius. If a planet is twice as wide as Earth, it's f(2,1). If it's two thirds as wide as Earth, it's f(2,3).It's all a ratio of Earth. Earth is about 6,378 km in radius. The easy-peasy way to specify it, therefore, is as a fraction with the desired value first, and Earth's value second. Ceres is about 476 km, so that is like this:
Code:
:radius(f(476,6378))
See data/systems/custom/03_elite.lua for how I did the Elite systems. I got the radii of the planets from the alioth.net wiki (here are Lave's details, for example). It shows the radius of Lave as:Planet Radius: 4116km...so I coded that in as:
Code:
:radius(f(4116,6378))
Hope that clears it up, and makes it less daunting.
trumpet
Private
Posts: 96
Joined: Tue Jul 05, 2011 2:33 am

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by trumpet »

Ok cool. I got that they were fractions I just couldn't see the pattern. But I do like your easy-peasy method! that should help me a great dealcheers
fluffyfreak
Private
Posts: 1292
Joined: Sun Nov 27, 2016 12:55 pm

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by fluffyfreak »

@trumpet:Did you ever come up with a useful spreadsheet?I'm trying to put together a system right now and it's horrible!
fluffyfreak
Private
Posts: 1292
Joined: Sun Nov 27, 2016 12:55 pm

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by fluffyfreak »

Or to be more precise, I grabbed JonG's FFEStarSys program and wanted to try to recreate the Ache®nar star system... for fun. The process is proving to be... not fun.For example converting between the values it has and the fixed point ratio-like representation we use is particularly complicated, especially when you don't know which ones actually belong to which value. Lets take the semi-major-axis which isn't what I thought it was I was actually looking for axial-tilt, I think.EDIT: thinking about it, what might be nice is the ability to simply dump the data for a system straight from the Frontier/FFE data...
trumpet
Private
Posts: 96
Joined: Tue Jul 05, 2011 2:33 am

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by trumpet »


'fluffyfreak' wrote:
Or to be more precise, I grabbed JonG's FFEStarSys program and wanted to try to recreate the Ache®nar star system... for fun. The process is proving to be... not fun.For example converting between the values it has and the fixed point ratio-like representation we use is particularly complicated, especially when you don't know which ones actually belong to which value. Lets take the semi-major-axis which isn't what I thought it was I was actually looking for axial-tilt, I think.EDIT: thinking about it, what might be nice is the ability to simply dump the data for a system straight from the Frontier/FFE data...
I started to. I just couldn't get my head around the fractions aspect. The stuff that Brianetta suggested worked well for radius etc, but I got stitched up on some of the orbital/axial data again. Sorry man. Best laid plans of mice and men...
trumpet
Private
Posts: 96
Joined: Tue Jul 05, 2011 2:33 am

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by trumpet »

Achenar would be awesome! That system is bloody huge.
fluffyfreak
Private
Posts: 1292
Joined: Sun Nov 27, 2016 12:55 pm

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by fluffyfreak »

Indeed and it's difficult to understand the current system.Still I'm slogging my way through it, got the first 6 worlds out of 10 almost in, successfully docked at one of the orbitals <img src="'[url]http://spacesimcentral.com/forum/public/style_emoticons//icon_e_biggrin.gif[/url] class='bbc_emoticon' alt=':D' />Will have to go through and double check everything when I'm done and then it'll need per-world parameters for the atmosphere and things but so far so good.
fluffyfreak
Private
Posts: 1292
Joined: Sun Nov 27, 2016 12:55 pm

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by fluffyfreak »

AaARGH, *headdesk*, having just posted that I realise I've got _all_ of the rotation_period's wrong.bugger,onwards!
fluffyfreak
Private
Posts: 1292
Joined: Sun Nov 27, 2016 12:55 pm

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by fluffyfreak »

A lot of issues resolved now, just working on the mass vs radius of the terrestrial (rocky) worlds that you can land on, have star ports etc. Well I say working on it, what I'm doing is bashing my head against the desk.It wasn't at all obvious how they were related at first and I couldn't take off or land on any for a while. Think I've worked it out now, the rules seem different for stars and gas giants though and I haven't entirely figured them out yet.However Achernar now has all of the worlds, stations and starports from FFE and it is a pretty cool system already <img src="'[url]http://spacesimcentral.com/forum/public/style_emoticons//icon_e_smile.gif[/url] class='bbc_emoticon' alt=':)' />
fluffyfreak
Private
Posts: 1292
Joined: Sun Nov 27, 2016 12:55 pm

RE: Excel Wikipedia Data to Pioneer LUA code calculator

Post by fluffyfreak »

Submitted a pull request for Achernar re-implementation <img src="'[url]http://spacesimcentral.com/forum/public/style_emoticons//icon_e_smile.gif[/url] class='bbc_emoticon' alt=':)' />
Post Reply

Return to “Pioneer”