Karetní hra Bang! online a umělá inteligence
Bang! the card game online and artificial intelligence
bachelor thesis (DEFENDED)

View/ Open
Permanent link
http://hdl.handle.net/20.500.11956/197410Identifiers
Study Information System: 250540
Collections
- Kvalifikační práce [11321]
Author
Advisor
Referee
Pergel, Martin
Faculty / Institute
Faculty of Mathematics and Physics
Discipline
Computer Science with specialisation in Programming and Software Development
Department
Department of Software and Computer Science Education
Date of defense
10. 2. 2025
Publisher
Univerzita Karlova, Matematicko-fyzikální fakultaLanguage
Czech
Grade
Excellent
Keywords (Czech)
karetní hra|umělá inteligence|bang!Keywords (English)
card game|artificial intelligence|bang!Bang! je westernová karetní hra, kde hráči chtějí odhalit skryté role oponentů. Naším cílem bylo implementovat herní prostředí umožňující hru více hráčů po síti a následný vý- zkum a vývoj umělé inteligence. Hru jsme implementovali pomocí herního engine Unity. Poté jsme využili neuroevoluci a modely strojového učení k ohodnocování herních akcí v daném herním stavu. Trénovací data modelů jsme k zajištění různorodosti sbírali z ná- hodných her. Z testovaných modelů měly ensemble metody nejvyšší R2 a nejnižší MSE. Dále jsme neuroevolučním algoritmem NEAT trénovali univerzální a specializované neu- ronové sítě. Univerzální sítě byly určeny pro všechny role, kdežto ty specializované pouze pro jednotlivé role. Výkonnost umělých inteligencí jsme měřili proti náhodným hráčům. Specializované sítě měly nejlepší výsledky, a proto jsme s nimi odehráli několik her. I přes potíže s odhadováním rolí a s některými jednoduchými herními situacemi vykazovaly, že rozumí hlavním konceptům hry, a byly schopny hrát v týmu i individuálně.
Bang! is a western-themed card game, where players aim to uncover hidden roles of opponents. Our goal was to implement a game environment enabling online multiplayer and to research and develop artificial intelligence (AI) for this game. We developed the game using the Unity game engine with a focus on extensibility. Then, we used neu- roevolution and machine learning models to score game actions in a given game state. We collected the training data for the models from random games to ensure data diversi- ty. Among the tested models, ensemble methods achieved the highest R2 and the lowest MSE. Furthermore, we used the neuroevolutionary algorithm NEAT to train universal and specialized neural networks. Universal networks were for use with all roles, while specialized networks focused on individual roles. The performance of AIs was assessed against random players. Specialized NEAT-trained networks demonstrated the best re- sults, and so we tried playing against them. Despite having difficulties with estimating roles and some simple game situations, they showed an understanding of the game's main concepts and were capable of playing both in teams and individually.