Skip to main content

Posts

Showing posts from March, 2024

Sandbox RPG Week #4 - Action Commands

[Attacking Command] With the UI in place and the combat component carrying all the information a "Unit" character needs it's time to program some functionality into my project. To Start off I created a custom event which I will be calling again later, once this event is called I need the chosen unit character to move towards the selected enemy and back to its original battle position, then I added a variable containing an animation montage and told it to play the animation upon attacking. The animation that plays can be changed on a per character basis as each character will have a different skeleton which wouldn't immediately work with that last chosen animation. To apply damage to the chosen actor I created two functions that take values from the combat component stat structure and from the parent unit class stat modifiers then combine them together to create a single damage value and the second of these functions will take the single value result of the first funct...

Sandbox RPG Week #3 - Adding Stats to Units

[Stat Spreadsheet] To add stats to my project I could add a variable for each "stat" a character would need then manually set all the differences between character class type such as "Mage" or "Barbarian", however there's a better way to do this, In unreal engine you can have a data table asset which contains as large amount of numerical data and you can separate specific cells from that data table using blueprints. This means you can have the data table decide how much HP a character has and then when the character levels up the local HP variable will change from level 2 HP to level 10 HP rather then setting up a function that increases the value of the variable each time they level up. Doing the levelling system this way allows for more freedom as it means the player can add upgrades on top of default values protecting them from mistakes such as forgetting to spend their acquired upgrades since they'll always be strong enough to take part in a fi...

Sandbox RPG Project - Week #2 - Creating a Battle System & UI

[Intro Here] With a project full of empty blueprints its a good idea to start adding some simple shapes and colours that represent where future assets will be so in the top level parent class "Unit Base" I added a cylinder and a new material which is just a colour value into the "Base Colour" parameter, that I then made different material instances of varying colours to represent the party characters and the enemy characters in this early stage of the battle stage level. [Battle Level] In a large amount of RPG the battle area is greatly limited (newer 3D based use a small range of movement) with the classic turned based ones simply picking a camera angle and spawning the characters involved in specific locations on screen, I am going to choose that method for this project as I am not going to allow the player control over the party characters movements while battling and they will be stuck navigating different menus with moves/magic & items listed to choose from...

On-Rails Shooter Project - Week #4 - Adding Enemy AI

With control of the player character's location and rotation achieved it's time to work on something else that will grab the players attention and challenge them, the enemy AI. I have had some poor experience with programming AI during my Trash Collector project so in this project I am going to attempt multiple different ways of programming enemies then choose one that bets fits my use case afterwards. 1st Enemy - Simple AI The quickest and easiest solution is to do the same as when moving the player character and simply grab the enemies current location then linearly move between that and a desired new location, luckily for me this is a pre-programmed function of Unreal Engine in the "AI MoveTo" node which will linearly transition between the starting location of any Pawn class plugged into the node and then the location data plugged into the "Destination" pin. I started by selecting the player characters location as the destination so even if the player wa...

Sandbox RPG Project - Week #1 - Project Planning

The Goal of this project is to create a levelling and ability system for the player to makes tweaks to then test their changes on an enemy in battle. With this goal in mind the project will consist of 3 stages for the player to experience. Project Stages:      *Collect Skill upgrades.      *Spend Skill upgrades.      *Test Upgrades in battle. Detailed Intentions Collecting Stage When the player first loads up the project they will be dropped into a corridor featuring different upgrade items but they will only be able to acquire a limited amount of total upgrades and upon collecting upgrade A they will be locked out of upgrade B then presented with a choice between upgrade C & D. The Idea behind this is to provide the player with a mid tier party of RPG characters that are only focused in one specific role and lacking in other roles therefore providing incentive for the player to run through the project a 2nd time. Spending Stage Now the p...