First, it looks, from what you posted, you're talking about non-persistent (i.e. generated only on enter-to-box and erased once you leave the box) fleets.
I assume the model would then be, what damage you do to the encounter (if you fight it) is subtracted from the wealth/whatever of both the destination and origin towns?
(And if you don't fight it, that wealth is added--excepting piracy in the abstract)
Or (further) do you mean /totally/ disassociated economy and encounter systems, the encounters as encounters have no effect on economy? (I.e. the economy handling is done almost purely in the abstract, only changed by "did the player fire on a ship of this nation recently" in terms of player actions).
I had at first hoped to have _everything_ done in the concrete--i.e. any commerce done between islands would be done by concrete fleets, and any interruption in trade would be from things happening to those fleets (either natural, or as the prey of yet /other/ fleets).
But per my above and various things in the fleets topic, it's pretty clear that that goal can't be reached due to POTC's very slow execution of scripts--or my inefficient coding, of course. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid="

" border="0" alt="smile.gif" />
{And it's yet possible Inez, or anyone else who'd like to try, could make the code execute fast enough. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid="

" border="0" alt="smile.gif" /> --A hearty THANKYOU to you, Inez. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid="

" border="0" alt="par-ty.gif" /> }
And this is without any real AI code or fleet-fleet or fleet-town interaction!
And even with the 20 fleets we're running with now, it's really not fast enough to be acceptable; but conversely, 20 fleets is far too little for the map, far too little traffic.
This is due partly to the fact that we can only represent a small fraction of the worldmap in sea mode due to floatingpoint precision issues, or whatever engine issues it is, and that the boxes (what I use as a basis to determine what gets loaded with the player on loading sea mode) need to be small both for that reason and to speed the fleet system itself (so that it is not so often that more than one fleet is in a box).
Then again, if we do too much on-enter-box temporary fleet creation, we'll be stuck again with stuff going too slowly (even if it weren't now).
One possible solution is to run the worldmap for a day, then do a fadeout to a loading screen as the day's calculations are done, but that's not a terribly inspiring option. :]
So it looks like we'll need to go with a mix of non-persistant (or at least only-temporarily-persistent) fleets, as well as full fleets.
<!--QuoteBegin-The Diamond+May 4 2005, 08:27 PM--><div class='quotetop'>QUOTE(The Diamond @ May 4 2005, 08:27 PM)</div><div class='quotemain'><!--QuoteEBegin-->I'm not quite sure that I'm following you, NK...when you talk about the town and fleet systems, do you mean the variables that the model proposed here would require to be generated and/or tracked? Things such as, say, value of cargo in a generated fleet and its destination and ETA?<div align="right">[snapback]104026[/snapback]</div><!--QuoteEnd--></div><!--QuoteEEnd-->
Right, and whatever town variables need to be tracked and changed.
Three systems, really.
1. One that tracks town states
2. One that creates fleets and tracks them (based on #1, and any non-town-specific national variables)
3. One that creates temporary fleets based on the box (and based on #1)--what you're talking about below.
And then a fourth that handles the loading to sea based on 2 and 3, of course. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid="

" border="0" alt="smile.gif" />
So, about those temporary fleets. They need _some_ kind of peristence, so i.e. if you sail into the corner of a different box and immediately come back the fleet should still be there--but anything more than that will be too much of a drain.
So how about something in between. (Now, even this may be too much for the engine to handle...but it's worth trying).
That is, for any box the player is _currently_ in, we (every so often, and perhaps only if there's no (concrete) fleet there) generate a temp fleet. That temp fleet gets handled as a real fleet, but disappears once it gets more than one box away from the player (so it could be one box away and still exist--i.e. if it changes boxes before you do, it doesn't suddenly vanish).
On vanishing we do some calc to check whether it arrives OK or not, and post an appropriate event to the town-update queue[FN1].
But then I guess we also have to account for temp fleets that are never created--i.e., local commerce for towns far from the player. So I guess that gets handled on the town update side.
Hmm. What if each town gets a certain number of auto-trades per update period (both going and coming), and if a tempfleet is generated with that town as dest or origin, the auto-trade allotment is decremented, and the tempfleet--until it disappears--is handled like a normal fleet.
Then if it disappears before reaching its destination, we add it back to the autotrade allotment after all.
And the autotrade allotment is reduced based on piracy and privateering, whatever your model calls for.
FN1: We need some system for applying events to towns /sometime in the future/--i.e., if it takes a week for that tempfleet to arrive, don't apply its effects until after that week.
<!--QuoteBegin-The Diamond+May 4 2005, 08:27 PM--><div class='quotetop'>QUOTE(The Diamond @ May 4 2005, 08:27 PM)</div><div class='quotemain'><!--QuoteEBegin-->I expected that trade routes would have to be pre-mapped. We'd need to look at balancing the trade network anyway, to prevent certain towns being overly predisposed to wealth. The way I see trade routes as described so far is along the lines of them being a part of an overall fleet generation class.
Each box will have a list of attributes, noting who owns the waters, any trade routes passing through, etc. and these will decide, overall, the chance of what kind of ships may be generated. We can give them arbitrary weightings for now. I would assume that the weightings will be variables - if only for the option of making there be more warships/pirates to traders on higher difficulty settings, etc.
So, we generate a random number. If we've generated a trader, we then use the trade routes' attributes to work out what they're carrying, where it was going, etc. (ie, we have a method of selecting which trade route the trader is on, and then we simply lift the variables out of that trade route).<div align="right">[snapback]104026[/snapback]</div><!--QuoteEnd--></div><!--QuoteEEnd-->
Again there's the persistency problem. This is still a better system than POTC's--i.e. it's much like SeaDogs (the original) but improved[FN2], but there's still the "what happened to that fleet I just fought!? It disappeared!" issue.
Unless you do mean once the tempfleet (boxfleet?) is generated, then it persists until it reaches its destination--but here the speed problem rears its ugly head.
FN2: In SD, you could set the chances for various types of fleets being generated in any given map box, but not what they'd carry (or even nation?), let alone what you did to the fleet affecting anything else. CCC, you're the expert on this IIRC...
<!--QuoteBegin-The Diamond+May 4 2005, 08:27 PM--><div class='quotetop'>QUOTE(The Diamond @ May 4 2005, 08:27 PM)</div><div class='quotemain'><!--QuoteEBegin-->The big problem with this (and I mean BIG problem) is the whole pre-mapping element. The entire trading model (which goes right back to which goods are produced where) is based entirely on geography. Remapping that entire section would be necessary every time someone makes a change to the island set, or any new islands would simply be ignored by the model (and, as a result, get messed up). Which is not good, given that there's currently discussion of mapping in the actual Caribbean...<div align="right">[snapback]104026[/snapback]</div><!--QuoteEnd--></div><!--QuoteEEnd-->
Hmm. What if we wrote an external app (or, heck, used POTC as the compiler with a different seadogs.c and outputting the data via trace()) to do that generating?
You're quite right that 1600 boxes is one heck of a lot to do by hand. <img src="http://www.piratesahoy.com/forum/style_emoticons/<#EMO_DIR#>/happy.gif" style="vertical-align:middle" emoid="^_^" border="0" alt="happy.gif" />
<!--QuoteBegin-The Diamond+May 4 2005, 08:27 PM--><div class='quotetop'>QUOTE(The Diamond @ May 4 2005, 08:27 PM)</div><div class='quotemain'><!--QuoteEBegin-->I think the best way round it would be to sacrifice exact accuracy for a hell of a lot of simplicity:
When an encounter is made, we generate the ship's nationality, its destination and then its type (warship, trader, etc.) Or any order of those three that you care, there are balancing issues for any order.
Once we know nationality, destination and type, we then determine its mission. For a trader, we know what things their destination requires: so we know what they would be taking to that destination, so that's what we give them. Depending on exactly what they are given will affect what kind of ship they are (e.g. if they are given contraband, then they're smugglers). We can weight the chances of the more valuable goods being shipped by the way this is decided.
For example (Good 1 = least profitable - Good 4 = most profitable, Good 5 = contraband):
Good 1: 45% chance
Good 2: 30% chance
Good 3: 12% chance
Good 4: 8% chance
Good 5: 5% chance
Or whatever works when it is balanced out in testing.
The main advantage of this is that new towns just need to be tacked on to the end of the list and their respective goods demanded/produced, base wealth and other variables, etc. added in, and the game made aware that the new town is there and should be featured in calculations. Once that's done, merchants may generate it as their destination, etc.
It'd be a LOT easier to amend the map with that underlying model than a fully-fledged trade route system, which would soon get very complex to keep track of. If we want to leave the door open to having trade routes at a later stage, we can do it by letting the attributes of the 'box' in the sea determine things first (e.g. chances of seeing type Trader and then chances of mission Trade Silk, etc.), but generating all boxes to have a default set of attributes unless and until anyone is bothered to tinker.
Right now, I've not given it too much thought. I'll try to get the underlying economics mapped out into some vaguely workable example model that people can tinker with, soon. Hopefully that'll be a better guide.
<div align="right">[snapback]104026[/snapback]</div><!--QuoteEnd--></div><!--QuoteEEnd-->
I think due to speed constraints we may /have/ to go with the traderoute system, simply so we don't have to recalculate all those properties you mention each time we need to generate a tempfleet.
Well, I guess we could just generate that "there's a tempfleet here" and not actually figure out _what_ it is until reloading to sea--but again then that wouldn't have any economy-side effect unless and until we reload to sea near it (which then again may be what you /want/--don't screw up the (abstract) econ model unless we have to?)
EDIT: a further point.
The latter system is pretty much what I'm using for the /concrete/ fleet generation, although not in that detail nor correctness. More to come (in fleet thread), I'll explain what I have for fleet at the moment.