Groupproject TechnicalReport
Groupproject TechnicalReport
GROUP 11
Group members:
Dylan 165z1ec6
Tianyou Chen 0837b84h
Zi jian jack Kew 901joumb
Lecturer: Julia Ge
Peer Evaluation Form
Dylan Tianyou Jack Total
Character 40% 30% 30% 100%
Creation
(Unit Class)
Battle 35% 35% 30% 100%
Actions
(Attack/Heal)
AI Behaviour 30% 40% 30% 100%
User 20% 50% 30% 100%
Interface
Event 25% 35% 40% 100%
logging
Game 30% 35% 35% 100%
Restart
Introduction of project
In this project, we developed a battle game by utilizing Python and Tkinter.
In this game, players can customize their characters by picking Warrior and
Tanker roles from the list and, consequently, fight against AI-controlled
enemies. These sections also feature an attack mechanism, a healing bond,
and a way of gaining levels while recording everything through a battle log.
By implementing OOP principles, we built the game on classes with functions
so as to support modularization and facilitate easy maintenance.
Every game character possesses distinct hero attributes that include HP,
ATK, DEF, and EXP. Players are able to strategically engage in combat and
bring down the AI using various forms of units while ensuring their units’
health and experience are acceptable. During the battle, it is a turn-based
strategy where both the player and AI are allowed to perform actions
alternatively.
The combat resolution equation includes attack power, defense, and the
stochastic or random variation factor, ensuring a thrilling outcome. When a
unit hits the 100 EXP threshold, their level up leads to an increment of ATK
and DEF stats, hence making them more effective warriors. AI enemies apply
a targeting system that is based on as many unique rules as possible; for
example, if one unit has the least HP, then the programmers will direct the AI
to attack them.
Created with Tkinter as our primary physical interface, this game contains an
interface with an interactive GUI where users can attack, heal, restart the
game, and view the characters' current status. In addition, by implementing
health bars and an event-log system that pulls all activity in real-time, the
player gets the chance to witness instant consequences of their actions. The
is also a file keeps actions in a log (battle_log.txt) for debugging and
reviewing.
a. Flowchart
Start
Get Player
Names
Initialise
characters
Display Game
Menu
Player turn
(Choose
Action)
Perform
action
(Attack/Heal)
Update
HP/Heal
Check Game
Status
Is Game Over
Yes No
Display Continue
Outcome Game
Restart
Next Player's
game?
Turn
(Yes/No)
Yes No
Restart the
Game
This flowchart shows how our game progresses starting from initialization
where player and AI are set up and battling phase where players choose
actions and AI take turns to attack. The game will loop until a win is met, at
that point the game will restart or end.
AI Action Logic
After the player completes their action, the AI takes its turn
automatically:
If all player units are dead, the AI wins and the game ends.
If a player's unit earns 100 EXP, they will level up, increasing their
attack and defense stats:
2. The game displays a message showing the new ATK and DEF
values.
At the end of each turn, the game checks if one side has lost all
its units:
Player
AI Setup
Setup
Character Generate
Creation AI Team
Game
Action
Handling
Attack
Logic
Heal Logic
Turn Logic
This hierarchical chart shows the relationship of the functions in our game.
The chart starts with the main game loop and branches to specific operations
relating to our game.
Each unit (player or AI) is created using the Unit class, which defines
essential attributes such as:
DEF (Defense Power) – Determines how much damage the unit can
mitigate.
The game includes a logging system that records all actions in real time:
c. Test Report
The test report provides info on the tests conducted to ensure that the game
functions as it should.
1. Test 1: Character Creation
Test: When a player uses the heal action, the player’s HP should
increase within the healing range.
Likely result: AI selects the player unit with the lowest HP as its
attack target.
Result: Passed. AI correctly selects the player unit with the
lowest HP and attacks it.
Test: The game should end when all player or AI units are
defeated.
Likely result:
If all player units are defeated, the game should display “AI
Wins” and restart.
If all AI units are defeated, the game should display “You Win”
and restart.
Result: Passed. The game correctly detects when all units are
eliminated and displays the correct victory message.
Conclusion
The game mechanics were strictly verified to ensure their accuracy. The
Combat now accurately applies damage calculations basing on attack power,
defense values, and a randomized modifier. The healing functionality
restores HP at a range defined not to exceed the maximum limit. Character
level up, which is provided after players gain 100 EXP, will allow for the boost
in stats and also the characters' capabilities to attack and defense.
Furthermore, the AI mechanisms play a crucial role in advancing the game
by choosing the player unit with the least amount of HP for its attack target,
thus introducing an element of strategy in attack and combat.
The battle log system behaves as an automated notary and records all
moves made by both player and AI, assuring the transparent nature of the
game and supporting the debugging process. The battle system user
interface facilitates easy interactions by showing HP ahead of time, the
growing level of a character, and the battle events. The implementation of a
structured game loop is able to point errors and ensure that the transitions
and inputs are properly posted, and unexpected actions will not be at the
right time.
Through the game, we can successfully see how programming concepts are
applied, how algorithms are thought up, and how to develop a graphical user
interface (GUI). The project succeeds in its concept by joining fight
mechanisms, the AI model's decision, and in-game event tracking, which in
the end makes it possible to have an equitable and well-functioning fighting
system. The structured approach to game design consideration and
production will hold the system together and provides a great gaming
experience for the user.