[WIP] One Pickup Per Player (aka Serious Sam Style Pickups)

Maps, modifications, add-ons, projects, and other releases for Zandronum. Also includes announcers.
scroton
 
Posts: 63
Joined: Mon Aug 26, 2013 3:33 am

[WIP] One Pickup Per Player (aka Serious Sam Style Pickups)

#1

Post by scroton » Thu Jun 02, 2016 11:01 pm

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
Last edited by scroton on Sun Jun 05, 2016 1:34 am, edited 8 times in total.

User avatar
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)

#2

Post by Combinebobnt » Fri Jun 03, 2016 2:07 am

finally

User avatar
Medicris
Forum Regular
Posts: 614
Joined: Mon Jun 04, 2012 5:29 am

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#3

Post by Medicris » Fri Jun 03, 2016 11:21 am

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.

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

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#4

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

Combinebobnt wrote:finally
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.

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!

Laggy Blazko
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)

#5

Post by Laggy Blazko » Fri Jun 03, 2016 2:03 pm

Well this is definitely great. Thank you very much!

FascistCat
 
Posts: 98
Joined: Mon Jul 20, 2015 12:51 pm

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#6

Post by FascistCat » Fri Jun 03, 2016 4:17 pm

Combinebobnt wrote:finally
^

This mod should change a lot of things in Survival. Tyvm.

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

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#7

Post by scroton » Sat Jun 04, 2016 12:03 am

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.

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

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#8

Post by scroton » Sat Jun 04, 2016 12:55 am

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.

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

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#9

Post by scroton » Sat Jun 04, 2016 1:36 pm

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

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

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#10

Post by scroton » Sat Jun 04, 2016 5:21 pm

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.

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

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#11

Post by scroton » Sun Jun 05, 2016 1:34 am

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.

Bloax
Forum Regular
Posts: 411
Joined: Mon Jun 04, 2012 5:11 pm

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#12

Post by Bloax » Fri Jun 24, 2016 3:59 pm

It works great, come get some.

User avatar
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)

#13

Post by ZZYZX » Tue Jun 28, 2016 3:42 am

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?

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

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#14

Post by scroton » Sat Jul 02, 2016 2:21 am

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?
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.

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.

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

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#15

Post by scroton » Sat Jul 02, 2016 2:43 am

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.

User avatar
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)

#16

Post by StrikerMan780 » Mon Jul 04, 2016 6:33 am

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.

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

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#17

Post by Ivan » Mon Jul 04, 2016 10:34 am

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.

User avatar
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)

#18

Post by ZZYZX » Mon Jul 04, 2016 12:45 pm

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;
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.

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.

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

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#19

Post by Ivan » Mon Jul 04, 2016 1:18 pm

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.

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

[WIP] Re: One Pickup Per Player (aka Serious Sam Style Pickups)

#20

Post by scroton » Tue Jul 05, 2016 1:16 am

StrikerMan780 wrote:I really hope someday something like this can be implemented natively in Zandronum, so weapon mods and the like can work.
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.

Anyone can use this code for anything they want.
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.
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.
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 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.

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.
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.
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.

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.

Post Reply