Skip to content

Capucinoxx/csg-2026-agents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

csg-2026-agents

Build and Configuration

You can build specific components of the project using the provided Makefile at the root of the repository:

  • make client: Builds the client executable (Editor and Visualizer).
  • make server: Builds the TCP server and tournament engine executable.
  • make appimage: Packages the client and its config.json into a portable AppImage format.

Both the client and server executables can parse a config.json file located in their execution directory. This file allows you to dynamically override the system's default values without needing to recompile the source code.

(Note: Constants strictly related to the hardware architecture design, such as MEM_SIZE = 4000 bytes or MAX_BIN_SIZE = 2000 bytes, are hardcoded and cannot be modified via JSON).

Below is the exhaustive list of configurable keys:

1. Network Configuration

Key (JSON) C++ Constant Type Default Description
NET_PORT cfg::PORT uint16_t 10478 TCP Server listening port.
SRV_IP cfg::SERVER_IP std::string "127.0.0.1" Target IP address of the server.
NET_BUF_SIZE cfg::BUF_SIZE size_t 8192 Maximum network buffer size for TCP sockets.
NET_MAX_RUNS cfg::MAX_CONCURRENT_RUNS int 1 Max simultaneous simulations allowed per team.
NET_COOLDOWN cfg::COOLDOWN_MS_RATE uint64_t 5000 Cooldown delay (ms) between execution requests.

2. Client Configuration (Local Files)

Key (JSON) C++ Constant Type Default Description
CLI_OUT_FILE cfg::OUTPUT_FILE std::string ".csg26" Filename used to save the player's source code.
CLI_SESSION_FILE cfg::SESSION_FILE std::string "session.key" Filename storing the authentication token.
CLI_OUT_DIR cfg::OUTPUT_DIR fs::path "csg26" Local directory path for cache (code, session, replays).

3. Server Configuration (Infrastructure)

Key (JSON) C++ Constant Type Default Description
SRV_CREDS cfg::CREDS_FILE std::string "creds.txt" File storing the team credentials database.
SRV_SECRET cfg::SERVER_SECRET std::string "SECRET" Cryptographic key used to sign session tokens.
SRV_MAX_TEAMS cfg::MAX_TEAMS size_t 32 Maximum number of teams supported by the server.

4. Physics and Thermodynamic Model (Engine)

Key (JSON) C++ Constant Type Default Description
PHYS_DURATION cfg::phys::SIM_DURATION_SEC double 8.0 Maximum simulation duration (Time Limit) in seconds.
PHYS_STEP cfg::phys::TIME_STEP double 0.001 Integration time step (dt) for one cycle, in seconds.
PHYS_FREQ cfg::phys::BASE_FREQ double 1000.0 Base CPU frequency (Hz).
PHYS_TEMP_AMB cfg::phys::AMBIENT_TEMP float 10.0 Ambient temperature of the arena (°C).
PHYS_TEMP_SAFE cfg::phys::SAFE_TEMP float 40.0 Max threshold for the Turbo Zone (Efficiency bonus).
PHYS_TEMP_CRIT cfg::phys::CRITICAL_TEMP float 120.0 Critical threshold triggering maximum thermal throttling.
PHYS_COOL_RATE cfg::phys::COOLING_RATE float 5.0 Newton's law passive cooling constant (k).
PHYS_BASE_DISSIPATION cfg::phys::BASE_DISSIPATION float 15.0 Continuous static thermal dissipation (Fan).
PHYS_WAT_COOLING cfg::phys::WAT_COOLING_PER_CYCLE float 0.5 Active heat dissipated by each cycle sacrificed via WAT.

5. Scoring and Telemetry System

Key (JSON) C++ Constant Type Default Description
SCORE_VICTORY cfg::score::VICTORY int 100000 Points awarded for total annihilation of the opponent.
SCORE_KILL cfg::score::KILL int 500 Points awarded when an enemy evaluates your JAM opcode.
SCORE_SUICIDE cfg::score::SUICIDE int -200 Penalty applied for evaluating your own JAM.
SCORE_CONQUEST cfg::score::CONQUEST int 25 Overwriting (via MOV or JMP 0) memory belonging to the enemy.
SCORE_COLONIZATION cfg::score::COLONIZATION int 5 Overwriting empty memory (Owner 0).
SCORE_FORK cfg::score::FORK int 50 Bonus for successful process cloning via FRK.
SCORE_EFFICIENCY cfg::score::EFFICIENCY int 1 Rentability points gained at each time step where T <= 40°C.

Example: config.json

If you want to test your code locally with a faster cooldown and a higher base frequency, you can create a config.json file in your execution directory containing the following overrides:

{
  "SRV_IP": "127.0.0.1",
  "NET_PORT": 8080,
  "NET_COOLDOWN": 500,
  "PHYS_DURATION": 10.0,
  "PHYS_FREQ": 1500.0,
  "SCORE_KILL": 1000
}

Creds

To create accounts, add a creds.txt file, with user:password on each line.

Example:

nobody:strongpassword
test:weakpassword

Test de bon fonctionnement

1. ACTION : Connectez-vous avec le mot de passe de test : test
  -> RÉSULTAT ATTENDU : La documentation s'affiche à l'écran.

2. ACTION : Appuyez sur la touche 's'.
  -> RÉSULTAT ATTENDU : La langue de l'interface change.

3. ACTION : Appuyez sur la touche 'q' pour quitter la documentation.
  -> RÉSULTAT ATTENDU : Vous arrivez sur l'éditeur de code.

4. ACTION : Appuyez sur 'i' pour passer en mode insertion.

5. ACTION : Tapez du texte arbitraire, puis appuyez sur 'Entrée'.
  -> RÉSULTAT ATTENDU : La nouvelle ligne de texte apparait correctement dans l'éditeur.

6. ACTION : Tapez '.' (point) pour quitter le mode insertion.

7. ACTION : Appuyez sur 'h'.
  -> RÉSULTAT ATTENDU : La fenêtre de documentation s'ouvre à nouveau.

9. ACTION : Appuyez sur 'q' pour fermer la documentation.

10. ACTION : Appuyez sur 'u' pour initier un match.
  -> RÉSULTAT ATTENDU : Une liste des équipes s'affiche.

11. ACTION : Tapez le nom d'une équipe adverse (exemple : admin2) et appuyez sur 'Entrée'.
  -> RÉSULTAT ATTENDU : Un écran de chargement s'affiche. Après quelques secondes, l'interface de la partie apparait et le match commence.

12. ACTION : Utilisez les flêches du haut et du bas pour voir la mémoire.
  -> RÉSULTAT ATTENDU : On devrait y voir du vert et du rouge dans la grille. 
   

12. ACTION : Appuyez sur 'q' pour quitter la partie en cours.
  -> RÉSULTAT ATTENDU : Vous êtes redirigé vers l'éditeur de texte, qui se trouve en mode vue/lecture.

13. ACTION : Appuyez sur 'r' pour consulter l'historique de vos matchs.
  -> RÉSULTAT ATTENDU : La liste de vos parties passees s'affiche (s'il s'agit d'une nouvelle installation, il ne devrait y en avoir qu'une seule).

14. ACTION : Tapez '1' et appuyez sur 'Entree'.
  -> RÉSULTAT ATTENDU : La partie que vous venez de jouer se lance en mode rediffusion (replay) pour que vous puissiez la revisualiser.

15. ACTION : Appuyez sur 'q' pour fermer la partie.
  -> RÉSULTAT ATTENDU : Vous êtes redirigé vers l'éditeur de texte, qui se trouve en mode vue/lecture.

16. ACTION : Appuyez sur 'q' pour essayer de quitter.
  -> RÉSULTAT ATTENDU : Vous ne quittez pas l'application.

17. ACTION : Appuyer sur 's' pour sauvegarder.
  -> RÉSULTAT ATTENDU : Affichage comme quoi le fichier a bien été sauvegardé.  

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors