Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Remaster Assets/Pak #3

Open
d10sfan opened this issue Aug 10, 2023 · 18 comments
Open

[Feature Request] Remaster Assets/Pak #3

d10sfan opened this issue Aug 10, 2023 · 18 comments
Labels
enhancement New feature or request

Comments

@d10sfan
Copy link

d10sfan commented Aug 10, 2023

Quake II recently was updated with a remaster (https://store.steampowered.com/news/app/2320/view/3644027577415996831?l=english), that includes a new expansion among other things.

Is it possible for this project to add support for the new content? Inside the steam/gog release, there's a rerelease/baseq2/pak0.pak file (that's it for pak files), trying to launch from this directory, yquake2 complains about Error: Couldn't load pics/conchars.pcx

For reference, the original Quake also got a remaster and there was some work done by those engines to support that and the kpf file, which contains the localization strings.

@Yamagi
Copy link
Member

Yamagi commented Aug 10, 2023

Supporting the remastered game data would be nice. However on very, very first look it seems like the changed a lot of things. Including gamecode changes and alteration to the assets. This might not be easy to implement so don't get your hopes too high. It would be easier if they release their source code...

And there's the question how compatible Vanilla Quake II and Quake II Remastered are in terms of network protocol and mods. Since YQ2 need to stay compatible with Vanilla, it might be impossible to dully support Quake II Remaster.

@0lvin
Copy link
Contributor

0lvin commented Aug 10, 2023

Custom maps designed for the PC versions of the original Quake II should still work with the enhanced release of the game.

It could be that in opposite directions it will be possible, new game library could have same API as old one, and yquake2 could load new game.dll on windows.

But in same time I don't see mention of Linux and freebsd in release notes.

@OpenRift412
Copy link

OpenRift412 commented Aug 10, 2023

It would be easier if they release their source code...

Well we do have this, luckily: https://github.com/id-Software/quake2-rerelease-dll

Do you think this would make things more feasible?

@Yamagi
Copy link
Member

Yamagi commented Aug 10, 2023

That's really cool. Even better is that they finally released the unaltered source code of the addons under GPL2. Until now the addons were under the crappy SDK License, which wasn't really an open source license and made it impossible to distribute them together with the client. I need to ponder if relicensing our versions is possible.

The rerelease of Quake II uses a new version of the API to communicate between the server & the game module. It also introduces a very thin "client game" module, akin to Quake III Arena's cgame module, to allow for extended modding opportunities that change previously hardcoded client behavior. It also has a new network protocol, version 2023.

It won't "just work", because YQ2 doesn't support this new API version. But with the extensible documentation (many thanks to Nightdive Studios, that's much better than just a source code dump!) it should be possible to implement the changes in YQ2 or maybe separate YQ2 Remastered branch.

I'm currently moving to a new home and don't have much time. This could be a nice project for long winter nights.

@OpenRift412
Copy link

That's really cool. Even better is that they finally released the unaltered source code of the addons under GPL2. Until now the addons were under the crappy SDK License, which wasn't really an open source license and made it impossible to distribute them together with the client. I need to ponder if relicensing our versions is possible.

The rerelease of Quake II uses a new version of the API to communicate between the server & the game module. It also introduces a very thin "client game" module, akin to Quake III Arena's cgame module, to allow for extended modding opportunities that change previously hardcoded client behavior. It also has a new network protocol, version 2023.

It won't "just work", because YQ2 doesn't support this new API version. But with the extensible documentation (many thanks to Nightdive Studios, that's much better than just a source code dump!) it should be possible to implement the changes in YQ2 or maybe separate YQ2 Remastered branch.

I'm currently moving to a new home and don't have much time. This could be a nice project for long winter nights.

Understood. I myself am looking into separating the new expansion and Quake II 64 into separate PAK files, see if I can somehow get them working standalone.

@d10sfan
Copy link
Author

d10sfan commented Aug 10, 2023

That'd be interesting to see if the new expansions could be playable that way. I did attempt to extract the pak and load the map, although there were alot of broken textures, possibly the wrong format? To get the game to load, I extracted the pak to a fresh baseq2 and then copied the original paks along so the original assets were still there for use.

For example, if load q64/bio, you'll see the following, along with alot of others:

Couldn't load textures/n64/BLOCK1_5.m8
Couldn't load textures/n64/BLOCK1_5.m8
Couldn't load textures/n64/env/SKY3_1.m8
Couldn't load textures/n64/env/SKY3_1.m8
Couldn't load textures/n64/env/SKY3_1.m8
Couldn't load textures/n64/RFLR2_1.m8
Couldn't load textures/n64/RFLR2_1.m8
Couldn't load textures/n64/RFLR2_1.m8
Couldn't load textures/n64/BLOCK1_5.m8
Couldn't load textures/n64/BLOCK1_5.m8
Couldn't load textures/n64/BLOCK1_5.m8
Couldn't load textures/n64/FIXME.m8
Couldn't load textures/n64/FIXME.m8

Trying to load mgu1m1 gets: ERROR: Map has too many surfaces

@0lvin
Copy link
Contributor

0lvin commented Aug 10, 2023

Error about m8 textures is fine, it's format from heretic2, I suppose it just related to not existed textures with known extensions. So textures are placed in different path or have different format to supported.

@d10sfan
Copy link
Author

d10sfan commented Aug 10, 2023

Yeah it seems the textures the pak has aren't supported or aren't being found correctly, since along with those errors, the map looks like this

image

For reference, the extracted pack looks like this (this is the baseq2 folder):

image

@d10sfan
Copy link
Author

d10sfan commented Aug 10, 2023

It looks like https://www.fteqw.org/ works at least with the q64/bio example, I haven't done any in-depth testing

@CaptainMuskrat
Copy link

This is the beauty of the GPL license. If John Carmack had licensed his work on Quake II permissively (i.e MIT/BSD), then Zenimax could get away with not publishing their changes. But because John had the right mindset at the time, they are forced to do so, lest they risk being sued one day.

Unfortunately, Quake II doesn't seem to have as many source ports as Quake. There really isn't an Ironwail or vkQuake equivilent that can handle the remaster's assets no problem.

@atsb
Copy link

atsb commented Aug 11, 2023

This is the beauty of the GPL license. If John Carmack had licensed his work on Quake II permissively (i.e MIT/BSD), then Zenimax could get away with not publishing their changes. But because John had the right mindset at the time, they are forced to do so, lest they risk being sued one day.

Unfortunately, Quake II doesn't seem to have as many source ports as Quake. There really isn't an Ironwail or vkQuake equivilent that can handle the remaster's assets no problem.

It isn't a GPL2 thing, since Bethesda / MS have the rights to change the license for commercial purposes, which is why we don't have the source for the actual engine. The Quake 2 gamecode is released as GPL2 most likely to support mods on a permissive license (to prevent closed source mods maybe). But without this code, mods would have been impossible, so they kind of 'had' to release this.

@Yamagi
Copy link
Member

Yamagi commented Aug 12, 2023

The remastered version has yet another music track mapping. It shouldn't be too hard to support it since we already have code for two different mappings.

@Bittermens
Copy link

Supporting the remastered game data would be nice. However on very, very first look it seems like the changed a lot of things. Including gamecode changes and alteration to the assets. This might not be easy to implement so don't get your hopes too high. It would be easier if they release their source code...

And there's the question how compatible Vanilla Quake II and Quake II Remastered are in terms of network protocol and mods. Since YQ2 need to stay compatible with Vanilla, it might be impossible to dully support Quake II Remaster.

Fortunately for you sponge answered that on quake discord, you can check with him there and and SVkaiser on twitter if it is to make it compatible with the old stuff

-it is using the original engine, kex is just doing controller support and other stuff
-its based on the xbox 360 port of quake 2, kex engine just wraps the video and input and such
-it is not a remake, its a port

also the old demos work but you see how the old behavior clashes with the new one.
Plus, it seems that it is imperative now to reverse engineer Oblivion dll file off that linux dump file

the remaster really put Q2 into Q1 source port levels when it comes to map sizes and design, i see even the like of alkaline now on Q2, plus the Md5 support paired with md2 is really damn good.

@Bittermens
Copy link

it would be possible to sort it out with nightdive and id devs the retexture scaling code?

Q2R has texture replacement issues for map textures, but monsters everything else are fine.

2320_20230813120732_1
2320_20230813120740_1

@Paril
Copy link

Paril commented Aug 17, 2023

That's really cool. Even better is that they finally released the unaltered source code of the addons under GPL2. Until now the addons were under the crappy SDK License, which wasn't really an open source license and made it impossible to distribute them together with the client. I need to ponder if relicensing our versions is possible.

The rerelease of Quake II uses a new version of the API to communicate between the server & the game module. It also introduces a very thin "client game" module, akin to Quake III Arena's cgame module, to allow for extended modding opportunities that change previously hardcoded client behavior. It also has a new network protocol, version 2023.

It won't "just work", because YQ2 doesn't support this new API version. But with the extensible documentation (many thanks to Nightdive Studios, that's much better than just a source code dump!) it should be possible to implement the changes in YQ2 or maybe separate YQ2 Remastered branch.

I'm currently moving to a new home and don't have much time. This could be a nice project for long winter nights.

You're welcome! I pushed to get the old mission pack sources GPL'd for you guys.
I worked on the re-release, so if you guys have any questions or concerns give me a shout if there's something I forgot to document and I'll get you the info you need.

@mrsteyk
Copy link

mrsteyk commented Aug 17, 2023

Can give my 2 cents on this too, haven't reverse'd that much (I focus on more of a recreation of kex), but SV_Init related stuff got changed slightly, SV_ChooseGamemode is not present as is - after cvar latched_string stuff and svs_init = true, engine checks values of deathmatch and coop variables, prioritising deathmatch over coop. If dedicated is 1 - checks if coop is not 0 - sets deathmatch to one, then goes to set spawncount (calls to randk). Now things start to differ: first it does some checks and sets on maxclients, numsplit, deathmatch and coop (looks similar to the original code after allocations but working on different cvars and separated into a function I called set_mp_convars), after that gets tickrate convar value and checks if ms value is integer, if not - warn the player and clamp it down (no less than 10, no more than 50), also try to clamp if value isn't 30, then set global tickrate value and update convar value if integer value changed. Set tick_second and tick_millisecond global values after. Call Sys_GetGameApi, which calls PreInit at the end (also calls some function at some point which unloads global cgame api and cleans all allocations with tags above or equal 765, currently only Game and Level, I call it CleanCGame_and_Allocs_Level_Game). Then call set_mp_convars again, then Init. Run some sort of NET_Config esque function, allocate client_t of size 386360 (0x5E538), set global maxclients, return.

CGameAPI:
Sys_GetCGameAPI is similar to game counterpart, calls Init at the end. CL_PrepRefresh (the only reference of "weapon.md2") calls it at the very beginning after an if. Many things call into cgame api, like Com_Print you pass to game api (check for developer convar and NotifyMessage(0, str, 0)). Needless to say (auto)save(2) concommands call into it with ClearNotify for every split and NotifyMessage(0, some_typemap_localisation_stuff(some_global_typemap_ref_wrapped, "$g_saving_game"), 0) etc etc etc...
Unload gets called in CleanCGame_and_Allocs_Level_Game, initialising cgameapi, gameapi, CL_Shutdown after setting bool, CL_ClearState before memsetting cl stuff.

P.S. forgot to mention useless fact that if some dword isn't 0 it checks for a version of 2023 when parsing serverdata packet, but then if version is below 2022 - set tickrate to 10 if not then read it, then set sec and msec globals...

@Paril
Copy link

Paril commented Aug 17, 2023

SV_ChooseGamemode is handled by the game DLL now, in a callback named "PreInit". It allows the game DLL to prepare to change any cvars before InitGame is run. The only exception is I forgot to remove the "deathmatch and coop both set" line, that should have been moved to PreInitGame but I forgot. The function you're seeing with regards to maxclients is SV_ClampMaxClients which runs twice in InitGame to make sure the parameters for it are correct.

10, 20 and 40 are the only tickrates supported - 50 is not supported, it will round it down to 40.
The 2023 version thing is checking the server state; it's the "BIG HACK" to load old demos from vanilla.

@atsb
Copy link

atsb commented Aug 18, 2023

That's really cool. Even better is that they finally released the unaltered source code of the addons under GPL2. Until now the addons were under the crappy SDK License, which wasn't really an open source license and made it impossible to distribute them together with the client. I need to ponder if relicensing our versions is possible.

The rerelease of Quake II uses a new version of the API to communicate between the server & the game module. It also introduces a very thin "client game" module, akin to Quake III Arena's cgame module, to allow for extended modding opportunities that change previously hardcoded client behavior. It also has a new network protocol, version 2023.

It won't "just work", because YQ2 doesn't support this new API version. But with the extensible documentation (many thanks to Nightdive Studios, that's much better than just a source code dump!) it should be possible to implement the changes in YQ2 or maybe separate YQ2 Remastered branch.
I'm currently moving to a new home and don't have much time. This could be a nice project for long winter nights.

You're welcome! I pushed to get the old mission pack sources GPL'd for you guys. I worked on the re-release, so if you guys have any questions or concerns give me a shout if there's something I forgot to document and I'll get you the info you need.

That is really cool of you Paril, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

9 participants