level.time seems to return wrong values in hubs

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom 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.
Post Reply
User avatar
Player701
 
 
Posts: 1636
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

level.time seems to return wrong values in hubs

Post by Player701 »

This is probably related to the recent "level refactor" changes. One of the symptoms of this issue is that the old method for calculating player's air supply value (player.air_finished - level.time) no longer works correctly in a hub. See the steps below to reproduce the issue.
  1. Load the test file and warp to MAP01.
  2. Type in the console: "give TestInv; use TestInv".
  3. In both GZDoom 3.7.2 and GZDoom g3.8pre-718-g6c91d15b0, the following is printed: "Result = 699".
  4. Go to the red teleporter to enter MAP02.
  5. Type "use TestInv" in the console. In GZDoom 3.7.2, the result is 699 as before, while in GZDoom g3.8pre-718-g6c91d15b0 the value is different (always less than 699).
This means that any mod featuring a custom HUD with an air supply indicator will break when playing a hub in post-3.7.2, if the mod itself is not fixed (level.time needs to be replaced with Level.maptime). It is possible that other problems of similar kind may arise as well under the same circumstances.
Attachments
air_test.pk3
(4 KiB) Downloaded 28 times
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: level.time seems to return wrong values in hubs

Post by Graf Zahl »

Basing these on the hub timer was simply broken, I changed several such things to be based on the map timer. If this breaks some HUDs, I'm sorry, but this change was necessary.
User avatar
Player701
 
 
Posts: 1636
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: level.time seems to return wrong values in hubs

Post by Player701 »

I see. I reported this because backwards compatibility is usually preserved, and when something breaks due to recent changes, it looks like a bug to me. Well, I guess this is yet another reason why I'll have to update my mod again for the new release...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: level.time seems to return wrong values in hubs

Post by Graf Zahl »

Normally, yes, but I cannot leave bugs in the engine just because mods may depend on them. Fortunately there's not so many hub-based mods out there that have underwater areas so the effect of this is rather limited.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: level.time seems to return wrong values in hubs

Post by Blue Shadow »

Graf Zahl wrote:Basing these on the hub timer was simply broken, I changed several such things to be based on the map timer.
Is this change from time to maptime meant to be for specific air-supply-related cases only? Because I see, for instance, BaseStatusBar.GetAirTime() and ACS's GetAirSupply() are still using time instead of maptime.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: level.time seems to return wrong values in hubs

Post by Graf Zahl »

From the looks of it the change was incomplete. Several places still used level.time instead of the more robust level.maptime for checking it.
Post Reply

Return to “Closed Bugs [GZDoom]”