[Not a bug] [r2867+] Player class set to random

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

[r2867+] Player class set to random

Postby DBThanatos » Wed Oct 13, 2010 1:33 pm

Tested also with several svn versions up to r2940, with same results.

If you go to player setup, and set the player to an specific type, press esc, and return to player setup, the player will be set to random.

You can test this behavior with hexen. Set player class on the "Player setup", then enter any level through the console, and you'll see the player class will be actually random.

This bug appeared somewhere between r2837 (no issues) and r2867(2869). Sorry I cant narrow it down further, but those are the only ones I have from that period.

Apparently, this was fixed before, but it came back.
User avatar
DBThanatos
Guns, explosions, gore.
 
Joined: 14 Apr 2006
Location: in "the darkness that lurks in our mind"

Re: [r2867+] Player class set to random

Postby Player701 » Thu Oct 14, 2010 4:37 am

OMG. Confirmed.

Setting the class through the console variable "playerclass" works fine, though.
Last edited by Player701 on Wed Nov 10, 2010 1:21 am, edited 1 time in total.
User avatar
Player701
 
Joined: 13 May 2009
Location: Russian Federation
Discord: Player701#8214
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: [r2867+] Player class set to random

Postby Graf Zahl » Wed Nov 03, 2010 5:14 pm

That's because the new menu code doesn't make any permanent settings until you actually start the level.

This was one serious issue with the old code. It set global variables at a time when it wasn't even clear that the selection being made will actually get used. Now the selections of the 'start game' menu chain are stored locally and only applied when the final menu in this chain is terminated and the level being started.

In fact, selecting something in this menu should not have an effect on the player setup screen until a game with the selected player class is started and that's precisely what happens now.


BTW, the link to another bug report is something different.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [r2867+] Player class set to random

Postby DBThanatos » Mon Nov 08, 2010 2:15 pm

So, that means that now we cant rely on the player setup menu to set the class, but actually use the regular player selection screen (like in hexen)? If so, that's fine, but I wonder, in which case the player setup screen (the "player class" part) would come useful if at all?
User avatar
DBThanatos
Guns, explosions, gore.
 
Joined: 14 Apr 2006
Location: in "the darkness that lurks in our mind"

Re: [r2867+] Player class set to random

Postby Enjay » Mon Nov 08, 2010 2:27 pm

Unless I'm missing something, this change does seem to make the ability to change player class on the player setup screen irrelevant. I don't usually change player class mid game so I'm not too familiar with how useful that menu option is and the only time that I have needed to use it is, of course, with AEoD.

If the player setup menu is not longer a suitable place to change the player class, then, IMO, that ability should be removed from that menu. It could, perhaps, still report which player class is active but not allow the class to be changed (seeing as how the change is ignored anyway and set to random instead - that is if my interpretation of what appears to be the current behaviour is correct).
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: [r2867+] Player class set to random

Postby Graf Zahl » Mon Nov 08, 2010 3:20 pm

For single player games in a mod that has a player selection menu, yes. But there's still situations where using that menu makes sense.

Honestly, I think what Grubber made back then was very poorly thought out. The player setup menu should never have been influenced by anything that's done in the single player startup menus. The setting in there should have been for multiplayer and direct console starts only. But it was all mashed together in the same global variables and now, years later, it's no longer possible to clean this up and make it robust.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [r2867+] Player class set to random

Postby Grubber » Wed Nov 17, 2010 8:30 am

Well, what I did then was simply extending what was already there without making too invasive changes. You (or randy, or anyone else) had plenty of time (cca 3 months between the release of 2.0.98x and inclusion of the player class code in r250) to review the code and/or make any necessary changes. You even could throw the code away and don't use it at all. It was your decision, and I never was an official ZDoom developer, so don't blame me.

BTW:
Graf Zahl, in this thread wrote:However, and here lies the problem, Grubber used the 'display'names for purposes other than just displaying them so I have 2 choices now: Either risk breaking a handful of mods or leave it as it is which means that player class displaynames cannot be stringtable references.

You got it wrong. I didn't use displayname, it didn't exist before I added it. The code it evolved from already used it for purposes other than displaying names, before I touched it. What I did wrong was naming the property displayname, it should have been playerclassname or something like that.

I've attached the original patch so you can see for yourself that I didn't change any of the logic (at least not on purpose), just generalized it. Most of the code is actually definition of the new actor properties, addition of the properties to the decorate parser and changes to the menu (and even there I followed the original code as closely as I could).
You do not have the required permissions to view the files attached to this post.
User avatar
Grubber
I can wire anything directly into anything. I am the professor!
 
Joined: 15 Oct 2003
Location: Czech Republic

Re: [r2867+] Player class set to random

Postby Graf Zahl » Wed Nov 17, 2010 9:16 am

Well, I don't really know, how much of that stuff was accessible to modders before the addition - it was too long ago - and I have to admit that back then I did not spot the issue. I only realized its full impact when I did the menu rewrite and ran into problems with the player class selection menu for Hexen. Of course hindsight is always clearer but from today's perspective the system as it is sure shows its problems and if I had to add it today I would make some changes.

Anyway, even if the property was called 'Playername' it would still be the same: The same name is used for internal purposes and for exposition to the player who should not care at all about engine internals. So even if it hadn't been possible to match it to the player's actor class name this should have been 2 separate properties.

I guess there's one lesson to be learned here: Making a feature with the 'least invasive' implementation is not always the best idea (again, isn't hindsight a bitch? ;))
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [r2867+] Player class set to random

Postby Grubber » Wed Nov 17, 2010 9:18 am

It sure is :-)
User avatar
Grubber
I can wire anything directly into anything. I am the professor!
 
Joined: 15 Oct 2003
Location: Czech Republic


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests