Headblend data 'limit'

Client

Using canary? yes

local spawnedPeds = {}
Citizen.CreateThread(function()
	RequestAndWaitModel(`mp_m_freemode_01`)
	local pos = GetEntityCoords(PlayerPedId())
	for i=1,128 do
		local a, b = i, 0
		while a >= 10 do
			b = b + 1
			a = a - 10
		end

		local ped = CreatePed(4, `mp_m_freemode_01`, pos.x + a * 1.0, pos.y + 1.0 * b, pos.z - 1.0, 0.0, true, true)
		SetPedHeadBlendData(ped, math.random(4, 20), math.random(4, 20), math.random(4, 20), math.random(4, 20), math.random(4, 20), math.random(4, 20), 1.0, 0.5, 1.0)
		FreezeEntityPosition(ped, true)
		SetBlockingOfNonTemporaryEvents(ped, true)

		spawnedPeds[#spawnedPeds + 1] = ped
	end

	RegisterCommand("testReset", function() -- not working
		for _,v in pairs(spawnedPeds) do
			SetPedDefaultComponentVariation(v)
			SetPedHeadBlendData(v)
			SetPedComponentVariation(v, 0)
		end
	end)
end)

AddEventHandler("onResourceStop", function(r)
	if r ~= GetCurrentResourceName() then return end

	for _,v in pairs(spawnedPeds) do
		DeletePed(v)
	end
end)

image

Some people including me described this issue, here is a repro script to get it locally.
My head blend data stuff has been set after (all peds) spawned

1 Like

Hey ! this is still a thing, is there any workaround ?
Thanks :wink:

Not likely to be any time soon, or at all.

I tried several workarounds, like resetting the ped’s blend data but without success (as expected)
But it could be nice (hard?) to add a new native for us, and then we could make a script that reset ped’s blend data once they are far from u :man_shrugging:

This should be on top of your list, this is definitely a very ugly bug :confused:

Not possible to fix anyway, putting it “on top of the list” would mean there won’t ever be any development done on anything as this thing in itself is HIGHLY unlikely to be fixable.

i see!
it’s kind of sad because it’s a huge issue but i understand :wink:

I’d like to see a work-around for this in ‘normal’ OneSync.
We don’t wanna go-to BigSync: we use AI’s for our scripts and interaction with these, and also we don’t have 128 players (yet), as it’s a whitelisted RP server.

:rp: problems is that your character doesn’t look like yourself, or rather your haircolor doesn’t, when your joining as player 65 or higher. :<

One recent addition to plans is a ~128-240 max player mode with limited compatibility (players would still exist but player peds for them would not - so iteration might be tricky) using player ped culling as @PichotM has apparently successfully been running for quite some time.

If this mode would also set the maximum size of culled player peds to 64 in a radius (which might mean you’ll not see players if more than this amount get close, without dynamic culling radiuses being implemented yet), the head blend issue should all but vanish (and there should also be a noticeable performance increase at that!).

1 Like

Do we have any estimated timeframe on this? Would gladly help out testing it :mascot:

How would we go about doing this?

1 Like