Bug: Broken vphysics collision tracing in P2CE/Revo engine builds
Describe the bug
See https://github.com/ValveSoftware/Source-1-Games/issues/7426
Reproduced on P2CE staging buildid 19733512; engine commit 7f99c016
https://github.com/user-attachments/assets/758b6f72-9d70-4848-8e25-e4c793c68ecc
To Reproduce
Follow instructions in above linked issue
Issue Map
Not applicable
Expected Behavior
Physics should behave correctly like in HL2
Operating System
No response
Does not reproduce on Momentum 0.10.0-prerelease (buildid 19719896). Could not repro test case 3 due to hl2-style physics prop restrictions that are not present in p2ce
https://github.com/user-attachments/assets/310fbf49-6561-46e9-aa69-363909eaf1bc
https://github.com/user-attachments/assets/16e5eeb0-032f-4b3a-8117-d49c2eafa5f1
The test map used in case someone is interested. It is optimized to run on many source games out of the box.
valve_source_engine_issue7426_v2.zip
This video shows how the test map is used and what issues to expect:
The solution is to compile vphsyics to use doubles instead of floats. The problem is bringing Valve to do it. Garry's Mod developer Rubat has contacted them to multiple times, but it always caught up in bad timing or forgotten commitments. It is not legal for the licensees to compile and ship a fixed version by them selves.
Each contact did at least something, but required follow ups. It seem to be very difficult to conduct follow ups with no one responding. Sometimes mad process is reset too as some one different responds, but does not follow up.
Momentum Mod is compiled with physics using doubles instead of floats. I am hesitant to move P2CE to use doubles if Portal 2 was also using floats. I’m unsure of if moving to doubles could potentially break backwards compat with physics based puzzles
Are these puzzles so tightly designed? I don't think it has the potential to break them to be honest.
Portal puzzles involve objects being flung through the air and other such. I haven’t personally tested if the arc of an object changes between floats vs doubles or if objects bounce drastically differently. I’m just always cautious, as it seems every time we touch something related to physics, we get a regression somewhere.
The effects should be minimal. It is more likely that the puzzles works better with a more precise engine. I would like to ask you to actually test it.
@pivotman319-owo if you copy paste vphysics.dll from 0.10 momentum mod into p2ce, I believe the game should run okay. Can you give that a shot? Otherwise I’ll compile a variant of it for you.
Also it is not as simple as just compile v physics with doubles. Double mode of vphysics got broken at some point in development, and nobody at valve was bothered enough to fix it. That's why it is not being used by any newer source game. I have spent some time fixing it. That is why momentum has double vphysics mode.
So would you share what you did to fix it then?
Any fixes or features we’ve made for strata are available to other source engine licensees if they contact us and ask.
what is the best ways for licensed to contact you ?
Most straightforward is probably to email us at [email protected] there’s a contact link and info about the project here https://stratasource.org/
Otherwise I guess if anyone has just informal questions or other such, my Discord DMs are always open
Reply to #1490 (comment)
Orange Box (Source 2007) was the last to use double VPhysics. Starting with L4D branch (even at launch back in 2008), Valve switched to float (could be multiple reasons like console optimization to network prediction optimization), and all subsequent Valve games also used this VPhysics, Valve eventually backported this change to TF2 branch (a branch which is derived from SteamPipe/2013 MP, itself derived from Orange Box).
Most straightforward is probably to email us at [email protected] there’s a contact link and info about the project here https://stratasource.org/
Otherwise I guess if anyone has just informal questions or other such, my Discord DMs are always open
Source: Discord Chat, 2025-09-01
Apparently Rubat is not interested in working with Strata on the physics issue as he legally can not deploy custom physics builds by himself, even if he has the fixed code.