Bundles sound good.
So, each planet type maps to a bundle type?
As far as matrixing, the other solution is to NOT matrix it...
Just doing a search of nearby systems by following the jumps a couple of levels deep, or until a base of each given type is found.
Just like the flyweight pattern trades speed for memory.
EDIT:
Never mind; I thought this was for local use, where the player is... This is about simulation of global trade, right?
If so, sounds like there's a problem.
Hmmm....
Well, maybe the nearness of other planet types could be computed on first run, like map generation, and stored in the planet files; then economics simulation could simulate one single system per 11 Hz sim frame; and to avoid aliasing perhaps the system at each sim frame could be picked at random.
Midway step in refactoring trade
Moderator: pyramid
-
- Star Pilot
- Posts: 4
- Joined: Wed Sep 14, 2005 10:20 pm
Re: Midway step in refactoring trade
chuck starchaser == chuck_starchaser
had to create new id because the wiki would not see the underscore... Programmers...
had to create new id because the wiki would not see the underscore... Programmers...
-
- Elite
- Posts: 7243
- Joined: Mon Apr 18, 2005 2:40 pm
- Location: LS87, Buenos Aires, República Argentina
Re: Midway step in refactoring trade
Yep, global trade. I was planning to use coroutines for that.chuck starchaser wrote:Never mind; I thought this was for local use, where the player is... This is about simulation of global trade, right?
If so, sounds like there's a problem.
Hmmm....
Well, maybe the nearness of other planet types could be computed on first run, like map generation, and stored in the planet files; then economics simulation could simulate one single system per 11 Hz sim frame; and to avoid aliasing perhaps the system at each sim frame could be picked at random.
-
- Expert Mercenary
- Posts: 893
- Joined: Thu Jul 08, 2010 11:43 pm
- Location: Sol III North American Continent
Re: Midway step in refactoring trade
This is my thought as well.chuck starchaser wrote:Well, maybe the nearness of other planet types could be computed on first run, like map generation, and stored in the planet files
Are you thinking recalculating the system the player is in 11 times each second or at a 11hz tick recalculate a new/random system?chuck starchaser wrote:then economics simulation could simulate one single system per 11 Hz sim frame; and to avoid aliasing perhaps the system at each sim frame could be picked at random.
The way I had it envisioned was to do a per planet check only once a "day" like the end of day commodity price reports.