Thread: Team vs Team Balancing Tutorial

Results 1 to 2 of 2
  1. #1
    Nutcracker A1win's Avatar  
    Contributor
    Join Date
    Dec 2003
    Location
    Finland
    Posts
    2,246

    Team vs Team Balancing Tutorial

    If you are making a map with one team of monsters and another team of players, and you want them to have the same number of troops, or a relative number, like 1 player = 2 monsters, read this...

    This will only count living players as troops, so if there are 8 players on the server and 5 of them are dead (well they most likely will respawn, though), only 3 monster spawns are activated.

    This is quite advanced tutorial

    1) Plan
    - Consider the maximum number of monsters that will be related to the number of the players. You must think about the entities... One relation will take at least 4 entities. If you have 8 relations, they will take about 30 + 32 entities (It always takes 32 game_counters, regardless of the number of relations) .
    - One relation means the number of players = x times the number of monsters. For example, 1 players = 1 monster is one relation and 2 players = 2 monsters is another relation. If you have 8 players = 8 * 1 monsters, it means 8 relations. If the maximum number of relations is 10, and there are more than 10 living players on the server, the entity system will still think that there are only 10 players alive on the server and will spawn 10 monsters.

    2) info_player_deathmatch
    - Make as many info_player_deathmatch entities as you think is necessary (no more than 32 usually, 16 might be a good amount for most maps)
    - Set their target key to have value "zoner_mm"

    3a) multi_manager "zoner_mm"
    - Make a multi_manager with targetname "zoner_mm"
    - Turn SmartEdit off to add custom keys
    - - Add a key enemies_off with value of "0"
    - - Add a key zoner with value of ".1"

    3b) game_counter_set "zoner_mm"
    - Make a game_counter_set entity with targetname "zoner_mm" (the same name as the multi_manager)
    - Set the target key to "count_players"
    - Leave the New Value key as it is ("0")

    4) game_zone_player "zoner"
    - Make a game_zone_player brush entity somewhere where the players can't with targetname "zoner"
    - Set the key Counter For Out Players to "count_players"

    5) 32 game_counter "count_players" entities
    - Make 32 game_counter entities with targetname "count_players" (All of them must have this name)
    - Edit the first game_counter entity:
    - - Set the target key of the game_counter to "enemies1"
    - - Set the Limit Value key of the game_counter to "1"
    - Edit the second game_counter entity:
    - - Set the target key of the game_counter to "enemies2"
    - - Set the Limit Value key of the game_counter to "2"
    - ...
    - Edit the Nth game counter entity, where N is the number of relations:
    - - Set the target key of the game_counter to "enemiesN" (replace N with the number of relations)
    - - Set the Limit Value key of the game_counter to "N" (replace again)
    - Edit the rest of the game_counter's, from N to 32
    - - Set the target key of the game_counter to "enemiesN" (replace N with the number of relations)
    - - Set the Limit Value key of the game_counter to "N" (replace again)
    (I couldn't test this when I created the system, so I noticed it just now when $ilentSheep told me it bugs when there are more than 8 players (I had 8 maximum relations).

    6) N multi_manager "enemiesN" entities, where N is the number of relations
    - Make a multi_manager entity with targetname "enemies1"
    - Make a multi_manager entity with targetname "enemies2"
    - ...
    - Make a multi_manager entity with targetname "enemiesN", and replace N with the number of relations
    - Edit the multi_manager named "enemies1":
    - - Turn SmartEdit off
    - - Add a key enemy1on
    - Edit the multi_manager named "enemies2":
    - - Turn SmartEdit off
    - - Add a key enemy1on
    - - Add a key enemy2on
    - ...
    - Edit the multi_manager named "enemiesN" (where N is the number of relations):
    - - Turn SmartEdit off
    - - Add a key enemy1on
    - - Add a key enemy2on
    - - ...
    - - Add a key enemyNon (replace N again)

    7) N trigger_relay "enemyNon" entities, where N is the number of relations
    - Make a trigger_relay entity with targetname "enemy1on"
    - Make a trigger_relay entity with targetname "enemy2on"
    - ...
    - Make a trigger_relay entity with targetname "enemyNon" (replace N)
    - Edit the "enemy1on" entity:
    - - Set the key target to "enemy1"
    - - Set the key Trigger State to "ON"
    - Edit the "enemy2on" entity:
    - - Set the key target to "enemy2"
    - - Set the key Trigger State to "ON"
    - ...
    - Edit the "enemyNon" entity (replace N)
    - - Set the key target to "enemyN" (replace N)
    - - Set the key Trigger State to "ON"

    7) N trigger_relay "enemies_off" entities, where N is the number of relations
    - Make N trigger_relay entities with targetname "enemies_off", where N is the number of relations
    - Edit the first trigger_relay entity:
    - - Set the key target to "enemy1"
    - - Set the key Trigger State to "OFF"
    - Edit the second trigger_relay entity:
    - - Set the key target to "enemy2"
    - - Set the key Trigger State to "OFF"
    - ...
    - Edit the Nth trigger_relay entity
    - - Set the key target to "enemyN" (replace N)
    - - Set the key Trigger State to "OFF"

    8) N squadmaker "enemyN" entities (N meaning, surprise surprise, the relations again)
    - Make a squadmaker with targetname "enemy1"
    - If you want the first player to have 2 enemies against him, make another squadmaker that is a copy of the one you just created (and edit these together).
    - You can choose which numbers of players have which monsters against them by customizing the squadmakers and the number of squadmakers
    - Make a squadmaker with targetname "enemy2"
    - ...
    - Make a squadmaker with targetname "enemyN" (replace N)
    - Edit the "enemy1" squadmaker:
    - - Set Monster Type key to whatever you want (that is an existing monster entity, though)
    - - Choose the Grunt/Assassin weapons key value to give them the weapons you want. If you want to find out what are the values for a medic, create a temporary monster_human_medic_ally, choose the weapons, then turn off SmartEdit and check the weapons key value. It is a number - copy it to the squadmaker's weapon key.
    - - Set Monster Count key to "-1" (You can customize this later if you want)
    - - Set Max Live Children key to "1" (This is probably the wisest value here...)
    - - Set Frequency key to "5" (If you want to simulate the spawn delay of players...)
    - - Set Monster Roaming Nodes to "Always" (Add some nodes too, to make the monsters wander around. Players need to see them first, though, before they start wandering)
    - Edit the "enemy2" squadmaker:
    - - Set Monster Type key to whatever you want (that is an existing monster entity, though)
    - - Set Monster Count key to "-1" (You can customize this later if you want)
    - - Set Max Live Children key to "1" (This is probably the wisest value here...)
    - - Set Frequency key to "5" (If you want to simulate the spawn delay of players...)
    - - Set Monster Roaming Nodes to "Always" (Add some nodes too, to make the monsters wander around. Players need to see them first, though, before they start wandering)

    If you did everything as I said, and I didn't make any mistakes here, this should work. I just did a map which is using the idea... I can release the source (.rmf) here if anyone is really interested. Here's the .bsp, at Map Showcase forum: http://www.svencoop.com/forums/showthread.php?p=275080

    Or just wait for 3.5 - Sniper just told me there's an entity in it which makes this useless
    Last edited by A1win; 04-09-2004 at 04:21 PM.

  2. #2
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,478

    Re: Team vs Team Balancing Tutorial

    Very interesting idea and well written

    Just a note for anyone who wants to try this out however, the next version of SC is going to feature an entity called game_player_counter that should make this system a bit easier.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •