Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Create an account below if you want to be able to make edits.

Port: Difference between revisions

From the OpenFront Wiki Project
m 1 revision imported: Port from openfront.miraheze.org
Tidwell (talk | contribs)
Update how level interacts with Trade Ship Spawning and Partner Selection.
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[File:Port.png|thumb|A '''Port''' when it's built.|x200px]]
[[File:PortIcon.svg|thumb|200x200px|The port's icon]]
This [[Buildings|building]] spawns [[Trade Ship|trade ships]] and allows you to build [[Warship]]s.
The '''Port''' is a [[Buildings|Building]] that spawns [[Trade Ship|Trade Ships]] and allows you to build [[Warship]]s.


The first [[Buildings|building]] costs 125,000, then the cost doubles for each one you buy until the price reaches 1,000,000.
== Cost ==
Ports scale in price based on number of owned '''ports AND factories'''.
{| class="wikitable"
|+City cost
!Port/factory number
![[Gold]] cost
|-
|1st
|125,000
|-
|2nd
|250,000
|-
|3rd
|500,000
|-
|4th+
|1,000,000
|}


[[Trade Ship|Trade ships]] sent out make more [[gold]] the farther they have traveled from their [[Port|ports]].
== Mechanics ==


= Trade Ship Spawning =
=== Warship spawning ===
[[Port|Ports]] check every 10 ticks if they should spawn a [[Trade Ship|trade ship]]
[[Warship|Warships]] can only be bought if a player owns a port. The game will try to spawn the warship from the closest fort to where the warship is being deployed.


Spawn chance is calculated based on number of owned [[Port|ports]], number of owned trade ships, and number of all trade ships
=== Trade Ship Spawning ===
[[Port|Ports]] check every 10 ticks if they should spawn a [[Trade Ship]].  Ports higher than Level 1 "roll the dice" once for each level (the same as if they were separate entities).
 
Spawn chance is calculated based on number of owned [[Port|ports]], number of owned trade ships, and number of trade ships on the map.


<math>\text{spawnChance} = \frac{1}{\left\lfloor \frac{25}{\sqrt{\text{baseChance} * \text{portMultiplier}}} \right\rfloor}</math>
<math>\text{spawnChance} = \frac{1}{\left\lfloor \frac{25}{\sqrt{\text{baseChance} * \text{portMultiplier}}} \right\rfloor}</math>


Where $\text{baseChance}$ is equal to 1 when you own less than 3 trade ships (exclusive), otherwise it is:
Where baseChance is equal to 1 when you own less than 3 trade ships (exclusive), otherwise it is:


<math>\text{baseChance} = 1 - \frac{1}{1 + e^{\left(-\frac{\ln(2)}{10} * (\text{numOfShips} - 55)\right)}}</math>
<math>\text{baseChance} = 1 - \frac{1}{1 + e^{\left(-\frac{\ln(2)}{10} * (\text{numOfShips} - 55)\right)}}</math>
Line 21: Line 42:
<math>\text{portMultiplier} = \frac{1}{1 + \frac{\text{portsOwned}}{10}}</math>
<math>\text{portMultiplier} = \frac{1}{1 + \frac{\text{portsOwned}}{10}}</math>


More [[Port|ports]] = lower spawn rate **per port**. Gradual decay prevents scenario where more ports => fewer ships **overall**.
More [[Port|ports]] = lower spawn rate '''per port''', but higher spawn rate '''overall'''.


There is no spawn cap.
There is no spawn cap.


= Trade Route Selection =
=== Trade Route Selection ===
[[Port|Ports]] will only trade with other players (not their own [[Port|ports]]). Trade partners are prioritized in this order:
[[Port|Ports]] will only trade with other players (not their own [[Port|ports]]). Trade partners are prioritized in this order:
* Closer [[Port|ports]] get double chance of being selected (proximity bonus)
* Closer [[Port|ports]] get double chance of being selected (proximity bonus)
* Allied [[Port|ports]] get double chance of being selected
* Allied [[Port|ports]] get double chance of being selected
* A port's <code>level</code> determines how many times it is added to the pool of destinations.


[[Trade Ship|Trade ships]] are free to build and don't count against unit limits.


= [[Gold]] Generation =
[[Trade Ship|Trade ships]] are automatic, free to build, and don't count against unit limits.
{{Update|inaccurate=yes|Reason for being outdated=If ports are very close, the gold gain is significantly reduced}}
 
=== [[Gold]] Generation ===
[[Gold]] earned is based on ''Manhattan distance'' (which means the sum of the absolute differences in x and y coordinates) between [[Port|ports]] and the number of ports you own:
[[Gold]] earned is based on ''Manhattan distance'' (which means the sum of the absolute differences in x and y coordinates) between [[Port|ports]] and the number of ports you own:


<math>\text{gold} = (100000 + 100 * \text{distance}) * \text{bonus}</math>
<math>\text{tradeShipGold} =  
\left\lfloor
baseGold
*
bonus
\right\rfloor</math>
 
BaseGold scales with Manhattan distance. There is also a debuff for small distances, less than around 400 [[Tile|Tiles]], this means that short trade routes are extremely unprofitable, and should be avoided. See the graph for details.
[[File:Desmos port baseGold v26.png|alt=A graph|thumb|The relationship between Manhattan distance in tiles and baseGold]]<math>\text{baseGold} = \frac{100,000}{1 + e^{-0.03 * (\text{distance} - 300)}} + 100 * \text{distance} </math>


Bonus is a value which is dependent on the number of ports you own. The more ports you own, the smaller the increase, the medium point is at 4 ports with a bonus of approx. 1.9. The bonus is an example of [https://en.wikipedia.org/wiki/Hyperbolic_growth hyperbolic decay].
Bonus is a value which is dependent on the number of ports you own. The more ports you own, the smaller the increase; the medium point is at 4 ports with a bonus of approx. 1.9. The bonus is an example of [[wikipedia:Hyperbolic_growth|hyperbolic decay]].


<math>\text{bonus} = 1 + 2 * \frac{\text{portsOwned} - 1}{\text{portsOwned} + 4}</math>
<math>\text{bonus} = 1 + 2 * \frac{\text{portsOwned} - 1}{\text{portsOwned} + 4}</math>
Line 46: Line 76:
Longer trade routes are more profitable (linear scaling with distance).
Longer trade routes are more profitable (linear scaling with distance).


= See also =
== See also ==
* [[Buildings]]
* [[Buildings]]
* [[Warship]]
* [[Warship]]
* [[Trade Ship]]
* [[Trade Ship]]
* [[Transport Ship]]
* [[Transport Ship]]
[[Category:Buildings]]
[[Category:Economy]]

Latest revision as of 01:41, 23 December 2025

The port's icon

The Port is a Building that spawns Trade Ships and allows you to build Warships.

Cost

Ports scale in price based on number of owned ports AND factories.

City cost
Port/factory number Gold cost
1st 125,000
2nd 250,000
3rd 500,000
4th+ 1,000,000

Mechanics

Warship spawning

Warships can only be bought if a player owns a port. The game will try to spawn the warship from the closest fort to where the warship is being deployed.

Trade Ship Spawning

Ports check every 10 ticks if they should spawn a Trade Ship. Ports higher than Level 1 "roll the dice" once for each level (the same as if they were separate entities).

Spawn chance is calculated based on number of owned ports, number of owned trade ships, and number of trade ships on the map.

spawnChance=125baseChance*portMultiplier

Where baseChance is equal to 1 when you own less than 3 trade ships (exclusive), otherwise it is:

baseChance=111+e(ln(2)10*(numOfShips55))

A graph
The relationship between the total number of ships and baseChance

In short, this means that the more ships there are on the map, the less likely more ships are to spawn, with a small number having only a very small effect. At 25 ships, the chance is 88%, at 55 it's 50%, at 100, it's just 4%.

portMultiplier=11+portsOwned10

More ports = lower spawn rate per port, but higher spawn rate overall.

There is no spawn cap.

Trade Route Selection

Ports will only trade with other players (not their own ports). Trade partners are prioritized in this order:

  • Closer ports get double chance of being selected (proximity bonus)
  • Allied ports get double chance of being selected
  • A port's level determines how many times it is added to the pool of destinations.


Trade ships are automatic, free to build, and don't count against unit limits.

Gold Generation

Gold earned is based on Manhattan distance (which means the sum of the absolute differences in x and y coordinates) between ports and the number of ports you own:

tradeShipGold=baseGold*bonus

BaseGold scales with Manhattan distance. There is also a debuff for small distances, less than around 400 Tiles, this means that short trade routes are extremely unprofitable, and should be avoided. See the graph for details.

A graph
The relationship between Manhattan distance in tiles and baseGold
baseGold=100,0001+e0.03*(distance300)+100*distance

Bonus is a value which is dependent on the number of ports you own. The more ports you own, the smaller the increase; the medium point is at 4 ports with a bonus of approx. 1.9. The bonus is an example of hyperbolic decay.

bonus=1+2*portsOwned1portsOwned+4

Both the source and destination port owners receive the full amount.

Longer trade routes are more profitable (linear scaling with distance).

See also