Differences

This shows you the differences between two versions of the page.

Link to this comparison view

mps:proiect [2024/11/22 17:27]
giorgiana.vlasceanu [Game Mechanics]
mps:proiect [2025/10/07 10:49] (current)
mihai_lucian.voncila [Agenți]
Line 1: Line 1:
  
-====== Proiect ====== +====== Proiect: 2D Arena Micro-Battle  ​======
-**Project Title: Escape the Maze**+
  
-==== Project Description ====+Proiectul la MPS pe direcția A va fi dezvoltat în echipe de 7-8 persoane, valorând un total de 6 puncte, fiind evaluat în două etape. Prima este de-a lungul laboratorului în cadrul semestrului,​ valorând un total de 4 puncte. A doua o reprezintă o prezentare în cadrul sesiunii de tip "​Demo-Day"​ care valorează 2 puncte.
  
-This project involves the development of a competitive game where multiple AI agents, created by teams of students, navigate through programmatically generated mazes. The student teams are responsible for both developing the AI agents (clients) and setting up a server that connects these AI agents. Additionally,​ the server will load the programmatically generated maze maps and function as a viewer to display the progress of the game.+==== Idee de bază ====
  
-==== Objective ====+Proiectul constă în dezvoltarea unui joc de tip 2D shooter "​top-down"​ micro-battle cu agenți bazați pe inteligență artificială (AI). Jocul se va desfășura de-a lungul a diverse runde scurte, jucate pe o hartă prestabilită,​ care urmăresc îndeplinirea unui obiectiv principal, bazat pe un mod de joc selectat, unde o echipă de agenți încearcă să câștige împotriva unei alte echipe de agenți. Agenții vor urmări îndeplinirea acestui obiectiv pe baza unor strategii definite intern, pentru fiecare, cât și a unor moduri de comunicare între aceștia. Scopul final fiind reprezentat de colectarea de diverse statistici pe baza jocurilor desfășurate între agenți.
  
-The goal is to determine the most efficient AI solution through direct competition among the AI agents, with the current positions of the players being highlighted on the screen. The player whose AI exits the maze first is declared the winner. The server will monitor win conditions and award points accordingly.+==== Obiective ====
  
-==== Game Mechanics ====+Proiectul are în vedere cinci mari obiective:​ 
 +  *Implementarea unei interfețe cu utilizatorul (UI) pentru vizualizarea jocului și definirea modului în care agenții vor acționa 
 +  *Implementarea a diverse moduri de joc, simple, și mecanici aferente pentru acestea 
 +  *Implementarea a diverse tipuri de agenți și strategii pentru aceștia 
 +  *Implementarea a diverse moduri de comunicare între agenți 
 +  *Colectarea de statistici aferente jocurilor desfășurate între agenți.
  
-  *Visibility:​ Visibility: By default, each player can see a 5x5 area around their current position, indicating possible directions of movement: North (N), East (E), South (S), and West (W) +==== Mecanici Joc ====
-  *Turn-based Movement: The game operates on a turn-based system. In each turn, the AI will send a sequence of up to 10 steps (comprising the characters N, E, S, W) to the server, which will then move the player in the specified directions. For each command that cannot be executed (e.g., due to hitting a wall), the length of the allowable sequence for the next turn will decrease by one. +
-  *X-RAY Points: At the start of the game, each player has 10 X-RAY points. These points can be used to access an expanded view around the player. For example, an X-RAY command, of 2 will consume 2 points and expand the visibility window from 5x5 to 7x7. The X-RAY command counts as one of the steps the player is taking, and are sent to the server as X, in the character array. +
-  *The maze can contain additional tiles with various functionalities,​ which can only be placed alongside the path and not the wall: +
-    *Fog tile: The player can see an area of only 3x3 around him (X-RAY points can still be used) +
-    *Tower tile: The player can see in an area of 7x7 around this tile (X-RAY points can still be used) +
-    *Traps, which can be seen at a max of 2 steps away from them, and are of multiple kind, with a number n assigned to them: +
-      *traps are not disabled when activated by walking over them +
-      *movement decrease: decreases the maximum number of steps you can send to the server in the next turn by n +
-      *rewind: the players last n moves are undone +
-      *pushforward:​ the player is forced forward based on the direction of their movement for n steps +
-      *pushback: the player is forced backwards based on the direction of their movement for n steps +
-    *Portals: They work in pairs and connect one point of the maze to another. +
-      *Each pair has a specific id to represent a portal +
-      *To activate a portal the agent must send a command "​P"​ while on top of one  +
-    *Consumables:​ +
-      *X-RAY point increments+
  
-=== Maze Generation Requirements ===+Jocul se va desfășura în cadrul unei hărți 2D. Pentru simplitate agenții vor fi reprezentați sub formă de cercuri, armele sub formă de bețe dreptunghiulare,​ iar gloanțele/​proiectilele sub formă de cercuri mai mici. Harta va avea și un set de obstacole (ziduri) care pot fi distruse, sau nu, în spatele cărora agenții se pot ascunde. Fiecare agent va avea în fața lui un con ce reprezintă linia lui de vedere (LoS), un agent putând să împuște doar agenți inamici aflați în interiorul LoS.
  
-The maze must be generated according to the following constraints:​ +<note tip>LoS poate fi cerc în fațagentului pentru simplitateîn fază inițialăAstfelcoliziunile care trebuiesc verificate sunt de natură simplă doar cerc-cerc sau cerc-dreptunghi.</note> ​
-  *The maze generator must function procedurally,​ creating mazes with single entrance and a single exit. +
-  *The entrance and exit of the maze can be placed anywhere in the mazenot necessarily on the borders +
-  *In order to have intricate possible solutitions the shortest possible walkable path from the entrance to the exit must cover at least 50% of the total area covered by paths and elements placed on path tiles +
-  *The minimum rectangular path from the entrance to the exit must cover at least 50% of the total rectangular area of the maze. +
-  *Teams will choose the horizontal and vertical dimensions of each generated maze within specified maximum allowable ranges. +
-  *The maze should be able to be generated in one of the following ways: +
-    *completely randombased on a fixed seed, which may or may not be provided, and a set threshold that represents the maximum of special tiles that can be generated of each type. +
-    *semi-random, based on a fixed seed and a set number for each special tile that can be generated. +
-    *from an input file, which is represented by an image. +
-  *The maze can never place two special tiles next to each other, or next to the entrance/exit+
  
-Each generated maze needs to be checked for validity to see if it respects the constraints imposed.+Fiecare agent va avea anumite atribute și un rol, fie prestabilite,​ fie alese aleator, fie alese de către un agent la începutul unui joc. Aceste atribute se referă la număr de puncte de viață, viteza de mers, daune pe care le poate cauza, număr gloanțe, distanță LoS, viteză reîncărcare,​ etc. Acestea pot fi influențate fie direct pe baza unor puncte oferite la începutul jocului, fie indirect, calculate pe baza unor atribute mai simple, precum putere, dexteritate etc.
  
-=== Files === +Se propune implementarea a patru moduri de jocfiecare cu propriul său obiectiv principal
-The maze generator must output an imagein 8bpp, grayscale format, with the following color representations for each pixel+  *Survival ​câștigă echipa care reușește să ucidă toți agenții inamici, sau echipa care are cei mai mulți agenți rămași în viață după un anumit timp limită 
-  *wall +  *King of the Hill (KOTH)- câștigă echipa care acumulează cele mai multe puncte prin controlul unei anumite zone cheie din cadrul hărții; punctele se acumulează dacă nu există niciun agent inamic în cadrul zoneio rundă putând fi încheiată fie după un anumit timpfie pe baza unui număr maxim de puncte 
-  *255 - path +  *Capture the Flag (CTF)câștigă echipa care adună cele mai multe puncte prin livrarea unui steag capturat de la baza echipei adverse și livrat în propria bazăcu aceleași idei de finalizare de rundă ca și în cadrul KotH 
-  *64 - entrance +  *Transport ​o echipă încearcă să transporte un obiect către baza adversăcâștiga echipa care după un anumit timp fie reușește să livreze obiectulfie previne livrarea obiectului
-  *182 - exit +
-  *16 - X-RAY point increment +
-  *32 - fog tile +
-  *224 - tower tile +
-  *90 - reserved value for generic trap tiles (this is not used in generation, but will be sent to the agents during solve) +
-  *96-100 - trap movement tile with n = [1,5] +
-  *101-105 - trap rewind tile with n = [1,5] +
-  *106-110 - trap pushforward tile with n = [1,5] +
-  *111-115 - trap pushback tile with n = [1,5] +
-  *150-169 - portal idseach value should only appear twice in a maze representing that portal pair (a maze should never have more than 20 portal pairs) +
-The maze generator can take the same image back as input to generate the exact same maze, or other images to generate new mazes. +
-Obs: Images which contain undefined pixel colors are to be rejected.+
  
-==== Server ​==== +==== Agenți ​====
-The client, represented by an agent strategy, and the server will communicate with each other through a series of JSON commands. +
-The first time a client connects to a server it gets assigned a UUID, thus the server will distinguish between a new connection and a reconnection attempt based on the UUID.+
  
-The first connection from an agent will always be an empty JSONwhereas every recconection will be JSON containing the UUIDin the following format+Agenții vor încerca să îndeplinească obiectivul unui mod de joc pe baza unor limitări în comunicaresau diverse moduri de comunicareși anume
-  ​{ +  ​*lipsă de comunicare - agenții iau decizii individuale pentru a îndeplini obiectivul principal al jocului 
-  ​"​UUID"​""​ +  ​*comunicare limitată - agenții pot comunica între ei pe baza unor restricții clare 
-  ​}+    *topologică,​ unul sau mai multe din următoarele exemple: 
 +      *cei mai apropriați vecini 
 +      *stil inel (agentul A1 poate transmite doar către A2, A2 către A3, etc. urmând ca An să poată transmită înapoi către A1) 
 +      *stil stea (similar cu cel de mai sus dar un agent poate transmite către alți doi agenți) 
 +      *stil hub/lider (un agent central primește mesajele de la toți ceilalți agenți, agentul central poate transmite înapoi către toți ceilalți) 
 +      *aleator - agenții cu care poate comunica sunt aleși aleator la începutul fiecărei runde/joc 
 +    *bazată pe dimensiunea mesajului - mesajele sunt limitate în funcție de numărul de biți 
 +    *bazată pe distanță - mesajele peste o anumită distanță între agenți în cadrul hărții nu pot fi transmise 
 +    *bazată pe timp - un agent nu poate transmite mai mult de un mesaj în cadrul unui interval de timp (ex1s/2s etc.) 
 +  ​*comunicare nelimitată - agenții pot să transmită orice tip de mesaj
  
-<​note ​important> +<​note ​tip>Se recomandă următoarea schemă comună pentru transmiterea de mesajedefinite în format YAMLdar orice alt mod de implementare este binevenit
-In order to simplify the problem, the server can work in a friendly mode where it communicates to an agent its initial coordinates in the maze and the maximum maze size: width, heightalongside the 5x5 tiles it sees initially. +  ​*TIMESTAMP: ​{x} #timpul la care a fost transmis mesajul 
-Thusthe first JSON request back from the server should be in the following format+  ​*TARGETS{A1..., Ak} #ID-urile agenților țintă pentru mesaj  
-  {  +  ​*MOVE{xy} #poziția spre care agentul intenționează să se deplaseze către 
-  ​"​UUID"​""​+  ​*ASSIST{xy} #cerere către alți agenți să se deplaseze spre o anumită poziție 
-  ​"x [optional]"​""​+  ​*FOCUS{Axx, y} #ID-ul unui agent din echipa adversă care ar trebui țintit simultan și poziția curentă a acestuia 
-  ​"y [optional]"​""​+  ​*STATUS{hpammo, etc.} #detalii despre status-ul curent al agentului 
-  ​"width [optional]"​""​+  ​*ROLE{x} #ce rol îndeplinește agentul în momentul de față 
-  ​"​height [optional]"​""​+ 
-  ​"​view"​"​string of the matrix representation of the visible area around the agent" +Pot fi adăugate alte tipuri de mesaje în funcție de necesitate/complexitatea dorită.
-  "​moves":​ "total number of moves/commands available for the agent in the first turn"​ +
-  }+
 </​note>​ </​note>​
  
-In a normal turn the agent sends a JSON to the server in the following format: +Fiecare ​agent va avea o altă strategie de joc, reprezentat de un alt AI, în funcție de rolul pe care îl ocupă în cadrul echipei. Se propun următoarele 4 rolurilider, înaintare, tanc, suport.
-{input: "​string of commands up to length 10"}+
  
-The server will output back a JSON with the following format: +==== Hartă ====
-  { +
-  "​command_1":​ { +
-    "​name":​ "name of command, ex: "​N"",​ +
-    "​successful":​ "​0|1",​ +
-    "​view":​ "​string of the matrix representation of the visible area around the agent after the move;"​ +
-            ex for 3x3: "[0, 255, 255; 0, 255, 0; 0, 255, 0]" +
-  }, +
-  "​command_2":​ { +
-    "​name":​ "",​ +
-    "​successful":​ "",​ +
-    "​view":​ ""​ +
-  }, +
-  ... +
-  "​command_N":​ { +
-    "​name":"",​ +
-    "​successful":​ "",​ +
-    "​view":​ ""​ +
-  }, +
-  "​moves":​ "total number of available moves for the next turn"​ +
-  } +
-   +
-In the case of a friendly solve, the server will always output the value of a trap if it's inside the agent'​s visible area. However, in the case of an unfriendly solve, traps are only shown if the agent is 1 tile away from them and their type is hidden using the value of 90. +
-   +
-Once an agent solves a maze, or the server decides the agent is taking too long so it gets timed out, the server will send a JSON with the following format: +
-  { +
-  "​end":​ "0|1, based on if the agent solved the maze or not" +
-  } +
-   +
-Following a solve, the server can test the agents on a new maze, for this it sends a request in the following format: +
-  { +
-  "x [optional]":​ "",​ +
-  "y [optional]":​ "",​ +
-  "width [optional]":​ "",​ +
-  "​height [optional]":​ "",​ +
-  "​view":​ "​string of the matrix representation of the visible area around the agent"​ +
-  "​moves":​ "total number of moves/​commands available for the agent in the first turn"​ +
-  } +
-  +
-The server can store generated mazes as images and output them back on request.+
  
-<note important>​ +Harta poate fi predefinităgenerată pseudo-aleatorsau editată pe baza unui editor. Nu este nevoie de dimensiuni enorme ci suficient de mari pentru ​se asigura o durată rezonabilă medie pentru runde (30-120s). Nu trebuie implementate toate trei modurilefiecare echipă poate alege unul singur pe care îl consideră mai potrivit.
-In the case where multiple agents are on the same serverthey don't interact with one otherso that each agent has fair chance at solving the maze. For this reason, every trap triggered by an agent will only affect that specific agent, so the server needs to keep track of which agent triggered which trap. +
-</​note>​ +
-==== Agents ==== +
-An agent can work in one of two modes: +
-  *real time: it sends the move commands to the server, receives back the success fail results and immediately follows with the next list of commands +
-  *await for input: sends the list of commands, receives the results of the execution and awaits for user input before sending the next list of commands ​(this is done client side, not server side) +
-Each agents performance is measured in one of three ways: +
-  *Least time taken to solve the maze +
-  *Least number of turns taken to solve the maze +
-  *Least number of moves taken to solve the maze +
-For the real-time mode the agents will have a maximum time allotted before sending each command. If the allotted time expires, the agent is timed out and disqualified,​ and the maze is considered unsolvedThe maximum time can be set before each runor be preset depending on the maze difficulty.+
  
-<note important>​Each AI agents behaviour must be uniqueavoid creating different agents that have only minor part of their strategy modified.</​note>​+În cazul în care se merge pe ideea de hartă generată pseudo-aleatorse va folosi mereu același seed pentru generare în evaluarea statisticilor măsurate mai jos pentru ​avea rezultate reproductibile.
  
-==== Viewer ​==== +==== Statistici Măsurabile ​====
-The viewer should output the maze and the agents solving it in the following manner: +
-  *1920x1080 resolution +
-  *20 pixels/tile by default +
-  *Mazes that don't fit on screen should have a scroll option. +
-  *Zoom function +
-  *Two possible viewing modes: +
-    *view the entire maze +
-    *view what each agent has explored so far +
-  *The colors for each tile are left to the discretion of each team to make the output more interesting. +
-  *Traps should have their value n on top of them if possible. +
-  *The walked path should be represented by a solid line, and the planned moves of the agent by a dashed line. +
-  *The viewer can put the server into an await for input mode, where it doesn'​t output back an agents results for a move till a button is pressed in the viewer.+
  
-==== Team collaboration ====     +Pe lângă dezvoltarea jocului se are în vedere și măsurarea ​diverse statistici legate de agențimodurile de joc, și modurile de comunicare dintre aceștia. Vor fi măsurate un set de metrici comune, cât și un set de metrici specifice unui mod de joc. 
-After the initial phase of developing the project: +
-For successful collaborationthe teams should consider the following:​ +
-  *collaborations will happen between teams in each lab +
-  *meetings will happen between 2 members of each team +
-  *each team can test each other'​s agents and offer feedback and suggestions+
  
-<note warning>​Teams still need to develop individual solutions. They are allowed to implement and test the same strategies, but each team needs to implement that strategy in their own code.</note>+Se propune măsurarea următoarelor metrici comune: 
 +  *Daune pe Secundă (DPS) 
 +  *Daune Încasate pe Secundă (DTPS) 
 +  *Overkill - daune peste numărul de puncte de viață rămase ale unui agent 
 +  *rată kill/death/​assist (KDA) 
 +  *puncte viață ramase mediu 
 +  *timp mediu de supraviețuire agent 
 +  *timp mediu rundă 
 +  *rată foc țintă - 2 sau mai mulți agenți țintesc același inamic 
 +  *gloanțe medii 
 +  *distanță parcursă medie
  
-==== Milestones and Grading ====+Următoarele metrici pot fi măsurate individual pentru un anumit mod de joc: 
 +  *Survival  
 +    *număr mediu agenți rămași în viață  
 +  *KOTH 
 +    *rată control zonă 
 +    *DPS în/în afara zonei  
 +  *CTF  
 +    *timp mediu livrare 
 +    *timp în viață cu steagul 
 +    *număr steaguri livrate în medie  
 +  *Transport 
 +    *rată avans 
 +    *timp mediu livrare
  
-The project is worth 6 points and is split into 3 major milestones, which will happen in Labs 3, 8, and 12. +==== Livrabile ====
-The milestones and their allocated points are as follows: +
-  -Setup milestone (0.5p), lab 3, 21-25 October 2024 +
-    -team members and their respective roles +
-    -the chosen programming language, potential tools etc. +
-    -the chosen development methodology (ex: Agile, Scrum etc.) +
-    -The teams will have to create private projects on the MPS gitlab, in the form of Day_Hour_TeamName,​ ex: Monday_8_Team1 +
-      -All documents for the next milestones will be part of the repository for each team in wiki or others files. +
-      -The README of the repo will contain all other links used - if the team uses a third-party solution for project tracking.  +
-      -The README will also contain the names of all participant members and the student groups they are a part of. +
-  -First demo solution (2.5p), lab 8, 25-29 November 2024, which will be graded on the following:​ +
-    -Maze Generator (0.3p) +
-    -Server (0.3p) +
-    -Viewer (0.4p) +
-    -AI Agents (at least one, points awarded based on the agents solving efficiency) (0.6p) +
-    -Documentation,​ which must contain the following (0.6p): +
-      -SDD +
-      -testing reports +
-      -meeting minutes +
-    -Respecting the chosen methodology(0.3p):​ +
-      -respecting team roles +
-      -respecting scheduling and set tasks +
-  -Final demo solution (3p), lab 12, 8-14 January 2025, which will be graded on the following:​ +
-    -  Potential improvements and bug fixes on (0.5p): +
-        - Maze Generator +
-        - Server +
-        - Viewer +
-    - Improved AI Agents based on team collaborations (at least one additional solution different from the original developed one) (1p) +
-    - Documentation (0.7p) +
-        - new testing reports +
-        - new meeting minutes (collaborative + individual) +
-    - Presentation highlighting the results, potentially the evolution of the solution (0.5p) +
-    - Respecting the chosen methodology (0.3p): +
-      - respecting team roles +
-      - respecting scheduling and set tasks+
  
-<​note ​tip+Pentru ca proiectul să fie considerat complet, fiecare echipă va trebui să prezinte următorul set de livrabile detaliat mai jos. 
-Try developing the project in a couple of notable phases+ 
-  - Develop core components: +<​note ​important>​Se urmărește ca soluția software să fie dezvoltată în mod continuu în cadrul materiei, fiind țintit un progres constant, cu modificări majore o dată la cel mult două săptămâni. Soluțiile implementate pe ultima sută de metri vor fi depunctate în mod substanțial.</​note
-    - Implement a barebones maze generator (it only places walls and a path in a predefined rectangular area) + 
-    - Implement a dummy agent (random movement) and check if it works as intended. +=== Software === 
-    - In parralel to the maze generator implement the server and the viewer ​(preferably you have 1 person assigned to each component, but you may also choose not to develop them in parralel). + 
-    - You can design the viewer/server to only interact with one agent in this phase+Pe partea de software se doresc următoarele
-    Test that all components interact properly+  ​*Interfață cu utilizatorul pentru urmărirea agenților de tip top-down 
-    Implement some actual solving strategy on an agent and see how it performs+  ​*Sistem simplu de fizică 
-  ​- Improve solution: +  ​*Sistem replay pentru runde/​jocuri 
-    - Add special tiles to the maze that don't complicate the solving strategy too much (ex: movement trapsfog, tower+  ​*Vizualizator pentru statistici echipe ​(KDA/runde câștigate etc.) 
-    - Update the viewer to reflect these changes. +  ​*Inspector pentru un agent vizualizare detalii precum puncte viață, număr gloanțe etc
-    - Add the possibility that the agent can use X-RAY points. +  ​*Sistem de logare pentru mesaje transmise ​protocol comunicare, tip mesaj, timestamp, agenți țintă, conținut mesaj etc
-    - Try developing a different strategy on a different agent. +  ​*Cel puțin 3 moduri de joc la alegere 
-    - Test how they perform+  ​*Editor/​Generator hărți, sau cel puțin 4 hărți predefinite ​(1 pentru fiecare mod de jocla dimensiuni rezonabile
-  - Team collaboration phase +  ​*Statistici măsurate pe mod de joc/mod de comunicare 
-    - Test each others agents. +  ​*Teste de validare agenți 
-    - Obtain feedback related to your strategies, and decide on some better solutions. + 
-    - Add portals to the maze and see how these affect your agent strategies. +<note tip>UI, sistemul de fizică nu trebuie implementate individual; se poate folosi un motor grafic existent separat (Unity, Unreal)Soluțiile pot fi dezvoltate în orice limbaj de programare și orice mediu dorit</​note>​ 
-    - Try designing new strategies to combat the addition of portals. + 
-  ​- Final improvements +=== Documentație === 
-    - Add consumables to the maze+ 
-    Try creating mazes with tricky layouts and test how the agents perform. +Pe partea de documentație se doresc următoarele componente: 
-    - Update the viewer/​server so multiple agents can run at once on the same maze. +  ​*Repository pe Git cu README care conține membrii echipei, limbajul de programare utilizat, soluții externe, metodologie de dezvoltare aleasă 
-    - Fix any potential issues in the code. +  ​*Document Design Software (SDD) 
-</​note>​+  ​*Planificare echipă/​sarcini (ex: Diagramă Gantt, Kanban, Scrum Board, timeline etc. 
 +  *Plan comunicare ​minute întâlniri (decizii, acțiuni, responsabili,​ termene) 
 +  ​*Rapoarte testare 
 + 
 +<note important>​Se punctează respectarea rolurilor în echipă, a sarcinilor planificate,​ și a timpilor estimați pentru fiecare sarcină.</​note>​
mps/proiect.1732289265.txt.gz · Last modified: 2024/11/22 17:27 by giorgiana.vlasceanu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0