Skip to main content

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 function then subtract how much damage will be resisted by the type of enemy unit which is receiving the attack.


[Ranged Attack]

The Ranged version of the basic attack command starts off similar to the melee attack command where the party unit moves to a new position, plays an animation, then returns to their original positions however, if a unit character is using magic or a bow or a gun they need to fire a projectile of some sorts to make their attack animation appropriate to their weapon.

To enable the projectile from this animated attack I created a "Notifier" blueprint which will communicate to all other actors letting them know what has occurred, with the notifier on hand it needs to be placed within the animation montage and from there I can return to the Ranged Attack Command event within the Combat Component and drag off the "On Notify" pin of the attack animation and spawning the projectile to be used as an actor and have it seek out the enemy unit.


[Animations]

All of the "Command" options that can be accessed by the player need a animation that plays on screen to go with them so the player is aware that their selection went through. Since within Unreal Engine animations are tied to a characters specific skeletal mesh you would need to re-target the same animation to the new character skeleton or you could create a new character model specific animation, however, in either case the developer working on this project needs to re-assign the animations for each newly created character (or any character where the skeletal mesh has been swapped) and I have made this process easier then usual as the animations that will be used during battle actions are tied to empty variables saved on the top parent class ("Unit Base" & "Combat Component") so all a dev needs to do when adding a new character is head straight to the bottom level child blueprint, which would also be where they selected the new skeletal mesh, then find the empty variables labelled "Animations" and select the appropriate animation sequences. 

Comments

Popular posts from this blog

Guest Lecture #1 - 21/09/2022 - Secret Mode

Guest - Joshua Garrity, Head Game Scout at Secret Mode Guest Bio Joshua started as a product Manager in the marketing department. Joshua was in charge of digital publishing for Fireshine. Attending public events like Gamescom not only allowed him to network his way into the position as Head Scout at Secret Mode but is also a method he uses to accomplish his job by seeing new indie projects in beta stages at these events. Takeaway #1 – How to Pitch my projects Scouts and Studio CEOs will be travelling often and walking around both Hotels and event centers, so  you  need to be able to pitch your project anywhere at any time. This means your presentation needs to be smooth, quick, and confident, when talking with scouts, CEO, or other representatives you need to answer their questions (without checking notes) and speak honestly about what your team has done and what it will cost for your studio team to do more. Takeaway #2 – What Do Game Scouts Get Up to Game Scouts in their day-...

Guest Lecture #4 - 19/10/2022 - 10:10 Games

  1st Guest Bio - Bart Kosciolek, Junior Animator @ 10:10 Games Jfjdiejdjd 2nd Guest Bio - Reece Hewitson, Junior Games Developer @ 10:10 Games skdjalskjdlkasjd Takeaway #1 - Determination As an applicant trying to get into the industry I will be rejected many times due not being the correct fit for studios I am applying for, be it not enough experience or not the correct style of work for how the studio does things. I need to not let this deter me.  Takeaway #2 - Networking The video games industry is still very young (in business terms/years) and still very small (in one sense), while a single title is a product of many peoples work all put together those people often split after projects have been finished and they will end up working on other projects at other studios and this results in "everyone knows everybody" where you can say a name in conversation with a new co-worker and they'll reply with "oh yeah I know (name) I've worked with them on this project. ...

Guest Lecture #2 - 05/10/2022 - Rebellion Games

  Guest - Peter Dimitrov, Environment Artist @ Rebellion Games Guest Bio Peter enlightened us and told us his day-to-day while he worked on the 1st DLC project for Sniper Elite 5, as a environment artist Peter worked with another level designer to develop and refine the flooded map level that the 2 of them had been assigned to.  Takeaway #1 - Working with limitations      Both Peter and his co-worker had to stick to a schedule where sections of the map needed to be                   done to a specific deadline, the white box version needed to be done within a certain time limit,                   changes could not be made once the art pass had started, the map needed to include certain features like      ditches and a spot for a supply train to run through. The map itself went under many changes before         ...