Curious About 5CP Timers

Discussion in 'Team Fortress 2 Talk' started by a_sock, Apr 12, 2018.

  1. a_sock

    a_sock L1: Registered

    Messages:
    3
    Positive Ratings:
    0
    I want to experiment with the capture point timer but have no knowledge of how to do it.
    For example:
    • Can I make it change the status/ownership of multiple control points upon reaching zero, instead of having it restart the match?
    • Can I make it so that if team A captures a point, no time gets added to the timer but if team B captures a point X minutes get added?
    I have been thinking about tweaking various aspects of 5CP to reduce the frequency of stalemates but unfortunately don't have any knowledge regarding implementing and testing these ideas.
    If you could point me in the right direction, or better yet, know or are someone who could help me figure out a way to really test what I have thought up, I would really appreciate if you could talk to me.

    Thanks in advance
     
  2. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    699
    Positive Ratings:
    480
    Yes and yes. All of that is controlled by custom logic. Time getting added to the timer is controlled by an output from the control point, so simply modifying the output/CP logic to get different times added for different CPs and different teams. The round ending when the timer hits zero is also controlled by an output, from the timer to a game_round_win entity. Modifying this output will allow you to change what happens when the timer hits zero.
     
    • Thanks Thanks x 1
  3. a_sock

    a_sock L1: Registered

    Messages:
    3
    Positive Ratings:
    0
    Thank you for the quick reply!
    It sounds to me as if I could actually make all these mentioned changes by simply firing up hammer myself (for the first time) and playing around with pre-existing logic. Awesome!

    I am worried that the next category of changes I want to test may not be as simple to implement:
    • Is there a way to change how teams score points i.e. make CP captures add up to a team total, with different control points being worth different amounts of points?
    • Can I specify multiple win scenarios based on a score total? To clarify: The idea is to grant a team the victory as soon as it has reached a score target AND then continued to capture it's opponent's last.
      Since that can theoretically take an inifinite amount of time, there is supposed to be a score CAP. The team who reaches that cap first, wins no matter what.
    I have been theorising about 5CP changes for many months now and decided it's finally time to start testing. I am glad that TF2Maps.net is as helpful of a community as I have hoped.
    Thank you for helping me.
     
  4. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    699
    Positive Ratings:
    480
    Under the team_control_point_master entity, setting the scoring style to "Add team score for each captured point" should do it, if that's not already what it's set to. Unfortunately, AFAIK there is not a way to set a different point value for each control point.

    Yes. For a conditional win scenario, such as the one you described above where you need to meet a certain condition and then perform an action to win, you'd use a logic_relay set up to fire the win input to a game_round_win entity when triggered. Set the logic_relay to start disabled (unless the win condition is already met at the start of each round), enable it when the win condition is met (a certain number of points being reached), and if applicable, disable it if the win condition is no longer met. Trigger the relay when the win action is performed (capturing the final control point). If the win condition has been met and the relay is enabled, the team will win. If the win condition has not been met, nothing will happen because the relay is disabled and therefore can't be triggered. Note that you'll need to set the Restrict Team from Winning keyvalue to Both to prevent teams from winning automatically when they cap last. Unfortunately, there is no way to detect the number of points a team has. Fortunately, we can overcome this.

    math_counter is an entity that stores a value that can be adjusted via inputs. It can be used for many things; in this case, we can use it to track points behind-the-scenes. Simply create two counters (one per team), and set up each control point to fire the Add input when it is captured to add 1 point to the proper team's counter. To detect when a team has reached a certain point value, we would ordinarily set a maximum value and use the OnHitMax output; however, you want to continue tracking points so that you can have a score cap upon which a team wins immediately, so we'll be using the max value method to detect that. Set the maximum value to your score cap and fire OnHitMax to the win entity. To detect when a team has reached the score condition, we'll need a logic_compare. Set the compare value to the min point value. Fire the OutValue output from the counter to the SetValueCompare input on the comparer. Leave the parameter field alone to automatically pass the counter's value as the parameter. In the comparer, the OnEqualTo output will fire to enable the win condition relay. Note that you'll need to duplicate all this logic for the other team.

    Now, about your idea itself. I don't think it will work as well as you want it to. What happens if a team hasn't met the required number of points and captures the final CP? Now they're holding all CPs, so they can't cap any more, and they have to purposely let Blu cap some points so they can retake them and score more points until they reach the required number. Having a score cap seems like a neat idea to prevent stalemates (in addition to the timer), but a score requirement to win seems like it would be weird, especially if there was nothing to explain how this score requirement works.
     
    • Thanks Thanks x 1
  5. a_sock

    a_sock L1: Registered

    Messages:
    3
    Positive Ratings:
    0
    Thank you again for the quick and very detailed reply.
    It's exciting to see that manifesting my ideas might be doable.
    Regarding your concerns: I believe I might have been unclear with my terminology. I intend to let teams score points through capping CPs across one or multiple rounds (capturing last yields the highest score and starts a new round).
    Winning a round therefore does not necessarily complete the match, it just moves 1 team closer to the score target.
    If the team has already reached said target, it'll win of course.
    Since a team might surpass the score target but be unable to capture Last, reaching the score cap will make that team win regardless.

    I hope that tracking score like this across multiple rounds wouldn't be an issue.

    You are correct in saying that a timer is needed, I have developed what I call an "Engagement Based Timer" that will redistribute CP control upon running out to the previously defending team. It also guarantees that teams will gain score at a certain pace.

    Now, from what I have gathered from your response to my last post, the scores would be invisible to the players.

    • How hard would it be to draw the number of points each team has onto the HUD?
    • Wouldn't it be possible to set up the inputs for the math_counter entity to different values for different CPs and make e.g. Lasts worth more points than Mid that way?

    It's great to talk to someone knowledgeable about this, I really appreciate you taking the time to write these answers.

    If you are interested in all of my ideas, I have written well above 20 pages about 5CP's flaws and ideas to overcome them. The documents are still in development but I am always looking for people to discuss them with, so if you are interested, I would gladly make them accessible to you.

    Thank you again for your help.
     
  6. Da Spud Lord

    aa Da Spud Lord L0: Crappy Member

    Messages:
    699
    Positive Ratings:
    480
    Pretty easy, actually. You'll need a different entity for each different point value up to the max and each team, but just hook them up to a logic_case that looks at the value of the counter and picks the appropriate text entity to display. Make sure the display time is set to ridiculously long, and that each team's entities are on different channels (but all the entities for the same team are on the same channel, so picking a new one will overwrite any others for the same team but not for the other team). You can also position the text anywhere on the screen, so pick a position off to the side that won't cover/be covered by any other HUD elements.

    Yes, definitely, since the outputs have to be defined separately for each control point, each output can be unique. In fact, you could have different point values per team on a single control point.
     
    • Thanks Thanks x 1
    Last edited: Apr 18, 2018