Skip to content

Conversation

@ImAciidz
Copy link
Contributor

Apologies for the essay...

Minimum effort changes to make things work on the April 27th, 2011 build of the game. LP hud is broken (I'm guessing the field for the Portal count was added with the CM update?), the way I disabled the ""broken"" aspect of it (ie constant console spam due to the missing field) is probably not ideal but I didn't feel like putting further thought into it lol. TAS tools won't work due to SteamControllerMove not existing at all, there's also a crash around line 384 or so of TasPlayer.cpp when trying to play a TAS that I didn't care enough to figure out. SAR's strategy for injecting data into demos won't work either, as this version of the game doesn't save the radial menu cursor position to the demo. restart_level and select_map don't exist on this version of the game which is probably relevant for a few SAR/srconfigs features.

Otherwise, I was able to play a full AMC run with bill, record/play demos, render a demo, and do other things without any obvious issues. The minor angle decay patch even worked once I fixed the ApplyMouse offset, so clearly we are gaming Kappa

I cannot verify the integrity of the game is fully intact (when it comes to potentially incorrect vtable offsets or the like causing wrong functions to be hooked), but I will leave that to someone more familiar with the codebase/features to look into. I left my notes for what I checked/went through in the offsets file so whoever works on this (presumably AMJ) won't have to look through stuff I already did.

The following is mostly repeating what I already said or alluded to in p2sr, but just putting this here for anyone in the future who may have questions about the particular game version choice or Portal 2 versions of this era in general:

It's possible a later (early) version of the game may be more optimal or ideal to use with regards to stability or features (though when it comes to random crashes, this seems night and day compared to the day 1 build of the game, as I haven't experienced any crashes outside of stuff caused by SAR).

For example, the May 6th 2011 update apparently fixes a rare crash when painting hard light bridges (as well as some other potentially beneficial fixes), the May 12th update removes the devonly flag from cl_fov (obviously SAR could just do that, and ofc sar_force_fov exists regardless), May 20th update fixes the crosshair not drawing on "extra wide" resolutions, May 26th update fixes a "rare case where the final section could not be completed" (?? monkaS), as well as an "invalid memory read in the paint shader".

However, despite having all of the Steam2-era game files available, the versions that are actually playable is limited, as Portal 2's client and server dlls were protected by CEG until 2014 or so, so we can only play versions that had CEG cracked/bypassed on the respective dll's (and the downloads for those need to have survived online to the current year, ofc). You also can't just crack the dlls as they are from the depot, as the dlls downloaded from Steam are incomplete, so when you launched the game back in the day for the first time (or after a game update), the missing 4kb or so of machine code was streamed/added back into the relevant files, along with the "personalization" (so that those dlls only worked on your computer and nobody else's).

Therefore, if someone wants to play the earliest builds with Challenge Mode/course 6 for shits and giggles, they should look for Portal 2 depot 624 v17/v18/v19 cracks (Oct 6th, 7th, and 21st 2011 updates). With that being said, the only other versions newer than this build that can be played at this time are the May 6th and September 27th builds (apparently the May 10th and 25th dlls were also recovered, but they weren't verified by someone else yet, and I'm too lazy to do that myself, so, shrug). A handful of other versions between release and the CM/course 6 update had complete/personalized (but uncracked) dlls recovered, but I doubt anyone will want to go through the effort of cracking those. (Technically, if you have an Intel Mac that is still on whatever update that supports 32-bit software, you can play any of these game versions, since CEG was only a thing for Windows).

The only reason I did stuff with this particular version is because it's what I randomly decided to extract and mess with on my computer back in September when I first got access to the files. At this point, I don't feel like trying one of the later (potentially better) versions and getting instant depression when an offset breaks. If it turns out this game version sucks badly for whatever reason, then I can look into a different game version later on.

Anyways, this was a fun way to spend like 5 entire afternoons/evenings after work.

@ImAciidz ImAciidz force-pushed the 2025-03-feat/2011-p2-support branch from ec8bb5b to b30913a Compare March 28, 2025 18:10
@ThisAMJ
Copy link
Member

ThisAMJ commented Mar 29, 2025

Just add a default (true probably) to the new Interface::GetPtr argument and this should be fine to merge

Minimum effort to make things work on the April 27th, 2011 build of the
game. LP hud is broken (I'm guessing the field for the Portal count was
added with the CM update?). TAS tools won't work due to
SteamControllerMove not existing at all, there's also a crash around
line 384 or so of TasPlayer.cpp regardless when trying to play a TAS
that I didn't care enough to figure out. SAR's strategy for injecting
data into demos won't work either, as this version of the game doesn't
save the radial menu cursor position to the demo.

Otherwise, I was able to play a full AMC run with bill, record/play
demos, render a demo, and do other things without issues.

I cannot totally verify the integrity of the game is intact (when it
comes to potentially incorrect vtable offsets or the like causing wrong
functions to be hooked), but I will leave that to someone more familiar
with the codebase/features to look into. Anyways, this was a fun way to
spend like 5 entire afternoons/evenings.
@ImAciidz ImAciidz force-pushed the 2025-03-feat/2011-p2-support branch from b30913a to fd9d7e9 Compare March 29, 2025 19:24
@ThisAMJ ThisAMJ merged commit 720b8ec into p2sr:master Mar 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants