Please select what you are reporting on:
Unreal Editor for Fortnite
What Type of Bug are you experiencing?
Devices
Summary
I have a very simple system I want to implement in my map. When you get an elimination you should receive +5 score and if you are eliminated you should receive -10 score. I added score managers to this and I was blown away with how incoherent the settings for this device are. Based on the tooltips I thought okay, I can ignore every other setting since what I’m doing is so simple. The tooltip for Score Value says “Awards this many points when triggered”, okay great so I set this to 10 and set the Score Award type to “Subtract” since I want to subtract 10 from the score if a player is eliminated. What ends up happening is when someone is eliminated the HUD message will say “+10 Eliminated”. Why would the HUD message artificially insert a “+” character that wasn’t defined in my HUD message? Furthermore the device itself has a hologram of “-10” since the mode is set to subtract.
The issue doesn’t stop there though. After testing I realized whatever I set the score value to in the score manager is the limit of how far a score will go. I changed the Score value to be “-10” and set the mode to addition to fix the issue of the HUD message displaying “+10”. When I am eliminated 1 time I go from 0 → -10 as my score on the scoreboard. Okay it seems to be working? But no once I am eliminated a second time instead of my score going from -10 → -20 it goes -10 → -10. This is wrong. So I try using these incrementing settings. I set Score Change When Activated to be -10 since I want it to decrease their score by -10 every time they are eliminated. This is also completely broken because it properly counts -10 → -20, but the HUD message now displays “-20 Eliminated”. So every elimination the points are stacking higher and higher instead of it being a constant -10 each time it’s activated. It’s able to go past the -10 limit that I had previously, but the functionality is completely wrong.
The problems don’t stop here. I tested being eliminated so I have -10 points and then got 1 elimination (worth +5 points). Upon getting the elimination my score goes from -10 → 5. So I just gained 15 in score despite my devices being set to only award -10 or 5. There’s definitely a bug with the arithmetic in the score when it comes to negative numbers. After this I got pretty frustrated and I started trying all kinds of configurations with the score manager device and I could not find any configuration where I could get the correct functionality of getting eliminated subtracts 10 and getting an elimination adds 5. I also tried doing this in verse because these settings are so incoherent. When I did this I tried having the score manager on “Set” mode because clearly there’s an issue with the addition of negative numbers. So my thought process is maybe I can manually “set” the score to be -10 or +5 of whatever their current score is.
NewScore := ScoreManager.GetCurrentScore(EliminatedAgent) - 10
ScoreManager.SetScoreAward(NewScore)
ScoreManager.Activate(EliminatedAgent)
This also doesn’t work. It has the same bugs of randomly the score having a lower limit of -10 no matter how many times I am eliminated. Or the score would simply not update at all. I then tried using a map of player agents to a PlayerDetails class that tracks eliminations and eliminated counts and has a function GetScore().
PlayerDetails<public> := class():
var Eliminations<public> : int = 0
var Eliminated<public> : int = 0
GetScore():int=
return (5 * Eliminations) - (10 * Eliminated)
This function returns the wrong value as written because the sign of the returned integer disappears. This is probably due to the weird syntax for having “signed” integers in Verse where you just put a “-” in front of it, but at runtime it seems like this expression will not evaluate to negative. This is definitely a bug because at runtime depending on the Eliminations and Eliminated count this expression should evaluate to either a negative or positive integer. The only way around this I found was to write it like
GetScore():int=
EliminatedScore := -(10 * Eliminations)
EliminationScore := 5 * Eliminations
return EliminationScore - EliminatedScore
This will return the correct sign but this is kind of silly to write it this way imho. If there was a way to write the original expression so it returns a signed integer when it truly is signed then the Verse documentation for integers needs to be updated to be more clear because using a random “-” or “+” to depict sign is unintuitive when a variable could be either or. If wrapping the entire expression and putting a “-” in front like -((5 * Eliminations) - (10 * Eliminated))
yields a correct sign if the evaluated integer is positive or negative then this needs to be more thoroughly explained in the documentation. Furthermore, if the only type in Verse for an integer is int
with no specific uint
type then the assumption would be that int
can be negative or positive without issue and without any extra syntax needed.
At this point I was just in shock by how difficult it has become to accomplish a very simple scoring system. I started looking into other devices that could potentially award score because I thought maybe this is just something wrong with the score manager device. I found the timer device is able to award score on success OR do a penalty. Okay we can work with this. So I set it up in verse where if someone is eliminated it will start a timer for that agent and when the timer succeeds/fails it will award the scores I set to each of them. I have a elimination timer and an eliminated timer. Amazingly setting the Failure Score Penalty to “10” ends up ADDING 10 to the players score. I guess this was my fault, but I don’t think it’s a far stretch to expect a setting that’s labeled as a “score penalty” to subtract the value I put in, but fine. So I set that timer to have a penalty of -10. It appears to be working, until I reach the case of having -10 score (being eliminated 1 time) and then being eliminated a second time. Somehow even with the timer device method my score has a lower limit of whatever value I put in. If I change the value to -100 instead of -10 then the lower limit of my score is -100.
After this it’s become clear that there is some issue that’s rooted in the counting of score that goes beyond the devices in UEFN. All I want is to be able to have a simple scoring system that the player earns points with eliminations and loses points on eliminated, but it’s seemingly impossible or at the very least extremely difficult to accomplish. I tried reaching out in the UEFN discord and the only suggestion was to manually track in verse, which I’m already doing. But the point is I want the real score to reflect on the real in game scoreboard. I don’t want to make a custom UI widget I want the score to to reflect in the scoreboard that is already in the game. I don’t think this is a big ask? Having a scoring system is a fundamental aspect of making games in creative. If anyone knows how to set the score managers up properly so that I can achieve this system then please let me know what settings I should put in because as it stands right now I can’t go any further with the development of my map if I can’t get past this issue because I want the score the players have to be on the scoreboard. No custom UI widgets. Furthermore if there’s a way to set this up with the score manager so I can have working HUD messages that display the correct text like “-10 Eliminated” and “+5 Elimination” that would also be great because I think having to disable those settings on the score manager and have to make a HUD message device just to avoid the bug with “+10 Elimination” is ridiculous.
Here are my takeaways from this whole experience
- Score manager device settings needs to be completely overhauled
- There should be no setting/concept of Increment/Decrement since there’s no use case for wanting score to accumulate like that, the majority use case is to award a constant value when some action happens
- The Verse functions for Increment and Decrement on the score_manager_device do not align with the settings in the editor. In the editor you can set a specific value to be incremented so you would expect the verse methods to take in an integer, but they don’t. This increment/decrement functionality should be completely removed because of how unintuitive it is, but if you insist on keeping it then the Verse functions should at least align in functionality of what’s exposed in the editor.
- The Score Value setting with the tooltip “Awards this many points when triggered” should be renamed because there’s ambiguity if this means the device will award that amount when activated or if this is the current value stored in the score manager for a particular agent or all agents
- Score manager (and many other devices’) properties should be renamed to more accurately depict what the setting does. With my previous point the Score Value option is ambiguous with if it’s the amount that it will award or if it’s the current value of the score manager. Since Verse has functions for SetToAgentScore this gets confusing very fast because the way that reads is that you’re essentially “loading in” the current agent’s score, but then when activating it should add/subtract/set by the Score Value you put since the tooltip reads that it’s the amount that will be awarded on activate.
- Redundant options should not exist. The Increment Score On Awarding checkbox seemingly pairs with Score Change When Activated (As written in its tooltip). If there is some sort of functionality this setting does without having Increment Score On Awarding checked then the tooltip should be changed or these should both be renamed to be more clear what they’re actually doing. If they truly are paired in functionality then there shouldn’t even be a checkbox since if the Score Change When Activated being set to any non 0 value indicates that they are “enabling” that functionality. Either way this whole incrementing/decrementing system should not exist at all.
- Min & Max score settings should be removed OR their purpose should be to act as a clamping action on the score as a whole and not on the amount the device can award in a single activation. This is a very obscure setting because there’s a legitimate use case for not wanting the total Score for an agent to ever go below 0 (even when being eliminated/doing some penalty action when you only have 0 points), but there isn’t a clear way to achieve this currently.
- Score Award Type(s) “Add”, “Subtract”, “Set” all make sense but there’s a setting for “No”. This is extremely incoherent and it’s unclear what this even does and if it does nothing then the device is basically useless
- There is a bug with arithmetic of negative numbers when it comes to score that goes beyond any device and is an issue with what’s going on behind the scenes that displays score on the scoreboard (See my example above of going from -10 → 5 after doing -10 + 5, this happened on both the score manager and the timer device)
- There seems to be an issue with order of operations in Verse itself and/or an issue with detect if an integer variable is negative, but I need to investigate more
- The HUD message of the Score Manager artificially adds “+” and “-” characters to the HUD message based on the Score Value instead of the Score Award Type (See my example of Score Value of 10 with Subtract mode displays “+10” as the HUD message). If we must have this artificial sign character then it should be based on the Score Award Type (Add, Subtract, Set) instead of the sign of the score value because that’s what makes the most sense to the user
Once again, there definitely is a way to set this up properly to do what I want because I’ve played maps that work in that way. But I think I speak for everyone saying that the way this device is set up right now is unintuitive and has many bugs. If anyone knows how to set these up to do the functionality I need I would love an explanation how because I don’t want to have to give up development on my map over this issue.
Steps to Reproduce
- Add score manager to map
- Configure it in a way to add or subtract a constant value each time it’s activated
- Scoreboard score is somehow limited to a minimum of whatever value you’re subtracting by
- Adding score while an agent has a negative score incorrectly adds them together
Expected Result
- Scoreboard should accurately reflect score
Observed Result
- Scoreboard does not accurately reflect score
Platform(s)
PC
Additional Notes
This is an unpublished map so I can’t provide an Island Code