MantisBT - VCMI
View Issue Details
0000925VCMIAI - Adventure Mappublic2012-04-11 11:582022-04-11 17:49
q4a 
Tow 
normalminoralways
closedfixed 
x86WindowsXP SP3
0.88 
0.89 
0000925: AI is trying to visit events, but should not see it
Tested on r2622.
Load attached save (homm3 map "The Five Rings.h3m")
Click "End Turn".
Green hero Gundula will stand on place(35x29) with event, but nothing happens.
If on next day my 2nd hero(Cuthbert) will kill Gundula and will stand on its place, then Cuthbert will fight with guardians for 5000 gold.

I checked: this event should happens with every player and "Cancel event after first visit".
No tags attached.
related to 0001450assigned Warmonger Stupid demeanor AI. Constantly dies in ambush events 
7z save.7z (124,716) 2012-04-11 11:58
https://bugs.vcmi.eu/file_download.php?file_id=897&type=bug
? t03.h3m (1,631) 2012-04-11 13:41
https://bugs.vcmi.eu/file_download.php?file_id=898&type=bug
Issue History
2012-04-11 11:58q4aNew Issue
2012-04-11 11:58q4aStatusnew => assigned
2012-04-11 11:58q4aAssigned To => Tow
2012-04-11 11:58q4aFile Added: save.7z
2012-04-11 13:03WarmongerNote Added: 0002356
2012-04-11 13:41q4aFile Added: t03.h3m
2012-04-11 13:45q4aNote Added: 0002357
2012-04-11 15:04WarmongerAssigned ToTow => Warmonger
2012-04-11 15:10WarmongerNote Added: 0002358
2012-04-11 15:22majaczekNote Added: 0002359
2012-04-11 15:24q4aNote Added: 0002360
2012-04-11 15:25q4aNote Edited: 0002360bug_revision_view_page.php?bugnote_id=2360#r1559
2012-04-11 15:25q4aNote Edited: 0002360bug_revision_view_page.php?bugnote_id=2360#r1560
2012-04-11 15:32q4aNote Edited: 0002360bug_revision_view_page.php?bugnote_id=2360#r1561
2012-04-11 15:34majaczekNote Added: 0002361
2012-04-11 15:48WarmongerNote Added: 0002362
2012-04-11 15:50WarmongerNote Edited: 0002362bug_revision_view_page.php?bugnote_id=2362#r1563
2012-04-12 04:11q4aNote Added: 0002363
2012-04-14 07:24TowNote Added: 0002365
2012-04-14 07:24TowStatusassigned => resolved
2012-04-14 07:24TowFixed in Version => 0.89
2012-04-14 07:24TowResolutionopen => fixed
2012-04-14 07:24TowAssigned ToWarmonger => Tow
2013-09-10 05:39WarmongerRelationship addedrelated to 0001450
2013-09-10 05:47WarmongerSummaryNothing happens, when AI visit event => AI trying to this visit events, but should not see it
2013-09-10 05:48WarmongerSummaryAI trying to this visit events, but should not see it => AI is trying to visit events, but should not see it
2022-04-11 17:49PovelitelStatusresolved => closed

Notes
(0002356)
Warmonger   
2012-04-11 13:03   
Are you sure it's not player-only event?
(0002357)
q4a   
2012-04-11 13:45   
Yes, sorry. My mistake.
Anyway, AI trying to this visit events:
Start attached map t03.h3m.
Click "End Turn".
- in VCMI AI will try to visit events.
- in h3wog AI will not do it, but will attack red hero.
(0002358)
Warmonger   
2012-04-11 15:10   
^This one made me laught XD

Hmm, that's quite tricky. AI should not try to visit events, but also not avoid them completely (as they can't be seen).
(0002359)
majaczek   
2012-04-11 15:22   
So while VCMI team want to make an AI which can win with player, actually made a cheating AI. AI sees what player don't see even if it is just an event. Which bring me a better idea for cheating AI. Currently on Rook (chess tower) both player and AI has some amount of resources and AI plays as good as it can. So instead giving AI more resources (not only basic resources, but also units, experience points etc.), we could give the cheating AI better knowledge that it could find without cheating (I don't mean knowledge points but information which game knows but player shouldn't know - so in example exact size of army AI want to fight - in some cases, or for Impossible level even all map uncovered). More interesting if we aren't able to prepare good enough AI to win the player, we have to make AI cheating, but player don't want to feel it - and my appproach would work great. Think this the way "It's not bug but a feature". Yes the bug is the AI visits the event which does not affect them, but visiting event by AI in itself doesn't have to be a bug but may be a feature. If implementing my approach deeply an AI may even win with cheating player and be still legal - Cheats player do for knowledge only are legal, as making any knowledge Illegal is insane, and would suggest judging any experienced player is already an illegal cheater as he know more than inexperienced one could. Experienced players already cheat in AI fights - they know techniques to use for AI acting dumb, and in result they win because skill of knowing game mechanics, not by skill of tacics of real player - but it is perfectly legal, because if not the Heroes3 matches would be nonsence. Player even could actually know most of the game know by peeking at game memory - why AI shouldn't be able to do it? Yeah sure we want to make good client-server mechanics, but still it's just cloning advantage of server owner which is still legal for him.
(0002360)
q4a   
2012-04-11 15:24   
(edited on: 2012-04-11 15:32)
@Warmonger: Ok. Should I open new bug for "AI trying to this visit events, but should not see it" or you will change Summary?

PS majaczek +1 =)

(0002361)
majaczek   
2012-04-11 15:34   
q4a if you like it come on forum. I already made a quote in "Adventure AI" thread, so you may there discuss what should cheating AI look like.
(0002362)
Warmonger   
2012-04-11 15:48   
(edited on: 2012-04-11 15:50)
AI doesn't "see" events or "read" messages and dialog boxes as human do. It's the issue of how much info is avaliable through game callback. Unfortunatelly, most of object mechanics are handled on client side and that's the hole we should fix. The problem is not cheating AI, but the possibility to cheat at all.

So I may just fix AI wanting to visit events, and the callback / engine investigations will be handled separately.

(0002363)
q4a   
2012-04-12 04:11   
Fix AI wanting to visit events.
All other improvements can be added later =)
(0002365)
Tow   
2012-04-14 07:24   
Fixed in r2624.
AI will use cb function that hides events from the list of visitable objects.
However the old tile access is still present, we'll have to close that loophole sooner or later. Player shouldn't be able to get events locations.