Player Destruction Guide

Discussion in 'Tutorials & Resources' started by Egan, Oct 7, 2015.

  1. Egan

    aa Egan

    Messages:
    1,304
    Positive Ratings:
    1,485
    PD - Player Destruction Map Guide


    [​IMG]


    What is Player Destruction?

    Player Destruction is a spin on the Robot Destruction entities which focuses on bringing team objectives to a deathmatch foundation. In this gamemode players will drop flags if they were killed or ‘finished off’ by another player. The objective is to bring these flags to the capturezone to score. Whoever has the most amount of flags on each team is given a dispenser, an outline, and a number above their heads indicating the number of flags they are carrying. The captuezone can be toggled on and off, and in Watergate it scrolls across the map shown on a timer on the HUD.

    Entities needed to set up the gamemode:

    tf_logic_player_destruction
    Name: pd_logic

    logic_auto
    OnMultiNewRound - pd_logic - EnableMaxScoreUpdating
    OnMultiNewRound - pd_logic - DisableMaxScoreUpdating - After 30 seconds

    func_capturezone
    Team: Red
    OnCapTeam1_PD - pd_logic - ScoreRedPoints

    func_capturezone
    Team: Blue
    OnCapTeam2_PD - pd_logic - ScoreBluePoints

    Other things you can do with Player Destruction:

    tf_logic_player_destruction:
    Inputs:
    SetCountdownTimer <integer> Set the countdown time and start the timer.
    SetCountdownImage <string> Set the countdown image.
    SetFlagResetDelay <integer> Set the length of time (in seconds) before a dropped flag resets.
    SetPointsOnPlayerDeath <integer> Set number of points per flag dropped upon player death.
    Outputs:
    OnRedScoreChanged <float> Send when score changes, and is a value representing total progress from [0..1].
    OnBlueScoreChanged <float> Send when score changes, and is a value representing total progress from [0..1].
    OnCountdownTimerExpired Sent when the countdown timer expires.

    Download the prefab:
    http://tf2maps.net/resources/pd-prefab.858/

    Editing the HUD:

    The tf_logic_player_destruction entity includes the keyvalue ‘res_file’ which allows you to set the map up with an edited version of the existing PD HUD.

    [​IMG]

    You can find the existing PD HUD in the tf/tf2_misc_dir.vpk file at:
    resource/UI/HudObjectivePlayerDestruction.res

    To make your own version of this you will first need to make a copy of it and rename it for your map (“ExampleHUD.res”). Then inside add a few lines at the start and type:

    Code:
    #base "HudObjectivePlayerDestruction.res"
    Inside of your map you can put the name of your custom .res file in the logic entity as so:
    resource/UI/ExampleHUD.res

    In your ExampleHUD.res file you can edit anything at all and it will show up in your map. You can change all the icons with custom packaged icons, you can disable any element, you can change the background color of any element, etc.

    Here is the .res file Watergate uses for example:
    Code:
    #base "HudObjectivePlayerDestruction.res"
    
    "Resource/UI/WatergateHUD.res"
    {
        "CarriedContainer"
        {
             "CarriedImage"
             {
                 "image"                                             "../hud/hud_invasion_bottle"
             }           
             "TeamLeaderImage"
             {
                 //"image"                                             "<your image name>"
             }
        }
        "CountdownContainer"
        {
            "Background"
            {
                "image"            "../hud/hud_invasion_greenbg"
                "teambg_2"        "../hud/hud_invasion_greenbg"
                "teambg_3"        "../hud/hud_invasion_greenbg"
            }
            "CountdownImage"
            {
                "xpos"            "117"
                "ypos"            "15"
            }
        }
        "ScoreContainer"
        {
             "ProgressBarContainer"
             {
                 "FlagImageBlue"
                 {
                         "image"                                             "../hud/hud_invasion_bottle"
                         "zpos"            "100"
                 }
                 "FlagImageRed"
                 {
                         "image"                                             "../hud/hud_invasion_bottle"
                         "zpos"            "100"
                 }
             }
        }
    }

    Design Stuff:

    Player Destruction is a mode that opens the door to more dynamic gameplay. It allows you to ‘turn off’ the capturezone and let the potential points build up in the map, before turning back on the capturezone to frantically spit points onto the HUD. It seems to necessitate places around the capturezone for teams to push and pull out of, rather than always fighting for the capturezone itself. Chasing after the team leaders (who have the most amount of points) when the capturezone was closed resulted in some of the most fun moments.

    Watergate is a map with a layout like Hightower - a wider map that lets combat manifest at more places to give the map a more hectic pace, however this means that there is less teamplay because players can be farther apart from each other. In this sense it may be worth looking into a less wide layout like Viaduct that has teammates closer more often (teamplay in Watergate was a bit of an issue unless it came from some other source - like a veteran on the microphone).

    In previous versions of Watergate I had a control point at the top of the tower that spawned extra pickups to the team that controlled it. This was really good for leading the players who weren’t good at deathmatch somewhere to feel like they could help their team, however it became the best option for all players including the team leaders which nullified the importance of holding any other section of the map - hence its removal. The focus on a dynamic objective means that holding points can manifest anywhere making combat feel fresh often.

    June 2016 - Egan:
    I tested a pd_cuisine back in January 2016's 72hour jam which featured two capturezones at either end of the map. The idea came from complaints in Watergate where if you died while holding lots pickups then your killer would pick up all your loot and immediately go to score them, which was frustrating. I thought that if the capturezone for the enemy team was in your base that would mean the enemy might kill you, take your pickups near their side of the map, but would bring it back to your side giving you a second chance to stop them.

    The problem with this style of gameplay, we found, was that teams were then naturally not going to be in the same place fighting over the same objective for very long. Players did not feel obligated to stay and defend their home capturezone because the next logical step of killing the attackers is to pick up their loot and head all the way over to their base. This gave the map a very 'all over the place' feeling, unlike Watergate's beam that had both teams jumping into the same location both trying to capture points there.

    An idea maybe could be having just one capture point still, but make it mobile, moving close to a team that had the least amount of points scored, similar to YM's koth_tug.


    FAQ:

    Can I add new elements to the HUD?
    While I haven’t tested yet, I’d suspect no because these things are implemented by the game code - you can hide them, move them around, or modify them some other way, but you can’t create new elements.

    What do I use to edit the HUD .res file?
    You can use Notepad++ or anything similar ( https://notepad-plus-plus.org/ ).

    Where do the paths “../hud/ammo” go to?
    Those go to /tf/materials/HUD

    Why is my custom HUD invisible?
    If you are using a custom .res file for the HUD in your PD map and have already packed it into the map then it might appear invisible for you - in which case you would have to rename the .res file in your ui folder with an underscore at the end just to not interfere with the game stuff. If you haven’t packed it into the map then you may want to make sure the filenames are set up correctly in the PD entity and in the header of the .res file itself.

    --

    Post any questions below and I can add them to the FAQ.
     
    • Thanks Thanks x 18
    Last edited: Jul 8, 2017
  2. Vel0city

    aa Vel0city func_fish

    Messages:
    1,900
    Positive Ratings:
    1,512
    Who did the voice acting on the map? Because that could be better. Like, a LOT better.

    THEE EN-AH-MEE IZ IN THUH BEEM!

    Also, being in the beam is sort of a death sentence. You can't do anything while moving up and you're just target practice for everybody else.
     
  3. SC PL

    aa SC PL local shitposter

    Messages:
    380
    Positive Ratings:
    399
    Sounds awesome I mean nice guide man!
     
    Last edited: Aug 11, 2016
  4. tyler

    aa tyler snail prince, master of a ruined tower

    Messages:
    5,032
    Positive Ratings:
    3,978
    It's voice to text, and if you dislike the beam, make a better implementation! You can now, without plugins!
     
    • Thanks Thanks x 1
  5. Tuaam

    Tuaam L6: Sharp Member

    Messages:
    326
    Positive Ratings:
    185
    Nice.
     
  6. Pocket

    aa Pocket func_croc

    Messages:
    4,489
    Positive Ratings:
    2,215
    Yeah I really wish Valve had at least taken the time to get new Administrator lines for that. They're the ones who replaced the piles of money with beer bottles, right? And possibly added the mechanic where you deliver them to the UFO by standing in the beam? I think I missed the last couple releases of Watergate.
     
  7. Bakscratch

    aa Bakscratch Finisher of Maps

    Messages:
    680
    Positive Ratings:
    1,166
    Nope, The cash hasn't been in it for a while. Valve only only came in like a week before the update (date that it originally was) to work on the game mode. All they did was turn the source mod into the game code.
     
  8. saph

    saph L4: Comfortable Member

    Messages:
    163
    Positive Ratings:
    280
    Is it possible to trigger a logic_relay with an output of Score[Red/Blue]Points <IntValue> to add points to the corresponding team's score?
     
  9. killohurtz

    aa killohurtz Distinction in Applied Carving

    Messages:
    1,003
    Positive Ratings:
    1,152
    Technically, yes, it should be possible. But let me take this opportunity to share a bit of info that might apply to anyone who's altering the gamemode:

    No matter what you're doing with the ents, in order to use ScoreRedPoints and ScoreBluPoints, you must send EnableMaxScoreUpdating and DisableMaxScoreUpdating to the tf_logic_player_destruction entity first. If you don't intend to use the score updating functionality, just set Points Per Player to 0 and enable/disable score updating over a second or something.

    [​IMG]

    Thanks @Egan for helping me figure this out, I probably should have posted about it sooner. Maybe it could go in the FAQ?

    Edit: I misread your original question; yes, you should be able to send the input from any entity you like, but it does not take a parameter for multiple points, so you'll have to send the input multiple times instead.
     
    • Thanks Thanks x 1
    • Agree Agree x 1
    • Useful Useful x 1
    Last edited: Nov 22, 2015
  10. Simulacron

    Simulacron L6: Sharp Member

    Messages:
    299
    Positive Ratings:
    151
    Is the "OnCapTeam1_PD" right? Mine is red like a wrong Connection and I have only the Option "OnCapTeam1".
     
  11. Nicky

    aa Nicky Lets try something new!

    Messages:
    912
    Positive Ratings:
    1,698
    Yes it is correct
     
  12. Simulacron

    Simulacron L6: Sharp Member

    Messages:
    299
    Positive Ratings:
    151
    ok, thanks
     
  13. Simulacron

    Simulacron L6: Sharp Member

    Messages:
    299
    Positive Ratings:
    151
    I have another question, how can you "kill" the pickups that are droped by the Players? I want to make a deathpit and don't want to have all pickups in it.
     
  14. Nicky

    aa Nicky Lets try something new!

    Messages:
    912
    Positive Ratings:
    1,698
    Don't worry too much about stuff like that. I had some death pits in pd_meme_machine and when people fell in, some of the pickups were stuck in it, they despawn after a little bit.
     
    • Thanks Thanks x 1
  15. Simulacron

    Simulacron L6: Sharp Member

    Messages:
    299
    Positive Ratings:
    151
    Thanks again
     
  16. Egan

    aa Egan

    Messages:
    1,304
    Positive Ratings:
    1,485
    I've added some notes from pd_cuisine into the Design Stuff section. If anyone else who has made a PD map wants to make some design notes like that I can then quote the post and add it to that section. @Yrr @Crash @NickTF
     
    • Thanks Thanks x 1
  17. Beef Bucket

    aa Beef Bucket L41: Blessed Member

    Messages:
    336
    Positive Ratings:
    413
    [Shameless Bump] Would it be possible to make flags manifest themselves within player inventories without having to be picked up? I envisioned a trigger brush that adds flags to whoever is standing inside it over time.
     
  18. Yrr

    aa Yrr An Actual Deer

    Messages:
    986
    Positive Ratings:
    1,882
    2 month late response to egan's post
    i'll probably have more to say about the differences in the "collection" pd variant rapture uses after we finish and try the new mid out, which was not in dev back when you made that post
     
  19. Mikroscopic

    aa Mikroscopic

    Messages:
    597
    Positive Ratings:
    604
    Is it possible to make it so pickups function like normal flags, in that they show on player's backs, and you can only hold one of them at a time?
     
  20. VMan_2002

    VMan_2002 L1: Registered

    Messages:
    2
    Positive Ratings:
    2
    How do I make players score points faster while in the capture zone instead of 1 per second?