RealBot icon indicating copy to clipboard operation
RealBot copied to clipboard

When a bot detects a wrong connection it should remove it (learn)

Open stefanhendriks opened this issue 4 years ago • 17 comments

It looks like when a bot walks a path and encounters a 'troubled' connection it won't forget (after too many retries) the connection. Although the logs seem to indicate it would forget it - it does'nt.

Examples

  • [ ] cs_italy stairs going up to hostages
  • [ ] as_oilrig ramps

Ideas

  • [ ] use trace_hull when connecting nodes, instead of trace_line?

Example of troubled connection not working: image

Logs saying:

RBPRINT->[FragMe 'setGoalNode()']-[Team COUNTER] : Setting iGoalNode to 124
RBPRINT->[FragMe 'cNodeMachine::path_think']-[Team COUNTER] : I have chosen a goal: Node [124], Goal type [GOAL_HOSTAGE], score [6.177016], distance [561.016296]

RBPRINT->[FragMe 'cNodeMachine::path_think']-[Team COUNTER] : I have chosen a goal: Node [124], Goal type [GOAL_HOSTAGE], score [6.177016], distance [561.016296]
RBPRINT->[FragMe 'cNodeMachine::path_walk()']-[Team COUNTER] : Next node will be the destination!

RBPRINT->[FragMe 'cNodeMachine::path_walk()']-[Team COUNTER] : Next node will be the destination!
RBPRINT->[FragMe 'cNodeMachine::path_walk()']-[Team COUNTER] : Next node will be the destination!

RBPRINT->[FragMe 'cNodeMachine::path_walk()']-[Team COUNTER] : Next node will be the destination!
RBPRINT->[FragMe 'cNodeMachine::path_walk()']-[Team COUNTER] : Heading to destination!

RBPRINT->[FragMe 'cNodeMachine::path_walk()']-[Team COUNTER] : Heading to destination!
RBPRINT->[FragMe 'rprint()']-[Team COUNTER] : ForgetGoal

RBPRINT->[FragMe 'rprint()']-[Team COUNTER] : ForgetGoal
RBPRINT->[FragMe 'cNodeMachine::path_think']-[Team COUNTER] : No goal yet


RBPRINT->[FragMe 'cNodeMachine::path_think']-[Team COUNTER] : No goal yet

RBPRINT->[FragMe 'rprint()']-[Team COUNTER] : Setting final goal after choosing a goal from goals list

RBPRINT->[FragMe 'rprint()']-[Team COUNTER] : Setting final goal after choosing a goal from goals list
RBPRINT->[FragMe 'setGoalNode()']-[Team COUNTER] : Setting iGoalNode to 109

RBPRINT->[FragMe 'setGoalNode()']-[Team COUNTER] : Setting iGoalNode to 109
RBPRINT->[FragMe 'cNodeMachine::path_think']-[Team COUNTER] : I have chosen a goal: Node [109], Goal type [GOAL_HOSTAGE], score [22.698469], distance [146.518631]

RBPRINT->[FragMe 'cNodeMachine::path_think']-[Team COUNTER] : I have chosen a goal: Node [109], Goal type [GOAL_HOSTAGE], score [22.698469], distance [146.518631]
Wrote HalfLife03.tga

Wrote HalfLife04.tga

RBPRINT->[FragMe 'path_walk']-[Team COUNTER] : players near? 0, shouldMove? 1, walking path? 1, previousPathNodeIndex? 0

RBPRINT->[FragMe 'path_walk']-[Team COUNTER] : players near? 0, shouldMove? 1, walking path? 1, previousPathNodeIndex? 0
RBPRINT->[FragMe 'rprint()']-[Team COUNTER] : MoveToNodeTime expired

RBPRINT->[FragMe 'rprint()']-[Team COUNTER] : MoveToNodeTime expired
RBPRINT->[FragMe 'rprint()']-[Team COUNTER] : ForgetGoal

RBPRINT->[FragMe 'rprint()']-[Team COUNTER] : ForgetGoal
RBPRINT->[FragMe 'path_walk']-[Team COUNTER] : a troubled connection!

RBPRINT->[FragMe 'path_walk']-[Team COUNTER] : a troubled connection!
Connection may be retried
Scoring will not start until both teams have players

Scoring will not start until both teams have players

RBPRINT->[FragMe 'path_walk']-[Team COUNTER] : players near? 0, shouldMove? 1, walking path? 1, previousPathNodeIndex? 1

RBPRINT->[FragMe 'path_walk']-[Team COUNTER] : players near? 0, shouldMove? 1, walking path? 1, previousPathNodeIndex? 1
RBPRINT->[FragMe 'rprint()']-[Team COUNTER] : MoveToNodeTime expired

RBPRINT->[FragMe 'rprint()']-[Team COUNTER] : MoveToNodeTime expired
RBPRINT->[FragMe 'rprint()']-[Team COUNTER] : ForgetGoal

RBPRINT->[FragMe 'rprint()']-[Team COUNTER] : ForgetGoal
RBPRINT->[FragMe 'path_walk']-[Team COUNTER] : a troubled connection!

RBPRINT->[FragMe 'path_walk']-[Team COUNTER] : a troubled connection!

Still even with 'forgetGoal' and such being called (which should clear the path!) it keeps going to this node.

stefanhendriks avatar Sep 06 '19 18:09 stefanhendriks

Video of this at: https://www.youtube.com/watch?v=AmFJZURwoF4&feature=youtu.be

stefanhendriks avatar Sep 06 '19 18:09 stefanhendriks

The logic has improved a bit, but not as much as I'd like. While working on this I broke bomb planting, hostage rescueing and bomb defusion.

Now those things seem to work fine again.

stefanhendriks avatar Sep 11 '19 05:09 stefanhendriks

Playing in AS_OILRIG I noticed that bots are slow learners.

See this case: image

A bit dark picture, but you can see 3 bots trying to get down. They don't duck and they are pretty close to each other.

Probably the canDuck function thinks it is not possible, due the bar being at a specific height? Perhaps this can piece should be removed and tried anyway when nothing else seems to work. Same goes for jumping. It could also be a combination of this and #22.

Regardless, the bots take their time removing connections and this takes too long.

stefanhendriks avatar Sep 13 '19 04:09 stefanhendriks

also please fix moment when bots try go up where no laders. I use plugin that add more spawn ponts. And i add 16 more spawns on iceworld above head. Bots fall in start and try go up. Maybe make one side connections or other fix

Overitab avatar Sep 13 '19 11:09 Overitab

can u give me last build dll ? i can test it

Overitab avatar Sep 13 '19 11:09 Overitab

@Overitab could you tell me which map you use? Perhaps even record it (youtube video?) so I can see for myself?

stefanhendriks avatar Sep 13 '19 11:09 stefanhendriks

ok i make video, give me 30 min

Overitab avatar Sep 13 '19 11:09 Overitab

The latest master is not really release-able, though I could probably create a DLL for you. But you'd have to wait for it for a while.

stefanhendriks avatar Sep 13 '19 11:09 stefanhendriks

I was wrong, I didn't use the spawn above head . But still bots behave strangely, look up, dont run. https://youtu.be/EZ5kXZZXIZc Please give me last build dll, becouse i use old build . I asked to make me a dll of the author of yapb https://github.com/jeefo/yapb last yapb here https://yapb.ru/files/binaries/5707/release/. You have telegram or some contact ?

Overitab avatar Sep 13 '19 11:09 Overitab

@Overitab just to be sure, there are nodes in the map? Looks like as if the bots have no clue where to go. It could also be that the map type is unknown and the bots wouldn't know what to do. Although.. in the most basic sense they would always go to the opponent spawn point.

So two things:

  • Before adding bots (but keep realbot dll loaded), walk around the map a bit.
    • then re-add bots. Do they behave differently?
  • Question: which map is this? I can test locally then.

stefanhendriks avatar Sep 13 '19 11:09 stefanhendriks

fy_iceworld , but i add more spawns. Ok i can test , please upload dll

Overitab avatar Sep 13 '19 11:09 Overitab

I can't create a new DLL now - I'm on a different OS. However, I did run a quick test and saw 2 things:

  1. The spawn points in the map are pretty high up. So I can optimise for that. Perhaps make sure they are not floating too high. (https://github.com/Fundynamic/RealBot/issues/25)
  2. Once I walked around the bots usually went their ways and tried to shoot each other
  3. Bots try to buy stuff, which is impossible

I created https://github.com/Fundynamic/RealBot/issues/24 for proper support of FY_ maps. And a different issue for better goal/spawn point plotting.

Do understand that the nodes are not created like waypoints in Podbot (manually). You create them on the fly by playing the level. Please play the level first (with realbot enabled) and add bots later, they should start moving. See also a bit more about this here: https://www.youtube.com/watch?v=j9CjnLd2nHU&t=201s

stefanhendriks avatar Sep 13 '19 11:09 stefanhendriks

ok good, i wait

Overitab avatar Sep 13 '19 11:09 Overitab

realbot_mm.zip

@Overitab here you go. Latest version. (Windows DLL). Replace DLL with the current one. No warranties ;-)

stefanhendriks avatar Sep 16 '19 13:09 stefanhendriks

The learn rate is improved significantly. As it now uses a shorter time window. Also with #22 fixed there is a lot less false positives: ie bots know when they are stuck by other bots with more accuracy.

The stairs in as_oilrig cause quite a lot of faulty connections, which have to be 'unlearned' by this. Another way would be to make connecting nodes a bit more strict.

stefanhendriks avatar Sep 20 '19 08:09 stefanhendriks

I noticed the bots ignore func_illusionary. This is used at cs_italy for instance. As far as the bots concerned they can walk right over them. But since they are used as 'fences' the bots get stuck and think the connections are wrong.

Here is a wireframe of cs_italy, with a func_illusionary (orange):

image

stefanhendriks avatar Sep 20 '19 18:09 stefanhendriks

More info at #29 while dealing with func_illusionary. This should be dealt with because this causes for wrong conclusions about wrong connections. Ie, in cs_italy bots think they cannot jump over the fence and hence remove the connections. While they can jump over them.

stefanhendriks avatar Sep 21 '19 06:09 stefanhendriks