Page 8 of 8

Re: Midway step in refactoring trade

Posted: Mon Sep 17, 2012 7:57 pm
by chuck starchaser
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.

Re: Midway step in refactoring trade

Posted: Mon Sep 17, 2012 8:24 pm
by klauss
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.
Yep, global trade. I was planning to use coroutines for that.

Re: Midway step in refactoring trade

Posted: Mon Sep 17, 2012 10:29 pm
by travists
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
This is my thought as well.
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.
Are you thinking recalculating the system the player is in 11 times each second or at a 11hz tick recalculate a new/random system?

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.