[All Versions] IF: Clipping issues in 1st room in 1st level

Moderator: Raze Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
User avatar
mjr4077au
Posts: 830
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

[All Versions] IF: Clipping issues in 1st room in 1st level

Post by mjr4077au »

In the room you start the game in where the explosion takes place, if you strafe into any of the angled walls, you sort of sink down into the ground. It's as if the angled part is some kind of facade, etc.

Not entirely sure what the 'clip map' that loads on initialisation, but perhaps that's not loading right? Issue does not occur in latest upstream build.

Also noted that the initialisation of IF is a lot slower than in EDuke32. Once it compiles CON files and loads the DEF file, the aforementioned clip file load takes excessively long to load, so I wonder if that's part of it also?
User avatar
mjr4077au
Posts: 830
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: [All Versions] IF: Clipping issues in 1st room in 1st le

Post by mjr4077au »

The latest git head doesn't have this issue anymore. One of the upstream cherry picks must have sorted this out :).
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49203
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [All Versions] IF: Clipping issues in 1st room in 1st le

Post by Graf Zahl »

Scary how volatile this is, isn't it? :?
User avatar
mjr4077au
Posts: 830
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: [All Versions] IF: Clipping issues in 1st room in 1st le

Post by mjr4077au »

Yeah it certainly is, feels like a good breeze could blow it over! It has to be c110c1018d14e32a9ef57a11564c09daefd7d9c2 that's fixed it from what I can tell.

I'm still articulating how you would/could redo this cleanly. Both EDuke32 and Redneck are full of if statements to slither in special conditions/hacks. RR is the worst, it's full of functions like these:

Code: Select all

void sub_299C0(void)
{
    dword_A99D8 = 0;
    dword_A99DC = 0;
}

int sub_299D8(void)
{
    if ((int)totalclock - dword_A99D8 >= 30 && buttonMap.ButtonDown(gamefunc_Crouch))
    {
        dword_A99D8 = (int)totalclock;
        dword_A99DC ^= 1;
    }
    return dword_A99DC;
}
Seriously, what the fucking fuck are they and how could they mean anything tangible to anyone else beside the author? :bang:
User avatar
sinisterseed
Posts: 1349
Joined: Tue Nov 05, 2019 6:48 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support

Re: [All Versions] IF: Clipping issues in 1st room in 1st le

Post by sinisterseed »

Welcome to Build wonderland, where hacks and nonsense are at home :D .

Browsing through commits, some of the recent merges that added cleaner implementations of things made it pretty apparent just how much "if" and "else" are loved, noticed like 5 or 6 consecutive that got replaced!
User avatar
Rachael
Posts: 13881
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: [All Versions] IF: Clipping issues in 1st room in 1st le

Post by Rachael »

The naming nomenclature looks like autogenerated functions based on an approximate decompile of the code. My guess is at the time those functions were written (from the decompiled source) it was not known exactly what they did, so the names based on their address offsets remained in place.
User avatar
mjr4077au
Posts: 830
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: [All Versions] IF: Clipping issues in 1st room in 1st le

Post by mjr4077au »

That would make sense given the reverse engineed nature of the game.

I'm a bit green at this, but wouldn't you be best to use the decompiled code to interpret how the game works, then write clean code based on the interpretation?
User avatar
Rachael
Posts: 13881
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: [All Versions] IF: Clipping issues in 1st room in 1st le

Post by Rachael »

Raw decompiled code almost never works, but that also depends on how good your decompiler is, so I would imagine it's a bit of a mix. What works without modification probably gets copy-pasted in and what kicks the compiler out of the loop gets rewritten as closely as possible. If you have debug symbols it makes things even easier because then you have some idea what each function does. (Debug symbols would preserve these function names, it is common practice to strip them for a release to prevent exactly this kind of reverse engineering, and also to save space as well)

Personally I've never done this successfully myself, but I have read some guides on the process and have attempted it with some even older games.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49203
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [All Versions] IF: Clipping issues in 1st room in 1st le

Post by Graf Zahl »

mjr4077au wrote:That would make sense given the reverse engineed nature of the game.

I'm a bit green at this, but wouldn't you be best to use the decompiled code to interpret how the game works, then write clean code based on the interpretation?
Yes, but don't forget that Nuke's overarching goal was not clean code but demo compatible code!
User avatar
mjr4077au
Posts: 830
Joined: Sun Jun 16, 2019 9:17 pm
Graphics Processor: nVidia with Vulkan support
Location: Gosford NSW, Australia

Re: [All Versions] IF: Clipping issues in 1st room in 1st le

Post by mjr4077au »

Graf Zahl wrote:
mjr4077au wrote:That would make sense given the reverse engineed nature of the game.

I'm a bit green at this, but wouldn't you be best to use the decompiled code to interpret how the game works, then write clean code based on the interpretation?
Yes, but don't forget that Nuke's overarching goal was not clean code but demo compatible code!
pDwWl8d.jpg
You do not have the required permissions to view the files attached to this post.

Return to “Closed Bugs [Raze]”