top of page
Search
Writer's pictureVinny

All About Context

This weekend I focused on setting up custom gameplay effect context to use throughout the game.



Gameplay effect context provides all the necessary information to properly code gameplay effects and interactions. It contains the following:


  • Information on the ability itself

  • Level of the ability

  • Causer or "instigator"

  • Target

  • Ability system component for the source

  • Ability system component for the target

  • Replication state

  • Is a blocked hit?

  • Is a critical hit?

  • Damage before modification

  • Damage after modification


With this information you can perform all kinds of different things in the code related to gameplay mechanics. This critical "context" is setup and reusable across the project.


I worked on the following tasks this weekend:


  • Created custom gameplay effect context for all abilities

  • Learned about net serialize and replicating bits

  • Implemented net serialize into the ability types class to handle saving and loading data

  • Implemented struct ops type traits in ability types to be able to set bools for WithNetSerializer and WithCopy

  • Created an ability system globals class to hold the custom gameplay effect context

  • Learned how to use UPARAM(ref) to make the variable an output in Blueprint instead of an input

  • Created more static functions in the ability system library to set critical hits and blocks during combat

  • Blocks and crits now display visually as floating text matching the color of the respective hit

  • Added damage types to the gameplay tags and introduced damage types

    • Physical

    • Fire

    • Cold

    • Poison

    • Disease

    • Magic

  • Mapped damage types to resistances for the different damage types

  • Created a resistance attributes gameplay effect to store the resistances

  • Applied resistance attributes to default attributes initialization code for the player and enemy



Attributes menu showing resistance types

Here's a short video showing some of the hit effects and damage types.




This week I'm going to spend time adding code to apply damage reduction based on resistances to physical and elemental damage types. I also plan to perform multiplayer testing to make sure everything is working as expected in the networked versions of the game.


Cheers,

Vinny



19 views

Recent Posts

See All

60 FPS

Comments


bottom of page