University of Split. University Department of Professional Studies. Department of Information Technology.
Abstract
Cilj ovog završnog rada bio je izraditi igru s primjenom metoda iz podruˇ cja umjetne inteligencije. U radu su obra ¯ deni algoritmi A* i minimax. Osim implementacije i primjene samih algoritama, rad prikazuje spajanje znanja iz razli ˇ citih podru ˇ cja kako bi se izradio jedinstveni projekt. To su izrada dizajna, primjena animacija te razli ˇ citih zvu ˇ cnih efekata kako bi se postigla zanimljiva atmosfera. Ovim radom prikazano je kako se uz gore navedene algoritme može izraditi igra ˇ c kontroliran umjetnom inteligencijom (engl. Artificial intelligence). To uklju ˇ cuje donošenje odluka na temelju matemati ˇ ckih izra ˇ cuna, bilo optimalnih ili približno optimalnim ovisno o trenutnoj situaciji i raspoloživim resursima. Naravno, imaju´ ci na umu da se radi o igri te je krajnji cilj zabava za igra ˇ ca. Isto tako ovim projektom prikazano je kako se s besplatnim resursima može izraditi sustav koji u kona ˇ cnici pruža zabavu i izazov za krajnjeg korisnika. U radu je opisan na ˇ cin izrade igrice korištenjem okruženja za izradu igara Unity3D (engl. Unity3D game engine) te programskog jezika C# koji se koristi u pogonskom alatu Unity3D. Ime igre je HoMM-Like, spada u žanr igara strategije. Igra ˇ ci igraju naizmjenice sve dok se ne dobije pobjednik (engl. Tactical turn based). Igra je izra ¯ dena na temelju postoje ´ ce igre Heroes of might and magic. Svaki igra ˇ c ima svog heroja te jedinice, odnosno figure (engl. Unit) s kojima raspolaže u bitci. Cilj igre je pobijediti protivni ˇ ckog heroja. Kako bi igra bila zanimljivija igra ˇ ci mogu prikupiti razne predmete te dodatne jedinice kako bi poboljšali svoje šanse u borbi.The aim of this thesis was to apply artificial intelligence in a game. The algorithms covered in this paper are A * and minimax. In addition to the implementation and application of the algorithms themselves, the paper shows the merging of knowledge from different fields to create a unique project. These includes making designs, applying animations and various sound effects to achieve an interesting atmosphere. This paper shows how an AI-controlled player can be created with addition of the algorithms above. This involves making decisions based on mathematical calculations, either ideal or close to ideal depending on the current situation and available resources. Of course, keeping in mind that this is a game and the ultimate goal is fun for the player. Also, this project shows how even with free resources a system can be created that ultimately provides fun and a challenge for the end user. The paper describes how to create a game using the Unity3D game development environment and the C # programming language which is used for scripting in the Unity3D engine. The name of the game is HoMM-Like, it belongs to the genre of strategy games. Players play alternately until winner is determinated. The game is based on the existing game Heroes of might and magic. Each player has own hero and units belonging to the hero which are used in the battles. The objective of the game is to defeat the opposing hero. To make the game more interesting, players can collect various items and additional units to improve their chances in combat