Topic: Improving the AI
Tibor |
Posted at: 2019-12-02, 16:52
Yes, this sounds bad, it is good you will investigate this... Top Quote |
hessenfarmer |
Posted at: 2019-12-02, 23:40
ok I found the issue with crude statistics. It is simple but not obvious with a timebase of 10 minutes or 600000 ms we were limited to 71 % max as this is were we reached the uint32 overflow. with 480 it is something about 91 %. I will try a fix for this and retest. Top Quote |
Tibor |
Posted at: 2019-12-03, 07:58
ouh, sh*t. Great catch! This is typical case where unittests would help Also I think this fix should go in separate branch.... as fast as possible and I will retrain AI Edited: 2019-12-03, 08:34
Top Quote |
hessenfarmer |
Posted at: 2019-12-03, 09:19
Please wait with retraining until I have implemented the worker management in AI although I am not planning to use genetics here I don't know yet if there might be a reason to do so. I have implemented som penalty for unoccupied buildings as well i my amazons branch. Top Quote |
Tibor |
Posted at: 2019-12-03, 09:23
So you will make separate branch for crude statistics fix and new worker management - would be great.... tell me if you will need some help... Top Quote |
hessenfarmer |
Posted at: 2019-12-03, 10:55
exactly! I will develop and test them with my amazons branch and then pull them out to an AI branch. Testing with amazons is necessary as only there the worker evict is of high importance. the AI branch will contain the penalty for unoccupied sites as well. Top Quote |
hessenfarmer |
Posted at: 2019-12-03, 22:23
Well I really could use some help as my knowledge of c++ is to little. Here is what I have tried:
but it isn't compiling and i don't understand what to do. Top Quote |
hessenfarmer |
Posted at: 2019-12-04, 00:04
ok got htings to compile but crashes. What i wanted to do is for a given productioinsite check for all working positions described in the bo whether the actual worker is the worker in the bo. If not check if we have at least 1 worker of the current worker in stock. if not evict him from the side. Top Quote |
hessenfarmer |
Posted at: 2019-12-04, 00:55
I am getting there. This code does not crash:
However all master workers get removed completely instead of expelled. And it is only working for buildings with only 1 working position so far. Top Quote |
hessenfarmer |
Posted at: 2019-12-04, 01:19
ok last update this is doing what it should do:
So I only need to find out how to compare multiple workers in a building with its related position. Top Quote |