game ar4: turn-based strategy · map - sea for each base tile: draw towards center of the map...
TRANSCRIPT
![Page 1: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/1.jpg)
AR4: Turn-Based Strategy Game
Pedram Amirkhalili, 20254413, CSE
![Page 2: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/2.jpg)
Project Purpose
2 major issues in TBT’s:1. Time - Solved via Random Generation2. Difficulty Level - Can be solved via a
Genetic Algorithm
![Page 3: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/3.jpg)
The “ideal” difficulty curve
![Page 4: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/4.jpg)
Objectives
1. Randomly Generated Levels2. Core Mechanics3. Genetic Algorithm4. Gameplay Features
![Page 5: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/5.jpg)
Random Generation
A Level consists of 3 components:1. Map2. Units3. AI
![Page 6: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/6.jpg)
Map
● Generated in stages● Specific ordering● Validated upon completion● Base of Plains tiles
![Page 7: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/7.jpg)
Map - Rivers
● Placed next to make it easier
● Algorithm works to create less “rigid” rivers
● Starts by selecting 2 edge tiles as endpoints
![Page 8: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/8.jpg)
Map - Rivers
● Connect the endpoints
● Still very “rigid”
![Page 9: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/9.jpg)
Map - River● Try to bend the river● Select a point on a straight edge● Push in/out, adjust river● Repeat recursively
![Page 10: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/10.jpg)
Map - Bridges● Having just placed a
River● Bridges are placed
along with it● 15% chance that a
River tile will be a Bridge tile during generation
![Page 11: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/11.jpg)
Map - Sea
● Placed after River, allowed to overwrite
● Start by selecting an edge tile as start
![Page 12: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/12.jpg)
Map - Sea
● Assign 25% of Sea tiles as base
● Draw along edge(s) to create base
![Page 13: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/13.jpg)
Map - Sea
For each base tile:● Draw towards center of the map● Amount drawn between 1 - 8● Based on previous tile amount, increase,
decrease, stay the same● Probability of the type of change based on
previous tile
![Page 14: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/14.jpg)
Final Process being applied to the base
![Page 15: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/15.jpg)
Map - Mountains
● Can only overwrite Plains tiles
● Aims to create “Clusters”
● Starts by randomly selecting a Plains tile as the start
![Page 16: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/16.jpg)
Map - Mountains
● Add the adjacent tiles to a pool of potential new locations
![Page 17: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/17.jpg)
Map - Mountains
● Perform check if new cluster should be started.
● If not select a tile from candidates● If Plains add as Mountain, if not reselect● Add new adjacent tiles
![Page 18: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/18.jpg)
Process if new cluster check fails (don’t need a new cluster)
![Page 19: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/19.jpg)
Map - Mountains
If a new cluster should be started:● Clear pool of
candidates● Select a new start
location
![Page 20: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/20.jpg)
Map - Woods and Forts
● Placed last, least significance● Simply randomly selecting tiles.● If they are Plains they are replaced
![Page 21: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/21.jpg)
Map - Validity Condition 1
Move from any crossable tile to another crossable tile
● Tested via a graph representation● Connected graphs fulfill conditions● Exhaustive test, uses Breadth-First
Search
![Page 22: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/22.jpg)
Map - Validity Condition 2
Rivers flow continuously ● Check each River tile● Ensure that the adjacent River tiles are
correct
![Page 23: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/23.jpg)
Units
● Randomly selecting from a set of classes○ Axeman, Acolyte, Archer, Shaman, Defender,
Swordsman, Cavalier○ Lord is player specific, generated separately
● Created at level 1● Base stats are adjusted● Levelled up if required
![Page 24: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/24.jpg)
AI
Two different types:1. Passive2. Aggressive
As well as a Ruthless Modifier
![Page 25: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/25.jpg)
AI
● Dijkstra's Algorithm used for path finding● Shaman class has unique AI
○ Hunts injured allies○ Heals them
![Page 26: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/26.jpg)
Flow diagram for the AI
![Page 27: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/27.jpg)
AI - Ruthless
● Priority ordering to attack selection○ Lord○ Shaman○ Archer, Acolyte○ Swordsman, Axeman, Cavalier○ Defender
![Page 28: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/28.jpg)
Genetic Algorithm
Needed to control:● Random Generation● Difficulty
Works on a population of 10 levels
![Page 29: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/29.jpg)
Fitness Function
A fitness function was made to try and evaluate levels
Upon evaluating all levels, check if one fits requirements
![Page 30: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/30.jpg)
Fitness Function - Map
Map is rated based on choke points:
![Page 31: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/31.jpg)
Fitness Function - Forces
Player/AI’s forces are rated on the strength of the units:
This total is then multiplied by a skill level
![Page 32: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/32.jpg)
Selection
First and last of the population are selected
![Page 33: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/33.jpg)
CrossoverLocus (crossover point) is selected
![Page 34: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/34.jpg)
Mutation
Some aspect is potentially changed or regenerated
![Page 35: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/35.jpg)
Testing
● Unit Testing● System Testing● Acceptance Testing
○ Player’s asked to answer question
![Page 36: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/36.jpg)
Evaluation
● Majority of Objectives achieved● Player’s liked the concept
○ Felt execution was hit and miss
Future Improvements:● Full implementation of Map evaluation● More intelligent breeding● Better AIs
![Page 37: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/37.jpg)
Demo
![Page 38: Game AR4: Turn-Based Strategy · Map - Sea For each base tile: Draw towards center of the map Amount drawn between 1 - 8 Based on previous tile amount, increase, decrease, stay the](https://reader033.vdocuments.mx/reader033/viewer/2022050106/5f442082eb3fc960a4632a15/html5/thumbnails/38.jpg)
Thank you, any questions?