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

[Suggestion] Heretic: support for unique/ dedicated skies for each episode #852

Open
rzhxiii opened this issue Mar 13, 2022 · 4 comments
Open
Labels

Comments

@rzhxiii
Copy link

rzhxiii commented Mar 13, 2022

Background

Version of Crispy Doom: N/a

Operating System and version: N/a

Game: Heretic

Any loaded WADs and mods (please include full command line): N/a

Bug description

Observed behavior: at the moment (correct me if I'm wrong) it's not possible to have unique skies for Heretic E4 and E5 (and E6, technically). It still seems to be hardcoded I guess? Or at least I wasn't able to find any information on this.

Expected behavior: is it possible to support dedicated skies for each episodes (named SKY4, SKY5, SKY6) or is this too big of a deviation/ does this affect demo compatibility?

@fabiangreffrath
Copy link
Owner

The patch is easy and shouldn't be a problem demo-wise, but there is an actual SKY5 texture in the IWAD that would be used then instead of SKY3.

@fabiangreffrath
Copy link
Owner

--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -1835,6 +1835,7 @@ void G_InitNew(skill_t skill, int episode, int map)
 {
     int i;
     int speed;
+    char skyname[6];
     static const char *skyLumpNames[5] = {
         "SKY1", "SKY2", "SKY3", "SKY1", "SKY3"
     };
@@ -1898,6 +1899,12 @@ void G_InitNew(skill_t skill, int episode, int map)
     finalintermission = false;
 
     // Set the sky map
+    M_snprintf(skyname, sizeof(skyname), "SKY%d", episode);
+    if (R_CheckTextureNumForName(skyname) != -1)
+    {
+        skytexture = R_TextureNumForName(skyname);
+    }
+    else
     if (episode > 5)
     {
         skytexture = R_TextureNumForName(DEH_String("SKY1"));

@rzhxiii
Copy link
Author

rzhxiii commented Mar 28, 2022

I finally managed to test this out, not sure if I'm doing something wrong since I'm still learning, but I have created a .WAD with SKY4 and SKY5, added them both to patches and textures and so on.
From my testing, E1 displays SKY1, E2 displays SKY2, E3 displays SKY3 and E4 displays the custom SKY4 properly.
However, for some reason, E5 displays SKY4. not SKY3 or SKY1, I assume this has something to do with the IWAD SKY5 texture, which is just SKY1, and it getting somehow overridden by SKY4, since E4 by default uses SKY1, but I'm not really sure how to fix that.

EDIT: Forgot to save after removing the IWAD SKY5 texture from the PWAD, not every episode displays their respective skies properly, except for "E6". I'm going to keep on testing this out.

@fabiangreffrath
Copy link
Owner

Unfortunately, there is currently no way to check if a specific texture definition comes from a PWAD. That would make things a lot easier.

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

No branches or pull requests

2 participants