Poison systems come in many shapes and sizes in survival games. From the radiation system present in games like Rust, to the poisoning in Minecraft. The included poison system in the MSGT is versatile and offers many options in terms of how it can be used.
The poison system requires the player controller to have a C_Manager-Health component attached to it to function properly. Optionally, it can also interact with the C_Manager-Stamina component and C_Manager-VisualFeedback component.
After adding the C_Manager-Poison component to your player controller, the component merely needs to be initialized properly. By default, this is all handled automatically in the included SurvivalController blueprint by the Initialize function, which is run on Event BeginPlay.
If attempting to implement the poison system in your own controller, you will be required to run the component’s function called Event Initialize on startup, parsing a reference to the player controller.
If feedback is desired on the HUD UI or via the visual feedback system, then those respective components must also be attached to the controller and references must be set within the oxygen manager. This is also true for the stamina manager if a stamina limitation impact is desired upon players entering a certain level of toxicity. This is all automatically done via the Initialize function within the poison manager, assuming the required components are attached to it’s parent controller.
|Disable System||This checkbox will disable the oxygen system and is useful in testing/debugging scenarios.||False|
|Toxicity Levels||This array defines the various levels of toxicity the player may achieve. The damage rate is spread out over these levels. Element 0 in the array must always be 0 for the system to work correctly.||5 elements:
Element 0: 0.0
Element 2: 25.0
Element 3: 50.0
Element 4: 75.0
Element 5: 100.0
|Max Player Toxicity||This value determines the maximum level of toxicity a player may achieve||100.0|
|Max Toxicity Damage||This value represents the maximum damage (per second) that the palyer will receive from poison. The maximum will only be applied when the player's toxicity is at or above the highest level of toxicity.||5.0|
|Update Frequency||This value determins how many times, per second, this system updates. Higher values will result in smoother mechanics and nicer visual feedback results, but may impact performance (both locally and networked).||20|
|Limit Stamina||Currently not implemented in version 18.104.22.168. Will be implemented in future version update.||True|
|Stamina Reduction||Currently not implemented in version 22.214.171.124. Will be implemented in future version update.||25.0|
|High Poison Visual Effect||The visual effect (if any) used to indicate to the player high toxicity levels. Will come into effect when the player's poison crosses the Visual Effect Threshold.||Vignette|
|Visual Effect Threshold||One the player's poison level exceeds this value, the High Poison Visual Effect (if any is set) will kick in.||75|
The poison system works slightly different to most other systems, in that it has a tiered-level approach to player impact. This means that a player who is at level 1 toxicity will receive less damage per second than a player at level 2 toxicity. The damage is determined as a even percent of the Max Toxicity Damage, meaning that if there are 5 levels defined by Toxicity Levels and the Max Toxicity Damage is set to 10, level 1 will receive 2 damage/sec, level 2 will receive 4 damage/sec, level 3 will receive 6 damage/sec, level 4 will receive 8 damage/sec and level 5 will receive the maximum 10 damage/sec.
In order to impose poison onto the player from a volume, the built in AddPoison function should be used. This is the same function used by inventory items that both raise and lower the player toxicity, and negative values are used to remove toxicity. As of 126.96.36.199, no example poison volume has been included. In a future version a fully usable poison volume actor will be added.
Depending on your project, the poison system may be something that rapidly impacts your player in a sudden fashion. Careful consideration for this system should be taken when setting the Update Frequency, as a suitable balance between bandwidth and feedback will need to be found.