RetroArch/deps/game_ai_lib/games/NHL94GameData.h
Mathieu Poliquin 66e23fca79
New feature: Override player input with machine learning models (#17407)
* Add dummy game ai subsystem

* First working prototype of a machine learning model that can override player input

* Update README.md

* Update README.md

* Fix loading path on Windows

* Change ai override to player 2

* Added quick menu show game ai option

* Implemented Quick Menu entry for Game AI options

* Redirect debug logs to retroarch log system + properly support player override

* Added support to use framebuffer as input to the AI

* Added pixel format parameter to API

* Fix game name

* code clean-up of game_ai.cpp

* Update README.md - Windows Build

* Update README.md

* Update README.md

* Update README.md

* Update config.params.sh

turn off GAME_AI feature by default

* Fix compile error in menu_displaylist.c

* Add missing #define in menu_cbs_title.c

* Added new game_ai entry in griffin_cpp

* Remove GAME_AI entry in  msg_hash_us.c

* Fix compile error in menu_displaylist.h

* Removed GAME AI references from README.md

* Fixes coding style + add GameAI lib API header

* Convert comment to legacy + remove unused code

* Additional coding style fixes to game_ai.cpp

* Fix identation issues in game_ai.cpp

* Removed some debug code in game_ai.cpp

* Add game_ai_lib in deps

* Replace assert with retro_assert

* Update Makefile.common

* Converting game_ai from cpp to c. First step.

* Convert game_ai from CPP to C. STEP 2: add C function calls

* Convert game_ai from CPP to C. Final Step

* Added shutdown function for game ai lib

* Update game_ai_lib README

* Fix crash when loading/unloading multiple games
2025-01-21 13:05:43 +01:00

100 lines
No EOL
1.5 KiB
C++

#pragma once
#include "memory.h"
#include "../utils/data.h"
enum NHL94Buttons {
INPUT_B = 0,
INPUT_A = 1,
INPUT_MODE = 2,
INPUT_START = 3,
INPUT_UP = 4,
INPUT_DOWN = 5,
INPUT_LEFT = 6,
INPUT_RIGHT = 7,
INPUT_C = 8,
INPUT_Y = 9,
INPUT_X = 10,
INPUT_Z = 11,
INPUT_MAX = 12
};
enum NHL94NeuralNetInput {
P1_X = 0,
P1_Y,
P1_VEL_X,
P1_VEL_Y,
P2_X,
P2_Y,
P2_VEL_X,
P2_VEL_Y,
PUCK_X,
PUCK_Y,
PUCK_VEL_X,
PUCK_VEL_Y,
G2_X,
G2_Y,
P1_HASPUCK,
G1_HASPUCK,
NN_INPUT_MAX,
// Used for normalization
MAX_PLAYER_X = 120,
MAX_PLAYER_Y = 270,
MAX_PUCK_X = 130,
MAX_PUCK_Y = 270,
MAX_VEL_XY = 50
};
enum NHL94Const {
ATACKZONE_POS_Y = 100,
DEFENSEZONE_POS_Y = -80,
SCORE_ZONE_TOP = 230,
SCORE_ZONE_BOTTOM = 210,
};
class NHL94Data {
public:
int p1_x;
int p1_y;
int p2_x;
int p2_y;
int p1_vel_x;
int p1_vel_y;
int p2_vel_x;
int p2_vel_y;
int g1_x;
int g1_y;
int g2_x;
int g2_y;
int puck_x;
int puck_y;
int puck_vel_x;
int puck_vel_y;
int p1_fullstar_x;
int p1_fullstar_y;
int p2_fullstar_x;
int p2_fullstar_y;
bool p1_haspuck;
bool g1_haspuck;
bool p2_haspuck;
bool g2_haspuck;
int attack_zone_y;
int defense_zone_y;
int score_zone_top;
int score_zone_bottom;
int period;
void Init(const Retro::GameData & data);
void Flip();
void FlipZones();
};