Pairs of random spawns

MendaspMendasp I touch maps in inappropriate placesValencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
edited September 2012 in Modding
This mod allows server operators to define a set of valid spawns per tech point, having a controlled set of random spawns depending on the initial Marine Spawn.

I have included configurations for all the official maps avoiding close spawns, you can check the configurations by opening the text files in the maps folder.

Only servers need to download it, it's fully server-side. If no text file is found, the default method will be used.

Readme.txt
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Extract into Natural Selection 2\ns2 folder.

The spawn configurations are controlled by text files with the same name as the map in the maps folder. They're written in JSON, so they should be easy to understand and modify.

If a Tech Point is not in the list, it will not be assigned to any team. The Tech Point names have to match exactly the name from the map ("sub access" is different from "Sub Access"). You can omit the enemy spawn points list ONLY if it's an aliens only Tech Point, otherwise it's always required.<!--c2--></div><!--ec2-->

I'm aware some people might want to make Summit static spawns, to do that you'd need to modify the summit text file so it'd be like this:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->[{
    "name":"Sub Access",
    "team":"marines",
    "enemyspawns": ["Atrium"]
},
{
    "name":"Atrium",
    "team":"aliens"
}]<!--c2--></div><!--ec2-->

<a href="http://www.mendasp.net/stuff/RandomSpawns_v217.zip" target="_blank">Download (Build 217)</a> - Not updated anymore
<a href="http://www.duplexgaming.co.uk/downloads/mods/90/mapper_defined_random_spawns/" target="_blank">Download @ Duplexgaming.co.uk</a>
«1

Comments

  • XariusXarius Join Date: 2003-12-21 Member: 24630Members, Reinforced - Supporter
    I think close spawns generally benefit aliens more than they do marines, due to the alien ability to apply much more pressure while their comm just AFKbuilds. So yeah, sounds like a good mod until they sort the early game balance.
  • ArkantiArkanti pub baddie Join Date: 2011-07-22 Member: 111781Members, NS2 Playtester, Squad Five Blue, Reinforced - Shadow
    <!--quoteo(post=1922875:date=Apr 8 2012, 04:28 AM:name=Xarius)--><div class='quotetop'>QUOTE (Xarius @ Apr 8 2012, 04:28 AM) <a href="index.php?act=findpost&pid=1922875"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I think close spawns generally benefit aliens more than they do marines, due to the alien ability to apply much more pressure while their comm just AFKbuilds. So yeah, sounds like a good mod until they sort the early game balance.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I like this, it's a good compromise between maps not playing the same all the time and keeping it a little more balanced in the early game. I'll make sure to tell other clanners about the mod!
  • swalkswalk Say hello to my little friend. Join Date: 2011-01-20 Member: 78384Members, Squad Five Blue
    edited April 2012
    Just reading this, makes me happy. Now I know I'm not insane.
    This should definitely be implemented into vanilla.
    I will probably get it running on ENSL, as close spawns really bork the game flow.
    You're very welcome to use our map/mod database on duplexgaming.co.uk for your files Mendasp.
    Just sign up and I will give you access to upload, asap.

    And btw. is the mod a serverside mod, or do the clients need the mod as well?
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    This is a server-side mod, the clients don't need to download it.

    I'll probably be working on an alternate way of doing this.

    My ideas for improving this mod are:
    - Add a way for the mappers to specify a minimum spawn distance, and if it's not present in the map it will use the default (modded) way. I think UWE could/should implement this, minus the modded part, it'd be just default behavior in their case.
    - The default behavior, instead of directly choosing the furthest away valid spawn point, I want to remove the closest 2 spawn points to the marine spawn from the list of valid spawn points (if possible). I can't think of any map layouts where this wouldn't work, but if you guys can think of any let me know so I don't ruin such a simple mod. You'd still have the mapper variable to fix it in that case.

    I'll probably register @ duplexgaming when I get the newer version done, the more places to find the mod, the better :)
  • DghelneshiDghelneshi Aims to surpass Fana in post edits. Join Date: 2011-11-01 Member: 130634Members, Squad Five Blue, Reinforced - Shadow
    edited April 2012
    <!--quoteo(post=1923772:date=Apr 10 2012, 03:28 PM:name=Mendasp)--><div class='quotetop'>QUOTE (Mendasp @ Apr 10 2012, 03:28 PM) <a href="index.php?act=findpost&pid=1923772"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->- Add a way for the mappers to specify a minimum spawn distance, and if it's not present in the map it will use the default (modded) way. I think UWE could/should implement this, minus the modded part, it'd be just default behavior in their case.<!--QuoteEnd--></div><!--QuoteEEnd-->
    If you want to include mapper input, then you should go all the way and implement a system to allow the mapper to select valid pairs of spawns instead of the hack-ish distance check. You'd need an extra file for every map (e.g. ns2_summit.spawns or similar), which contains an array of valid spawn pairs in a specified format.

    <!--quoteo(post=1923772:date=Apr 10 2012, 03:28 PM:name=Mendasp)--><div class='quotetop'>QUOTE (Mendasp @ Apr 10 2012, 03:28 PM) <a href="index.php?act=findpost&pid=1923772"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->- The default behavior, instead of directly choosing the furthest away valid spawn point, I want to remove the closest 2 spawn points to the marine spawn from the list of valid spawn points (if possible). I can't think of any map layouts where this wouldn't work, but if you guys can think of any let me know so I don't ruin such a simple mod. You'd still have the mapper variable to fix it in that case.<!--QuoteEnd--></div><!--QuoteEEnd-->
    An easy example of this system not working would be a bigger map which may have more than three spawns close to one another, like if Crossroads was a valid spawn in summit.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    <!--quoteo(post=1923776:date=Apr 10 2012, 03:42 PM:name=Dghelneshi)--><div class='quotetop'>QUOTE (Dghelneshi @ Apr 10 2012, 03:42 PM) <a href="index.php?act=findpost&pid=1923776"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->If you want to include mapper input, then you should go all the way and implement a system to allow the mapper to select valid pairs of spawns instead of the hack-ish distance check. You'd need an extra file for every map (e.g. ns2_summit.spawns or similar), which contains an array of valid spawn pairs in a specified format.<!--QuoteEnd--></div><!--QuoteEEnd-->
    I really wanted to do something simple... I'm a mapper (although I'm not really active right now) and I'd hate to do this, which is why I did this little hack. Forcing the mappers to do this would be overkill, in my opinion, the game should be able to choose the ideal spawn point in most of the cases without too much mapper input.

    <!--quoteo(post=1923776:date=Apr 10 2012, 03:42 PM:name=Dghelneshi)--><div class='quotetop'>QUOTE (Dghelneshi @ Apr 10 2012, 03:42 PM) <a href="index.php?act=findpost&pid=1923776"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->An easy example of this system not working would be a bigger map which may have more than three spawns close to one another, like if Crossroads was a valid spawn in summit.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Yes, I thought of this... but I don't think anyone would make Crossroads a valid spawn point. I know it'd probably be a problem if you ever had a spawn point with more than 2 ways in/out of it that lead to a tech point, but I can't think of any existing/WIP maps that do this... it really has to be a huge map.

    It's not a flawless idea but I think it'd work with the current maps while solving the close spawns problem... I guess I'll wait a little more before doing any changes.
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    Can you implement a maximum distance of effect? I most certainly won't have close spawn issues due to the size of my map and would hate for spawns to be limited because of your plug-in, which ultimately is for maps not designed around the concept of random spawns. Mine is designed around semi random spawns and doesn't need a mod to take care of the spawning system.
  • Evil_bOb1Evil_bOb1 Join Date: 2002-07-13 Member: 938Members, Squad Five Blue
    <!--quoteo(post=1923782:date=Apr 10 2012, 08:59 AM:name=Mendasp)--><div class='quotetop'>QUOTE (Mendasp @ Apr 10 2012, 08:59 AM) <a href="index.php?act=findpost&pid=1923782"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I really wanted to do something simple... I'm a mapper (although I'm not really active right now) and I'd hate to do this, which is why I did this little hack. Forcing the mappers to do this would be overkill, in my opinion, the game should be able to choose the ideal spawn point in most of the cases without too much mapper input.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Well in my opinion forcing the mapper to recreate geometry for occlusion is a bit overkill too, the game should be able to do that, but that is a different story. My point is sometimes direct input from a human is more valuable. A system where the mapper defines each possibility could be very simple also. For example for each marine spawn tell which random alien spawns.

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> MS1 (AS1/AS2)
    MS2 (AS2/AS3)
    MS3 (AS1/AS3/AS4)<!--c2--></div><!--ec2-->

    A system something like this could make it pretty simple. In the extent of a six tp map all random it would not exceed six lines if marines could spawn from each tp. In most cases though there would be less possibilities.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    edited April 2012
    <!--quoteo(post=1923841:date=Apr 10 2012, 08:02 PM:name=Evil_bOb1)--><div class='quotetop'>QUOTE (Evil_bOb1 @ Apr 10 2012, 08:02 PM) <a href="index.php?act=findpost&pid=1923841"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Well in my opinion forcing the mapper to recreate geometry for occlusion is a bit overkill too, the game should be able to do that, but that is a different story.<!--QuoteEnd--></div><!--QuoteEEnd-->
    I hate that and I can't fix it in LUA :P

    But you're comparing a very complex task with something more trivial. At least we're not placing waypoints manually anymore... ;)

    <!--quoteo(post=1923841:date=Apr 10 2012, 08:02 PM:name=Evil_bOb1)--><div class='quotetop'>QUOTE (Evil_bOb1 @ Apr 10 2012, 08:02 PM) <a href="index.php?act=findpost&pid=1923841"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec--><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> MS1 (AS1/AS2)
    MS2 (AS2/AS3)
    MS3 (AS1/AS3/AS4)<!--c2--></div><!--ec2-->

    A system something like this could make it pretty simple. In the extent of a six tp map all random it would not exceed six lines if marines could spawn from each tp. In most cases though there would be less possibilities.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Obviously, nothing is more perfect than manually specifying this kind of stuff, you get what you want 100% of the time.

    But, how would you choose the possible spawns? Because they're most probably based on distances, anything that lets you automate this process would be ideal. Maybe including a minimum radius/distance in the tech point entities? An option letting you say: "I only want the furthest away tech point from this one if this is the chosen spawn"... These are options that we could look at to automate as much as possible the mapper's decision making instead of having to actually make a .txt file. And they could be made within the editor, which is a lot more convenient. Don't you agree?

    You could maybe even give the mappers the option to do it manually... if you really wanted.
  • Evil_bOb1Evil_bOb1 Join Date: 2002-07-13 Member: 938Members, Squad Five Blue
    I do agree on that. Maybe those few lines of code could be set in the ns2_gamerules. Maybe as you say a distance requirement on the tp entity with a radius indicator similar to the light entity would make it user-friendly.

    The problem I see with distance is sometimes the layout makes certain paths longer and what might be the closest spawn in bird's flight distance could be the furthest in the actual route. Therefore the distance requirement should be calculated using the pathing system. And this makes it difficult to represent it in the editor.

    In all cases you are manually giving an input to the spawning system, so might as well go down to the root of it and put it all in one place rather than setting each tp to have its own rules.
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members
    The best system is the spawn pair list. You numerate the spawns 1 to N and then you give a list of pairs (marine start, aliens start) :

    (1,3)
    (1,2)
    (3,4)
    (4,3)

    Then the game pick up a pair randomly. It's very general and allows to assign probabilities, for example on turtle you could have most of the time (let's say 75%) the standard spawn (quarters, cargo) and 20% of the time (backup, cargo) and in 5% of the games something a bit crazy like (engine, bridge).

    I think it should be fairly easy to implement, you can access to the tech point name so you could provide the list directly with the spawn names in a lua file.
  • Evil_bOb1Evil_bOb1 Join Date: 2002-07-13 Member: 938Members, Squad Five Blue
    Let me explain a bit where I'm coming from. Here is what I am planning for b3 on turtle:

    <img src="http://dl.dropbox.com/u/42877240/t3l.jpg" border="0" class="linked-image" />

    With current system, I would probably make backup and quarters random marine spawns and cargo the only alien spawn. But what I would like is if marines spawn in quarters, aliens could spawn in cargo or loading, if marines spawn in backup, aliens could spawn in cargo or bridge.

    This could be achieved with a distance requirement.

    Using pairs i would have (quarters,cargo),(quarters,loading),(backup,cargo),(backup,bridge)
    with my system it would be [quarters(cargo,loading)],[backup(cargo,bridge)]

    So in this case my system is simpler, pairs might be simpler for other situations but it includes the possibility of making pairs too.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    edited April 2012
    Okay, to implement this staticly defined but still random spawn points in the least horrible way possible I've thought of this...

    The idea is to add two new fields to the tech_point entity:
    friendlyname: Where you set a shorter, friendlier name for your techpoint (a number, a single word, initials, whatever).
    opposingtps: Where you list the valid spawns (by their friendlyname) for the enemy team if this is the designated initial spawn. Since the marines always get their starting TP chosen first, you could probably skip doing this for aliens-only TPs.

    This way you don't have to fiddle around with text files and it's easy enough to do in-editor. I really didn't like the idea of having to create a separate file, which is why I insisted with all the distance requirements and such, but I didn't even think of doing this in-editor (duh!).
  • Evil_bOb1Evil_bOb1 Join Date: 2002-07-13 Member: 938Members, Squad Five Blue
    I think this way would be great!

    It has the advantage of being in editor, requires no distance calculation, and is easy to set up. The coding might be a different story :p
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    edited April 2012
    Okay, I got a version without any error checks working right now, it was fairly simple, so I'll finish this up tomorrow with proper checks and let you guys give it a go.
  • YuukiYuuki Join Date: 2010-11-20 Member: 75079Members
    Sweet, so you can add editable field in the editor ? How do you do that ?
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    edited April 2012
    <!--quoteo(post=1924082:date=Apr 11 2012, 11:40 AM:name=Yuuki)--><div class='quotetop'>QUOTE (Yuuki @ Apr 11 2012, 11:40 AM) <a href="index.php?act=findpost&pid=1924082"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Sweet, so you can add editable field in the editor ? How do you do that ?<!--QuoteEnd--></div><!--QuoteEEnd-->
    You can edit editor_setup.xml in the ns2 folder to add or modify fields.

    Okay, so I got the new version done, it's not exactly elegant, but it will do for now.

    Readme.txt
    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Extract into Natural Selection 2\ns2 folder

    The editor will have 2 new fields for the Tech Points, "Friendly Name" and "Valid Alien TPs". To make use of this mod, you have to assign "Friendly Names" to all the Tech Points, then, for the tech points set to "Marines only" or "Either team", you have to make a list of the Tech Point friendly names that the aliens can have as their initial spawn if the marines get this Tech Point as their spawn.

    Try to avoid very short or not unique names. Finding "sub" in a list that contains "sub2" will be considered the same since the mod simply checks if the friendly name is contained in the valid TPs string.

    If you leave the Valid Alien TPs entry empty in a Tech Point it will use the default behavior.

    Examples:

    TRAM
    ----
    SERVER ROOM
    Friendly Name: server
    Valid Alien TPs: shipping, repair

    SHIPPING
    Friendly Name: shipping
    Valid Alien TPs: warehouse, server

    WAREHOUSE
    Friendly Name: warehouse
    Valid Alien TPs: shipping

    REPAIR ROOM
    Friendly Name: repair
    Valid Alien TPs: server


    SUMMIT
    ------
    SUB ACCESS
    Friendly Name: sub
    Valid Alien TPs: atrium

    DATA CORE
    Friendly Name: dc
    Valid Alien TPs: flight

    FLIGHT CONTROL
    Friendly Name: flight
    Valid Alien TPs: dc

    ATRIUM
    Friendly Name: atrium<!--c2--></div><!--ec2-->

    Download in first post.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    Added it to <a href="http://www.duplexgaming.co.uk/downloads/mods/90/mapper_defined_random_spawns/" target="_blank">Duplexgaming.co.uk</a> :)
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    Updated for Build 205, check the first post for downloads, I realized today NS2Gamerules got updated in 205 (ugh!) so here's a quick update. I'll make sure this doesn't happen again with future updates...
  • Evil_bOb1Evil_bOb1 Join Date: 2002-07-13 Member: 938Members, Squad Five Blue
    Nice! Do you think there any chance that such a system will be implemented in the official game?
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    I'd really love to have an official implementation of this (or something similar), the more control for the mappers the better, even if the official maps stay as-is in regards to random spawns I feel the community (specially the competitive scene) would benefit lots from having this kind of flexibility.

    I don't really know if they'll end up doing it, though. But... a man can dream!
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    Updated for Build 206.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    Okay, so I was thinking about including the official maps already set up for this, since maybe server operators can't be bothered with modifying the map files each time they get updated... maybe I should try making it read from a .txt file if the map doesn't have the settings specified in it so it's easier for them? Any feedback on this?
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    I added a new version that includes modded versions of the NS2 maps so Server OPs don't have to play around with the editor at all. As always, check the first post.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    Updated for Build 209.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    Updated for Build 210.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    Updated for Build 212.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    edited July 2012
    I have now added a config for docking which is basically the same as the default but without close spawns (Tram-Terminal and Locker-Cafe are no longer possible).
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    edited July 2012
    Updated for Build 213.
    Edit: Still works for 214.
  • MendaspMendasp I touch maps in inappropriate places Valencia, Spain Join Date: 2002-07-05 Member: 884Members, NS1 Playtester, Contributor, Constellation, NS2 Playtester, Squad Five Gold, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Retired Community Developer
    Updated for Build 215.
Sign In or Register to comment.