Might be an engine bug

I don’t know if I’ve posted this into the right topic, correct me if it’s the wrong topic.

I am having a weird issue where a piece of code causes an error to a significant amount of mobile users but not to other devices.

local RainbowColor = ColorSequence.new({
	ColorSequenceKeypoint.new(0, Color3.fromHSV(1, 1, 1)),
	ColorSequenceKeypoint.new(0.2,	Color3.fromHSV(5 / 6, 1, 1)),
	ColorSequenceKeypoint.new(0.4,	Color3.fromHSV(2 / 3, 1, 1)),
	ColorSequenceKeypoint.new(0.6,	Color3.fromHSV(0.5, 1, 1)),
	ColorSequenceKeypoint.new(0.8,	Color3.fromHSV(1 / 3, 1, 1)),
	ColorSequenceKeypoint.new(1, Color3.fromHSV(1 / 6, 1, 1))
})

afbeelding

It states the color value is out of range, but this error only occurs to certain phone users.
On my own iPhone SE 2020 I can play just fine, but quite some other users can’t even play the game because the initialisation of the modulescripts keeps failing due to this error.

My hypothesis states that Color3.fromHSV(1, 1, 1) might be converted into a Color3 value that’s slightly higher than (1, 0, 0), like (1.0001, 0, 0) but I’m not entirely sure about that.

I’ve questioned some people who experienced this issue if they were an Android user, and yes, they were all Android users. Plus our concurrent users for phone and tablet have cut in half. So I think this only happens to the Android version of Roblox.

I’ve decided to use pcall on this function as a temporary solution, just so people can actually play the game.

1 Like

You’re probably right about it being a bug and why its happening. Can you try and find what values fromHSV is giving on those devices where this fails?

1 Like

User who had the issue:
afbeelding

Me, who didn’t have the issue. on my PC in Studio:
afbeelding

But both 1.19209e-07 and 5.96046e-08 are just very small, not rounded numbers.
Does roblox detect these as “out of range” on android?

try rounding the numbers
text text text

You could probably use math.clamp(), but this does seem like a genuine bug.

Edit: now I’m just thinking of one of the Roblox devs saying “works on my machine” lol

2 Likes

Yeah, almost certainly a missing “clamp” somewhere in the engine code. Clamping will also be the most efficient solution until the bug is handled.

I suppose rounding is possible too, yet questionably practical when it comes to long decimals (math.round(n*1000000000)/1000000000).

And a small observation:

As the OP said, those are microscopic numbers appearing as a result of the famous floating point error. The problematic lines are those that include fractions with infinite decimals, i.e. 1/3 and 2/3. My guess is that they pose a problem in converting angles in HSV (hue, saturation, value) to a unit RGB (have to check how it’s formally called, basically 1-255 to 0-1).

Hue value is an angle between 0 and 360, so angles like 33.33333334 are never completely precise on paper.

I’m away from my PC for a short while, but someone should write a bug report on this. :slight_smile:

2 Likes

Just encountered this issue today. I have filed a Bug Report

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.