Skip to content

E-Jay Tripoli

A documentation of my work for Year 2 – Studying Games Design and Art at the University of Southampton

Menu
  • Lament
    • Development
      • Procedural Room Generation
        • PRG – Pt 1
        • PRG – Pt 2
        • PRG – Pt 3
        • PRG – Pt 4
        • PRG – Pt 5
      • Dungeon
        • Stalagmites
        • Pitfalls
        • Health Potion
        • Dungeon Bug Fixing
      • Player
        • Player – Pt 1
        • Player – Pt 2
        • Player – Pt 3
        • Player – Pt 4
        • Player – Pt 5
      • UI/HUD
        • Start Menu – Pt 1
        • General UI
        • Skill Tree – Pt 1
        • Skill Tree – Pt 2
        • Skill Tree – Pt 3
        • Skill Tree – Pt 4
        • Skill Tree – Pt 5
        • Skill Tree – Pt 6
      • Enemies
        • Whispers – Pt 1
        • Whispers – Pt 2
        • Wrought – Pt 1
        • Wrought – Pt 2
        • Boss
      • Scenes
        • Tutorial
        • Hub
        • Depression Gate
        • Gateway Scenes
    • Logs
      • Initial Plan
      • Teamwork
        • GitHub
        • Discord
      • Weekly Logs
        • User Analysis
        • Accessibility
        • Testing
        • Marketing
        • Formative Feedback
      • Playtests
        • Playtest 1
        • Playtest 2
        • Playtest 3
      • Showcase Event
      • Post-Project Reflection
    • Research
      • Understanding Learning Outcomes
      • Understanding my role
      • Researching Tools
      • Researching Pipelines
      • GDD Breakdown
      • Researching Procedural Generation
      • Existing Games
  • Arcadia GDD
    • Weekly Logs
      • Week 1 – What is a GDD?
      • Week 2 – Game Worlds
      • Week 3 – Concept Art
      • Week 4 – Character Design
      • Week 5 – Narratives
      • Week 6 – Gameplay and Game Systems
      • Week 7 – Feedback week
      • Week 8 – Audio
    • Research
      • Analysing Existing Games
      • Genre Research
      • Research into Psychological Abuse
      • Character Research/Moodboards
      • Environment/Map Research
      • Researching Medieval Knights
      • Researching Enemies
      • UI Research
    • Ideation & Development
      • Initial Development
        • The Essential Experience
        • Initial Game Ideas
        • Choosing a Game Genre
        • Choosing the Game’s Title
      • Game Play
        • Gameplay Loops
        • Mechanics/Tech
      • Story/Narrative
        • Twine
        • Summary of Narrative and Story
      • Game Art
    • GDD
      • Game Overview
      • Game’s Vision
        • Game Pillars
        • Project Focuses
      • Gameplay
        • Mechanics
        • Skills
        • Enemy Behaviour
      • Story & Narrative
        • Twine Prototype
        • Story
        • Narrative
      • Character & NPC Profiles
      • Map/ Level Design
      • UI & HUD
        • Creating the logo
      • Prototype/ Proof of Concept
      • Sound
      • Target Audience
      • Controls & Platform Specs
Menu

Wrought – Pt 1

Posted on March 11, 2025May 9, 2025 by et4g23

As outlined in Lament’s GDD, there will be two enemies that appear throughout all of the realms. One of which are the ‘Wroughts’

These Wroughts were described and explained in the GDD, which I analysed in this Research Post, the analysis looked like this:

These Wroughts are a melee enemy type which, compared to the whisper, are slower but have more HP.

Explaining the Wrought’s script

The “Stats” and “Health” Header shows various variables that can be changed or edited in the Unity editor, as mostof these data types are set to public, variable such as: speed, stoppingDistance, maxHealth etc. Furthermore there are references set in the Start() method or in the editor that the script can access, like the player’s position, or the Wrought attack hitbox.

In the Start() method, many aspects of the Wrought’s script is set, such as: The player’s transform (position in the scene) is set; Its currentHealth to its maxHealth and its isAttacking bool.

In the Update() method, the HandleMovement(), HandleAttack() and HandleLook() methods are all constantly being called.

The HandleMovement() method outlines how the Wrought moves, which is very similar to the Whisper’s HandleMovement() method, essentially, it checks whether its distance from the player is greater than the stoppingDistance float, if it is then it uses the Vector2.MoveTowards function to move the Wrought towards the player until its distance from the player is smaller than the nearDistance float.

Once the Wrought is within range to attack (When its distance to the player is less than the nearDistance float) and the cooldown for its attack is up (When the timeBetweenShots float is equal to zero) the HandleAttack() method is called.
This HandleAttack() method sets the timeBetweenShots float to the startTimeBetweenShots float, essentially resetting the attack cooldown. But if the Wrought is within distance to attack but the cooldown isn’t over, the cooldown counts down, timeBetweenShots -= Time.deltaTime;.
Once all the conditions are met, the ActivateAttackforSeconds (float duration) Coroutine is called; this sets the Wrought’s attack hitbox to active for a certain duration before turning it off after waiting a certain duration.

The HandleLook() method is used for the Wrought to attack in the direction. Firstly, a Vector3 called directionToPlayer finds the direction from the Wrought to the player, and sets its z direction to zero (as the game is 2D and not 3D only the x and y directions are needed)
It then checks if the directionToPlayer Vector3 = Vector3.zero, if this is the case then the player and the Wrought are directly on top of each other, in this case none of the following code is executed. if directionToPlayer > 0, a float called angle is created, then Unity does math using the Mathf.Atan2 function to calculate the angle from the Wrought to the Player in radians (A unit for angles) which is then converted to degrees using another function called Mathf.Rad2Deg
The Wrought is then rotated by this float called angle to face the Player, so that when the Wrought’s attack’s hitbox is activated, it is in the direction of the player.

Lastly, the TakeDamage() method is explained in a Player Development post.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

©2025 E-Jay Tripoli | Built using WordPress and Responsive Blogily theme by Superb