Ikemen-GO icon indicating copy to clipboard operation
Ikemen-GO copied to clipboard

Float/Map operation errors

Open potsmugen opened this issue 1 year ago • 0 comments

Describe the bug

This looks like more of an issue with the programming language than the engine, but it may have a solution so it's worth posting. It looks like some errors in float calculations can accumulate and make map/variable values deviate from what was intended.

It's easy to understand what I mean with the reproduction steps.

To Reproduce

Paste this code into KFM:

[State -2, Debug]
type = mapadd
trigger1 = 1
map = "test"
value = 0.1
ignorehitpause = 1

[State -2, Debug]
type = displaytoclipboard
trigger1 = 1
text = "%f"
params = map(test)
ignorehitpause = 1

Turn on debug. You'll see the float starts acting up rather than staying a multiple of 0.1

Expected behavior

Little to no calculation errors, of course.

Screenshots / Video

ikemen000

Turns out this also happens in Mugen: Image1

Engine Version (or source code date)

0.99 but probably all of them

Operating system

Windows

Extra context or search terms

No response

potsmugen avatar Nov 22 '23 18:11 potsmugen