Page 1 of 1

Galaxy Populator

Posted: Wed Feb 12, 2014 9:38 pm
by Norby
Oolite is already made big steps from the player-centric "scanner populator" of Elite to the [wiki]Oolite_System_Populator[/wiki] in 1.79. After this post of cim I imagined a next step: how about if all ships in the 8 galaxies are tracked through the whole gameplay instead of respawned after hyperjumps?

In this case new ships will be created in shipyards only, all ship can get an unique name and can remember to the player, etc.

I think to an OXP level solution if possible, but I do not know all of the potential headaches about coding this idea.

I do not know also the thoughts of players: it can be a cool extension or unnecessary?

Re: Galaxy Populator

Posted: Wed Feb 12, 2014 10:33 pm
by cim
Ambitious.

Doing some very rough numbers:
- main station launch rate is about 1 group every five minutes. Pirates and secondary stations add some more to that, and the groups are a few ships in size on average, so let's very roughly say 1 ship per system per minute is launched.
- about half the ships are "local" traffic which will, assuming it's not destroyed, fly about for a couple of hours before returning. The other half will make a witchspace jump, average duration about a day plus a little in-system flight time. Depending on how you model time inside witchspace, we're probably looking at one trip per realspace day for any one ship, whether it's local or not, before the pilot needs a rest.
So that's 24 * 60 * 2048 ships, or about 3 million, to be tracked at any one time. You could probably say that to an approximation no-one travels between charts and only track the current chart, so maybe half a million at once.

The most efficient way to store the ship data would be to procedurally generate the ships from their entity personality and maybe a couple of other items; then you also need to store their location, especially for non-local ships, and a couple of bits for their memory of the player. With ultra-efficient storage you can probably do this in about 20 bytes per ship, so still around 10Mb per chart.

JS does not support that form of ultra-efficient storage, so you couldn't really OXP it - and an extra 80Mb on the size of the save file might be rather excessive, too. I don't think it's practical to do at all - maybe if you rewrote Oolite to support a client-server model for galaxy data and simulated the ships mostly offline with Oolite just needing to ask "who is in this system right now?", perhaps. Even then I think it's still going to be tricky to get sufficiently efficient.

...

The majority of the ships you meet - and the Elite rankings make this a necessity - are going to be:
a) people on their first or second trip into space; and
b) people who will shortly be dead even if you don't personally ensure this
So tracking most of them is I think a waste of time. What I have been considering, though (as very obliquely hinted at in some previous posts), is the possibility of introducing a class of "significant" Commanders - traders, couriers, smugglers, hunters, pirates, assassins, maybe even miners of particular renown (with skill, ship and hangers-on to match) who are somewhat persistent, rarely die (especially when the player isn't around), tracked around locations while the player isn't there, and may lead to rumours and "informal" missions in appropriate ways. By the time the player is Dangerous ranked, the game should probably consider them a "significant" Commander and do the same sorts of things to them. That I think is OXPable now (or maybe once 1.79 is feature-complete, anyway), though still not at all straightforward.

Re: Galaxy Populator

Posted: Thu Feb 13, 2014 12:16 am
by Diziet Sma
cim wrote:
What I have been considering, though (as very obliquely hinted at in some previous posts), is the possibility of introducing a class of "significant" Commanders - traders, couriers, smugglers, hunters, pirates, assassins, maybe even miners of particular renown (with skill, ship and hangers-on to match) who are somewhat persistent, rarely die (especially when the player isn't around), tracked around locations while the player isn't there, and may lead to rumours and "informal" missions in appropriate ways. By the time the player is Dangerous ranked, the game should probably consider them a "significant" Commander and do the same sorts of things to them. That I think is OXPable now (or maybe once 1.79 is feature-complete, anyway), though still not at all straightforward.
Now this sounds promising.. 8)

Re: Galaxy Populator

Posted: Thu Feb 13, 2014 12:25 am
by Cody
Yeah, don't it just.

Re: Galaxy Populator

Posted: Thu Feb 13, 2014 1:36 am
by Norby
Ok, I see the challenges of numbers but good ideas can help a lot and I enjoy the sub-game of solving these. ;)
As you said we do not need to track everything to get an "enough good" result, especially not in the first versions.

It is enough to store the encountered ships in the first step. This is a growing list but defeated ships will be removed and the maximum is limited: imho enough to store 64k ship if there is an optimization to drop out the least relevant ships first, which is a good simulation of forgetting and losing data in RL.

Processing times are another challenges like the mentioned "who is in this system", so we need to use indexed data and as rare updates as acceptable. I think the first version can be made in js to see what numbers are reasonable and which bottlenecks need core support.

Significant Commanders is a very good idea for this and other improvemets also. At this point ships can be separated from pilots, so need handling of ship changes due to purchases or escapes (ship type will be the same but the owner maybe give new name to the ship).

Re: Galaxy Populator

Posted: Thu Feb 13, 2014 7:32 am
by cim
Norby wrote:
At this point ships can be separated from pilots
This is the bit I said "needs 1.79 to be feature-complete" for: issue 44 will make that much easier.

Re: Galaxy Populator

Posted: Thu Feb 13, 2014 10:25 am
by Sendraks
cim wrote:
What I have been considering, though (as very obliquely hinted at in some previous posts), is the possibility of introducing a class of "significant" Commanders - traders, couriers, smugglers, hunters, pirates, assassins, maybe even miners of particular renown (with skill, ship and hangers-on to match) who are somewhat persistent, rarely die (especially when the player isn't around), tracked around locations while the player isn't there, and may lead to rumours and "informal" missions in appropriate ways. By the time the player is Dangerous ranked, the game should probably consider them a "significant" Commander and do the same sorts of things to them. That I think is OXPable now (or maybe once 1.79 is feature-complete, anyway), though still not at all straightforward.
This sounds all of the amazing.
Given that various ships, such as those through random hits, will do a runner to another system if brought under fire, it would be very believeable that some ships persist far longer than others.

Re: Galaxy Populator

Posted: Thu Feb 13, 2014 6:11 pm
by Zireael
So tracking most of them is I think a waste of time. What I have been considering, though (as very obliquely hinted at in some previous posts), is the possibility of introducing a class of "significant" Commanders - traders, couriers, smugglers, hunters, pirates, assassins, maybe even miners of particular renown (with skill, ship and hangers-on to match) who are somewhat persistent, rarely die (especially when the player isn't around), tracked around locations while the player isn't there, and may lead to rumours and "informal" missions in appropriate ways. By the time the player is Dangerous ranked, the game should probably consider them a "significant" Commander and do the same sorts of things to them. That I think is OXPable now (or maybe once 1.79 is feature-complete, anyway), though still not at all straightforward.
This is a very good idea - I made an OXP displaying the Elite rank of some NPCs, tracking Dangerous and above seems like a great follow-up!

Re: Galaxy Populator

Posted: Mon Feb 24, 2014 7:23 pm
by Astrobe
On half a million potential ships in a given galaxy, very few will actually cross the path of the player. And most of them won't even be seen or noticed by him, and the remaining part will more or less be quickly forgotten.

I think that rather than implementing a feature in order to achieve some effects, one could focus on the effects themselves and find out an implementation that achieves them. Of course, it is less satisfying in the sense that the "greater" implementation could give more emerging effects (some of which might not be desirable though), but that doesn't mean the lesser one cannot have interesting side-effects.

When one follows a convoy through a wormhole, one find them on the other side as expected. I don't know how it is implemented, but it can perhaps reasonably be extended to any ship that appears on the scanner. This could result in only a few thousand ships being tracked.

Furthermore if one sets an arbitrary limit, like only one thousand, at some point the game will have to decide which ship to drop from its table in order to make room for a newly-encountered one. One could apply a common strategy in cache technology in this case: the ship that is forgotten is the one that hasn't be seen for the longest time, because the player him/herself has probably forgotten it already, or has moved to a different part of the galaxy.

I think for the second intended effect of the suggestion, which is I believe to model a galactic economy, one could just model the flow of ships and goods, and instantiate actual ships with their cargo based on these data when needed. The tracked ships could certainly be instantiated like this as well, but based on more accurate data (because tracked).