w23 / OpenSource

Load Source games maps as combined meshes correctly positioned relative to each other
Do What The F*ck You Want To Public License
154 stars 16 forks source link

Cannot view Portal #83

Closed lymphoid closed 7 months ago

lymphoid commented 8 months ago

Can anyone please provide me with a working config for Portal?

w23 commented 8 months ago

I've added portal.cfg file here: https://github.com/w23/OpenSource/blob/master/misc/portal.cfg With default path steam install of Portal, it should be enough to just drag-and-drop this file onto OpenSource.exe.

lymphoid commented 8 months ago

Thanks Ivan! Here's what I get in the console before abruptly closing (please see attachment). Cannon read config file C:...\portal.cfg Error handling free option with argument 'C:...\portal.cfg' Error parsing command line arguments OpenSourcePortal Please help if possible. I will be very grateful.

w23 commented 8 months ago

This is interesting. It seems that it does get to the end of the cfg file, but then fails to register it as success (?!). I've added a bunch more logs, and also it now writes all messages into OpenSource.log file, so there's no more need to try to catch this obnoxious disappearing window. These changes are here: https://github.com/w23/OpenSource/pull/84 Are you building it from source yourself, or using a pre-built artifact? If you're using pre-built ones: this is the one from this PR: https://github.com/w23/OpenSource/actions/runs/7483592904/artifacts/1161300082 (can be seen on this page: https://github.com/w23/OpenSource/actions/runs/7483592904)

lymphoid commented 8 months ago

Thank you responding Ivan! I've download the new version with with the log file. (Sorry I am not totally familiar with the programmer/github lingo). It seems to locate the .vpk files without problem but fails after the "new map" steps. Here is the log output:

D:\a\OpenSource\OpenSource\src\OpenSource.c:816: Default platform steam basedir = C:\Program Files (x86)/Steam/steamapps/common D:\a\OpenSource\OpenSource\src\collection.c:293: Opening collection C:\Program Files (x86)/Steam/steamapps/common/Portal/portal/portal_pak_dir.vpk D:\a\OpenSource\OpenSource\src\collection.c:293: Opening collection C:\Program Files (x86)/Steam/steamapps/common/Portal/hl2/hl2_misc_dir.vpk D:\a\OpenSource\OpenSource\src\collection.c:293: Opening collection C:\Program Files (x86)/Steam/steamapps/common/Portal/hl2/hl2_textures_dir.vpk D:\a\OpenSource\OpenSource\src\OpenSource.c:123: Added new map to the queue: testchmb_a_00 D:\a\OpenSource\OpenSource\src\OpenSource.c:598: configReadCallback: Unexpected key "C:\Program" D:\a\OpenSource\OpenSource\src\OpenSource.c:780: Cannot read config file C:\OpenSource\portal.cfg D:\a\OpenSource\OpenSource\src\OpenSource.c:734: Error handling free option with argument 'C:\OpenSource\portal.cfg' D:\a\OpenSource\OpenSource\src\OpenSource.c:819: Error parsing command line arguments D:\a\OpenSource\OpenSource\src\OpenSource.c:677: Usage: C:\OpenSource\OpenSource.exe D:\a\OpenSource\OpenSource\src\OpenSource.c:682: -s: Override steam basedir D:\a\OpenSource\OpenSource\src\OpenSource.c:682: -m: Add map name to list of maps to load D:\a\OpenSource\OpenSource\src\OpenSource.c:682: -p: Add VPK file to list of files to load assets from D:\a\OpenSource\OpenSource\src\OpenSource.c:682: -d: Add directory to list of files to load assets from D:\a\OpenSource\OpenSource\src\OpenSource.c:682: -n: Specify a limit of number of maps to load D:\a\OpenSource\OpenSource\src\OpenSource.c:690: free arguments: Game configuration file to load

w23 commented 8 months ago

Is there anything else in the portal.cfg file, after the map line?

lymphoid commented 8 months ago

No, sir. Using the .cfg you shared.

w23 commented 8 months ago

This is somewhat puzzling. It's as if the cfg file contents are corrupted somehow. Try this one: https://github.com/w23/OpenSource/actions/runs/7497109902/artifacts/1164170031 it should just tolerate cfg errors. Also, now portal.cfg and bat are included in the archive, you can just click on the bat file. And even if it works, please send me the log file, at least first few dozens of lines of it, up until (hopefully) GL init lines.

lymphoid commented 8 months ago

Thanks Ivan, it worked!

I compared the new .cfg with my old one and I identified the issue: there needs to be a line break at the end. I added one into the older .cfg, just to confirm, and it fixed it.

PS: Is there a working .cfg file for Portal 2? I recall reading that the maps would need to be manually adjusted. If that hasn't been done yet, I wouldn't mind working on it, but I'd like to be sure no one has done it already, so that I don't waste my time.

Thanks again!

w23 commented 8 months ago

I compared the new .cfg with my old one and I identified the issue: there needs to be a line break at the end. I added one into the older .cfg, just to confirm, and it fixed it.

Haha, that means my cfg parser is extremely sloppy, I'll look into making it a bit more robust.

PS: Is there a working .cfg file for Portal 2? I recall reading that the maps would need to be manually adjusted. If that hasn't been done yet, I wouldn't mind working on it, but I'd like to be sure no one has done it already, so that I don't waste my time.

There's this one: https://github.com/w23/OpenSource/blob/master/misc/portal2.cfg However, the major issue with Portal 2 is that the engine has changed way too much for this little very experimental utility to make sense of the updated map file format. Maps mostly don't even look like anything they are in the game. This is the furthest I've got: https://www.youtube.com/live/eerFMHHJG7A?t=7640

There are also several unavoidable rendering glitches -- I've used this project to try out a bunch of very experimental approaches to software design and architecture, most of them not really that good :sweat_smile:, so it isn't very stable or robust (but hey, at least the whole self-contained executable is smaller than 90KiB uncompressed! Take that, modern 100GiB+ games!).

If you still want to do it, there are a few keys you can use to move maps within the game:

Every move will write new map coords into log. It is then a manual labor to extract these offsets and update the cfg file with them (look at hl2/hl1 files for examples, I no longer remember the format).

Thanks again!

Happy to help!

w23 commented 7 months ago

Saw the video ;), this can be closed now.