Code Monkey home page Code Monkey logo

Comments (5)

yumianhuli2 avatar yumianhuli2 commented on July 26, 2024 1

Ahh I see.. but I have no idea about Google's code, and I don't really have the time or energy to put into helping people with custom code. I hope maybe someone else can come along and help you here, so I'll leave this topic open. Good luck :)

^_^

from gameplayfootball.

BazkieBumpercar avatar BazkieBumpercar commented on July 26, 2024

I have no idea, depends on what all these variables mean :) needs more context..

In general, a direction would be normalized, while movement isn't, so info.player_direction = movement.GetNormalized(0); would make more sense. But it really depends on what you want, where movement comes from, what info.player_direction is, etc..

from gameplayfootball.

yumianhuli2 avatar yumianhuli2 commented on July 26, 2024

I have no idea, depends on what all these variables mean :) needs more context..

In general, a direction would be normalized, while movement isn't, so info.player_direction = movement.GetNormalized(0); would make more sense. But it really depends on what you want, where movement comes from, what info.player_direction is, etc..

Hello!The context is below from google-football engine,but this engine is from your project^_^
So I want to know where is the formula and code for the direction of the player! Thank you very
much!

void Match::GetTeamState(SharedInfo *state,
std::map<IHIDevice *, int> &controller_mapping,
int team_id) {
DO_VALIDATION;
std::vector &team =
team_id == 0 ? state->left_team : state->right_team;
team.clear();
std::vector<Player *> players;
GetAllTeamPlayers(team_id, players);
for (auto player : players) {
DO_VALIDATION;
auto controller = player->GetExternalController();
if (controller) {
DO_VALIDATION;
if (team_id == 0) {
state->left_controllers[controller_mapping[controller->GetHIDevice()]]
.controlled_player = team.size();
} else {
state->right_controllers[controller_mapping[controller->GetHIDevice()]]
.controlled_player = team.size();
}
}
if (player->CastHumanoid() != NULL) {
DO_VALIDATION;
auto position = player->GetPosition();
auto movement = player->GetMovement();
if (team_id == 1) {
position.Mirror();
movement.Mirror();
}
PlayerInfo info;
info.player_position = position.coords;
info.player_direction =
(movement / GetGameConfig().physics_steps_per_frame).coords;
GetGameConfig().physics_steps_per_frame).coords[0])<<","<<"y:"<<std::to_string((movement / GetGameConfig().physics_steps_per_frame).coords[1])<<","<<"z:"<<std::to_string((movement / GetGameConfig().physics_steps_per_frame).coords[2])<<"\n";
info.tired_factor = 1 - player->GetFatigueFactorInv();
info.has_card = player->HasCards();
info.is_active = player->IsActive();
info.role = player->GetFormationEntry().role;
if (player->HasPossession() && GetLastTouchTeamID() != -1 &&
GetLastTouchTeam()->GetLastTouchPlayer() == player) {
DO_VALIDATION;
state->ball_owned_player = team.size();
state->ball_owned_team = GetLastTouchTeamID();
}
team.push_back(info);
}
}
}

And I did not get the answer from this google-research/football#145,
so plz help me!^_^!
source link is here: https://github.com/google-research/football/tree/master/third_party/gfootball_engine

from gameplayfootball.

BazkieBumpercar avatar BazkieBumpercar commented on July 26, 2024

Ahh I see.. but I have no idea about Google's code, and I don't really have the time or energy to put into helping people with custom code. I hope maybe someone else can come along and help you here, so I'll leave this topic open. Good luck :)

from gameplayfootball.

roberth11 avatar roberth11 commented on July 26, 2024

Ahh, ya veo ... pero no tengo idea sobre el código de Google, y realmente no tengo el tiempo ni la energía para ayudar a las personas con código personalizado. Espero que alguien más pueda venir y ayudarte aquí, así que dejaré este tema abierto. Buena suerte :)

^ _ ^

you could compile the game

from gameplayfootball.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.