Coder Social home page Coder Social logo

segabl / pd2-streamlined-heisting Goto Github PK

View Code? Open in Web Editor NEW
10.0 4.0 2.0 115.14 MB

Full gameplay overhaul mod, fixing bugs, behaviours and consistency issues

License: GNU General Public License v3.0

Lua 100.00%
blt-mod payday2 payday-2 paydaymods mod balance npc enemies

pd2-streamlined-heisting's Introduction

Streamlined Heisting

Streamlined Heisting makes a lot of the gameplay mechanics more consistent. It is intended to build on what I think Overkill tried to accomplish rather than being a complete rebalance mod. As such, the mod doesn't add tons of new features or enemies and doesn't touch player balance or skills. The changes this mod makes are intended to make the game more consistent by replacing some of the very outdated code and fixing broken and disabled features.

For a player side balance, check out Streamlined Heisting Complements, a small tweaks mod specifically made with Streamlined Heisting in mind.
Also check out Alarmingly Streamlined Spawngroups for some cool extra features and further customization options.

As with all mods that extensively change mechanics or add new units, this mod locks your matchmaking and you will only be able to play with other people that are also using it. When enabling or disabling the mod from the BLT mods menu make sure to restart the game to avoid issues.

Compatibility

Mods that drastically change enemy AI, enemy weapons or spawngroups could cause conflicts or crashes, you will be asked to disable mods that are confirmed to be incompatible automatically. Mods that change enemy visuals are generally supported, most mods will be detected automatically and changes done by this mod will be disabled if they are incompatible, for some more complex mods you might have to turn off the faction improvements for the faction in question in the mod options manually.

Features

Improves enemy presets and weapon handling

Vanilla uses multiple presets that are assigned based on difficulty, but not every difficulty has its own preset. Presets are then further changed in different functions which leads to a lot of oversights and inconsistencies. The entire NPC shooting behaviour is needlessly complex and features like aim delay and focus delay don't work as intended. The preset system has been simplified and bugs in NPC weapon handling have been fixed.

  • Creates and uses a single base weapon preset which scales damage, focus delay and aim delay based on difficulty
  • Changes shotgun preset significantly, giving them very good accuracy to simulate multiple pellets but very harsh damage falloff
  • Changes enemy weapon stats to be consistent across their class (on the same difficulty a JP36 will perform the same as a Car-4)
  • Makes snipers more accurate but take longer to aim before shooting, avoiding cheap instant snipes due to bad RNG
  • Improves the surrender presets, different enemies have different chances to surrender
  • Gives enemies linear damage falloff instead of sudden drops after a distance threshold is reached
  • Fixes accuracy values being ignored for single fire weapons in NPC vs NPC situations
  • Simplifies the clunky fire mode system and interpolates the number of rounds fired based on distance instead (enemies will utilize full auto more)
  • Properly implements and makes use of aim delay, enemies will now take time to aim at their target before shooting (depends on distance and difficulty)
  • Fixes barely working focus delay code, enemies will take some time to reach their maximum accuracy when shooting (depends on difficulty)
  • Allows NPCs to use melee attacks against other NPCs
  • Improves suppression presets to be more distinct between different enemy types

Overhauls spawn groups and enemy behaviour

At one point the game had unique spawn groups with different behaviours and tactics which have been disabled or broken over time, like shotgunners or hostage rescue units. Missing tactics have been implemented and spawn groups have been restored and improved to have a bigger variety of enemies and make combat more interesting.

  • Restores original spawn groups that were disabled, adding back shotgunners, reinforce groups and hostage rescue units
  • Fixes scripted spawns to use the correct enemy faction when spawning enemies
  • Fixes units with defend type objectives rushing the player instead of actually defending their designated areas
  • Adds dynamic reinforce points to loot secure points and the escape zone
  • Fixes enemies crouch-walking when they are supposed to run
  • Implements missing murder tactic, enemies with this tactic will focus on finishing off downed and tased players regardless of any aggressive behavior
  • Implements missing shield and shield_cover tactics, enemies with shield_cover tactic will stick closely to group members with shield tactic
  • Fixes ranged_fire tactic, enemies with this tactic will properly stop and open fire from a distance for a bit when they encounter players
  • Fixes flank tactic, enemies will now try to flank properly and more consistently
  • Fixes enemies not pulling back when encountering players during anticipation
  • Reverts changes made to the Taser's line of sight check to allow them to tase more consistently again
  • Makes Cloaker attacks more consistent by removing some of their restrictions and fixes them crouch-charging on clients
  • Makes Shields reduce explosion damage from the front instead of a generic explosion damage resistance
  • Makes Medics require line of sight to heal
  • Fixes Bulldozers sprinting when they shouldn't and not switching to walking when they are close enough
  • Adds chance for enemies to use teargas grenades when players camp in an area for too long
  • Makes enemies less hesitant to shoot while moving and react to threats with adequate reactions
  • Fixes enemies walking backwards towards their objective when they are not aware of threats
  • Fixes enemy turn behaviour/speed differing between host and client and makes it more lenient
  • Updates old boss enemies with the new boss logic to make those boss fights more interesting
  • Makes enemies use more varied dodge directions

Improves the difficulty curve

The vanilla difficulty curve is all over the place with some difficulties feeling exactly the same and others introducing major jumps. Enemy spawns are highly exaggerated because issues in presets, behaviour and pathing prevent them from actually being a threat. Heist difficulty progression is unused and enemies will swarm you in full force as soon as a heist goes loud instead of the intended increasing force as time progresses. Difficulty dependent values have all been rebalanced to create a smoother curve and gradually increasing difficulties. Less but more responsive enemies will keep you on your toes instead of just staring you down waiting to be shot.

  • Properly scales enemy health, damage, aim and focus delay values according to difficulty
  • Makes each difficulty have custom player revive health percentages (from 65% on normal to 5% on DS)
  • Gives each difficulty custom suspicion settings (smoother increase in stealth difficulty)
  • Reduces the potential maximum amount of active enemies on the map
  • Makes Bulldozer armor block damage and scales its HP with difficulty
  • Scales assault duration with difficulty and reduces spawn pool to make it possible to end the assault earlier when spawns are exhausted
  • Makes use of and smoothes out heist difficulty progression such that enemy force and special frequency increases as the heist progresses
  • Reduces player grace period time but makes it always use the full duration (0.25s)
  • Makes the assault delay caused by having hostages scale with the amount of hostages (minimum of 5s per hostage, up to 4 hostages)

Standardizes enemy visuals

There are some inconsistencies with various enemy factions in the game that lead to issues like enemy recognition or missing enemy types. The changes to the enemy factions aim to fix all these problems.

  • Adds unique weapons for different factions, similar to how GenSec uses their own rifles and shotguns
  • Adds chest armor to the heavy SWAT on Normal and Hard, to be in line with the heavy SWATs on other difficulties
  • Makes shotgunners more distinct from their rifle counterparts (added shell straps, gadget variations)
  • Replaces the lazy recolors for Mexican police with custom models based on the less seen SWAT models
  • Adds missing enemy types (ZEAL Shotgunners, ZEAL Medic, GenSec and ZEAL Sniper)
  • Fixes heavy Murkywater units body armor protecting their back
  • Fixes some broken LOD models and removes some normal seams

Other changes

These are miscellaneous changes, fixes and optimizations that don't fit any of the above categories.

  • Reduces the effect of health granularity drastically (damage dealt to enemies is closer to the actual weapon damage listed in the inventory)
  • Restores spawning voicelines for Bulldozers and Tasers and spawn noise for scripted Cloaker spawns
  • Improves variety of enemy combat chatter and enables idle chatter for stealth
  • Makes special enemies and bosses more responsive by detaching their attack logic updates from the enemy task scheduler
  • Adds a short delay before SWAT turrets retract to repair, giving a longer time window to deal damage after their shield breaks
  • Makes sentry guns not count as criminals which stops enemies from pathing to them and ultimately get stuck
  • Fixes the assault fade phase almost always ending after the minimum amount of time
  • Increases the time it takes for Winters to reach the maximum damage reduction (from 10-50% in 40s to 5-50% in 90s)
  • Makes hurt and knockdown animations not stackable, no new animation triggers while there's already one playing
  • Fixes some spawn points being unavailable on certain maps due to incorrect pathing checks
  • Makes flashbangs more consistent and less penalizing when looking away in time
  • Fixes and optimizes fire spawned from molotovs and tripmines
  • Fixes instances of Winters not leaving the map when the formation was told to break up before he was registered
  • Fixes various synchronization issues where incorrect or incomplete data was sent to clients
  • Tweaks some heist mission scripts to play better or fix issues
  • Makes secured additional bags in Crime Spree reward one level per bag (up to a maximum of 10 additional levels)
  • Fixes Crime Spree level gain being calculated incorrectly when the host has a different level
  • Adds hints when an enemy can't be intimidated due to temporary cooldown, no surrender preset or maximum amount of hostages reached
  • Fixes Jokers sometimes following the wrong player
  • Makes civilians' reactions to intimidation more consistent and fixes them jumping into a standing position randomly
  • Fixes enemies sometimes just disappearing when they are told to retreat
  • Makes the maximum amount of random drill jams depend on the drill timer and prevents jams shortly after fixing a drill
  • Fixes enemies and civilians getting stuck and not updating their logic properly in some cases

Credits

  • AverageChan for testing, feedback and fixing some assets
  • fuglore for inspiring some gameplay features and fixes
  • Jarey_ for providing the base texture for the ZEAL medic
  • Masavik for creating the GenSec shield model
  • miss miki for testing, feedback and some mission script improvements
  • hitscanner, Nardo, nikita and others for testing and feedback

pd2-streamlined-heisting's People

Contributors

segabl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pd2-streamlined-heisting's Issues

Improve Zombie faction

Fix missing zombie enemies, overhaul the entire faction and make zombie type use regular enemies and just swap their material configs to avoid having to make and load otherwise identical models.

Panic Room: Doors remain close and mess with AI Pathing

I'm not sure how consistent of an issue this is on the dev-branch, but I ran into this last night.

Screenshot
First of all, the cops came right away, which is probably just fixing a longstanding bug with PAYDAY 2 in general here, but the problems come after. Doors that should be open or potentially get opened by gangsters remained shut.

Seems innocent enough, apart from locking off some of the loot on the map. But then I noticed some of my bot companions were having a hard time pathfinding. They would get stuck defending a location, without me having told them to hold position or to defend an area.

Crimespree crash

The game consistently crashes during a crimespree. It runs for a few minutes then it crashes. I have to check if it consistently around the same amount of time. Here are the crashlogs. They happen with the mod installed.
crash.txt

crashlog.txt

Stealth Detection going up more consistently

Hey!

I was wondering could it be possible to make it so stealth detection would go up and down more consistently? What i mean by this is that currently the stealth detection goes up by 2-4%, which is pretty inconsistant on how much the meter fills up. Could it be possible to smooth this out so the detection isnt so drastic?

Im not sure do you plan to update the stealth section with this mod, but i think it would benefit to have a streamlined stealth experience also, it being a bit harder with some new bells and whistles based on difficulty.
If you prefer to only update the loud section of the game thats fine too, and i wont make any more stealth related suggsections!

Side question: Do you also plan to touch Crime Spree at same point? Currently i like to play crime spree without some modifications (Like all forced, captain shiels, heavy sniper) since they bring down the enjoyment. The forced experially make it un-fun, since it forces you to quit at a sertain point, or abuse some systems like EMC rush while wasting hundreds of coins to get that one perfect heist.
Imo its a great idea of having random heist given to you and thown in some modifiers to make it more intresting, but its implemented very poorly from an enjoyment standpoint, and there are little to none mods that could make some changes other than mods that change the whole game.

Thank you for your time!

Ben

Crash after the newest update

Hey!

I experienced a weird crash that i havent seen before when i updated.
I was playing on hoxton breakout day 2, and when the assault started the seacond time and the HRT units came the game just crashed. They came from the roof that they blow up to the server room. I hope this gives some info!
Juding by crashlog something happened with Iter, which happened to also update yeasterday (Somewhere this week atleast). It also mentioned Better Assault Indicator, but im not sure if thats reveland.

Crashlog:
crash.txt

BLT Log:
2021_08_15_log.txt

If i should report this somewhere else instead, please let me know!

Side note: Should i report these issues here or on ur mod page? Just asking for a preferred place.

EDIT: It happened again. Same crash as above. Seems to be on every heist going loud, stealth is fine.

Ben

Visual Fixes causes access violation when helmet popping new Federales Taser

Probably from Visual Fixes' units\pd2_dlc_bex\characters\ene_acc_tazer_policia_federale_helmet\ene_acc_tazer_policia_federale_helmet.object file

Application has crashed: access violation

-------------------------------

Callstack:

         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     zip_error_init                                      
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
         payday2_win32_release  (???)     ???                                                 
                      KERNEL32  (???)     BaseThreadInitThunk                                 
                         ntdll  (???)     RtlGetAppContainerNamedObjectPath                   
                         ntdll  (???)     RtlGetAppContainerNamedObjectPath                   


-------------------------------

Current thread: Main
Script stack:
          _spawn_head_gadget()  lib/units/enemies/cop/copdamage.lua:3450            
               damage_bullet()  lib/units/enemies/cop/copdamage.lua:822             
          give_impact_damage()  lib/units/weapons/raycastweaponbase.lua:2953        
                on_collision()  lib/units/weapons/raycastweaponbase.lua:2830        
               _fire_raycast()  lib/units/weapons/raycastweaponbase.lua:958         
                   orig_fire()  lib/units/weapons/raycastweaponbase.lua:574         
                        fire()  @mods/AFSF2/AutoFireSoundFix.lua:57                 
                        fire()  lib/units/weapons/newraycastweaponbase.lua:2079     
             trigger_pressed()  lib/units/weapons/raycastweaponbase.lua:467         
_check_action_primary_attack()  lib/units/beings/player/states/playerstandard.lua:5142  
       _update_check_actions()  lib/units/beings/player/states/playerstandard.lua:1017  
                      update()  lib/units/beings/player/states/playerstandard.lua:446  
                    original()  lib/units/beings/player/playermovement.lua:279      
                                @mods/base/req/core/Hooks.lua:264                   

-------------------------------

System information:
	Application version : 1.139.199
	CPU : AMD Ryzen 7 3800X 8-Core Processor (8 cores); SSE; SSE2; SSE3; SSSE3; SSE4.1
	DirectX : 12.0 
	GPU : NVIDIA GeForce RTX 3060 Ti / nvldumd.dll[31.0.15.2802]
	Language : english
	Memory :     16299MB 1012KB
	OS : 6.2.9200 () 0x300-0x1 (64 bits)
	Physics : threaded
	Renderer : DX9 threaded
	Sound : Realtek Semiconductor Corp. (Speakers (Realtek High Definition Audio))

Some Federale light units have from helmet popping helmet

Hey!

I noticed when testing that some Federale light units have FBI helmets when you pop them. These include: SWAT Variant 2 (Shotgun) and Gensec Variant 1 and 2 (One with g36 and one with a shotgun)

I did a little digging and noticed that only the Federale units not included in Streamlined Heisting assets folder are affected
(Expect special units, they work fine). Also noticed that theyr counter parts in Payday2/characters dont include .unit files, which makes me suspect that the federales are somehow drawing from normal payday 2 unit pool in regard of helmets. But you dont have ene_city_swat_1, which is Federale gensec 1 counter part, which is also affected, so it doesent make sense in that regard.

Anyways, im sure you know how to fix the issue! Out of curiosity if you manage to fix it, i would like to know what was the issue was exacly and how you managed to fix it.

I did not have any other unit editing mods present, and removing Streamlined Heisting fixes the issue

Heres a screenshot of the comparisons (Left the wrong helmet and right the one that was supposed to pop):
20210920215506_1

Ben

Missing Russian unit tweaks

Clients with Russian faction tweaks enabled playing with a host with that setting disabled won't see the tweaked Russian light units on difficulties other than Very Hard and Overkill

Also, should the low-difficulty C45 Shield be changed to use the same model as the SR2 Shield ?

HRT and Asssault Break improvments

Hey!

I would like to sugsect some improvments to HRT and Assault Breaks.

HRT: Im not sure how this would work, but i was wondering if HRT would have more of an impact during assault breaks. I really like the idea of HRT, but they dont seem that unique, just another cop to shoot at that shoots back. Im not sure how it currently works, but would it be possible to edit enemy hostage rescue priority, so enemies during Assault (Escpecially when theres player and hostage close progsimity of each other) would have lower/none task to rescue the hostages, but the opposite would be true to the HRT. This does sound a bit silly that a armed officer woudnt rescue/try to rescue hostages, but i think it would benefit HRT abit. I would like to think HRT as more of a special enemy than an accual normal SWAT unit, maybe adjust theyr spawns during assault breaks etc. I dont know how they work at all in the mod/in the base game code (If they have any special code other than just disabling them).

Assault Breaks: I noticed that the assaults have been sligthly longered in the patch notes. Sorry if im wrong about this and this is already a feature, i dint pay that much attention how long the breaks last, but ive noticed that the HRT (Atleast a couple of versions ago) seemed to just come and go, even disapear right in front of my eyes, possibly because the assault breaks are so short. A counter to slightly longer assaults would be slightly longer assault breaks, that would scale with difficulty and hostage amount. E.g: Normal mode would have the longest assault break, and having hostages would make it even longer, while One Down would have the shortest and having hostages slightly longers it, but not too much. This would benefit the game emphetizing having hostages even more, and would go hand in hand with the upper HRT changes.

These are my ideas how the breaks would be more intresting during assault down time. I would like to hear ur side of this, and what and what would not be possible to implement, or if you want to implement at all!

Ben

Enemy unit re-skin mods compabilitys

Hey!

I was wondering are enemy unit overhauls how compatible with Streamlined Heisting?
I remember having crashes along time ago when trying enemy re-skin mods with this one, the game would crash or the shotgun guys would have the normal helmet instead of glass one. You mentioned that you would propably make a seperate file for those kind of mods in the mod page some time ago, and i was wondering if this is still the case or there arent any official plans to make these kinds of mods compatible?

E.g of one of these mods: https://modworkshop.net/mod/31196#description

This mod accually added compability with Streamlined: https://modworkshop.net/mod/24487

Sorry if i explained this very confusingly, if you have any further questions of what i mean let me know!

Ben

Missing weapon swaps when playing without faction improvements

All light and heavy rifle units for Federales except units/pd2_dlc_bex/characters/ene_swat_heavy_policia_federale_fbi/ene_swat_heavy_policia_federale_fbi and units/pd2_dlc_bex/characters/ene_swat_policia_federale_fbi/ene_swat_policia_federale_fbi

Zombie Taser isn't given yellow M4 - is this deliberate ?

Fps loss with Streamlined Heisting installed

Hey!

I desided to see what makes my fps dip when doing heist loud, and saw that removing Streamlined heisting seemed to help with it. I dont recall having these issues from the start, so maybe some update to the mod causes it. I dint expect a smooth as butter running game with this huge of a mod installed, but i thought maybe something could be improved fps wice. If this is normal and you cant do anything about it, please let me know!

I tested on a first world bank and my results are:

With Streamlined Heisting:
Average: 80-70
Min: 60

Without Streamlined Heisting:
Average: 100
Min: 90

It seems to have about 30 fps difference on average.

Graphic settings: Everything on lowest possible expect Texture Quality, wich is set to high.

Computer specs:
Nvidia GeForce RTX 2070 SUPER
AMD Ryzen 5 3600 6-Core Processor, 12 CPUs, 3.6Hz
16GB Ram

I remeber that Think Faster caused huge fps loss because it increased cop think rate, and i recall seeing something simelar in ur patch notes about specials being marked as important so theyr tasks could be used for full potential.

I hope this somehow narrows it down what the issue is, if you need more testing/help let me know and ill try to profide more useful info!

Ben

EDIT: Hmm, after wiping my mod_overrides folder, i saw that the numbers changed a bit

With Stream:
Average: 90-80
Min: 80

Without:
Average: 100-90
Min: 90-80

It seems like something in there is messing up the fps with Streamlined. Im now going to remove all the mods, and only leave streamlined in to see what happens.

EDIT 2: Now tested without any other mods expect Streamlined and Hoplib, and fps loss maybe 5 fps. So in conclusion:

Streamlined doesent accually drop the fps on its own, but removing it when other mods are installed does make the game run better, as seen in the first test. This is intresting. Going to test what mods now drop it.

EDIT 3: Okay ive been at this for about an hour or two and i really cant put my finger on what is causing the lag and what is possibly effecting Streamlined Heisting. Im going to leave this open incase you want to read it, but feel free to close it since i really dont know anymore.

Disable enemies checking for corpses and broken objects outside of stealth

Hey!

I noticed that in Think Faster changelog (https://modworkshop.net/mod/29403#changelog), enemies no longer dont check for corpses and broken object outside of stealth, which in return gives an noticable fps boost.
I was wondering could this also be applied to this mod, or would it be more of an idea stealing/not something that would go with what this mod does. This could help with the fps issues i noticed in earlyer discussion when going loud (I think i managed to sort most of them out/gotten used to it).

I dont know if Think Faster is compatable with this mod, since this mod changes some of the enemies thinking speed (Like specials), so i thought id ask if this could be possible to implement to this mod, or be ported to a standalone mod, since it seems to be a base game issue. (Ik this is for Streamlined Heisting issues, but id thought id ask for possibility of a standalone mod so i dont spam you in modworkshop for example. Please let me know where i should contact you if i had an standalone mod idea! I thought this would be more conviniant in this instance)

Whats your thoughts on this?

Ben

Mission Script: Flashlights don't work

I wanted to report issue with flashlights when they don't work on client but recently tested No Mercy in SH and both host and client don't have flashlights. Our perspective on screenshots below:
image

image

Crime Spree: Big Bank Escape Doesn't Trigger

I found that only in the Crime Spree mode, the escape doesn't trigger after collecting the 4 mandatory loot bags for the Big Bank heist. The escape plan in preplanning seems to have no real effect on the issue either. I've tried the default roof escape and the Elevator Trick and neither had the escape trigger.
The Plan B option doesn't change whether it triggers either. Neither using the Beast to open the vault or thermite to drop into the vault allowed the escape to trigger.

I lost the screenshot I had, so I'll see if I can update this once I have both a screenshot and a brief recording of the issue happening.

Enemy hitchances are not working as intended.

Due to a mistake OVERKILL made in CopActionShoot _get_unit_shoot_pos, the calculation that creates a new position to be used for missed shots will add the weapon's usage spread value multiplied by math.random() (so anything between 0 and 1), while code that is executed after this function applies spread regardless of the result using the full amount of the weapon's usage spread.

In order for shots to hit a player, the direction of the bullet vector has to be within 30 centimeters of the local player's camera. Because of the issue above, that second application of spread can potentially redirect the bullet back into the 30 centimeter radius.

This, obviously, shouldn't be a thing, as it invalidates the acc stat on charactertweakdata's usage presets.

There's also another separate issue with the way the miss vector is created in the first place, and it's that the positions used to create a perpendicular direction are based on the shooter's m_pos (where they're standing on, it's located at feet height), instead of using the position that the unit shoots from, which is m_head_pos (literally the center of the head).

Lastly, there's an issue when it comes to shooting other human/person targets that aren't the local player, and it's the minimum distance used for the miss + the detection/attention pos is used instead of center of mass when creating the miss vector, due to how that whole system was changed here in PD2.

This is how the code normally looks like:

local enemy_vec = temp_vec2

mvec3_set(enemy_vec, pos)
mvec3_sub(enemy_vec, self._common_data.pos)

local error_vec = Vector3()

mvec3_cross(error_vec, enemy_vec, math.UP)
mrot_axis_angle(temp_rot1, enemy_vec, math.random(360))
mvec3_rot(error_vec, temp_rot1)

local miss_min_dis = shooting_local_player and 31 or 150
local error_vec_len = miss_min_dis + w_tweak.spread * math.random() + w_tweak.miss_dis * math.random() * (1 - focus_prog)

mvec3_set_l(error_vec, error_vec_len)
mvec3_add(error_vec, pos)
mvec3_set(shoot_hist.m_last_pos, error_vec)

return error_vec

This is how it looks like when fixed:

local enemy_vec = temp_vec2

if shooting_local_player then
    mvec3_set(enemy_vec, pos)
elseif self._attention and self._attention.unit then
    local att_mov_ext = self._attention.unit:movement()

    if not att_mov_ext or not att_mov_ext.m_com then
        mvec3_set(enemy_vec, pos)
    else
        mvec3_set(enemy_vec, att_mov_ext:m_com())
    end
end

mvec3_sub(enemy_vec, self._shoot_from_pos) --proper shooting pos, instead of the unit's m_pos (which is where they're standing on)

local error_vec = Vector3()

mvec3_cross(error_vec, enemy_vec, math.UP)
mrot_axis_angle(temp_rot1, enemy_vec, math.random(360))
mvec3_rot(error_vec, temp_rot1)

local miss_min_dis = shooting_local_player and 31 or 120
local error_vec_len = miss_min_dis + w_tweak.spread + w_tweak.miss_dis * math.random() * (1 - focus_prog) --apply the full amount of w_tweak.spread

mvec3_set_l(error_vec, error_vec_len)
mvec3_add(error_vec, pos)

return error_vec

Do note that the file has received other optimizations and changes, including the fixed function above (and not doing a second application of spread if not needed in the first place), but this should be vanilla-friendly without having to go through the main update function.

EDIT: It seems one of the issues mentioned in here are actually fixed, but the common_data.m_pos thing isn't, outside of that, the rest of the information is null.

Enabling Medic fire panic animations

Hey!

I noticed for a long time that medics dont have a fire panic animation like all the other units (Expect Bulldozer, Shields and Cloaker). I saw a mod on the workshop that enables them and though would it be possible to implement in this mod, if it fits the scope?

Ben

Autofire_rounds crash

crash.txt
Not certain if it's just a random crash or related to "The Fixes", seeing as I was able to run about 3 maps before this and nothing broke... however, the last map was "Proving Grounds" on death sentence instead of mayhem/death wish... though I doubt that had much to do with it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.