Skip to content

Technical Design

Dirk ten Have edited this page May 24, 2024 · 103 revisions

A TDD serves as a blueprint for your programmers, outlining the game's technical aspects. Here's how to build one on a GitHub Wiki:

  • Introduction: Briefly describe the game, genre, target platform (PC, mobile etc.), and core functionalities.
  • Game Architecture: Explain how the game will be structured. This might involve components like the game engine, networking (if multiplayer), and data management. You can include diagrams for better visualization.
  • Core Systems: Delve deeper into the technical details of major systems: Gameplay Mechanics: How will movement, combat, or resource gathering work?
  • Input & Controls: How will players interact with the game (keyboard, mouse, touch)?
  • Rendering: 2D/3D graphics engine and rendering pipeline details.
  • Physics: How will physics simulations be implemented (if applicable)?
  • Networking (if multiplayer): Communication protocols, server architecture, and data synchronization.
  • AI (if applicable): Enemy or NPC behavior logic.
  • Save System: How will player progress be stored and loaded?
  • Data & File Formats: Specify file formats for game data (levels, characters, audio, textures etc.).
  • Development Tools & Technologies: List the programming languages, libraries, and frameworks used for development.
  • Testing Strategy: Outline how the game will be tested (unit tests, integration tests, manual testing).

Player turning

The turning of the player will use an raycast. The cursor will aim at a point in the scene itll return a vector 3 which will subtract from the current position so I know what the direction is and set that as the rotation.

Player Animations:

De animaties zijn geïntegreerd via scripts in de player movement script en de player attack script. Als de speler beweegt, dan krijg je een animatie dat de speler loopt, als de speler via de muis aanvalt, doet de speler een aanval animatie. De animaties zijn anders voor andere classes, zoals voor de archer en de knight, zijn de animaties anders, want de knight hoeft alleen te zwaaien met zijn zwaard en voor de archer heb je dat de speler eerst een arrow pakt en dan gaat aimen voordat het aanvalt.

Script Layout:

Walking Anim

De bovenste script is het script voor de movement, als de speler beweegt, gaat de speler ook bewegen met de animatie waarvan het ook nodig is. De script van beneden is hoe de speler de animatie gebruikt voor bijvoorbeeld de melee attack, of de archer attack.

Enemy wave spawning

On wave 1 each zone will have the exact same amount of zombies that it will spawn. It'll use a for loop so it iterates through the total spawn amount. It uses a random number generator with its ranges being the the minimum and maximum their zone then it will spawn until it has spawned the amount of enemies its required to.

graph TD;
     Start((Start))--> Wave-starts
    Wave-starts--> Get-current-wave;
    Get-current-wave--> Calculate-enemies-Count
    Calculate-enemies-Count-->Spawn-enemies
    Add-Health-Correlating-To-Wave-->Spawn-enemies
    Spawn-enemies-->Killed-all-enemies?
    Killed-all-enemies?--> |Safe period| Wave-starts;



Loading

Enemy AI

The enemy then gets an script for targeting, movement and attacking, within the targeting script, the script will target the nearest structure it finds, if the player comes near the enemy, it will target the player.

For the Enemy movement script, it will use the navmesh to get to the nearest structure for the enemy to attack, if the player gets too close to the enemy, the enemy will follow the player so it can attack the player.

When the Enemy uses the Attacking script, it will give the player or the structure it hits damage. If the player or structure has a health value of 0 or below, the player dies or the structure collapses.

graph TD;
   Start((Start)) --> Enemy_Spawns;
   Enemy_Spawns --> Is_Player_InRange;
   Is_Player_InRange --> |Yes| Player_Target;
   Is_Player_InRange --> |No| Get_Nearest_Structure;
   Player_Target --> Move_To_Player;
   Get_Nearest_Structure --> Find_Nearest_Structure;
   Move_To_Player & Find_Nearest_Structure --> Is_Enemy_At_Target?;
   Is_Enemy_At_Target? --> |Yes| Attack_Target;
   Is_Enemy_At_Target? --> |No| Move_Towards_Target;  
   Move_Towards_Target --> Is_Player_InRange;
   Attack_Target --> Target_Dead?;
   Target_Dead? --> |Yes| Is_Player_InRange;
   Target_Dead? --> |No| Continue_Attacking;




Loading

Universal Health Script

This script is used by every single object that needs health, like the player, enemy, structures or the main base.

Damage Dealing (Universal Health)

This script gets used to damage to damage each object that are bound to categories, the Enemy, the Player, the Structure and the main base. the Enemy deals damage to the base, structures or player, the Player deals damage to enemies, and some structures can deal damage to the enemy.

graph TD;
    A[Player] -->|DealDamage| B[Enemy]
    C[Structure] -->|DealDamage| D[Enemy]
    E[Enemy] -->|DealDamage| F[Player]
    E -->|DealDamage| G[Structure]
    E -->|DealDamage| H[Base]
Loading

Health Bar:

De Healthbar wordt gebruikt samen met de universal health, wat de speler, main gebouw, andere gebouwen of enemies kunnen gebruiken, zodat ze niet bijvoorbeeld na een hit dood gaan. Als het HP bij de healthbar op 0 is, gaat degene die er aan is geassigned met deze healthbar dood gaat. Verder is het ook mogelijk om een maximale HP threshold te geven aan degene die de healthbar krijgt. Verder als degene die de healthbar heeft damage krijgt, dan veranderd de healthbar ook met de hoeveelheid health het nog heeft.

Script Layout:

Schermafbeelding 2024-05-24 100817

Structure Building:

This script gets used when the player is on an placeholder place, where they are able to buy structures from the shop, if the player already has placed an structure on there, they can't create another structure on the same place.

Structure Behaviour:

This script gets used when the enemy is close in range of the structure, the structure will then shoot at the enemy that would deplete the health. It will only target the first enemy target, and not the 2nd one that is in range for now.

Classes system:

A script called classes manager will have access to a folder where all the classes will be stored in. A class is an gameobject and a scriptableobject. object with its level written in a JSON file. So If a player selects a specific class it will load the Gameobject with all the correct scripts and stats. For when the player must pick their class it will use the scriptableObject. In the scriptableobject the following data will be stored:

  • Sprite
  • Name
  • Description

Ping system:

A script that handles the ping system: pings are GameObject prefabs that will be instantiated when you call a function

Clone this wiki locally