NathanKell
...
As mentioned in the Towns thread, and the Nation.strength thread, fleets.
Rather than handling encounters as on-demand random generated fleets that sail aimlessly until they disappear and have no connection with anything else in the game, I've been working on a fleet backend. Fleets are generated by port towns (or by mapedges, i.e. Europe or other parts of the Caribbean), sail to destinations (engaging in combat on the way if they sight enemies), do things there (patrol, trade, sack, invade), and then have another destination (or go to a mapedge and disappear), and so forth. Towns would also have harbor fleets that stayed in place (i.e. coast guard, fishing boats, local commerce).
Note that as a side effect of this other ships than yours would no longer be visible on the world map; however, we could tell the player of nearby fleets via text messages and sounds (Sail ho, off the port bow!).
(This is because the worldmap ships are generated on the engine/DLL side, and we can only read their positions, not write to them.)
Fleet strength would be tracked, and strength on generation would depend on national strength and (if from a town) town strength. Strength would be reduced by storms or enemy action, and replenished gradually over time (repairs) or while in port (both more repairs, and crew).
Now, we can track strength in an abstract way, i.e. levels of strength, or specifically (track each ship in the fleet, and its hp/sp/crew). Same with goods, either abstractly (large cargo of this type of good) or specifically (so many of the trade good, so much food, so much rum, so much ammo, repair goods...).
Changes in fleet strength might change national power (i.e. if France loses a squadron of frigates, then her national strength would be decreased somewhat).
We should thus probably implement both true national strength (for use in international relations calcs) and local national strength, i.e. strength that can be applied directly on the 'pelago (and would reflect on--and from!--towns' economies, local fleets, and piracy).
For now I'm just selecting a random encountertype on fleet creation (based on trade/war/pirate), so I don't have to rewrite (well, do more rewriting) the Sea.c group creation and AIFantom ship-creation calls.
----------
Interaction between fleets, and between them and towns and the player, is handled by a grid system. Whenever more than one fleet is in a a grid box (or fleet/town), that box is placed in the update list. When going through and doing fleet updates, we check that update list and handle combat.
In addition, whenever a fleet reaches its destination, new orders are given (disappear if mapedge, or do something there (attack, defend, trade), and/or return home).
For now there is no interaction possible in box updates, and when a fleet reaches a destination they either return home and disappear, or disappear right there.
-----------
And as of 05-04-24 I've reloaded successfully to sea near a fleet and they did show up. The worldmap chugs some, but I can't think of anything further to do (at the moment) to speed it up. (That's for 20 fleets at once).
Rather than handling encounters as on-demand random generated fleets that sail aimlessly until they disappear and have no connection with anything else in the game, I've been working on a fleet backend. Fleets are generated by port towns (or by mapedges, i.e. Europe or other parts of the Caribbean), sail to destinations (engaging in combat on the way if they sight enemies), do things there (patrol, trade, sack, invade), and then have another destination (or go to a mapedge and disappear), and so forth. Towns would also have harbor fleets that stayed in place (i.e. coast guard, fishing boats, local commerce).
Note that as a side effect of this other ships than yours would no longer be visible on the world map; however, we could tell the player of nearby fleets via text messages and sounds (Sail ho, off the port bow!).
(This is because the worldmap ships are generated on the engine/DLL side, and we can only read their positions, not write to them.)
Fleet strength would be tracked, and strength on generation would depend on national strength and (if from a town) town strength. Strength would be reduced by storms or enemy action, and replenished gradually over time (repairs) or while in port (both more repairs, and crew).
Now, we can track strength in an abstract way, i.e. levels of strength, or specifically (track each ship in the fleet, and its hp/sp/crew). Same with goods, either abstractly (large cargo of this type of good) or specifically (so many of the trade good, so much food, so much rum, so much ammo, repair goods...).
Changes in fleet strength might change national power (i.e. if France loses a squadron of frigates, then her national strength would be decreased somewhat).
We should thus probably implement both true national strength (for use in international relations calcs) and local national strength, i.e. strength that can be applied directly on the 'pelago (and would reflect on--and from!--towns' economies, local fleets, and piracy).
For now I'm just selecting a random encountertype on fleet creation (based on trade/war/pirate), so I don't have to rewrite (well, do more rewriting) the Sea.c group creation and AIFantom ship-creation calls.
----------
Interaction between fleets, and between them and towns and the player, is handled by a grid system. Whenever more than one fleet is in a a grid box (or fleet/town), that box is placed in the update list. When going through and doing fleet updates, we check that update list and handle combat.
In addition, whenever a fleet reaches its destination, new orders are given (disappear if mapedge, or do something there (attack, defend, trade), and/or return home).
For now there is no interaction possible in box updates, and when a fleet reaches a destination they either return home and disappear, or disappear right there.
-----------
And as of 05-04-24 I've reloaded successfully to sea near a fleet and they did show up. The worldmap chugs some, but I can't think of anything further to do (at the moment) to speed it up. (That's for 20 fleets at once).