Comments (5)
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.
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.
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.
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.
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)
- Small typ0 and CMake build HOT 2
- Questions about the project. HOT 13
- designatedPossessionPlayer v.s. ballRetainer HOT 3
- Draw text over a texture HOT 3
- How Pass Command works?
- width depth mistake? HOT 1
- Instructions for modifying designs
- Making my own adaption based on this code HOT 5
- Move to another engine HOT 3
- m
- Any manual for compile this souce code? HOT 42
- I can't find any header files HOT 6
- where are your footballer models stored? HOT 8
- how rule-based AI works HOT 2
- fastapprox.h and function curve HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gameplayfootball.