Natural Selection 2

Natural Selection 2

Not enough ratings
NS2 Optimizations
   
Award
Favorite
Favorited
Unfavorite
Compatibility: Must be run on Server
File Size
Posted
Updated
39.268 KB
8 Mar, 2017 @ 10:31am
21 Jun, 2019 @ 3:29am
17 Change Notes ( view )

Subscribe to download
NS2 Optimizations

Description
Mod ID: 346C956E
website[github.com]
current git commit: c463e6ff1e02eeaa1131c983ac51e4386343f7cf


About
This mod just improves performance in NS2 (a game).
NB: The mod has been pretty much merged into vanilla, and as such there is no reason to use this anymore.

License

This project (NS2 Optimizations) in its entirety is licensed under the MIT
license, of which a copy is included below:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Configuration
Both the client and the server will have a file called either NS2OptiServer.json
or NS2OptiClient.json in the NS2 configuration directory. It has various self-explanatory
options, which you might want to tinker with.

Optimizations

Closure optimizations
Lots of code that allocated closures now use a table trick.
Very compatible with other mods.

Fast mixin
This makes mixin initialisation a lot faster, though it depends
on the fact, that most code only does static initialisation
of mixins, i.e. the mixins initialised does not change from entity
to entity of the same class.

Violating this inside either OnCreate or OnInitialized will have fatal effects.
Outside of these two methods, you have free reign, but it will have a performance impact.

Obviously this will have problems with some mods.

GUI rework
This is a complete rewrite of the GUIManager class and eventually also
of the entire minimap system. However, the minimap system has not been worked on
in some time due to my laziness.
The GUIManager code is completely active though.

The GUIManager part is purely a client-side optimisation.

This can have problems with some mods due to some assumptions it makes about GUI code,
so be aware of misfunctioning code.
If you are aware of any such mod, please do contact me, so that I may add an exception for
this particular mod.

Smart relevancy
NS2's netcode is obviously not very good (it's rather awful), and events such
as beacons will cause lag, due to many entities becoming relevant to many clients all
at once.
What this optimisation does, is to smooth the transition, thus making the same number
of entities relevant over a large amount of time.

Additionally, a special configuration key is available, which makes all player entities
relevant to all clients all the time. This does not seem like a good idea, but often
you may find NS2 counter-intuitive.

This is quite compatible with other mods, just like the closure optimisations, so you
should have few worries.

Tech
This change just optimises tech data look-ups. A tech data look-up could e.g. be
checking the health of a particular technology, such as a hive.
It could be the amount of armor, whether it needs infestation, or if it needs
to be attached to something to properly function.
The way these are implemented in vanilla is not optimal. This seeks to fix that.

Although this change may seem rather fundamental, it is still very compatible with
other mods.
10 Comments
_A_x_a_m_d_y_ 27 Sep, 2019 @ 10:05pm 
this mode is broken, steam auto download doesn't work anymore. can u fix it please?
SuperRobotMonkeyTeamHyperForceGo 22 May, 2019 @ 7:53pm 
psst, I heard if you throw a flat-chested demonlord in there it'll work even better. Here take ours we don't wa- I mean need her at the moment.
#PrinniesRiseUp
einsamer-verbrecher 18 May, 2019 @ 6:29pm 
lol
Kleadron 2 Jun, 2017 @ 11:06pm 
*shoves kraken into grinder*
GOOD OL KRAKEN DRIVE
(only KSP players will get this joke)
Techpriest 16 Mar, 2017 @ 7:36pm 
theres something missing.....AHAH,DRAGONS! *crams a ton of dragons into the grinder*
Las  [author] 12 Mar, 2017 @ 1:26am 
Though this will be the main one now.
Las  [author] 12 Mar, 2017 @ 1:26am 
BTW: This is just a reupload under a different user.
QuackerJack 11 Mar, 2017 @ 12:10am 
papa bless
Susie, Mafia affiliated 10 Mar, 2017 @ 9:09pm 
i knew it! flying monkeys were the missing factor
Butts McGee 10 Mar, 2017 @ 4:42pm 
god bless wooza