MantisBT - Zandronum | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0003147 | Zandronum | [All Projects] Suggestion | public | 2017-05-28 07:50 | 2017-05-29 21:31 |
Reporter | throwaway | ||||
Assigned To | |||||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | new | Resolution | open | ||
Platform | OS | OS Version | |||
Product Version | 3.0-beta | ||||
Target Version | Fixed in Version | ||||
Summary | 0003147: New ACS function for a monotonic player number | ||||
Description | Right now, I'm struggling with the problem of player numbers potentially referring to a different player than existed at the time the player number was read. For example, if player 0's player number was stored in an ACS array, he disconnected, and a new player filled the spot, that ACS array would now refer to a completely different player. Similarly, a player spectating and rejoining could now be an entirely different player under entirely different circumstances, but the array still points to them. This is easy enough to handle on your own when the issue only pops up in a couple ACS arrays, but it's much harder to handle when the player numbers get scattered everywhere, including in multiple ACS modules and in the inventories of actors (using counter items) with unknown TIDs. This is why I was thinking of a monotonic player number, which would be the amount of times the game had been entered before a given player. For example: - Player 1 joins an empty game that no one has entered yet. His PLN and monotonic PLN are both 0. - Player 2 joins the game. His PLN and monotonic PLN are both 1. - Player 1 disconnects. - Player 3 joins the game. His PLN is 0 since no one's occupying it, but his monotonic PLN is 2, since the game had been entered 2 times before. - Player 2 spectates and rejoins, possibly because he's stuck and the kill command is disabled. His PLN remains 1, but his monotonic PLN is now 3 since the game had been entered 3 times before. This way, a monotonic player number would always refer to a specific player session, or no one. There'd be no chance of carrying over data to a different player session on accident. ZDoom already has this guarantee, as you can't join the game mid-session there, and as such this request makes no sense there. This wouldn't solve every issue, but those issues are mostly related to storing data for each player in ACS, and can be handled with DISCONNECT scripts (or using inventory items) as is. For issues where you merely need to store a player number and want to be sure it won't refer to a different player later on, this would be perfect. | ||||
Steps To Reproduce | |||||
Additional Information | The implementation I was thinking was simply this: - UniquePlayerNumber() - returns the monotonic player number of the activator. - MapUniquePlayerNumber(int upln) - returns the player number associated with a monotonic player number. I would have the monotonic PLN counter reset with ACS global variables. Player numbers are already a massive pain in the ass (if not outright impossible) to keep track of between maps in a hub without mixing up players - monotonic player numbers should be free from that. ZDoom would just make UniquePlayerNumber() an alias for PlayerNumber(), and MapUniquePlayerNumber() an identity function. | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | |||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2017-05-28 07:50 | throwaway | New Issue | |||
2017-05-28 08:06 | Fused | Note Added: 0017770 | |||
2017-05-28 08:12 | throwaway | Note Added: 0017771 | |||
2017-05-28 08:12 | throwaway | Note Edited: 0017771 | bug_revision_view_page.php?bugnote_id=17771#r10662 | ||
2017-05-28 10:50 | Dusk | Note Added: 0017772 | |||
2017-05-28 10:50 | Dusk | Status | new => feedback | ||
2017-05-28 15:28 | Korshun | Note Added: 0017776 | |||
2017-05-28 19:13 | Torr Samaho | Note Added: 0017780 | |||
2017-05-29 20:58 | throwaway | Note Added: 0017789 | |||
2017-05-29 20:58 | throwaway | Status | feedback => new | ||
2017-05-29 21:31 | throwaway | Note Edited: 0017789 | bug_revision_view_page.php?bugnote_id=17789#r10670 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|