Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks
stefanhendriks opened this issue Sep 6, 2019 · 17 comments
Open
3 tasks

Comments

@stefanhendriks
Copy link
Collaborator

stefanhendriks commented Sep 6, 2019

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 stefanhendriks self-assigned this Sep 6, 2019
stefanhendriks added a commit that referenced this issue Sep 6, 2019
hostage rescue logic.

Also log more about the troubled connection - for #17
@stefanhendriks
Copy link
Collaborator Author

@stefanhendriks stefanhendriks changed the title Learning path navigation broken? When a bot detects a wrong connection it should remove it (learn) Sep 8, 2019
stefanhendriks added a commit that referenced this issue Sep 8, 2019
- remove wrong connection when detected, works fine as long there is no
opportunity to jump/crouch
- for #17
@stefanhendriks stefanhendriks added the pathfinding Everything regarding path finding, creating path but also walking/learning path label Sep 8, 2019
stefanhendriks added a commit that referenced this issue Sep 8, 2019
- bots still hang too much around invalid connections and dont decide
fast enough that they should severe the connection
- for #17
@stefanhendriks
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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.

@Overitab
Copy link

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
Copy link

Overitab commented Sep 13, 2019

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

@stefanhendriks
Copy link
Collaborator Author

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

@Overitab
Copy link

ok i make video, give me 30 min

@stefanhendriks
Copy link
Collaborator Author

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.

@Overitab
Copy link

Overitab commented Sep 13, 2019

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 ?

@stefanhendriks
Copy link
Collaborator Author

@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.

@Overitab
Copy link

Overitab commented Sep 13, 2019

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

@stefanhendriks
Copy link
Collaborator Author

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. (Goal nodes should not float too high #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 #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

@Overitab
Copy link

ok good, i wait

stefanhendriks added a commit that referenced this issue Sep 13, 2019
- for #22 and #17
- also add convenient functions to draw beams more easily
@stefanhendriks
Copy link
Collaborator Author

realbot_mm.zip

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

stefanhendriks added a commit that referenced this issue Sep 17, 2019
- this is now a timed thing
- we can now see when it gets < 20 or so, it usually means 'stuck'.
Although I haven't tested with crouching yet, which probably results
into distances of 20 by default. So the 'check' how much moved should
also be done against the kind of movement (jumping, ducking, running,
etc)
- for #17
stefanhendriks added a commit that referenced this issue Sep 17, 2019
@stefanhendriks
Copy link
Collaborator Author

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 stefanhendriks added as_oilrig cs_italy path walking and removed pathfinding Everything regarding path finding, creating path but also walking/learning path labels Sep 20, 2019
stefanhendriks added a commit that referenced this issue Sep 20, 2019
… bad connection when we can't see it anymore.

- for #17
@stefanhendriks
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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 added a commit that referenced this issue Sep 21, 2019
This is not perfect, and in fact should only be done when it is 'stuck' (after 0.1 ms decision). So we won't have these random jumps.
But it is a step forward for #29 and improving on #17
stefanhendriks added a commit that referenced this issue Sep 26, 2019
…on and when to learn about bad connections

- for #17 for instance

- When considered stuck, it will only try a few things and bail immediately. Ie, either jumping, ducking or it just logs its findings (but there is still work to do to make bot behave)
- When time is up to reach node, it will remove the connection. Even when not 'stuck'.
- take freezetime into consideration so we don't mark spawn points as bad nodes
- refactored Button/Door interaction and Stuck logic into their own functions. Making path_walk easier to read. Slow steps to a state machine at some day???
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants