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

[GH-1054] Bots movement improvement #1055

Merged
merged 16 commits into from
Feb 3, 2025
Merged

Conversation

tvillegas98
Copy link
Contributor

@tvillegas98 tvillegas98 commented Jan 21, 2025

Motivation

The randomness of the movements led our bots walking near the externall walls, now they will move through positions around the map and also they will be able to track players

Closes #1054

Summary of changes

How to test it?

Play with the bots and leave a feedback about their behavior!

Checklist

  • Tested the changes locally.
  • Reviewed the changes on GitHub, line by line.
  • This change requires new documentation.
    • Documentation has been added/updated.

@tvillegas98 tvillegas98 changed the title [GH-1054] Bots Positioning [GH-1054] Bots movement improvement Jan 21, 2025
@tvillegas98 tvillegas98 marked this pull request as ready for review January 24, 2025 20:16
def get_distance_and_direction_to_positions(base_position, end_position) do
%{x: x, y: y} = Vector.sub(end_position, base_position)

distance = :math.sqrt(:math.pow(x, 2) + :math.pow(y, 2))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use the distance function that you just created in apps/bot_manager/lib/math/vector.ex?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +50 to +56
position_to_move_to: nil,
time_amount_to_change_position: 2000,
last_time_position_changed: 0,
max_vision_range_to_follow_player: 1500,
vision_range_to_attack_player: 1200,
stuck_in_position: nil,
start_time_stuck_in_position: nil
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's create an issue to remove these magic numbers to make them parametrizable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #1067

@Nico-Sanchez Nico-Sanchez merged commit 68f18a5 into main Feb 3, 2025
1 check passed
@Nico-Sanchez Nico-Sanchez deleted the gh-1054-bots-positioning branch February 3, 2025 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] - Make the bots move through positions instead of random directions
3 participants