Pairs of random spawns
Mendasp
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
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>
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>
Comments
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!
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?
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 :)
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.
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.
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.
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.
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.
(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.
<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.
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!).
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
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.
I don't really know if they'll end up doing it, though. But... a man can dream!
Edit: Still works for 214.