AtomicStryker / srsmod

Automatically exported from code.google.com/p/srsmod
0 stars 0 forks source link

Spawn 1 tank & 1 witch guaranteed per every map #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
= Requirements =

* One wandering witch should spawn on every map, even maps that don't
normally have witches.
* One tank should spawn on every map, even maps that don't normally have tanks.

= CVARS =

* l4d2_srs_witch_count = -1 no witches, 0 default behaviour, 1 = 1 witch.
reserve 2 and higher for possible future implementations of multiple witches.

l4d2_srs_tank_count = -1 no tanks, 0 default behaviour, 1 = 1 tank. reserve
2 and higher for possible future implementations of multiple tanks.

= Implementation Suggestions =

For tanks, we will be spawning a tank bot (untried but probably
ZombieManager::SpawnTank) and then running the director tank lottery to
properly assign a tank to a player (CDirector::TryOfferTankBot). To force
the lottery to work on all maps, we will fake the "ProhibitBosses" script
value to always be 0 by detouring GetScriptValue.

For witches, we can simply spawn the witch (z_spawn witch).

In both cases we can (already) suppress any additional Director spawns by
blocking ZombieManager::SpawnTank/ZombieManager::SpawnWitch.

In both cases we will probably need to know the X,Y,Z coordinate <-> flow
rate mapping in order to figure out a place to spawn the bosses. Will need
to investigate CTerrorNavArea and those sorts of classes.

Original issue reported on code.google.com by gorik.sm...@gmail.com on 11 Jan 2010 at 8:02

GoogleCodeExporter commented 9 years ago
Can also use

sm_cvar versus_witch_chance_intro 1.0
sm_cvar versus_witch_chance 1.0
sm_cvar versus_witch_chance_finale 1.0

sm_cvar versus_tank_chance_intro 1.0
sm_cvar versus_tank_chance 1.0

Works for most maps, exceptions being for example Dead Center 1

Original comment by atomic_6...@yahoo.co.uk on 11 Jan 2010 at 9:55

GoogleCodeExporter commented 9 years ago
CEscapeRoute::GetPositionOnPath(float,Vector*) is used in UpdateBossSpawns. It 
is
likely the float is the flow rate, Vector* is the by-reference (outgoing) vector
argument. If this is correct we have a way to go flow rate -> coordinate, 
should be
perfect for spawning bosses anywhere we want.

To be able to call CEscapeRoute we can get the address for it from 
TheEscapeRoute()
function or from the @g_spawnPath symbol (Linux).

Original comment by gorik.sm...@gmail.com on 11 Jan 2010 at 10:22

GoogleCodeExporter commented 9 years ago
Unless there are other examples of no tank spawns, other than Dead Centre 1 and
Parish 1 the only Map I would say 100% needs a tank spawn is Parish 1. Parish 1 
is
short with few chokes and void of an event. Dead centre 1 however has the
disadvantage of having no primary weapon for the first half of the map, with the
second half starting an event running through halls of fire full of choke 
points. A
tank on this tank would almost always see either a attempted rush past the tank 
or a
wipe.

Original comment by phil...@gmail.com on 11 Jan 2010 at 12:51

GoogleCodeExporter commented 9 years ago
Map's already a wipe with all the death charges/death jockeys, this isn't for
discussing balance changes, please use the Google Wave for that :).

Original comment by gorik.sm...@gmail.com on 11 Jan 2010 at 7:43

GoogleCodeExporter commented 9 years ago
Found the function that calculates the boss spawn flow points from the CVAR 
values,
it's all in CDirectorVersusMode::InitVersusBossSpawning.

Original comment by gorik.sm...@gmail.com on 13 Jan 2010 at 12:30

GoogleCodeExporter commented 9 years ago
Was able to get the director to spawn a tank on Dead Center 1 by detouring
CDirector::GetScriptValue(const char* key, int) and having it return 0 for
key="ProhibitBosses". I imagine this reduces the problem to what we had in 
L4D1. 

As far as I can tell from reading the disassembly, it will still follow all the 
CVAR
values. The sidenote is that we may have trouble spawning a witch+tank on an 
intro
map as-is. Also not sure how this plays out with multiple witches at all, will 
have
to look into that.

Will link to a Left4Downtown issue on this later since it required adding a new 
forward. 

Original comment by gorik.sm...@gmail.com on 13 Jan 2010 at 10:01

GoogleCodeExporter commented 9 years ago
= CVARS =

l4d2_srs_bosses_unprohibit 0/1 (set to 1 to allow witches/tanks to spawn on 
maps that
normally dont)

= SPECIFICATION =

Tanks will spawn on every map in VS, even on the ones that in vanilla have tanks
disabled. Tanks should spawn as normal with the "You are becoming tank" message.

= FILES REQUIRED =

* Grab the SMX, put into /addons/sourcemod/plugins
* Grab left4downtown 0.4.5 RC1 DLL and TXT from
http://bitbucket.org/downtown1/left4downtown/downloads/
  * Overwrite the DLL in /addons/sourcemod/extensions/
  * Overwrite the TXT in /addons/sourcemod/gamedata/
* Make sure that left4downtown_version is 0.4.5 and that 
l4d2_srs_bosses_unprohibit is 1

= TEST REQUIREMENTS =

* Tanks should always spawn on every single map. Go through every map (noclip 
through
the map suggested) and make sure they do actually spawn.
* Witches will probably not spawn on maps 1,5 (4-map campaigns might be an
exception). Test if they are guaranteed to spawn on the other maps (in L4D1 they
would not always spawn even with the versus_witch_chance CVAR set to 1.0). 
* In other words we _need_ tanks to spawn 100% of the time. Spawning witches on 
every
map however is not required. While you are at it, jot down any notes about 
witches
spawning or NOT spawning on each map, and how many.

= TEST CONFIG = 

l4d2_srs_bosses_unprohibit 1 

//tank spawn on every level, witch spawn on level 2,3,4
sm_cvar versus_tank_chance_intro 1
sm_cvar versus_tank_chance_finale 1
sm_cvar versus_tank_chance 1
sm_cvar versus_witch_chance_intro 0
sm_cvar versus_witch_chance_finale 0
sm_cvar versus_witch_chance 1

Original comment by gorik.sm...@gmail.com on 14 Jan 2010 at 1:23

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by gorik.sm...@gmail.com on 14 Jan 2010 at 1:24

GoogleCodeExporter commented 9 years ago

Original comment by gorik.sm...@gmail.com on 14 Jan 2010 at 10:40

GoogleCodeExporter commented 9 years ago

Original comment by fissionm...@gmail.com on 15 Jan 2010 at 1:45