MantisBT - Zandronum
View Issue Details
0002649Zandronum[All Projects] Suggestionpublic2016-02-23 16:402018-09-30 21:43
Xsnake 
Dusk 
normaltweakN/A
closedfixed 
MicrosoftWindowsXP/Vista/7
3.0-beta 
3.03.0 
0002649: Extend SetActivator so that 64 players can be addressed
Right now, only AAPTR_PLAYER1 to AAPTR_PLAYER8 can be addressed. It would be nice to have all 64 players addressable that way. This is particularly useful when it comes to dealing with players in ACS without assigning them a TID.
No tags attached.
? setactivatortoplayer.pk3 (1,094) 2017-05-07 20:52
https://zandronum.com/tracker/file_download.php?file_id=2106&type=bug
Issue History
2016-02-23 16:40XsnakeNew Issue
2016-02-23 17:55DuskNote Added: 0014480
2016-02-24 15:29ZzZomboNote Added: 0014490
2016-02-24 17:36DuskNote Added: 0014491
2016-02-24 20:03throwawayNote Added: 0014493
2016-02-25 14:36DuskNote Added: 0014496
2016-02-25 14:43DuskNote Edited: 0014496bug_revision_view_page.php?bugnote_id=14496#r8767
2016-02-25 16:29XsnakeNote Added: 0014497
2016-02-25 18:58DuskNote Added: 0014498
2016-02-25 19:04DuskNote Edited: 0014498bug_revision_view_page.php?bugnote_id=14498#r8769
2016-02-25 19:04DuskAssigned To => Dusk
2016-02-25 19:04DuskStatusnew => needs review
2016-02-25 19:44throwawayNote Added: 0014499
2016-02-25 19:44throwawayNote Edited: 0014499bug_revision_view_page.php?bugnote_id=14499#r8771
2016-02-25 19:48throwawayNote Edited: 0014499bug_revision_view_page.php?bugnote_id=14499#r8772
2016-02-25 19:48throwawayNote Edited: 0014499bug_revision_view_page.php?bugnote_id=14499#r8773
2016-02-25 20:31DuskNote Added: 0014500
2016-06-27 18:18StrikerMan780Note Added: 0015141
2016-06-27 18:19StrikerMan780Note Edited: 0015141bug_revision_view_page.php?bugnote_id=15141#r9183
2016-06-27 18:20StrikerMan780Note Edited: 0015141bug_revision_view_page.php?bugnote_id=15141#r9184
2016-06-27 18:50StrikerMan780Note Edited: 0015141bug_revision_view_page.php?bugnote_id=15141#r9185
2016-06-27 18:51StrikerMan780Note Edited: 0015141bug_revision_view_page.php?bugnote_id=15141#r9186
2016-06-27 18:51StrikerMan780Note Edited: 0015141bug_revision_view_page.php?bugnote_id=15141#r9187
2016-06-28 05:59Torr SamahoNote Added: 0015144
2017-05-07 17:35DuskStatusneeds review => assigned
2017-05-07 17:50DuskNote Added: 0017594
2017-05-07 17:50DuskStatusassigned => needs review
2017-05-07 19:54Torr SamahoNote Added: 0017596
2017-05-07 19:57Torr SamahoStatusneeds review => needs testing
2017-05-07 19:57Torr SamahoTarget Version => 3.0
2017-05-07 20:52DuskFile Added: setactivatortoplayer.pk3
2017-05-19 03:15CombinebobntNote Added: 0017711
2017-05-19 08:16FusedNote Added: 0017713
2017-05-23 09:07XsnakeNote Added: 0017753
2017-06-28 01:46Ru5tK1ngNote Added: 0017947
2017-06-28 01:46Ru5tK1ngStatusneeds testing => resolved
2017-06-28 01:46Ru5tK1ngResolutionopen => fixed
2017-06-28 01:46Ru5tK1ngFixed in Version => 3.0
2018-09-30 21:43Blzut3Statusresolved => closed

Notes
(0014480)
Dusk   
2016-02-23 17:55   
This one has no easy solution. The actor pointer design is rather short-sighted and its design didn't take Zandronum into account at all. This particular case can be easily solved with a SetActivatorToPlayer function but actor pointers are present everywhere so a generic solution would be great for that...
(0014490)
ZzZombo   
2016-02-24 15:29   
HUH?
SetActivator(0,AAPTR_PLAYER1<<PlayerNumber());
(0014491)
Dusk   
2016-02-24 17:36   
And how do you stuff 64 distinct flags into a 32-bit integer?
(0014493)
throwaway   
2016-02-24 20:03   
You could use the highest 8 bits to store players 1 through 64 (up to 256), in addition to the current AAPTR_PLAYER[1-8]. It wouldn't be a simple bit shift anymore or AND check anymore, but it hopefully wouldn't collide with any new actor pointers from ZDoom later on.

Since only one selector from each category is supported, it should work with the other pointers just fine - I'd say ignore AAPTR_PLAYER[1-8] if a last-8-bits player pointer is used.
(0014496)
Dusk   
2016-02-25 14:36   
(edited on: 2016-02-25 14:43)
Actually yeah, I could define the remaining 56 players as composite bits and thus store them in the 0x40-0x2000 space. Of course I'm not going to be storing 56 more enum definitions so I'll have to make a new formula to build these.

EDIT: Actually they don't really look very easily computable. It's easier for me to just generate a table of them.

(0014497)
Xsnake   
2016-02-25 16:29   
After some investigations, I ran into this old pull request :

'https://bitbucket.org/Torr_Samaho/zandronum-old/pull-requests/88/added-aaptr_player_mask-so-that-all-64/diff [^]'

Is there something wrong with the implementation proposed here ?
(0014498)
Dusk   
2016-02-25 18:58   
(edited on: 2016-02-25 19:04)
Yeah, that also exists… I remember that Blzut3 was going to come up with a better solution than that, but he never did. I guess we should roll with it.

'https://bitbucket.org/Torr_Samaho/zandronum/pull-requests/73 [^]'

(0014499)
throwaway   
2016-02-25 19:44   
(edited on: 2016-02-25 19:48)
So would that mean player 1 would be at 0x80000000 and player 64 would be at 0x8000003F, in addition to the ZDoom AAPTR_PLAYER[1-8] selectors? Or would it be 0x80000001 to 0x80000040?

Also, does this mean I could potentially choose player 2147483647?

(0014500)
Dusk   
2016-02-25 20:31   
Yeah, that's how it would be.
(0015141)
StrikerMan780   
2016-06-27 18:18   
(edited on: 2016-06-27 18:51)
Instead of screwing around with and potentially conflicting with changes to the SetActivator flags in ZDoom's future... or if someday Zan supports more than 64 players... how about make a new ACS function: SetActivatorToPlayer(int playernumber)?

That way, stuff like "SetActivatorToPlayer(2);" and "SetActivatorToPlayer(ConsolePlayerNumber());" are possible (which if added, would be incredibly useful for some things).

(0015144)
Torr Samaho   
2016-06-28 05:59   
To me SetActivatorToPlayer sounds like the best solution to this problem so far.
(0017594)
Dusk   
2017-05-07 17:50   
Added'https://bitbucket.org/zandronum/zandronum-sandbox/commits/f2bcd84d0c86 [^]'
(0017596)
Torr Samaho   
2017-05-07 19:54   
We decided to go for SetActivatorToPlayer:'https://bitbucket.org/Torr_Samaho/zandronum/commits/a8afbe737e3015e2faafc0016598a6e627c167f2 [^]'
(0017711)
Combinebobnt   
2017-05-19 03:15   
How do i test this
(0017713)
Fused   
2017-05-19 08:16   
'https://jenkins.csnxs.uk/job/zandronum/24/label=windows/artifact/ZandroDev-3.0-alpha-r170507-1940windows.7z [^]' should have it
(0017753)
Xsnake   
2017-05-23 09:07   
I quickly recompiled a version of my team radar mod (https://zandronum.com/forum/viewtopic.php?t=7018) using the new SetActivatorToPlayer function. It can be found here :'http://xsnake.online.fr/wads/TeamRadar_v4.pk3 [^]'
Seems to be working with bots offline and online, but I could not do the test with actual players.
(0017947)
Ru5tK1ng   
2017-06-28 01:46   
Considering no other issues have been reported, I think your testing is sufficient. Reopen if necessary.