Engine icon indicating copy to clipboard operation
Engine copied to clipboard

Bug: Broken vphysics collision tracing in P2CE/Revo engine builds

Open pivotman319-owo opened this issue 4 months ago • 16 comments

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

pivotman319-owo avatar Aug 27 '25 16:08 pivotman319-owo

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

pivotman319-owo avatar Aug 27 '25 18:08 pivotman319-owo

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: Unstable collision detection in VPhysics in x64 Valve Source games.

Grocel avatar Aug 27 '25 18:08 Grocel

Also reproduced on latest stable Revo build

Video link

pivotman319-owo avatar Aug 28 '25 01:08 pivotman319-owo

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.

Grocel avatar Aug 28 '25 10:08 Grocel

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

ozxybox avatar Aug 28 '25 11:08 ozxybox

Are these puzzles so tightly designed? I don't think it has the potential to break them to be honest.

Grocel avatar Aug 28 '25 12:08 Grocel

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.

ozxybox avatar Aug 28 '25 12:08 ozxybox

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.

Grocel avatar Aug 28 '25 12:08 Grocel

@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.

ozxybox avatar Aug 28 '25 12:08 ozxybox

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.

SCell555 avatar Aug 28 '25 13:08 SCell555

So would you share what you did to fix it then?

Grocel avatar Aug 28 '25 13:08 Grocel

Any fixes or features we’ve made for strata are available to other source engine licensees if they contact us and ask.

ozxybox avatar Aug 28 '25 13:08 ozxybox

what is the best ways for licensed to contact you ?

kiddu25 avatar Aug 28 '25 13:08 kiddu25

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

ozxybox avatar Aug 28 '25 13:08 ozxybox

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).

megakarlach avatar Sep 01 '25 06:09 megakarlach

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

Image

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.

Grocel avatar Sep 02 '25 08:09 Grocel