Notes |
|
|
Hey Warmonger: I'm working on this bug, too. I'll post a patch if I fix it. |
|
|
|
Calling this ticket a "bug" i s a big misunderstanding on how AI works and how it is supposed to work. If it's a bug, what would be possible fix? |
|
|
(0005009)
|
Povelitel
|
2014-10-11 06:28
(edited on: 2014-10-11 06:30) |
|
If this is not the fault of what is it? All the players were with the initial forces and buy more of the city. The Luna was the last move to the city, but it is also not led him to buy troops.
Maybe there is some sort of a relationship between the presence of free money and priorities to build. Maybe he is saving some money as a percentage before skimp? And do not feel in danger. Not take into account that the city can pick up?
Besides, it is easy to verify in practice. Skip passages and open the map cheat.
|
|
|
|
You didn't answer my question. Can you tell exactly what would be possible fix? |
|
|
|
I'm still working on this issue (it's very poor behavior on the AI's part not to buy troops if you're about to take his town, but I agree this would fall under "enhancement request" rather than "bug" per se), and I think this has a lot to do with it:
const int GOLD_RESERVE = 10000; //when buying creatures we want to keep at least this much gold (10000 so at least we'll be able to reach capitol)
That is line 28 of VCAI.cpp. This line combined with the AI's tendency to buy new heroes way too often leads to poor play. I'm testing out my changes and trying to fix a few other issues while I'm at it (like the AI tries to take crypts with no army and of course dies), then I'll post a preliminary patch for your review.
By the way, this is some of the cleanest code I've ever worked on. Respect. |
|
|
|
Warmonger, if you ask me, I do not know what to answer. How to solve this problem. I'm not a programmer - I'm an observer.
But I can say that when you can kill enemies in fact starting troops is not normal. When his troops built, there is a good growth, and it ignores the threat of losing the city - is not normal.
Personally, my decision is the most simple and primitive, - give a million of money from the start. But it works.
Hopefully something linuxrocks123 will come up with may be. |
|
|
|
Hey Warmonger,
I forked the GitHub repo for my AI changes and they're at https://github.com/linuxrocks123/vcmi.git [^]
I would like you to review my changes when you get a minute. I made a lot of them and I think the AI plays much better now!
Have a nice day! |
|
|
|
|
|
(0005019)
|
Kantor
|
2014-10-13 13:15
|
|
Hi linuxrocks123, at the beginning I would like to say how glad I am to see You fixing some AI mechanics, especially such as this one, which looks quite complicated. I tested VCMI by compiling it's source from your branch (do I call it right?), but unfortunately there are some major glitches that causes VCMI crashes. I'll include a map, but I'm pretty sure this'll happen to all kind of maps, so in your free time you can take a look at it ;) |
|
|
(0005020)
|
linuxrocks123
|
2014-10-14 07:07
(edited on: 2014-10-14 07:20) |
|
Kantor, I believe I ran into that bug and fixed it in commit 3 to my branch. I downloaded your map and did nothing but end my turn and it worked alright. Is there something else I have to do to trigger the issue?
EDIT: I had a question earlier about why the fog of war wasn't working right in one of my AI calculations. Found the answer, line 3532 of CGameState.cpp. Doxygen is awesome :D
And, yeah, it's a branch.
|
|
|
(0005021)
|
Kantor
|
2014-10-14 14:56
(edited on: 2014-10-14 14:57) |
|
Hi, are You sure? I must point that it's a very randomly occurring bug, so sometimes You'll have to pass few days, sometimes even at ending of first turn it could happen...
This also happens when You type vcmieagles cheat to view whole map and end turn. It is really random bug, including saves would be pointless I think, so I include logs instead.
|
|
|
|
Kantor,
Which version of my tree are you using? Have you updated your tree to include this commit:
https://github.com/linuxrocks123/vcmi/commit/45b0bba3366341d447abd8573f28ac1367000d9e [^]
If not, please update to the latest version of my branch and see if it still occurs. If yes, I'd like to ask that you try to find a way to consistently reproduce it if possible. I just played an entire game against the AI and didn't run into any crashes, so, without a way to reproduce the issue, it will be very hard for me to fix it.
Btw, I'm thinking now, with my latest changes, if I created a random map tilted in the AI's favor, it might beat me. How much I would need to tilt it, I don't know. The game I played was the Arrogance map on hard, and I won handily, but I didn't notice it doing anything obviously "wrong", and I "know" that map and the AI doesn't, so I had an unfair advantage. I'll try that map on impossible next.
The battle AI does some dumb things, but other people are working on that. The current battle AI is called "StupidAI" in the source code, and they're working on replacing it with "BattleAI" but I think it's not stable or something because it's disabled by default.
Hey Warmonger, how do I enable BattleAI, and would that be a good idea? Also, Google tells me there used to be a prohibition against working on BattleAI because it was someone's thesis, is that still in effect?
Cheers! |
|
|
|
Give me assembly under windows somebody and I'll find you crash. guaranteed |
|
|
(0005024)
|
Kantor
|
2014-10-15 10:49
(edited on: 2014-10-15 11:12) |
|
linuxrocks123,
I see your point, but all I can do is to check logs only due to really randomness of it's occurring. I noticed in both cases (because I compared logs previously included here with the fresh ones made today) crash happens after "Leaving virtual void VCAI::tileRevealed(const std::unordered_set<int3, ShashInt3>&)" for client, and for server after "Leaving CGameHandler::moveHero(ObjectInstanceID, int3, ui8, PlayerColor)::__lambda14". I doubt it can help, but it's a only clue I have for now.
Oh, I forgot to answer Your question, yes, I'm using latest commit in your branch.
Povelitel,
You asked about VCMI package, right? Here is one: http://www.filedropper.com/vcmi096b [^]
|
|
|
|
linuxrocks123, how about you use our forum for topics not related to this issue? |
|
|
|
Kantor, go to the forum please, I wrote you a private message, so I do not flood here. (Your build does not work for me). |
|
|
|
Okay, Warmonger. Sorry.
Kantor, Povelitel, and Warmonger: I created a thread on the forum for discussions of my tree. We can continue this discussion there: http://forum.vcmi.eu/viewtopic.php?p=13283#13283 [^]
Kantor, I looked at your build, and I don't use Windows (I'm on Linux), so it may be that I can't reproduce your issue because the bug is platform-specific (I hate those...). Please run the client program in a debugger and post a stack trace when it crashes. I didn't change the server much, so the problem shouldn't be there. Post your responses to the thread I created; I'll be checking there for updates. |
|