Raised This Month: $12 Target: $400
 3% 

[L4D2] Versus Water Brake


Post New Thread Reply   
 
Thread Tools Display Modes
Author
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Plugin ID:
1388
Plugin Version:
1.1.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    4 
    Plugin Description:
    Allows slowing down Survivors in Water for Versus
    Old 01-06-2010 , 12:54   [L4D2] Versus Water Brake
    Reply With Quote #1

    For some reason Valve decided to all but remove the slowdown of Water on Survivors, in Versus Modes. Hard Rain Maps 3 and 4 are pretty much jokes because of this.

    Also adds depth to Swamp Fever.

    This Plugin gives you the power to bring back the slowdown.

    Active in configurable gamemodes



    CVARS:

    l4d2_vswaterbrake_enabled (default 1) - 0 disabled it

    l4d2_vswaterbrake_slow (default 0.7) - How much slower will a Survivor be in water - 0.75 equals 75% speed

    l4d2_vswaterbrake_jockeyslow (default 0) - Will a Jockeyed Survivor be slowed down still?

    l4d2_vswaterbrake_at_low_health (default 0) - Will a limping Survivor be slowed down?

    l4d2_vswaterbrake_gamemodeactive (default "versus,teamversus,scavenge,teamscavenge,muta tion12,mutation13") - which gamemodes will the water brake work in




    Changelog:

    1.0.0 - Release
    1.0.1 - Moar Performance
    1.0.2 - Bunny Hopping Fix
    1.0.3 - fix for Mapchange errorlogs
    1.0.4 - introduced Jockey Slow cvar
    1.0.5 - fixes for localhosts or 0 Survivor case
    1.0.6 - IsValidEntity check against errorlogs added.
    1.1.0 - updated to have the same functionality the srsmod submodule has
    1.1.1 - added active gamemode convar
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d2_versuswaterbrake.sp - 3962 views - 10.1 KB)

    Last edited by AtomicStryker; 04-25-2010 at 05:45.
    AtomicStryker is offline
    Newf
    Senior Member
    Join Date: Dec 2009
    Old 01-06-2010 , 13:11   Re: [L4D2] Versus Water Break
    Reply With Quote #2

    awesome stuff. those maps are definitely jokes now. i'll be putting this in right away.
    __________________
    I like to drink beer and shoot stuff. Video games are fun too i guess!
    Newf is offline
    Necrothug
    Member
    Join Date: Aug 2008
    Old 01-06-2010 , 13:14   Re: [L4D2] Versus Water Break
    Reply With Quote #3

    Awesome! Does anyone know how much the water slows you down in CoOp?
    Necrothug is offline
    Downtown1
    Veteran Member
    Join Date: Mar 2004
    Old 01-06-2010 , 14:35   Re: [L4D2] Versus Water Break
    Reply With Quote #4

    OnGameFrame?
    Downtown1 is offline
    dacomb
    Senior Member
    Join Date: Oct 2009
    Old 01-06-2010 , 16:51   Re: [L4D2] Versus Water Break
    Reply With Quote #5

    Atomic you rock man.
    I know the pubs are going to rage so much when I start using this tonight!! xD
    It would be so cruel to set 100% slow down... so they just get stuck
    dacomb is offline
    AtomicStryker
    Veteran Member
    Join Date: Apr 2009
    Location: Teutonia!!
    Old 01-06-2010 , 18:21   Re: [L4D2] Versus Water Break
    Reply With Quote #6

    Quote:
    Originally Posted by Downtown1 View Post
    OnGameFrame?
    I included Frameskips and made it as easy to run as possible. Im quite certain you could run 100 instances of the plugin without slowing a server down
    AtomicStryker is offline
    SkaP
    Senior Member
    Join Date: Dec 2009
    Old 01-06-2010 , 19:18   Re: [L4D2] Versus Water Break
    Reply With Quote #7

    Been waiting for this one. Thanks, makes Hard Rain well hard again.

    Edit: Tested the plugin at 50% it felt just like co-op but it would be nice to have the exact number co-op is at.

    Edit2: Ok bit of a problem with bunny-hopping, don't know if it can be fixed. In co-op you bunny-hop in the water it still feels slow, but using this plugin it feels like you accelerate though the air. You can just bunny-hop and avoid the slow down effect all together. Now I doubt most people will pick this up but me and my friends played defrag on quake3 forever and the minute they jump(and feel that acceleration like I did) they'll bunny-hop the whole thing.

    Last edited by SkaP; 01-06-2010 at 19:57.
    SkaP is offline
    Downtown1
    Veteran Member
    Join Date: Mar 2004
    Old 01-06-2010 , 22:40   Re: [L4D2] Versus Water Break
    Reply With Quote #8

    Quote:
    Originally Posted by AtomicStryker View Post
    I included Frameskips and made it as easy to run as possible. Im quite certain you could run 100 instances of the plugin without slowing a server down
    Well I am going to assume it's just not possible to do this without OnGameFrame. That being said your OnGameFrame has a lot of redundant checks.

    PHP Code:
                if (!IsClientInGame(target)) continue;
                if (
    GetClientTeam(target) != 2) continue;
                if (!
    IsPlayerAlive(target)) continue; 
    It loops from 1,MaxClients every time and skips all the "invalid" clients. However if we consider the typical situation of 4 alive survivors, 18 maxclients, that means you're skipping 66.66% of the time. Plus calling extra natives which is relatively expensive.

    By doing something like this you can reclaim a 66% speedup.

    PHP Code:
    #define MAX_SUPPORTED_CLIENTS 32
    new survivor_clients[MAX_SUPPORTED_CLIENTS];
    new 
    survivor_count 0;

    FindSurvivorIdx(client)

      for(new 
    0survivor_count; ++i
        if(
    survivor_clients[i] == client) return i;
      return 
    0;
    }

    SwapArrayElements(array[], ab)
    {
      if(
    == b) return;
      new 
    tmp = array[a];
      array[
    a] = array[b];
      array[
    b] = tmp;
    }

    //call this when player connects AND hes a survivor AND hes alive
    OnPlayerJoinSurvivors(client)
    {
      if(!
    FindSurvivorIdx(client))
        
    survivor_clients[survivor_count++] = client;
    }

    //call this when a player disconnects OR hes not a survivor OR hes not alive
    OnPlayerLeaveSurvivors(client)
    {
      new 
    idx FindSurvivorIdx(client);
      
    //keep the array contiguous
      
    if(idx
      {
        
    SwapArrayElements(survivor_clientsidxsurvivor_count-1);
        
    survivor_count--;
      }
    }

    ////////////

    public OnGameFrame()
    {
      
    //early out checks as before
      
    for(new idx 0idx survivor_counti++)
      {
        new 
    target survivor_clients[idx];
        
        new 
    level GetEntData(targetWaterOffset1);
        
    // etc rest of this is the same as before
      
    }

    Downtown1 is offline
    dacomb
    Senior Member
    Join Date: Oct 2009
    Old 01-07-2010 , 01:54   Re: [L4D2] Versus Water Break
    Reply With Quote #9

    I used it in Hard Rain tonight. It worked like a charm.
    dacomb is offline
    SkaP
    Senior Member
    Join Date: Dec 2009
    Old 01-07-2010 , 01:58   Re: [L4D2] Versus Water Break
    Reply With Quote #10

    Quote:
    Originally Posted by dacomb View Post
    I used it in Hard Rain tonight. It worked like a charm.
    What did you have it set too?
    SkaP is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 12:34.


    Powered by vBulletin®
    Copyright ©2000 - 2024, vBulletin Solutions, Inc.
    Theme made by Freecode