Skip to content

feat(gta-core-five): raise the shop ped apparel item limit#4061

Open
xalva98 wants to merge 1 commit into
citizenfx:masterfrom
xalva98:ShopPedApparelPool
Open

feat(gta-core-five): raise the shop ped apparel item limit#4061
xalva98 wants to merge 1 commit into
citizenfx:masterfrom
xalva98:ShopPedApparelPool

Conversation

@xalva98

@xalva98 xalva98 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Goal of this PR

Raise the limit on how much addon clothing (SHOP_PED_APPAREL_META_FILE items) a server can use. Today, once a server reaches roughly 65,520 clothing items in total across all packs, players crash while joining — and removing any handful of items anywhere makes it work again, which is what shows it's a fixed limit and not a broken item.

That limit can't be raised with any convar or increase_pool_size, and it's hit well before the streaming pools run out — so in practice it's the real ceiling on how much clothing a server can add (around ~29.5k addon items on build 3095, since the base game already uses a large chunk of it). With it removed, raising the relevant pools finally lets servers add far more clothing. It should also help some setups that currently run into what looks like a "YMT limit," since this limit is reached sooner than that.

The change is opt-in and off by default.

How is this PR achieving the goal

The game keeps a single list of every clothing item, looked up by name. That list can only hold about 65,520 entries, and the release build doesn't guard against going past it — so once a server crosses that number the overflow corrupts memory and crashes the client. It happens on join because that's when every clothing pack loads and the list gets rebuilt.

This PR keeps its own, larger list on the side and points the game at it — both the code that rebuilds the list and the code that looks items up in it. When the fix is off (the default), everything behaves exactly as it does today.

Enable it server-side with:

setr game_enableExtendedApparelShopLimit true

Here's a clip of a large clothing pack (over 30k+ addon clothing) with the convar set to false
https://youtu.be/QoKaBW9ue0E
As you can see the game crashes as soon as the clothing packs load.

Here's a clip of that same clothing pack with the convar set to true:
https://youtu.be/CakPxO7zUjc
The game fully loads in and all 1400+ clothing pieces for jackets are available (and more is possible probably)

This PR applies to the following area(s)

FiveM, Client

Successfully tested on

Game builds: 3258

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

https://discord.com/channels/779705925577080842/842554061734936596/1525121266275586211
b1da67e0-faf7-471a-a8f7-5f5fbf2df96b.dmp

PS: Even if my fix is not accepted I think everyone would highly appreciate this limit being increased to make full use of the pool size increases

@github-actions github-actions Bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Jul 10, 2026
@xalva98
xalva98 force-pushed the ShopPedApparelPool branch 2 times, most recently from 48624c2 to 86c6fba Compare July 11, 2026 14:07
@xalva98
xalva98 marked this pull request as draft July 11, 2026 17:23
@xalva98
xalva98 force-pushed the ShopPedApparelPool branch from 86c6fba to 0b3059d Compare July 11, 2026 22:10
@github-actions github-actions Bot added triage Needs a preliminary assessment to determine the urgency and required action and removed invalid Requires changes before it's considered valid and can be (re)triaged labels Jul 11, 2026
@xalva98
xalva98 marked this pull request as ready for review July 11, 2026 22:12
@github-actions github-actions Bot added invalid Requires changes before it's considered valid and can be (re)triaged and removed triage Needs a preliminary assessment to determine the urgency and required action labels Jul 11, 2026
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
@chromium-cfx chromium-cfx added enhancement Feature or other request that adds functionality or improved usability triage Needs a preliminary assessment to determine the urgency and required action and removed invalid Requires changes before it's considered valid and can be (re)triaged labels Jul 13, 2026
@xalva98
xalva98 force-pushed the ShopPedApparelPool branch from 0b3059d to 80188ac Compare July 13, 2026 09:42
@github-actions github-actions Bot added invalid Requires changes before it's considered valid and can be (re)triaged and removed triage Needs a preliminary assessment to determine the urgency and required action labels Jul 13, 2026
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
Comment thread code/components/gta-core-five/src/PatchShopPedApparelLookup.cpp Outdated
@xalva98
xalva98 force-pushed the ShopPedApparelPool branch 2 times, most recently from 42e9777 to a7ee78b Compare July 13, 2026 19:04
@chromium-cfx chromium-cfx removed the invalid Requires changes before it's considered valid and can be (re)triaged label Jul 14, 2026
…onvar

Registering more than ~65,520 shop ped apparel items crashes clients on
join: the global name lookup used to resolve apparel items overflows and
corrupts memory once it grows past that count, which no convar or pool
size can currently work around.

Keep a wider (eastl::hash_map) lookup on the side and divert the routine
that rebuilds it plus both copies of the lookup helper. The hash lookup is
also faster than the engine's binary search (O(1) vs O(log n)).

Opt-in and off by default via game_enableExtendedApparelShopLimit.
@xalva98
xalva98 force-pushed the ShopPedApparelPool branch from a7ee78b to 28f31eb Compare July 14, 2026 11:03
@github-actions github-actions Bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Jul 14, 2026
@chromium-cfx chromium-cfx removed the invalid Requires changes before it's considered valid and can be (re)triaged label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Feature or other request that adds functionality or improved usability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants