[WIP] One Pickup Per Player (aka Serious Sam Style Pickups)
[WIP] One Pickup Per Player (aka Serious Sam Style Pickups)
ONE PICKUP PER PLAYER (OPPP)
aka "SERIOUS SAM STYLE PICKUPS (SSSP)"
https://drive.google.com/file/d/0BxbbtK ... sp=sharing
It's also up on BestEver as "oppp_v0.04.pk3"
http://www.[bad site]/download?file=oppp_v0.04.pk3
This mod adds per-player pickups for all vanilla Doom items which only they can see for each and every vanilla pickup. Including ones dropped by enemies.
Won't be compatible with weapon mods, but doesn't change monsters so should work with any monster replacements.
Use with Coop or Coop Survival. Tested in Both.
It should work regardless of whether item respawn and weapon stay are on or off, with them not having any effect on it either way. Turn them off if you experience issues.
There is also now a version that allows you to use a puked script (default "L" key) while spectating to change what items you view to one of a player that is currently in the game, so that you can see the items that they see.
The puked script does cause a slight bit of lag when used, however, so it has an 8 second timer global for all players.
This version would probably be best to use when playing with friends, or in a passworded server, and not so much playing in a public server where people might try to use the puke to cause lag at an inopportune moment and kill you.
https://drive.google.com/file/d/0BxbbtK ... sp=sharing
It's also up on BestEver as "OPPP_spec_v0.02.pk3"
http://www.[bad site]/download?file= ... _v0.02.pk3
Feel free to use the code for this for anything.
For those wanting to use this to have similar pickups for their favorite mod: all you need to do is modify the ******_Pickup_00 actor at the top of each decorate file, for instance "Backpack_Pickup_00" to look the way it should in the "CanSee" state, and have the normal custominventory pickup checks starting from the "PickupSuccess", eg treat "PickupSuccess" as if it was the "Pickup" state in a normal pickup. You'd also need to edit the actor to have the pickup message and pickup sound you want. Note that you only need to know decorate to do this; no knowledge of acs is required!
CREDITS:
ijon tichy
--Helped troubleshoot 2 years ago, when I didn't know what ConsolePlayerNumber() was or how playernumber persistence worked.
--Helped troubleshoot recently when I was using acs_executewithresult instead of acs_executealways.
--Made the Samsara slot pickups which intentionally desync, the method which these copy and which I wouldn't know was possible if not for them.
Bloax
--Testing
Medicris
--Testing
BestEver
--Hosting of test servers
aka "SERIOUS SAM STYLE PICKUPS (SSSP)"
https://drive.google.com/file/d/0BxbbtK ... sp=sharing
It's also up on BestEver as "oppp_v0.04.pk3"
http://www.[bad site]/download?file=oppp_v0.04.pk3
This mod adds per-player pickups for all vanilla Doom items which only they can see for each and every vanilla pickup. Including ones dropped by enemies.
Won't be compatible with weapon mods, but doesn't change monsters so should work with any monster replacements.
Use with Coop or Coop Survival. Tested in Both.
It should work regardless of whether item respawn and weapon stay are on or off, with them not having any effect on it either way. Turn them off if you experience issues.
There is also now a version that allows you to use a puked script (default "L" key) while spectating to change what items you view to one of a player that is currently in the game, so that you can see the items that they see.
The puked script does cause a slight bit of lag when used, however, so it has an 8 second timer global for all players.
This version would probably be best to use when playing with friends, or in a passworded server, and not so much playing in a public server where people might try to use the puke to cause lag at an inopportune moment and kill you.
https://drive.google.com/file/d/0BxbbtK ... sp=sharing
It's also up on BestEver as "OPPP_spec_v0.02.pk3"
http://www.[bad site]/download?file= ... _v0.02.pk3
Feel free to use the code for this for anything.
For those wanting to use this to have similar pickups for their favorite mod: all you need to do is modify the ******_Pickup_00 actor at the top of each decorate file, for instance "Backpack_Pickup_00" to look the way it should in the "CanSee" state, and have the normal custominventory pickup checks starting from the "PickupSuccess", eg treat "PickupSuccess" as if it was the "Pickup" state in a normal pickup. You'd also need to edit the actor to have the pickup message and pickup sound you want. Note that you only need to know decorate to do this; no knowledge of acs is required!
CREDITS:
ijon tichy
--Helped troubleshoot 2 years ago, when I didn't know what ConsolePlayerNumber() was or how playernumber persistence worked.
--Helped troubleshoot recently when I was using acs_executewithresult instead of acs_executealways.
--Made the Samsara slot pickups which intentionally desync, the method which these copy and which I wouldn't know was possible if not for them.
Bloax
--Testing
Medicris
--Testing
BestEver
--Hosting of test servers
Last edited by scroton on Sun Jun 05, 2016 1:34 am, edited 8 times in total.
- Combinebobnt
- Retired Staff / Community Team Member
- Posts: 1893
- Joined: Mon Jun 04, 2012 3:37 am
- Location: Erth
- Contact:
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
So yeah this is great. No more baddies hoarding all the health and ammo then walking into cyb rockets. That alone should make it mandatory on surv.
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
I would have had this up in 2014, if I had known much of anything about acs or clientside scripting back then, but I didn't, and it took me this long to get back to taking another crack at it.Combinebobnt wrote:finally
Also updated OP with the fact that this is on BestEver.
Thinking about adding cvars for each category (health, ammo, armor) that control each category's pickup amount, and also thinking about adding a cvar that divides the pickup total by the number of players currently in game (not at start of game, but currently in game at time of pickup.) Thoughts/any other feature requests?
Also updated OP with section for those wanting to adapt this to their favorite mod. Note that you only need to know decorate to do this, no acs knowledge required!
-
- Forum Regular
- Posts: 296
- Joined: Tue Jun 05, 2012 3:00 pm
- Location: Heck no
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
Well this is definitely great. Thank you very much!
-
- Posts: 98
- Joined: Mon Jul 20, 2015 12:51 pm
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
^Combinebobnt wrote:finally
This mod should change a lot of things in Survival. Tyvm.
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
Updated OP with version that allows you to use a puked script (default "L" key) while spectating to change what items you view to one of a player that is currently in the game, so that you can see the items that they see.
The puked script does cause a slight bit of lag when used, however, so it has an 8 second timer global for all players.
This version would probably be best to use when playing with friends, or in a passworded server, and not so much playing in a public server where people might try to use the puke to cause lag at an inopportune moment and kill you.
The puked script does cause a slight bit of lag when used, however, so it has an 8 second timer global for all players.
This version would probably be best to use when playing with friends, or in a passworded server, and not so much playing in a public server where people might try to use the puke to cause lag at an inopportune moment and kill you.
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
Updated with version that should work regardless of whether item respawn and weapon stay are on or off, with them not having any effect on it either way. Turn them off if you experience issues.
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
Here is a test version which should have slightly better performance both in survival and coop, as it has items that should be doing nothing doing a better job of doing nothing, and items that check for new players (in coop) now only do so when new players connect rather than regularly.
Not putting in OP yet because I don't have the time to test this yet other than in an offline skirmish.
Regular version:
https://drive.google.com/file/d/0BxbbtK ... sp=sharing
It's also up on BestEver as "oppp_v0.03.pk3"
http://www.[bad site]/download?file=oppp_v0.03.pk3
Spectating version:
https://drive.google.com/file/d/0BxbbtK ... sp=sharing
It's also up on BestEver as "OPPP_spec_v0.03.pk3"
http://www.[bad site]/download?file= ... _v0.03.pk3
Not putting in OP yet because I don't have the time to test this yet other than in an offline skirmish.
Regular version:
https://drive.google.com/file/d/0BxbbtK ... sp=sharing
It's also up on BestEver as "oppp_v0.03.pk3"
http://www.[bad site]/download?file=oppp_v0.03.pk3
Spectating version:
https://drive.google.com/file/d/0BxbbtK ... sp=sharing
It's also up on BestEver as "OPPP_spec_v0.03.pk3"
http://www.[bad site]/download?file= ... _v0.03.pk3
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
I just realized I forgot to have global array cleanup at map end in spec version and test version; non spec version in OP is okay. That will be in next version. Also delay during loop to spawn item during coop enter script will be added. Also inventory jumps where possible to reduce acs calls. Also in spec version track which items to which player since no need to state change all, and puked script will call client side acs for each state change item so fake console change only affects the player that requested it.
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
New regular version is up. Performance for it has been increased.
Now pickups use clientside inventory jumps instead of running the script again every time a player runs over them to determine whether they should be seen or not.
Global array has proper cleanup at map end.
Spawner actors themselves now never check if a new player has entered the map in coop. Instead, in coop an open script runs and determines if any new players have entered the map, and if so sets all spawner actors to the state where they spawn items. This state setting has been set to take place over 8+(longer the more items there are) seconds so that any effects on server are minimized.
OP has been updated.
Now pickups use clientside inventory jumps instead of running the script again every time a player runs over them to determine whether they should be seen or not.
Global array has proper cleanup at map end.
Spawner actors themselves now never check if a new player has entered the map in coop. Instead, in coop an open script runs and determines if any new players have entered the map, and if so sets all spawner actors to the state where they spawn items. This state setting has been set to take place over 8+(longer the more items there are) seconds so that any effects on server are minimized.
OP has been updated.
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
It works great, come get some.
- ZZYZX
- Posts a lot
- Posts: 742
- Joined: Thu Jun 07, 2012 5:56 pm
- Location: Ukraine
- Clan: A3
- Clan Tag: [A3]
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
64 actors per pickup seem... thoughtless. Can't you just spawn 64 instances of the same class and set damage for each via APROP_Damage? Or it won't get synchronized? (hint: use inventory items then, their count always gets synchronized to the client)
Anyway the question is, are you sure that this horrible mess can't be reduced to one actor per pickup?
Anyway the question is, are you sure that this horrible mess can't be reduced to one actor per pickup?
quality DoomExplorer hackeringFilystyn wrote:Do you know what windows.h is? It's D, DWORD.
overcomplicated ZDoom grenade
random Doom things
GZDoomBuilder-Bugfix
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
It requires 64 actors per pickup. Not all of them are spawned though, just for the players in game or when a new player enters the game.ZZYZX wrote:64 actors per pickup seem... thoughtless. Can't you just spawn 64 instances of the same class and set damage for each via APROP_Damage? Or it won't get synchronized? (hint: use inventory items then, their count always gets synchronized to the client)
Anyway the question is, are you sure that this horrible mess can't be reduced to one actor per pickup?
The damage is there because it's an easy 1 line property that, as you said, gets synced. But it's not the reason for there being 64 actors.
The 64 actors are required because of the 64 different arguments passed to the pickup script, which is compared to player number during pickup. The reason this is required is because you cannot reference the custominventory actor in the pickup state; it's called from the player actor, so any properties reference the player, not the custominventory actor.
I would have done this a different way, if possible.
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
Also, when I am less busy the spec version will be getting an update so that it doesn't reset all inventory items to the state that determines if they are seen, but only those relevant to the player puking the script.
I will probably also post a more thorough explanation of modifying this for use with other projects at that time.
After that, this project is complete.
I will probably also post a more thorough explanation of modifying this for use with other projects at that time.
After that, this project is complete.
- StrikerMan780
- Forum Regular
- Posts: 279
- Joined: Tue May 29, 2012 9:16 pm
- Clan: Shadow Mavericks
- Clan Tag: [SM]
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
I really hope someday something like this can be implemented natively in Zandronum, so weapon mods and the like can work.
Either way, good work.
Either way, good work.
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
Well someone finally did what I did for DnD's health kits, just, for all items. That's some dedication. I used a similar method (if not the same) for those as well so I know how hard it is to make it.
- ZZYZX
- Posts a lot
- Posts: 742
- Joined: Thu Jun 07, 2012 5:56 pm
- Location: Ukraine
- Clan: A3
- Clan Tag: [A3]
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
You don't need to reference the custominventory actor in the pickup state. You can use current actor's damage property (http://zdoom.org/wiki/DECORATE_expressions, like ACS_Execute(damage, ...)) and just spawn 64 actors with SpawnSpotFacing(..., 16000) / SetActorProperty(16000, APROP_Damage, [0..63]) instead of having to define 64 different classes in DECORATE. Unless I severely misunderstand something.scroton wrote:The 64 actors are required because of the 64 different arguments passed to the pickup script, which is compared to player number during pickup. The reason this is required is because you cannot reference the custominventory actor in the pickup state;
edit: right, nevermind. Didn't realize trying to use "damage" would refer to the player too.
Although I remember using a horrible crutch that wasn't in fact an item pickup at all.
Basically, I've been trying to use a combination of registration script + scripted cubic A_RadiusGive + unregistration script for fake ACS-controlled pickups, where registration script would remember TID (often temporary) of currently active "pickup", unregistration script would clear it, and A_RadiusGive scripts are called immediately on "pickup" (example here http://www.mediafire.com/download/8ltu7 ... epammo.pk3).
This results in pickup-like functionality that still allows you to reference the pickup actor on the map from ACS.
In theory, a perfect finished implementation of my code should require one dummy actor like actor MultiPickup_PlasmaRifle replaces PlasmaRifle {}, with everything else being somehow faked (up to spawning PlasmaRifle pickup on client, resulting in controlled desync).
However, the downside of this, which is also why I've personally given up on finishing it, is that it doesn't get synced online properly (I believe it can be fixed by replacing uservars with something other that isn't used in a pickup actor anyway, like Damage...) and would anyway require to reimplement whole pickup functionality from scratch (clientside log, pickup flash, sound, calling action special on pickup, leaving the actor on map if player already has 100% ammo/health/armor/etc...)
It's nevertheless useful so you might want to look at the code.
quality DoomExplorer hackeringFilystyn wrote:Do you know what windows.h is? It's D, DWORD.
overcomplicated ZDoom grenade
random Doom things
GZDoomBuilder-Bugfix
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
That's nice and all, but I don't think it's worth spending much time thinking about this, because it feels like this is something the port should offer by itself as a dmflag or something. The lack of this is a big thing and let's be honest, it's A LOT easier to do this in the source code level.
[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)
It would be ideal to have this functionality native, but if you want to use this code for a mod you can do that right now--only decorate editing is required and only a little bit at that.StrikerMan780 wrote:I really hope someday something like this can be implemented natively in Zandronum, so weapon mods and the like can work.
Anyone can use this code for anything they want.
For the pickup part it's 64 different actors that have arguments 0-63 sent to a script that compares it to to the player number, and if they match they're picked up. The items are visible or not depending upon a clientside script that compares the actor Damage property to the console player number--basically just ijon tichy's Samsara weapon pickups. The only difference is that the script only runs once and thereafter being visible or not is determined with clientside only inventory item checks.Ivan wrote:Well someone finally did what I did for DnD's health kits, just, for all items. That's some dedication. I used a similar method (if not the same) for those as well so I know how hard it is to make it.
I will take a look at it when I get the chance--right now I'm pretty busy for the next month or so. I've not got the chance to sit down at a real computer for a while now and have been posting (including this post) from my phone. People that I talk to regularly have probably gotten sick of hearing that because I've been "busy for the next month or so" for about four months now.ZZYZX wrote:Although I remember using a horrible crutch that wasn't in fact an item pickup at all.
Basically, I've been trying to use a combination of registration script + scripted cubic A_RadiusGive + unregistration script for fake ACS-controlled pickups, where registration script would remember TID (often temporary) of currently active "pickup", unregistration script would clear it, and A_RadiusGive scripts are called immediately on "pickup" (example here http://www.mediafire.com/download/8ltu7 ... epammo.pk3).
This results in pickup-like functionality that still allows you to reference the pickup actor on the map from ACS.
In theory, a perfect finished implementation of my code should require one dummy actor like actor MultiPickup_PlasmaRifle replaces PlasmaRifle {}, with everything else being somehow faked (up to spawning PlasmaRifle pickup on client, resulting in controlled desync).
However, the downside of this, which is also why I've personally given up on finishing it, is that it doesn't get synced online properly (I believe it can be fixed by replacing uservars with something other that isn't used in a pickup actor anyway, like Damage...) and would anyway require to reimplement whole pickup functionality from scratch (clientside log, pickup flash, sound, calling action special on pickup, leaving the actor on map if player already has 100% ammo/health/armor/etc...)
It's nevertheless useful so you might want to look at the code.
I would also like to look at ijon's fake pickup that he used for his quake 2 backpack, since I'm not sure what the difference in performance would be between the three methods, and different methods might be better depending upon player count.
Ideally this would be a port feature. The only issue I would see is the intentional desyncs for displaying of the items--for current similar things like sv_weaponstay the actors remain visible for all players.Ivan wrote:That's nice and all, but I don't think it's worth spending much time thinking about this, because it feels like this is something the port should offer by itself as a dmflag or something. The lack of this is a big thing and let's be honest, it's A LOT easier to do this in the source code level.
Maybe someone that knows port development better than I do (read: anyone, since I know very little) could weigh in on whether or not this would be a possible feature in the future.