Collisions issues near 0,0
What happened?
Many players on my server have been experiencing collision issues near the 0,0 area. In these regions, collisions sometimes stop working entirely. NPCs nearby may flicker or fall through the map. This issue consistently affects some users.
Like the LOD issue with duplicated archetypes (https://github.com/citizenfx/fivem/issues/2752), this bug appears more often when the render scale is set to maximum and texture budget to minimum.
I've linked a test resource containing around 1300 interior collision files, which was the simplest way to share a way to reproduce the issue. However on my live server, which has a much more reasonable number of assets (~300 interiors and static collisions), the problem happens much more frequently, and even constantly for some users.
The issue seems specifically linked to interior collision files. Reducing their number significantly decreases the likelihood of the issue appearing.
https://github.com/user-attachments/assets/d3b9fd39-3132-4f6c-887a-b9c3776c1021 https://github.com/user-attachments/assets/db26928c-8694-469e-bf45-a7159d3e47e8
Expected result
Collisions should behave normally regardless of player location or the number of interior collision files.
Reproduction steps
- Start this reproduction resource: https://www.swisstransfer.com/d/dfd060f7-d1e3-4836-87bf-7450149018e5
- Set render scale to maximum and texture budget to minimum, to maximize the probability of the issue to appear
- No clip around the map for a few minutes
- Move near coordinates 0,0 (especially at these intersections: -48.989, 37.990; -77.990, -113.515; 69.202, -161.821)
- Observe broken collisions and NPC behavior
Importancy
Unknown
Area(s)
FiveM
Specific version(s)
FiveM b3258
Additional information
- Only parts of collision files seem randomly affected (specific mesh/material), not entire files
- The issue is strictly limited to areas around 0,0
I can confirm on our server as well we've been running into this issue for the past month or so. Maybe the bounds validation that was added recently somehow causes this?
I don't think it's related to the recently added bounds validation, since the issue started occurring for us around 6 months ago, well before that change.
The issue began after adding a map extension that included a significant number of MLOs and assets.
We have also this issue and it seems to happen when there are collisions outside the boundaries of the map (x or y greater than 8000) For example having Las Venturas will create this issue
We are indeed using Las Venturas, and it seems to greatly contribute to the issue. I even included a static collision file from Las Venturas in the reproduction resource I shared.
However, during my tests, this doesn't appear to be the only factor. I'm also able to reproduce the issue without having any collisions outside the map boundaries. So the root cause(s) remain unclear to me at this point.
I ran some additional tests today. Using the exact same files as in the reproduction resource, the issue does not occur in singleplayer, nor when using other modding platforms
Do you have the dealership by Breze near there in Vinewood. Or do you have any other interiors near by.
Do you have the dealership by Breze near there in Vinewood. Or do you have any other interiors near by.
Don't have any nearby and still get the same issue, I think cfx has to investigate this themselves at this point because our team has tried everything imagineable to find the reason for this
This looks like the collision engine is overloaded. I might be spouting nonsense, so take what i say with a grain of salt, but i heard they wanted to create easier compatibility between custom resources at some point. I wonder if they based some file loading on world position? if so, the loader could be trying to force load the ybn files collisions while near 0.0? (That's assuming ybns are actually placed at 0.0)
We have only had this issue when adding a resource that have large collision files, and we didn't hook it up to our ipl loader script.
Do you have the dealership by Breze near there in Vinewood. Or do you have any other interiors near by.
Don't have it either. I manage 3 different servers with differents assets and this happend everytime I use a map with collisions outside the -8000/8000 boundaries like:
https://forum.cfx.re/t/map-galapagos-islands/5257111 https://forum.cfx.re/t/map-roxwood-county/5093527 (only since a few months, previous versions didn't extend outside default world boundaries) https://fivem.las-venturas.com/
Hi, we're encountering the exact same issue on our server, especially around coordinates (0, 0, 0) — specifically near the barber shop and Pacific Bank.
Players sometimes fall through the map or become invisible in those areas. This happens inconsistently, but often enough to affect gameplay and immersion.
We've tried basic troubleshooting (like checking for custom MLO conflicts or YMAP issues), but the problem persists even on a clean build. Any update or insight would be greatly appreciated.
Thanks in advance!
Can you provide how much you extend boundaries (args in the native call) ? GTA V has some hard limits where things starts to fail.
Roxwood team suggested us to do this
ExtendWorldBoundaryForPlayer(
-100000000000000000000000.0,
-100000000000000000000000.0,
100000000000000000000000.0
)
ExtendWorldBoundaryForPlayer(
100000000000000000000000.0,
100000000000000000000000.0,
100000000000000000000000.0
)
It's maybe the issue here
Use this :
ExtendWorldBoundaryForPlayer(-16000.0, -16000.0, -1700.0)
ExtendWorldBoundaryForPlayer(16000.0, 16000.0, 2700.0)
Thanks!
Use this :
ExtendWorldBoundaryForPlayer(-16000.0, -16000.0, -1700.0) ExtendWorldBoundaryForPlayer(16000.0, 16000.0, 2700.0)
Thanks but nothing was fixed unfortunately, we still have the issue
This issue is caused by incorrectly placed static bounds for addon maps / objects. When a static bound is loaded without its corresponding map / object data being present, the game defaults to placing the collision at coordinates 0,0,0.
The BoxStreamer for fwStaticBoundsStore is occlusion-aware. As a result, depending on the entry angle when approaching the streaming area near 0,0,0, map bounds may be occluded by loaded addon static bounds, causing the described unexpected behavior.
To help debug and partially mitigate this issue, we've created a feature branch. You can opt into it by adding the following line to your CitizenFX.ini file (located in your FiveM Application Data directory):
UpdateChannel=specific/feature/static-bounds-store
This feature branch includes two key changes:
- Collision Loading Adjustment
- Collisions near the focus position (typically the player ped's coordinates) are now force-loaded, bypassing occlusion checks.
- Debug Commands
-
collisionDebug -
collisionDebugAddonThese commands log all loaded static collision bounds to the log file / console. Please check for addon collisions being loaded at coordinates where they are unexpected and fix these files.
-
Note: While this branch should reduce collision issues around the player ped, it does not resolve pathfinding / occlusion issues for population peds (commonly reported as "flickering peds"), for this, the faulty collision files need to be fixed / removed manually.
UpdateChannel=specific/feature/static-bounds-store
Thank you!!
Why would vanilla collisions be affected then if its an issue with add on maps? Eg. Non streamed collisions are affected.
Why would vanilla collisions be affected then if its an issue with add on maps? Eg. Non streamed collisions are affected.
if you read his reply its not an issue with just add on maps
This issue is caused by incorrectly placed static bounds for addon maps / objects. When a static bound is loaded without its corresponding map / object data being present, the game defaults to placing the collision at coordinates 0,0,0.
The
BoxStreamerforfwStaticBoundsStoreis occlusion-aware. As a result, depending on the entry angle when approaching the streaming area near 0,0,0, map bounds may be occluded by loaded addon static bounds, causing the described unexpected behavior.
Thank you for the work and clear explanation 🙏
I tested the feature branch with many users who experience this issue consistently, the system that forces collisions around the player works perfectly.
I managed to fix many cases using the debug commands, but I still have two spots (right outside an MLO at the Pacific Bank and a clothing store near 0,0) where the issue persists. The command doesn’t list any collision files that shouldn’t be there, but I do get quite a few entries marked as “Unknown Asset” when running collisionDebug.
Is it expected to see “Unknown Asset” entries in the output?
Unknown asset is vanilla stuff, as you're not running the add-on command
While the force request of collision near the player will probably solve most of the issues I still think there is more to it and that it is related to collision outside the ~8000 boundaries.
I already fixed all the collisions and the issue persists on production channel when using a collision outside boundaries.
Same here
While the force request of collision near the player will probably solve most of the issues I still think there is more to it and that it is related to collision outside the ~8000 boundaries.
I performed multiple tests with simple static collisions placed at X/Y: 13000.0 and -13000.0 and couldn't observe any issues. So it seems like there are other things causing this and not just simply placing bounds outside of the player's world limits.
EDIT: It seems like the main issue is still related to interior collisions, as they're offset from 0,0,0. So if they don't get registered in the corresponding .ymap they get placed close to zero in world space. Maybe interiors placed outside of the world boundaries cause issues too, I couldn't test this yet.
While I will continue to investigate possible issues with interiors outside of the default map bounds, the force loading of collisions has been merged into main. So most issues should be gone now.
To help debug and partially mitigate this issue, we've created a feature branch. You can opt into it by adding the following line to your
CitizenFX.inifile (located in your FiveM Application Data directory):UpdateChannel=specific/feature/static-bounds-store
Hi @tens0rfl0w , I used the "specific version" when the news about it was first posted here. Now, when I try to join a server with it (whether it's a public server with players or my clean server on b3258), I get a FiveM version error and can’t join any server. Is there any way to fix this?
I have this problem too @tens0rfl0w :
Who don’t care ? It’s dead project. Find another way, Cfx will not help you, they are useless. They lie on everything, money come without doing anything. 1M It’s fine, no need more. Sorry for your issue, we are in same boat since a while.
I have this problem too @tens0rfl0w :
The feature branch must have expired. Put UpdateChannel=canary in your CitizenFX.ini and you should be able to play.
I have this problem too @tens0rfl0w :
The feature branch must have expired. Put
UpdateChannel=canaryin your CitizenFX.ini and you should be able to play.
I can't execute commands CollisionDebug with canary version :(
