i'm going wiki crazy i think, but
Moderators: winston, another_commander
i'm going wiki crazy i think, but
why are there more boas than anacondas, by and large- or am i imagining it?
also i seem to have gone through every script there is, but the system populator seems to be very well hidden.
i apologize in advance if I am foolish
sorry I ought to provide more info- Anacondas and Boas, according to the the shipdata plist perform exactly the same roles, so i would have thought they would turn up just as frequently- but they don't.
Dont get me wrong- this is right and proper, anacondas are big beasts and boas are a third of the size so they ought to be more numerous- but i want to know why!
does anyone know?
also i seem to have gone through every script there is, but the system populator seems to be very well hidden.
i apologize in advance if I am foolish
sorry I ought to provide more info- Anacondas and Boas, according to the the shipdata plist perform exactly the same roles, so i would have thought they would turn up just as frequently- but they don't.
Dont get me wrong- this is right and proper, anacondas are big beasts and boas are a third of the size so they ought to be more numerous- but i want to know why!
does anyone know?
Re: i'm going wiki crazy i think, but
In the core game only, you're probably imagining it. They have the same roles, as you say, so should show up equally often (and they do for me, I think...). Do you have any OXPs that might change their roles installed?phonebook wrote:why are there more boas than anacondas, by and large- or am i imagining it?
The system populator is not managed by Javascript (and won't be for a while yet). It's in some functions inphonebook wrote:also i seem to have gone through every script there is, but the system populator seems to be very well hidden.
Universe.m
in the core Oolite code.Re: i'm going wiki crazy i think, but
i did a fresh install of oolite - no oxp- and always press shift on opening
yes you may be right, perhaps because there are more types of boas- marks 2s etc, i'm imagining the lowly numbers of anacondas
i might dig around in some oxps and see what they do- had a brief look at commies, and they plop extra ships in their systems- its all very complicated! to me at least
thanks for replying by the way
yes you may be right, perhaps because there are more types of boas- marks 2s etc, i'm imagining the lowly numbers of anacondas
i might dig around in some oxps and see what they do- had a brief look at commies, and they plop extra ships in their systems- its all very complicated! to me at least
thanks for replying by the way
Re: i'm going wiki crazy i think, but
The code could be modified to make these functions editable in the planetinfo.plist file. Using the source code from version 1.76.1, the original code in the Universe.m file from line 9079 reads like this:cim wrote:system populator is not managed by Javascript (and won't be for a while yet). It's in some functions inUniverse.m
in the core Oolite code.
Code: Select all
// traders
// TODO: consider using floating point for this stuff, giving a greater variety of possible results while maintaining the same range.
unsigned trading_parties = (9 - economy); // 2 .. 9
if (government == 0) trading_parties *= 1.25; // 25% more trade where there are no laws!
if (trading_parties > 0)
trading_parties = 1 + trading_parties * (randf()+randf()); // randomize 0..2
while (trading_parties > 15)
trading_parties = 1 + (Ranrot() % trading_parties); // reduce
OOLog(kOOLogUniversePopulate, @"... adding %d %@trading vessels", trading_parties, @"");
unsigned skim_trading_parties = (Ranrot() & 3) + trading_parties * (Ranrot() & 31) / 120; // about 12%
OOLog(kOOLogUniversePopulate, @"... adding %d %@trading vessels", skim_trading_parties, @"sun skim ");
// pirates
int anarchy = (8 - government);
unsigned raiding_parties = (Ranrot() % anarchy) + (Ranrot() % anarchy) + anarchy * trading_parties / 3; // boosted
raiding_parties *= randf() + randf(); // randomize
while (raiding_parties > 25)
raiding_parties = 12 + (Ranrot() % raiding_parties); // reduce
OOLog(kOOLogUniversePopulate, @"... adding %d %@pirate vessels", raiding_parties, @"");
unsigned skim_raiding_parties = ((randf() < 0.14 * economy)? 1:0) + raiding_parties * (Ranrot() & 31) / 120; // about 12%
OOLog(kOOLogUniversePopulate, @"... adding %d %@pirate vessels", skim_raiding_parties, @"sun skim ");
// bounty-hunters and the law
unsigned hunting_parties = (1 + government) * trading_parties / 8;
if (government == 0) hunting_parties *= 1.25; // 25% more bounty hunters in an anarchy
hunting_parties *= (randf()+randf()); // randomize
while (hunting_parties > 15)
hunting_parties = 5 + (Ranrot() % hunting_parties); // reduce
//debug
if (hunting_parties < 1)
hunting_parties = 1;
OOLog(kOOLogUniversePopulate, @"... adding %d %@law/bounty-hunter vessels", hunting_parties, @"");
unsigned skim_hunting_parties = ((randf() < 0.14 * government)? 1:0) + hunting_parties * (Ranrot() & 31) / 160; // about 10%
OOLog(kOOLogUniversePopulate, @"... adding %d %@law/bounty-hunter vessels", skim_hunting_parties, @"sun skim ");
unsigned thargoid_parties = 0;
while ((Ranrot() % 100) < thargoidChance && thargoid_parties < 16)
thargoid_parties++;
OOLog(kOOLogUniversePopulate, @"... adding %d Thargoid warships", thargoid_parties);
unsigned rockClusters = Ranrot() % 3;
if (trading_parties + raiding_parties + hunting_parties < 10)
rockClusters += 1 + (Ranrot() % 3);
rockClusters *= 2;
Code: Select all
// traders
// TODO: consider using floating point for this stuff, giving a greater variety of possible results while maintaining the same range.
unsigned trading_parties = (9 - economy); // 2 .. 9
if (government == 0) trading_parties *= 1.25; // 25% more trade where there are no laws!
if (trading_parties > 0)
trading_parties = 1 + trading_parties * (randf()+randf()); // randomize 0..2
while (trading_parties > 15)
trading_parties = 1 + (Ranrot() % trading_parties); // reduce
// Check whether there is an entry in planetinfo.plist for party:
unsigned backup_trading_parties = trading_parties;
trading_parties = [systeminfo oo_unsignedIntForKey:@"trading_parties" defaultValue:backup_trading_parties];
OOLog(kOOLogUniversePopulate, @"... adding %d %@trading vessels", trading_parties, @"");
unsigned skim_trading_parties = (Ranrot() & 3) + trading_parties * (Ranrot() & 31) / 120; // about 12%
// Check whether there is an entry in planetinfo.plist for party:
unsigned backup_skim_trading_parties = skim_trading_parties;
skim_trading_parties = [systeminfo oo_unsignedIntForKey:@"skim_trading_parties" defaultValue:backup_skim_trading_parties];
OOLog(kOOLogUniversePopulate, @"... adding %d %@trading vessels", skim_trading_parties, @"sun skim ");
// pirates
int anarchy = (8 - government);
unsigned raiding_parties = (Ranrot() % anarchy) + (Ranrot() % anarchy) + anarchy * trading_parties / 3; // boosted
raiding_parties *= randf() + randf(); // randomize
while (raiding_parties > 25)
raiding_parties = 12 + (Ranrot() % raiding_parties); // reduce
// Check whether there is an entry in planetinfo.plist for party:
unsigned backup_raiding_parties = raiding_parties;
raiding_parties = [systeminfo oo_unsignedIntForKey:@"raiding_parties" defaultValue:backup_raiding_parties];
OOLog(kOOLogUniversePopulate, @"... adding %d %@pirate vessels", raiding_parties, @"");
unsigned skim_raiding_parties = ((randf() < 0.14 * economy)? 1:0) + raiding_parties * (Ranrot() & 31) / 120; // about 12%
// Check whether there is an entry in planetinfo.plist for party:
unsigned backup_skim_raiding_parties = skim_raiding_parties;
skim_raiding_parties = [systeminfo oo_unsignedIntForKey:@"skim_raiding_parties" defaultValue:backup_skim_raiding_parties];
OOLog(kOOLogUniversePopulate, @"... adding %d %@pirate vessels", skim_raiding_parties, @"sun skim ");
// bounty-hunters and the law
unsigned hunting_parties = (1 + government) * trading_parties / 8;
if (government == 0) hunting_parties *= 1.25; // 25% more bounty hunters in an anarchy
hunting_parties *= (randf()+randf()); // randomize
while (hunting_parties > 15)
hunting_parties = 5 + (Ranrot() % hunting_parties); // reduce
//debug
if (hunting_parties < 1)
hunting_parties = 1;
// Check whether there is an entry in planetinfo.plist for party:
unsigned backup_hunting_parties = hunting_parties;
hunting_parties = [systeminfo oo_unsignedIntForKey:@"hunting_parties" defaultValue:backup_hunting_parties];
OOLog(kOOLogUniversePopulate, @"... adding %d %@law/bounty-hunter vessels", hunting_parties, @"");
unsigned skim_hunting_parties = ((randf() < 0.14 * government)? 1:0) + hunting_parties * (Ranrot() & 31) / 160; // about 10%
// Check whether there is an entry in planetinfo.plist for party:
unsigned backup_skim_hunting_parties = skim_hunting_parties;
skim_hunting_parties = [systeminfo oo_unsignedIntForKey:@"skim_hunting_parties" defaultValue:backup_skim_hunting_parties];
OOLog(kOOLogUniversePopulate, @"... adding %d %@law/bounty-hunter vessels", skim_hunting_parties, @"sun skim ");
unsigned thargoid_parties = 0;
while ((Ranrot() % 100) < thargoidChance && thargoid_parties < 16)
thargoid_parties++;
// Check whether there is an entry in planetinfo.plist for party:
unsigned backup_thargoid_parties = thargoid_parties;
thargoid_parties = [systeminfo oo_unsignedIntForKey:@"thargoid_parties" defaultValue:backup_thargoid_parties];
OOLog(kOOLogUniversePopulate, @"... adding %d Thargoid warships", thargoid_parties);
unsigned rockClusters = Ranrot() % 3;
if (trading_parties + raiding_parties + hunting_parties < 10)
rockClusters += 1 + (Ranrot() % 3);
// Check whether there is an entry in planetinfo.plist for party:
unsigned backup_rockClusters = rockClusters;
rockClusters = [systeminfo oo_unsignedIntForKey:@"rockClusters" defaultValue:backup_rockClusters];
rockClusters *= 2;
OOLog(kOOLogUniversePopulate, @"... adding %d asteroid clusters", rockClusters);
Code: Select all
"0 7" =
{
thargoid_parties = 100;
};
Of course getting this editable in Javascript is a different matter altogether...
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
- Commander McLane
- ---- 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:
Re: i'm going wiki crazy i think, but
But it's the only alternative. The rather unflexible plist-approach is certainly not the way forward.Pleb wrote:Of course getting this editable in Javascript is a different matter altogether...
- Wildeblood
- ---- E L I T E ----
- Posts: 2453
- Joined: Sat Jun 11, 2011 6:07 am
- Location: Western Australia
- Contact:
Re: i'm going wiki crazy i think, but
I've tried Pleb's mod, it seems to work fine from javascript.
Re: i'm going wiki crazy i think, but
Agreed that's why I hoped this could be expanded upon...Commander McLane wrote:But it's the only alternative. The rather unflexible plist-approach is certainly not the way forward.Pleb wrote:Of course getting this editable in Javascript is a different matter altogether...
It does? Can I ask how...?Wildeblood wrote:I've tried Pleb's mod, it seems to work fine from javascript.
EDIT: Never mind I saw your other post!
Last edited by Pleb on Sun Dec 09, 2012 5:01 pm, edited 1 time in total.
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Re: i'm going wiki crazy i think, but
Yes, or use
I have some more ambitious plans for after 1.77/8 which I'll post more about nearer the time (i.e. when I've had time to write them up properly)
system.addShips
and ship.remove
to modify the number of ships in the system shortly after the system populator runs. So in that sense it can already be modified by script.I have some more ambitious plans for after 1.77/8 which I'll post more about nearer the time (i.e. when I've had time to write them up properly)
Re: i'm going wiki crazy i think, but
So its already possible to remove all police/bounty hunters anyway then? Okay thought I'd discovered something new lol!cim wrote:Yes, or usesystem.addShips
andship.remove
to modify the number of ships in the system shortly after the system populator runs. So in that sense it can already be modified by script.
Sounds good, can't wait!cim wrote:I have some more ambitious plans for after 1.77/8 which I'll post more about nearer the time (i.e. when I've had time to write them up properly)
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Re: i'm going wiki crazy i think, but
UsePleb wrote:So its already possible to remove all police/bounty hunters anyway then?
system.shipsWithPrimaryRole()
to get a list of all ships with role "police" or "hunter", then call ship.remove()
on each member of that list.