How do stations and new ships appear?

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
elite
Deadly
Deadly
Posts: 128
Joined: Thu Jun 21, 2007 9:26 am

How do stations and new ships appear?

Post by elite »

Hi all.

I have loads of oxp's installed but I still havn't seen most of the ships and bases I have.

For instance one oxp I have is the transhab.oxp which adds a Transhab Station to the game.

However on my travels I have yet to see one.

I just woundered what determins that a certain station appears at a certain planet?

I see that my Lave system has a good looking 'gritty' station.
So what makes other planets have different types of stations and is it something that can be changed in one of the games text files.

Only asking because all I seem to see are mainly standard Coriolis stations and a few Dodec ones too, but it would be nice to see more of the others too (maybe by increasing the percentage chance that they will appear, in a text file somewhere?).

Thanks
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:

Post by Commander McLane »

Stations are chosen by the engine, based mainly on the techlevel of a system. E.g. the Coriolis Station is a very common view. Dodecahedron Stations are rarer, and Icosahedron stations are--as far as I understand--restricted to higher techlevel systems. This seems to be a restriction in the engine itself, as there is nothing in its shipdata indicating a specific techlevel.

Alternative stations like the Transhab and the Globestation are placed as an exchange for one of the existing stations. According to its shipdata a transhab is called as an alternative to a coriolis, but with only 10% probability of any other thing called "coriolis". That makes it rare. The globe is called as an alternative to a icosahedron, which in itself is rare and can be found in higher techlevels only. Also the Globestation has only a certain probability to replace it.

The Torus Station is different. The OXP comes with a planetinfo.plist, specifying all the planets that will get one of the different types of tori. There is no random element to that.

Now if you just want to see a specific station or ship and happen to have the Debug Menu.oxp installed (for Oolite 1.69.1 and following only (and for Mac only, isn't it?)), this is easy. Debug menu.oxp adds a menu named "Debug" to the menu-bar of your Oolite. In this menu you find an item "Create Ship". Choose it and enter the role of the desired entity, and it will spawn somewhere close to the station of the system you're in. The required role is available in the ship's (or station's) shipdata.plist. In case of a Transhab you should enter "transhabstation". Of course a Transhab Station created this way would not replace the original station. It's just an extra, as the whole menu item is meant for testing purposes only. But you would get a visual image of a Transhab in-game.
User avatar
elite
Deadly
Deadly
Posts: 128
Joined: Thu Jun 21, 2007 9:26 am

Post by elite »

Thanks.

I found in the shipdata file for the transhab the variable I needed.... coriolis(0.10).

As a test, I set it to coriolis(1.00) and the transhab appeared at every planet where a normal coriolis station would be.

I have now set the variable to coriolis(0.45) to give me a better chance of seeing it again without seeing it too much.
I also changed a few others too.

Thanks again.
User avatar
Arexack_Heretic
Dangerous Subversive Element
Dangerous Subversive Element
Posts: 1876
Joined: Tue Jun 07, 2005 7:32 pm
Location: [%H] = Earth surface, Lattitude 52°10'58.19"N, longtitude 4°30'0.25"E.
Contact:

Post by Arexack_Heretic »

I like the gritty station alot. :)
Riding the Rocket!
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

PAGroove and I have created some replacement icosahedron stations for an oxp, but Oolite seems to have a preference for using the built in icosahedron stations instead of our new ones, whats the best way of upping the chances for our ico station being selected over the default one?

There are 4 new ico ststions in the shipdata.plist for the oxp, they all have the following roles "ico icosa icosahedron station" - the same as the built in ico station, if i change the roles for all 4 of our new ico stations to something like

Code: Select all

roles = "ico(0.25) icosa(0.25) icosahedron(0.25) station";
Each of the 4 new ico stations should get a 1-in-4 chance of being selected whenever an icosahedron station is called for? Is that right? My grasp of probability is a bit crap, but is that good enough odds to make the new stations appear more often, prehaps even replacing the built in station all together?
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:

Post by Commander McLane »

Not quite. With icosahedron(0.25) (only that one is actually used by the engine, AFAIK) each of the models gets one quarter the chance of the original icosahedron. So in half of all cases any of your stations should be chosen. The total probability is: usual ico 100, your ico A 25, your ico B 25, your ico C 25 and your ico D 25. That sums up to 200, of which the usual ico gets half (100) and each of your models one eighth, so together the other half.

If you want to completely equal the chances, so one fifth for each of your station and one fifth for the original, you have to give it just the role icosahedron, without a probability added. And if you want to increase their chances, you have to increase their probability above 1. Example: icosahedron(10) for each of the stations means that in 41 cases of icosahedrons chosen by the game, each of your stations would be chosen 10 times, and the original only once.
User avatar
pagroove
---- E L I T E ----
---- E L I T E ----
Posts: 3035
Joined: Wed Feb 21, 2007 11:52 pm
Location: On a famous planet

Post by pagroove »

Comndr MC Lane,

We want to have the chance as high as over 90% because the ICO's are very rare. Can you give us an example how the entry in the plist would look?
For P.A. Groove's music check
https://soundcloud.com/p-a-groove
Famous Planets v 2.7. (for Povray)
Image
https://bb.oolite.space/viewtopic.php?f=4&t=13709
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Arrgh:- Probability! Just spent 3 weeks dealing with STR Random Occurrence Ratios!

I think that if two entries call "icosahedron" (ie the game plus the OXP) then each has a 50:50 chance of being chosen. If you say icosahedron(0.25) then I think this means the new icosahedron has a 25% divide by 2 (ish) chance of being chosen. A lot of shipdata entries with icosahedron as a role should up the chances, but Oolite only considers dealing a "card" with icosahedron on it where the system is tech 12(?) or more. So upping the cards in the deck still leaves these stations rare as Oolite only consults the deck of icosahedron stations very rarely. Sorry had a few beers and this is probabley as clear as mud.

Edit : As Commander McClane has said, just giving all your entries the role icosahedron should up them. Ie If you put in 10 icosahedron role entries then 10% of icosahedron stations should be orginal and the other 90% OXP. However icosahedrons will still be rare as its only rarely that the game calls icosahedron stations.
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
Cmdr. Maegil
Sword-toting nut-job
Sword-toting nut-job
Posts: 1294
Joined: Tue Feb 27, 2007 10:28 pm
Location: On the mend in Western Africa

Post by Cmdr. Maegil »

How about some consistency in the generation?

Instead of making it a random chance, I'd rather very much like to see the same station every time I visited a given system. Not only the same main station, but also knowing if there'd be a convenience store near the whichpoint so I could optimize the cargo rooster before departing.
'Procedural', is that how it's called?
You know those who, having been mugged and stabbed, fired, dog run over, house burned down, wife eloped with best friend, daughters becoming prostitutes and their countries invaded - still say that "all is well"?
I'm obviously not one of them.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Post by Griff »

Commander McLane & LB,
Thanks guys, sorry i took so long to reply! i've taken your advice on probability (remind me never to play poker with you two) and set the roles to "icosahedron(10) station" and i'm seeing new ico stations in systems where oolite used to select the original version.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Cmdr. Maegil wrote:
How about some consistency in the generation?

Instead of making it a random chance, I'd rather very much like to see the same station every time I visited a given system.
That is possible by using not normal random numbers but a pseudoFixedD100_number or pseudoFixedD256_number. These generate the same result over and over again for a given system. McLane uses them currently in Anarchies. Whenever you found a system with a hackers outpost in it, it will also be there the next time.

For replacing standard stations it is also possible by giving it a very high probability, but in the same time limit the selection by adding a condition field based on those pseudo random numbers.
Last edited by Eric Walch on Wed May 07, 2008 7:24 am, edited 1 time in total.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Commander McLane’s got it right.

The number after a role is a probability weight¹. Ships of equal weight will be chosen equally often. Ships with a higher weight will be chosen more often than ones with a lower weight.

The probability of a given ship being chosen when creating a ship by role is the weight of the ship divided by the sum of the weights of all ships of that role. For instance, if you have three the following three ships:

Code: Select all

{
    example_a  = { roles = "example(0.5)"; name = "A"; }
    example_b  = { roles = "example"; name = "B"; }
    example_c  = { roles = "example(3)"; name = "B"; }
}
the probability of B appearing when you call “addShips: example 1” is 1 / (0.5 + 1 + 3), or 22.2%.

¹ Just to be absolutely clear, this has nothing whatsoever to do with the mass of the ship.
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:

Post by Commander McLane »

There is one final question, Ahruman: Does the internal system selector use random or pseudo random?

So will we get the same model in the same system again, if we just use the probability weight and leave it to the system populator? Or will the populator probably choose the model with the 66.66% chance next time when I re-enter the system?

If so, then it would be not enough to assign a probability weight to the four models, but Griff and pagroove would have to script something.
User avatar
Cmdr. Maegil
Sword-toting nut-job
Sword-toting nut-job
Posts: 1294
Joined: Tue Feb 27, 2007 10:28 pm
Location: On the mend in Western Africa

Post by Cmdr. Maegil »

Commander McLane wrote:
Or will the populator probably choose the model with the 66.66% chance next time when I re-enter the system?
It'll be 100% every time as it isn't random, but only pseudo-random.
That function is to assign a static number to the system, according to whatever internal conditions. That number can then be used to define your environment.

Or at least so understood the non-coder...
You know those who, having been mugged and stabbed, fired, dog run over, house burned down, wife eloped with best friend, daughters becoming prostitutes and their countries invaded - still say that "all is well"?
I'm obviously not one of them.
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:

Post by Commander McLane »

Sorry, Maegil, but that's a misunderstanding. I think Ahruman (or anybody of those who are actually reading the code) will have an answer to my question.

Perhaps a little bit more of explanation for non-coders:

The main station of a system (and that's what we are talking about here, not any additional stuff) is created by the system populator when the player enters the system (actually shorty before that, but that doesn't matter here).

This process has two steps:

First, the system populator choses one station-type. By default there are three types: coriolis, dodecahedron and icosahedron. Which one of the three types is chosen is determined mainly by the techlevel of the system, and therefore not random at all. So in a given system the default main station will always be of the same type. So far, so good.

But now the second step starts: There may be more than one individual station of each of the types. And this is indeed, what Griff and pagroove are working on. They have created four more stations of the type "icosahedron".

So what does the game do, after step 1 is finished, and the engine knows that an icosahedron station is called for, in order to decide which of the five (one built-in, four added) should be used in the current system?

Again this step has two sub-steps: First the engine has a look, which different individual stations of the type "icosahedron" exist. It throws all of the possible individuals in a pool, like marbles of different colours in a bag. The probability weight tells it how many copies of each individual station have to go into the pool. How many red marbles, how many blue, white, yellow and black marbles, with numbers ranging from 1 to virtually unlimited, like hundreds of thousands.

This is done each time the player enters a system where the engine is going to add an icosahedron. So the same numbers of marbles of different colours are in the bag each time.

The second and final sub-step is to finally choose one of the marbles (stations) in the bag and put it into the system. I assume this step is governed by random, but I could be wrong, hence my question.

Now, if it is indeed governed by random, then there is no way to guarantee that each time you enter the same system, the marble (station) will have the same colour. Because each time there is this bag full of marbles of different colours, and only one is chosen. Highly unlikely that each time it will be the same (or even one of the same colour as last time).
Post Reply