ship populator code

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Dr Beeb
Dangerous
Dangerous
Posts: 127
Joined: Sun Mar 23, 2008 10:28 pm
Location: Mt. Vista, Oosa, Biarge System, Galaxy 1

ship populator code

Post by Dr Beeb »

Ever noticed that it is relatively easy to deliver computers to a Poor Agr. Anarchy? Or trying to reach a Rich Ind. Multi-Gov station to get ship repairs can be a nightmare?

In fact, I think (check my numbers below) the average number of pirates in a Avg. Ind. Communist are the same as for a Poor Agr. Anarchy.
And, on average, there are more pirates at Rich Ind. Multi-Gov than even the most industrialized (Poor Ind.) Feudals.

In Universe.m I found the space-population code, with extracts below, along-with my attempt at table summaries:

Code: Select all

government = [systeminfo  oo_unsignedCharForKey:KEY_GOVERNMENT]; // 0 .. 7 (0 anarchic .. 7 most stable)
economy = [systeminfo  oo_unsignedCharForKey:KEY_ECONOMY];       // 0 .. 7 (0 richest .. 7 poorest)
unsigned trading_parties = (9 - economy);		      // 2 .. 9 (poor Agr ... Rich Ind)

if (government == 0) trading_parties *= 1.25;	// 25% more trade where there are no laws!

Average number of trading parties:
-------------------------------------------
Poor Agr ..                     .. Rich Ind
3     4     5     6     7     8     9    10    for Corporate state 
3     4     5     6     7     8     9    10    for Demo
3     4     5     6     7     8     9    10    for Confed
3     4     5     6     7     8     9    10    for Communist

3     4     5     6     7     8     9    10    for Dict
3     4     5     6     7     8     9    10    for Multi
3     4                 7     8                for Feudal
3     4                 8     9                for Anarchy
Nominally we are told that poor Anarchies cant afford luxury goods, but the market model in Elite (and Oolite) makes it more profitable for a trader to bring computers to a poor Agr than food/furs to Poor Ind. But Oolite populates more traders going to Poor Ind than Poor Agr. I dont know if this was the case in original Elite, but it leads to the problems mentioned above because the number of pirates depends partially on number of traders.

Code: Select all

// pirates
	int anarchy = (8 - government);   1..8
	unsigned raiding_parties = (Ranrot() % anarchy) + (Ranrot() % anarchy) + anarchy * trading_parties / 3;	// boosted

Average number of pirates:
--------------------------------------------
Poor Agr ..                      .. Rich Ind
 2     2     2     3     3     3     4     4  for Corporate state   
 4     4     5     6     6     7     8     8  for Demo              
 6     7     8     9    10    11    12    13  for Confed            
 8     9    10    12    13    14    16    17  for Communist         

10    11    13    15    16    18    20    21  for Dict              
12    14    16    18    20    22    24    26  for Multi             
14    16                23    25              for Feudal            
16    18                29    32              for Anarchy           

I dont know what the original Elite code had but I suspect that the number of pirates was very strongly dependent on the Government level, and only weakly influenced by the economy type? In addition, I think having the number of traders not so strongly dependent on economy would make visiting Rich Ind. less of chore with the mass locks.

Suggested new code:

Code: Select all

   unsigned trading_parties = (15 - economy);		      // 8 .. 15 (poor Agr ... Rich Ind)
        if (government < 2) trading_parties *= 1.20;	// 20% more trade where there are few laws!
	if (trading_parties > 0)
		trading_parties = 1 + trading_parties * (randf()+randf()) *0.5 ;   // randomize 0..2
	while (trading_parties > 15)
		trading_parties = 1 + (Ranrot() % trading_parties);   // reduce

Average number of trading parties:
--------------------------------------------
Poor Agr ..                    .. Rich Ind
5     5     6     6     7     7    8     8    for Corporate state 
5     5     6     6     7     7    8     8    for Demo
5     5     6     6     7     7    8     8    for Confed
5     5     6     6     7     7    8     8    for Communist

5     5     6     6     7     7    8     8    for Dict
5     5     6     6     7     7    8     8    for Multi
5     6                 8     8               for Feudal
5     6                 8     8               for Anarchy


// pirates
   int anarchy = (8 - government);  // 1..8
   unsigned raiding_parties = (Ranrot() % anarchy) + (Ranrot() % anarchy) + anarchy * (1 + trading_parties/4); // boosted

Average number of pirates:
------------------------------------------
Poor Agr ..                      .. Rich Ind
 3     3     3     3     3     3     4     4  for Corporate state   
 6     6     7     7     7     7     8     8  for Demo              
 9     9    10    10    11    11    12    12  for Confed            
13    13    14    14    15    15    16    16  for Communist         

16    16    17    17    18    18    20    20  for Dict              
19    19    21    21    22    22    24    24  for Multi             
22    24                28    28              for Feudal            
26    28                32    32              for Anarchy    
The most difficult 'level' continues to be the Poor Ind Anarchies and that remains unchanged.
All Anarchies are more difficult than all Multi-Governments (unlike the present code).
Feudals are slightly more difficult than before, and Multi-Govs slightly easier.
Overall the Communist-Dictactorship divide marks the half-way point to the Anarchy skill level.
White dots were so much easier to hit
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Post by Switeck »

My big problem is similar to this.
At Ensoreus, I have seen 3-6 groups of Vipers on radar at once...each often with 5 or more Vipers!
I was wanting to place a Thargoid invasion "blockade" along its trade lane, but found even 50-100 Thargoids pretty quickly get killed off by all the trader and Vipers...to say nothing of the Behemoth that I also intended to be the centerpiece of the fight!
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: ship populator code

Post by Switeck »

There should probably be slightly more trade ships for high TL worlds than low TL worlds.
Likewise, government type should have at least some influence on the number of trade ships -- corporate states should have more than communist for instance.
Post Reply