Re: Midway step in refactoring trade
Posted: Mon Sep 17, 2012 7:57 pm
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.
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.