fivem icon indicating copy to clipboard operation
fivem copied to clipboard

redm: draw text/sprite blinking

Open Identity-labs opened this issue 11 months ago • 10 comments

What happened?

Since last update ~5 days ago all draw text/sprite are blinking on redm

https://medal.tv/fr/games/red-dead-2/clips/jwuwolaLc6eS6P-1M/AcuyyywyhC9T?invite=cr-MSxoYnIsMjM1OTY4OTMwLA

Expected result

Not blinking

Reproduction steps

All draw text/sprite are used with SetDrawOrigin / ClearDrawOrigin

Importancy

Slight inconvenience

Area(s)

RedM

Specific version(s)

all

Additional information

No response

Identity-labs avatar Jan 19 '25 20:01 Identity-labs

Can you show example code?

AvarianKnight avatar Jan 19 '25 20:01 AvarianKnight

const position = GetEntityCoords(PlayerPedId(), true);
setTick(() => {
    Citizen.invokeNative(0xE10198D5.toString(16), position[0], position[1], position[2], 0); // SetDrawOrigin
    SetTextScale(0.30, 0.30);
    Citizen.invokeNative('0x50A41AD966910F03', 255, 255, 255, 215); // SetTextColour
    const str = Citizen.invokeNative('0xFA925AC00EB830B9', 10, 'LITERAL_STRING', 'Blinking text', Citizen.resultAsLong());
    SetTextCentre(true);
    Citizen.invokeNative('0xD79334A4BB99BAD1', str, 0.0, 0.0); // DisplayText
    Citizen.invokeNative('0xC9884ECADE94CB34', 'generic_textures', 'hud_menu_4a', 0.00000001, 0.0125, 0.11, 0.022, 0.1, 1, 1, 1, 190, 0); // DrawSprite
    Citizen.invokeNative(0xDD76B263.toString(16)); // ClearDrawOrigin
});

On medal video player have an RTX 3060

Me i have GTX 1070 OC and i don't have the issue

I have ask to other server owners, they have same behavior.

Identity-labs avatar Jan 19 '25 20:01 Identity-labs

When you ALT Tab you see it more, some change has impacted drawing performance

Identity-labs avatar Jan 22 '25 11:01 Identity-labs

I have tested in Lua and I don't have an issue with it. tested using with invoking natives and declarations

CreateThread(function()
    while true do
        Wait(0)
        local position <const> = GetEntityCoords(PlayerPedId(), true)
        SetDrawOrigin(position.x, position.y, position.z, false)
        SetTextScale(0.30, 0.30);
        SetTextColor(255, 255, 255, 215)
        local str = VarString(10, 'LITERAL_STRING', 'Blinking text')
        SetTextCentre(true);
        BgDisplayText(str, 0.0, 0.0)
        DrawSprite('generic_textures', 'hud_menu_4a', 0.00000001, 0.0125, 0.11, 0.022, 0.1, 1, 1, 1, 190, false)
        ClearDrawOrigin()
    end
end)

perhaps is an issue with javascript ? or has been fixed...

can you check again @Identity-labs also your video is not available anymore

outsider31000 avatar Feb 07 '25 05:02 outsider31000

I can't replicate this either (with the provided snippet, or this one)

const position = GetEntityCoords(PlayerPedId(), true);
setTick(() => {
    SetDrawOrigin(position[0], position[1], position[2], false)
    BgSetTextScale(0.30, 0.30);
    BgSetTextColor(255, 255, 255, 215);
    SetTextFontForCurrentCommand(1)
    const str = Citizen.invokeNative('0xFA925AC00EB830B9', 10, 'LITERAL_STRING', 'Blinking text', Citizen.resultAsLong());
    SetTextCentre(true);
    BgDisplayText(str, 0.0, 0.0);
    DrawSprite('generic_textures', 'hud_menu_4a', 0.00000001, 0.012, 0.11, 0.022, 0.1, 1, 1, 1, 190, 0);
    ClearDrawOrigin();
});

AvarianKnight avatar Feb 07 '25 17:02 AvarianKnight

You have both good hardware ?

Identity-labs avatar Feb 07 '25 21:02 Identity-labs

I have a Geforce GTX 1070 and AMD ryzen7

outsider31000 avatar Feb 07 '25 21:02 outsider31000

This person have a GTX 1080 https://medal.tv/fr/games/red-dead-2/clips/jMRrAzSXgu9SAItuQ?invite=cr-MSxTazQsMjc0ODg0OTUzLA

Draw is done in setTick with only all required drawing natives no extra calls.

Overall of server resources is 0.5ms, the server has only one resource, only necessary tick/interval are running.

On my side i have GTX 1070 OC but it's not like this person, drawing blink once every 5~10 sec.

Like i say it's becoming worst around January 9 without any change on server resource.

Identity-labs avatar Feb 28 '25 14:02 Identity-labs

Hi, having the same issue with RTX 4070 Super on a resource i'm working on

I've noticed some strange behavior Switching from day to night seems to increase the chance to flicker Having some ptfx, or at least smoke in the fields of view seems to increase the chance to flicker

https://streamable.com/tkv6ov

levraimurphy avatar Mar 07 '25 09:03 levraimurphy

This can be revert plz https://github.com/citizenfx/fivem/commit/9313b36d04762fd14e4003c1f555857fae00013a This change has been push in production without any feedbacks from the community

When it's reverted it's totally fine.

https://github.com/user-attachments/assets/71dabab0-1a65-4f30-8ffc-829e541c7fa6

Identity-labs avatar Apr 15 '25 11:04 Identity-labs