Topic: News about AI
GunChleoc |
Posted at: 2017-05-30, 19:56
No, there isn't - we can only do that with scenario code in Lua - something like this:
Busy indexing nil values Top Quote |
Tibor Topic Opener |
Posted at: 2017-05-30, 20:00
I am using exactly the same setup, savegame made/started in few starting seconds. To be 100% sure, look at the command line output and look for lines like that:
Probably your starting place is too small and then AI is not smart enough to build these buildings. I dont see any no-logs-deadlocks during my tests. I am using script that regulates speed of game, it uses command line switch "--script=/......../bla_bla_bla.lua" that allows commands like:
When "Winner" windows pups up, I see in console something like that:
maybe this can be modified to contain more info... Top Quote |
PkK |
Posted at: 2017-05-30, 20:51
First testing result (on Lesser ring 1.1 using 4 x HQ, 4 x trading outpost): The AI seems to build a shipyard early, which IMO is typically not that useful early in the game. Also, it seems to build a colosseum / arena rather late, even though that is a relatively cheap way to boost military capabilities. Philipp Top Quote |
Tibor Topic Opener |
Posted at: 2017-05-30, 21:05
Well, these big buildings are problem for genetic algorithm. The overall effect on AI performance is low so AI does not know cope well with them. F.e. the difference between 1 ranger and 5 ranger is huge and for AI it is easier to figure out that 5 is usually better than 1. I think some manual tweaking will be needed there... And then we still have that forced_after and prohibited_till flags... Top Quote |
Tibor Topic Opener |
Posted at: 2017-05-30, 21:09
I added the text into log clearly saying that basic economy mode is to be started:
I will add support for save/load in few days Top Quote |
soulless |
Posted at: 2017-05-31, 13:01
I read the forum often and this basic economy sounds very interesting and like the logic I had in mind after finding the lua-files with not-before and forced_after. So I will try to explain the full logic I had in mind. As I am no real programmer (but can read code a little bit) this is just the logic how I think it could be possible to do: In the lua-file:
in DefaultAI::construct_building:
in check_basic_economy_build check for all buildings with basic_count if their number >= basic_count (and perhaps also if stock for wares produced by basic_economy >= basic_count in wares.lua) in check_shipyard_economy_build check for all buildings with basic_shipyard_count if their number >= basic_shipyard_count perhaps the return-value for this functions can be cached for some time whith:
and
that should solve the save and load-game problem and also puts the ai back in basic_economy if it lost some basic buildings. And than in mode expand_cheap_and_fast only build military buildings which are cheap and help to expand fast like sentry or blockhouse or perhaps barrier and buildings needed for basic_economy. And in mode stop_shipyard set all wares in shipyard to 0 and stop the shipyard so resources are not spent for building ships before having the buildings needed to found a new colony and get soldiers there. For empire I would suggest the following settings for basic_economy:
and wares if possible:
and for shipyard_economy
as I did not play the other tribes that often no suggestions for them from me. I would also like to note that I like some of the new functions very much, specially that the building windows are not closed after pressing stop / start / dismantle buttons. I also will try to test the new post-ai the next few days because that basic_economy sounds like a good solution for some weakness of the ai. Top Quote |
WorldSavior |
Posted at: 2017-05-31, 16:02
Interesting. It's good that they don't get mills or bakeries
Yes, that's clever. It makes the AI more flexible.
Ouh... I didn't anything which improves military strength because my lists should be good for all cases. If barbarians are close to their enemies, a barrack is a good option for early fights. But I think that empire and especially atlanteans are stronger in this situation, if they don't build a barrack, but an arena, or a trainings camp, or an arena and a trainings camp, or even a colosseum, or respectively a labyrinth, or a labyrinth and a dungeon...
No, that's not cheating, it looked at the map editor once and didn't forget anything
Well... For trading outpost, it could make sense
I thought about that to avoid deadlocks. But if it's on the lists it means that the AI will not build more of those before everything else is build, so it is a little catastrophy... And anyway, the wood economy can also be build without being on the list... And I think that the wood economy is just too map-dependent for being on the list...
Yay, someone who likes the second vineyard...
armorsmithy and weaponsmithy? Edited: 2017-05-31, 16:04
Wanted to save the world, then I got widetracked Top Quote |
Tibor Topic Opener |
Posted at: 2017-05-31, 18:58
Well, I want to clarify some details about implementation of BE. The core data container is remaining_basic_buildings that is unordered_map of <building id:count>, that is generated on the begining based on flags in lua files, and once a particular building is build, it is removed from the "list". Once the list is empty, the basic economy is achieved. This list will be preserved in the savegame. I opted for this design also for upgrading of buidings - even though such building is upgraded, it is not added to the list. Intentionally. We can ofcourse discuss whether upgrading during BE stage would be allowed. Basic economy is really intended as a starter, ideally for first 30 minutes. If it takes more than hour - this is not good. If you add ranger (or similar) to the list it will not make big difference, unless you add something like <ranger:20>. As for shipyard economy - this complicates things. I am not against a dependency BE->shipyard/port, f.e. 'do not build/stock shipyard untill BE is completed' though. This can be nicely hardcoded. Shipyard currently ignores BE altogether. I repeat - forced_after and prohibited_till controlled about first 30 minutes of game. BE should not last much longer, if at all. Of course many approaches are possible, but experiments take a lot of time and work... Top Quote |
Nordfriese |
Posted at: 2017-05-31, 19:31
Hello, I´m back with a large number of test results! I tested a lot of games, but I did not store the number or even the individual statistics – only average values for each list and map. First some comments on AI in general (I do not mean to offend, even if the AI may seem stupid now):
On the positive side, AI generally is better than in current trunk. I did not test Autocrat games, as they take so long. I only used Collectors. The test results surprised me. I used my program to draw diagrams of each player´s land,productivity,NbWorkers,NbWares,NbBuildings. Also, I noted the Points diagram from the Game Statistics Window. I used a simple, flat, rich map for 3 players (1-BAR, 2-EMP, 3-ATL). The map was divided into 3 equal compartments so AIs were completely unable to interact. Results for the Collector Points:
The statistics for the other values: The graphs are a bit confusing. The colours are: Blue for BAR, Red for EMP, Green for ATL. The shadings code for the categories (land, ware number etc). Quick summary:
All in all, I am under the impression that Barbarians play best with N>P>W, Empire with P>N>W Atlanteans with P>W>N. In other words: Tibor´s presets are the best suggestion for Empire and Atlanteans. My lists are best for Barbarians. WorldSaviour´s lists are also good, but not the best for any tribe. Would you like me to do more testing (more maps, more win conditions, …)? Top Quote |
Tibor Topic Opener |
Posted at: 2017-05-31, 19:51
@Nordfriese Thanks for your effort and feedback! So I will update the presents for barbarians, can you post them here once more? You mentioned some points, so few words about them:
From my standpoint no further testing is needed. As I said I will adopt your list for barbarians and let AI train with that. If you can, preserve your testing setup, in the future you can use it again I think. Top Quote |