Charles555nc
Prince
- Joined
- May 3, 2010
- Messages
- 522
I have considered trying to parallelize some of the code, but I haven't attempted it. The thing is, most of the code is written in such a way that it needs to be run sequentially. For example, most of the CPU time between turns is spent on AI decisions for individual units. The AI units can't decide on their individual move at the same time, because the choices of one unit may depend on the outcomes of the another unit's actions. Also, the decision making process for individual units currently goes along the lines of if I can do X, then do that; otherwise, if I can do Y, then do that; otherwise ... and so on.
There are many individual loops which could be sped up with multiple threads, but generally they are low cost loops anyway. I suspect that to get significant gains, a lot of loops in a lot of places would need to be changed.
Anyway, if you want to get an idea of where all the time goes, here is a copy of the profiling data that I was looking at today. That's the data from a single turn, on a big map with lots of players and units etc. the turn took around 9 seconds.
(I was testing to make sure that my new code for evaluating maintenance changes in civics was not going to be too slow. The old code used an awful approximation which was nowhere near the true value.. the new code is precisely the true value... and it took less than 1 millisecond of that 9 second turn, so I think it's ok for general use.)
Fixed many (minor) bugs caused by inconsistencies in how the original code checked whether or not a plot improvement gives access to a resource.
I don't think so, no. I basically took the assumption that all of the game mechanics were 'working as intended', and so the only things affected by that set of bug-fixes are the UI and the AI.Does this mean that if i have, say a coastal city and there is an island (single plot) with a resource on it and improvement build (with or without road on it) i will have access to it?
I really don't know. If you like, you could test it by setting up a situation with the world-builder; and you could test it without K-Mod as well to see if it works the same way.Maybe its because there are two infantry guarding resources near the our common border...would that negate showing me an army coming into my territory?
Well, this is possible already, and I think there are already a couple of other mods that use K-Mod as a base. (People have mentioned them to me, but I haven't been following their progress.)I really look forward to K-Mod one day becoming a modding base that other experienced modders use to merge really good AI with really fun gameplay alterations.
I know atleast 1 popular mod is switching its AI to K-Mod from BBAI (forgot which one). Releasing a K-Mod Minor Modcomp that is purely unaltered game play fixs like the paratroop, modifer keys fix (Alt, CTRL, Shift), and pathing, point that out on BULL+BUG so it hopefully gets included in BULL as with the credit there people will look at K-Mod Minor, see the Full K-Mod and likely give it a try. More people playing it and rating it, more it becomes the 'standard'. Overall thou there is less Modding done now then when BBAI was made, so less mods are going to use K-Mod as a base I feel.