Checking which player spectating player is spectating.

Discuss all aspects related to modding Zandronum here.
scroton
 
Posts: 63
Joined: Mon Aug 26, 2013 3:33 am

Checking which player spectating player is spectating.

#1

Post by scroton » Fri Jun 03, 2016 1:24 pm

Is there any possible way to check which player specifically a spectating or dead spectating player is spectating?

Alternatively, can dead spectating or spectating players puke scripts or do something effectively similar?

What happens to clientside player scripts (like, OPEN CLIENTSIDE) when they die in survival? Do they keep running or immediately terminate?

Thanks for the help all.

User avatar
Sean
IRC Operator
Posts: 982
Joined: Thu Jan 16, 2014 9:09 pm
Location: United Kingdom
Clan: Zandronum
Clan Tag: [Za]
Contact:

Re: Checking which player spectating player is spectating.

#2

Post by Sean » Fri Jun 03, 2016 1:32 pm

scroton wrote:Is there any possible way to check which player specifically a spectating or dead spectating player is spectating?
If you mean you want to find out who a player is coop-spying, then no.
scroton wrote:Alternatively, can dead spectating or spectating players puke scripts or do something effectively similar?
Only CLIENTSIDE (or possibly NET) scripts. They can't manipulate themselves though, as spectators aren't technically players.
<capodecima> i dont say any more word without my loyer jenova

scroton
 
Posts: 63
Joined: Mon Aug 26, 2013 3:33 am

Re: Checking which player spectating player is spectating.

#3

Post by scroton » Fri Jun 03, 2016 1:52 pm

Sean wrote:
scroton wrote:Is there any possible way to check which player specifically a spectating or dead spectating player is spectating?
If you mean you want to find out who a player is coop-spying, then no.
scroton wrote:Alternatively, can dead spectating or spectating players puke scripts or do something effectively similar?
Only CLIENTSIDE (or possibly NET) scripts. They can't manipulate themselves though, as spectators aren't technically players.
Ah, bummer. I was wanting to be able to have coop-spying players see what the player they are spying sees for this since right now they either see pickups that don't get picked up or no pickups, depending upon whether they were spawned before or after they died. The fact that PlayerIsSpectator could return whether players are spectating gave me hope, but I guess it's just a hard limitation.

Thanks for your help.

EDIT: Wait a minute...
Sean wrote:Only CLIENTSIDE (or possibly NET) scripts. They can't manipulate themselves though, as spectators aren't technically players.
I kinda didn't parse this correctly: so dead spectating players CAN puke clientside scripts? This is great, as the only thing I need to do is change a single clientside variable, the pickups check themselves whether they should be seen or not.

EDIT: Got the whole thing working here, thanks again for help in both threads, Sean.

ZzZombo
Forum Regular
Posts: 323
Joined: Mon Jun 11, 2012 12:11 pm
Location: Ravenholm

Re: Checking which player spectating player is spectating.

#4

Post by ZzZombo » Sat Jul 16, 2016 9:46 am

as spectators aren't technically players.
as spectators aren't technically players.
as spectators aren't technically players.
technically
uw0tm8?
QZRcon - Qt-based tool for Zandronum/Skulltag servers!
#grandvoid funny stats

User avatar
SwordGrunt
Forum Regular
Posts: 377
Joined: Thu Jun 07, 2012 8:43 pm

Re: Checking which player spectating player is spectating.

#5

Post by SwordGrunt » Sat Jul 16, 2016 1:21 pm

ZzZombo wrote:
as spectators aren't technically players.
as spectators aren't technically players.
as spectators aren't technically players.
technically
uw0tm8?
Technically, spectators do not have a physical game world actor like players do. So that is entirely correct, as spectators are potential players in the server but not for the game engine.

ZzZombo
Forum Regular
Posts: 323
Joined: Mon Jun 11, 2012 12:11 pm
Location: Ravenholm

Re: Checking which player spectating player is spectating.

#6

Post by ZzZombo » Sat Jul 16, 2016 2:03 pm

They do have everything like normal players do, even a body. It is given special flags like no actor collision, invisible, etc. They could even use items if given by some extraordinary means, like scripts and some bogus routines in the engine, fixed by now.
QZRcon - Qt-based tool for Zandronum/Skulltag servers!
#grandvoid funny stats

User avatar
Ænima
Addicted to Zandronum
Posts: 3579
Joined: Tue Jun 05, 2012 6:12 pm

Re: Checking which player spectating player is spectating.

#7

Post by Ænima » Sat Jul 16, 2016 2:23 pm

ZzZombo wrote:They do have everything like normal players do, even a body. It is given special flags like no actor collision, invisible, etc. They could even use items if given by some extraordinary means, like scripts and some bogus routines in the engine, fixed by now.
^This.

Every spectator has a body, however their bodies are invisible and wait in the spawn room (you can see them on the automap). Their positions are not sync'd on the server so nobody sees them move on the automap except that client themselves.

There was a very old bug in Skulltag where spectators could use items. I made a mod with a portable Partial Invisibility item. If a spec used it, other players would see a partially-visible but unshootable player floating in the air in the spawn area. :p
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
SwordGrunt
Forum Regular
Posts: 377
Joined: Thu Jun 07, 2012 8:43 pm

Re: Checking which player spectating player is spectating.

#8

Post by SwordGrunt » Sat Jul 16, 2016 3:48 pm

Ænima wrote:
ZzZombo wrote:They do have everything like normal players do, even a body. It is given special flags like no actor collision, invisible, etc. They could even use items if given by some extraordinary means, like scripts and some bogus routines in the engine, fixed by now.
^This.

Every spectator has a body, however their bodies are invisible and wait in the spawn room (you can see them on the automap). Their positions are not sync'd on the server so nobody sees them move on the automap except that client themselves.

There was a very old bug in Skulltag where spectators could use items. I made a mod with a portable Partial Invisibility item. If a spec used it, other players would see a partially-visible but unshootable player floating in the air in the spawn area. :p
Yeah I'm aware of the client-side actor thing, which means they don't exist on the server and therefore shouldn't be able to interact with the game at all - I didn't knonw about the item bugs, that's pretty retarded haha.

ZzZombo
Forum Regular
Posts: 323
Joined: Mon Jun 11, 2012 12:11 pm
Location: Ravenholm

Re: Checking which player spectating player is spectating.

#9

Post by ZzZombo » Sat Jul 16, 2016 5:16 pm

THEY ARE PRESENT EVEN ON SERVER. Monsters used to target them under some circumstances, and that's purely a server-side function. Please, don't speak technicalities, if you don't know them.
QZRcon - Qt-based tool for Zandronum/Skulltag servers!
#grandvoid funny stats

User avatar
Slim
Zandrone
Posts: 1112
Joined: Sat Mar 16, 2013 7:11 am
Location: Zero Space
Clan: Can't fit it in here
Clan Tag: -=FSR=-
Contact:

Re: Checking which player spectating player is spectating.

#10

Post by Slim » Sat Jul 16, 2016 5:32 pm

Ænima wrote:
Every spectator has a body, however their bodies are invisible and wait in the spawn room (you can see them on the automap). Their positions are not sync'd on the server so nobody sees them move on the automap except that client themselves.

There was a very old bug in Skulltag where spectators could use items. I made a mod with a portable Partial Invisibility item. If a spec used it, other players would see a partially-visible but unshootable player floating in the air in the spawn area. :p

If cheats are on they can even summon actors (i.e monsters and pickups), I've done it before.
Image

"Your childish antics grow tiring. If you dare to fight me, then I accept your challenge: Anytime, anywhere." - Zero, Megaman X5
Spoiler: Quotes (Open)
5:54 PM - Slim: you're complaining about something so small that
5:54 PM - Lance: so? we do that all the time
5:55 PM - Lance: we're a bunch of losers complaining at a bar minus the bar
Spoiler: Galactus tried evading (Open)
Image

Catastrophe
Retired Staff / Community Team Member
Posts: 2569
Joined: Sat Jun 02, 2012 2:44 am

Re: Checking which player spectating player is spectating.

#11

Post by Catastrophe » Sun Jul 17, 2016 12:16 am

So much wrong here. Spectators are not considered actual players. Meaning their movements are not recorded by the server at all. To everyone else your spectator body is where you initially spawned-in as a spectator. This however doesn't mean the spectator can't communicate with the game, you can still puke scripts, talk, etc, but anything client-sided that you do as a spectator such as noclipping, moving around, coop spying, etc, is all calculated by your own computer and not the server. So to sum it up, spectators are coded in a way so they have as minimal impact to the server as possible.

User avatar
SwordGrunt
Forum Regular
Posts: 377
Joined: Thu Jun 07, 2012 8:43 pm

Re: Checking which player spectating player is spectating.

#12

Post by SwordGrunt » Sun Jul 17, 2016 6:45 am

ZzZombo wrote:THEY ARE PRESENT EVEN ON SERVER. Monsters used to target them under some circumstances, and that's purely a server-side function. Please, don't speak technicalities, if you don't know them.
No need to get upset, sorry if I offended your extensive knowledge of doom technicalities lmfao

The server doesn't keep track of their actions (movement, which is the only action they can take) at all, merely knowing that a player exists - if anything can be done to that player on the server, then it's a bug, as you have mentioned a few, and I find it stupid to consider that as functionality of the game. Obviously they can interact with the server via commands because that's independent of their actor. It's to be expected that some parts of the engine would bug with the spectator code since it's a Zandronum addition to the ZDoom engine, and how many online-only bugs haven't we seen over the years...

ZzZombo
Forum Regular
Posts: 323
Joined: Mon Jun 11, 2012 12:11 pm
Location: Ravenholm

Re: Checking which player spectating player is spectating.

#13

Post by ZzZombo » Sun Jul 17, 2016 4:23 pm

I do not like where this is going, and do not plan on participating in a petty argument after you were proven to be wrong in your claims using technical evidence. Just look at your earlier post:
Technically(!), spectators do not have a physical game world actor like players do. So that is entirely correct, as spectators are potential players in the server but not for the game engine.
that was dispelled right after as an example.
QZRcon - Qt-based tool for Zandronum/Skulltag servers!
#grandvoid funny stats

User avatar
SwordGrunt
Forum Regular
Posts: 377
Joined: Thu Jun 07, 2012 8:43 pm

Re: Checking which player spectating player is spectating.

#14

Post by SwordGrunt » Mon Jul 18, 2016 12:38 am

ZzZombo wrote:I do not like where this is going, and do not plan on participating in a petty argument after you were proven to be wrong in your claims using technical evidence. Just look at your earlier post:
Technically(!), spectators do not have a physical game world actor like players do. So that is entirely correct, as spectators are potential players in the server but not for the game engine.
that was dispelled right after as an example.
Your "technical evidence" is based on engine bugs that either have been or likely will very soon be fixed if they are still present. I can't say I care whether you think you've "proven me wrong" or not. The thread author had his questions answered and it was explained that spectators cannot be physically affected like players because they are ignored by the server. Whether they have their invisible actor or not on the server means nothing because the only interactions that could possibly occur with that actor would be buggy ones that shouldn't be considered ever by a coder with half decent standards as a feature for a project. Apparently none of that matters to you since boosting your ego by "proving me wrong" with "technicalities" is more important than discussing practical Doom editing (which I believe is what this board is for, right?)

User avatar
Ænima
Addicted to Zandronum
Posts: 3579
Joined: Tue Jun 05, 2012 6:12 pm

Re: Checking which player spectating player is spectating.

#15

Post by Ænima » Mon Jul 18, 2016 1:11 am

can everybody clam down


I don't think it's a "bug". It's neither a bug nor intended behavior, honestly. It's just the way things are. Every player in the server has to have a "body" (otherwise you crash, like when you TID_Remove a player). That body is just invisible, non-solid, and unshootable, and unsync'd to the server. (but this is like the thousandth time it's been repeated so...)

I wouldn't dismiss its use in a mod as illegitimate though, Swordgrunt. There may be *some* use for it, like making some kind of fog or other effect in the spawn room where the spectators are, to show you how many reinforcements you'll have in the next survival round.

I don't see the current behavior being "fixed" because there's nothing broken really.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

ZzZombo
Forum Regular
Posts: 323
Joined: Mon Jun 11, 2012 12:11 pm
Location: Ravenholm

Re: Checking which player spectating player is spectating.

#16

Post by ZzZombo » Mon Jul 18, 2016 3:11 am

Look: "Technically, spectators do not have a physical game world actor like players do. So that is entirely correct, as spectators are potential players in the server but not for the game engine". You are saying that from the engine's point of view ("technically"), spectators aren't players, because they do not have a body, except they absolutely are, and DO have one. They are players, but with special characteristics attached to their internal spectator flag, they have everything that normal players do, like the same player_t structures and associated bodies. What you are really trying to say, as stemmed from your following posts, that they aren't players from the point of view of modders. The only real difference between he two is a special boolean flag marking spectators on top of the regular player data. Yes, the real technical difference between them is a single flag. You used the word "technical" incorrectly throughout the entire thread, BTW.
QZRcon - Qt-based tool for Zandronum/Skulltag servers!
#grandvoid funny stats

Konda
Forum Regular
Posts: 487
Joined: Thu Jun 07, 2012 5:22 pm

Re: Checking which player spectating player is spectating.

#17

Post by Konda » Mon Jul 18, 2016 1:45 pm

If you guys can't make up your minds about it, why don't you just refer to the source code or something? lol

User avatar
ibm5155
Addicted to Zandronum
Posts: 1641
Joined: Tue Jun 05, 2012 9:32 pm
Location: Somewhere, over the rainbow

Re: Checking which player spectating player is spectating.

#18

Post by ibm5155 » Mon Jul 18, 2016 1:56 pm

I actually have a script to know if an spectator is coop spying, but it required some changes on the zandronum code.
zdoom team denied it, but I belive it could be implemented under zandronum but I was Always lazzy to request it...

What it does is basically 4 or 5 new functions:
GetMyCameraPosX,GetMyCameraPosY,GetMyCameraPosZ,GetMyCameraAngle.

what it does is it gets the spectator position from the same data that idmypos gets his information, but at one cost, the functions can only be called from clientside scripts, but you can also send the position to the server with requestscrit puke...

Since in zdoom multiplayer land everyone needs to be returning the same value, if the same function return different values to the players, it'll cause an out of sync. (not the case of zandronum).

how do I know if someone is coop-spying? save every spectator x/y/z data into a matrix and compare with your position, if you're 10 units near, then there's a big chance that the specifc player is spectating you...

Here's an old example video that I did with the functions:
phpBB [video]
The [youtube] tag is deprecated, please use the [media] tag
Projects
Cursed Maze: DONE, V2.0
Zombie Horde - ZM09 map update: [3/15/13]
Need help with English? Then you've come to the right place!

<this post is proof of "Decline">

User avatar
Ivan
Addicted to Zandronum
Posts: 2229
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

Re: Checking which player spectating player is spectating.

#19

Post by Ivan » Mon Jul 18, 2016 3:57 pm

I like how an innocent question just caused this thread to turn into a "I KNOW MORE ABOUT THIS GAME ENGINE" thread. Good for you, become a developer and speed things up, or, save your knowledge :)

User avatar
SwordGrunt
Forum Regular
Posts: 377
Joined: Thu Jun 07, 2012 8:43 pm

Re: Checking which player spectating player is spectating.

#20

Post by SwordGrunt » Mon Jul 18, 2016 4:03 pm

ZzZombo wrote:Look: "Technically, spectators do not have a physical game world actor like players do. So that is entirely correct, as spectators are potential players in the server but not for the game engine". You are saying that from the engine's point of view ("technically"), spectators aren't players, because they do not have a body, except they absolutely are, and DO have one. They are players, but with special characteristics attached to their internal spectator flag, they have everything that normal players do, like the same player_t structures and associated bodies. What you are really trying to say, as stemmed from your following posts, that they aren't players from the point of view of modders. The only real difference between he two is a special boolean flag marking spectators on top of the regular player data. Yes, the real technical difference between them is a single flag. You used the word "technical" incorrectly throughout the entire thread, BTW.
Thank you for sharing your superior knowledge of the engine with this forum. The only thing your analysis is missing is the major point that this "single flag" makes them completely different from the players that are physically in the game, you know, the ones that you can see, are solid, are shootable, can use walls, can pick up and use items, can be seen by monsters (obligatory reminder that engine bugs are only that, bugs), can telefrag, are subject to gravity... and, generally, can be interacted with by the physical game world. A single special boolean flag nullifies almost all of the player's other flags, but uh, since what matters here are "technicalities" and not what actually happens in the game, I guess I'm wrong. Stupid me, trying to explain the practical applications of something (modders can't do to spectators 90% of what they can to players) instead of source code knowledge no one could care less about (wow they still have the same body as regular players, even though they're not in the game and can't be physically interacted with at all! "Technically" you're right, so there you go, you have the last word!)
Ivan wrote:I like how an innocent question just caused this thread to turn into a "I KNOW MORE ABOUT THIS GAME ENGINE" thread. Good for you, become a developer and speed things up, or, save your knowledge :)
It's pretty retarded since I've been repeating the same thing over and over (and at this point it's boring me already) and I couldn't care less about the game engine given I actually play the game and speak from there instead of looking up the source code to boost my ego in some bad excuse for a debate. I can't see how the pro technical knowledge of an invisible camera that does nothing but fly around being treated as a player body helps the game at all, but good for those who know it!

Post Reply