Skip to content

v2.16.0 - Revamp

Compare
Choose a tag to compare
@DrVrej DrVrej released this 29 Jan 03:45
· 220 commits to master since this release

SHOWCASE VIDEO: https://www.youtube.com/watch?v=cxKFiM6zVuI
Danger Detection AI: https://www.youtube.com/watch?v=XuaMWPTe6rA
Eating AI Demo 1: https://www.youtube.com/watch?v=vWg_yg0QoSw
Eating AI Demo 2: https://www.youtube.com/watch?v=kRGzymEIe7k
Improved Hitboxes for NPCs: https://www.youtube.com/watch?v=J3ZQEaoz5ro
Player Animation Support For NPCs: https://www.youtube.com/watch?v=SLg5ods0Fw4
Weapon base update, secondary fire for players: https://www.youtube.com/watch?v=EFRvy0RdVgU
New NPC controller weapon, hammer I/O support, new spawnicons: https://www.youtube.com/watch?v=FfSN7gG9urU

VERSION: 2.16.0

New

  • Added the ability to toggle movement jumping when controlling an NPC by pressing the key "J"
  • Added a bone follower system for NPCs, its purpose to set specific collisions rather then a box (Ex: HL2 Strider)
  • Added stink system to corpses and gibs for organic type of NPCs (Effective and optimized!)
  • Added new damage bounds for all NPCs, allowing parts outside of the NPC's collision to be damaged and provide more precise hitgroups!
  • Added Hammer support for NPCs, allowing map makers to better control VJ NPCs through Hammer!
  • Added 2 new options to the NPC Spawner tool: "Relation Class Override" and "Friendly To Player Allies"
  • Added a new default test NPC: Player NPC
  • Added player secondary attacks for AR2, SMG1, SPAS-12, and Glock 17
  • Added custom view and world models for the NPC controller weapon with animations & sounds!
  • Added new spawn icons for all default NPCs, weapons and entities!
  • AI Changes:
    • Added danger system (details below)
    • Added following system (details below)
    • Added default player animation support for human NPCs
    • Added 0.15 second processing delay on spawn for all NPCs to give the engine enough time to fully initialize the NPC (This will fix couple of spawning issues)
    • NPCs will now hear bullet impacts, so if a bullet is fired from an unknown being, they will turn and look at the impact location
    • Now use Source engine NPC state and condition systems
    • Humans will now only find a hiding spot to reload their gun if the enemy is further than 650 units
    • Human jumping is a bit better and more realistic
    • Humans will now try to move to a random location if they fail to find cover from danger (Ex: grenade)
    • Humans will now keep their aim angle until fully transitioned to idle
    • Humans now detect HL1 grenades
    • Better gesture reloading system for humans
    • Humans no longer regard other NPCs or players as a hiding zone
    • Guarding NPCs will no longer be called to an ally's position that got damaged by something unknown
    • Guarding NPCs will no longer move to the position of a friendly NPC that got killed
    • Guarding human NPCs will now set a new guarding location automatically if it avoids friendly fire
    • Guarding human NPCs will now only move to a covered position if it's within 60 units and they will now automatically set the guarding location to the new covered position
    • MAJOR: Fixed NPCs refusing to chase the enemy after the enemy becomes reachable again if it was unreachable previously
    • MAJOR: Fixed NPCs getting stuck in a loop where they move and stop constantly while another ally is fighting an enemy
    • MAJOR: Fixed Default NPCs always choosing to target VJ NPCs over other default NPCs (They now share equal relations!)
    • MAJOR: Fixed humans not being able to fire their weapon in some situations, especially when using custom animation sets!
    • Fixed NPC not properly turning to look at an enemy player that is shining flashlight on it
    • Fixed humans setting the clip of a weapon to full when they switch between weapons (Clips number will now stay!)
    • Fixed human AI often breaking if its weapon was forced to change while playing a reload animation
    • Fixed humans that are moving to a covered reload position still playing the reload animation even though their weapon was changed
    • Fixed an issue that caused the NPC to continue engaging when its enemy is detected and reset within a 0.5 second
    • Fixed damage-driven parts of the AI running when AI is disabled or VJ_STATE_FREEZE is applied (Ex: Flinching)
    • Fixed human NPCs that don't have a weapon interrupting higher priority objectives in favor of running away (Melee attacking, jumping, following a player, etc.)
    • Fixed human NPCs without a weapon attempting to aim their gun when transitioning from combat to idle
    • Fixed temporarily interrupting follow player or medic behavior in favor of going to the location of an enemy that was lost (Not killed)
  • Added danger detection for human NPCs:
    • When a danger is detected, they will attempt to flee the area if they believe it is a danger to them
    • Developers can make the NPC play a unique sound similar to grenade detection
    • Works alongside the existing grenade detection
    • Tank NPCs now set danger hint in the location they are about to fire
    • Some of the things that are detected as danger (These are only some of the possible dangers!):
      • Tank shells, VJ combine ball and VJ SMG grenade
      • Props that are one fire, and props like barrels that are about to explode
      • Combine mine that is triggered and about to explode
      • The location that the Antlion Worker's spit is going to hit
      • Combine Flechette that is about to explode
      • Antlion Guard that is charging towards the NPC
      • Player that is driving a vehicle at high speed towards the NPC
      • Manhack that has opened its blades
      • Rollermine that is about to self-destruct
      • Combine Helicopter that is about to drop bombs or is firing a turret near the NPC
      • Combine Gunship's is about to fire its belly cannon near the NPC
      • Turret impact locations fired by Combine Gunships, or Combine Dropships, or Striders
      • The location that a Combine Dropship is going to deploy soldiers
      • Strider is moving on top of the NPC
      • The location that the Combine or HECU mortar is going to hit
      • SMG1 grenades that are flying close by
      • A Combine soldier that is rappelling on top of the NPC
      • Stalker's laser impact location
      • Combine APC that is driving towards the NPC
  • Added NPC Follower tool
  • Added new following system for NPCs:
    • Replaces the old player following system
    • Can now follow anything, even non-living objects like props!
    • Now accounts for NPC's size, so larger NPCs no longer attempt to come very close to their leader
    • Human NPCs will now stop and reload before continuing to follow
    • Will now stop to attack or do other activities if the leader isn't far away
    • Will now stop activities and attacks if the leader is very far
    • Much better custom developer support
  • Menu Updates:
    • New NPC settings: Disable NPCs Calling for Help, Disable Gib/Death VFX
    • Added Incompatible Addons button in the Contact & Support tab
    • Added a tutorial button in the Installed Plugins tab
    • Difficulty selector in the options menu is now ordered
    • Spawn menu NPC selector now recognizes NPC weapon categories
    • Removed: Disable Gib Decals, Disable Gib/Death Particles and Effects

General Changes & Improvements

  • Reduced file size from 113 MB to 84 MB!
  • Major optimizations were applied to the main parts of the base, expect performance increases!
  • Can now pick up flare rounds and wooden boards by pressing E
  • Wooden Board now receives damage force and has proper health (50 hp)
  • Better weapon handling when controlling a human NPC
  • VJ Corpses and gibs now have health based on their model
  • Default gib fade time is now 90 seconds
  • Weapon base now handles player animations much better (especially idle, reload and deploy animations)
  • Decreased the chance of NPCs using the secondary fire for the AR2
  • NPC Controller weapon now has a delay between each "fire"
  • Improved human NPC melee attacks:
    • Now deal knockback by default
    • Can now deal melee damage to more types of props and destructible objects
    • Player's screen shake is now based on the damage amount
    • Now properly sets the current damage type (Same one used by default HL2 humans)
    • Is now much more customizable for developers
  • Developers can now apply the bone angle to the player's camera when controlling an NPC
  • Improved duplicator behavior and console prints on VJ NPCs
  • Developers can now disable the NPC Controller HUD
  • Updated language localizations
  • Renamed Mortar Synth to Aerial NPC
  • Renamed convar vj_npc_sd_ongrenadesight to vj_npc_sd_ondangersight
  • Removed convars: vj_npc_nogibdecals, vj_npc_nogibdeathparticles

General Fixes

  • Fixed NPC pain sounds overlapping with other sounds
  • Fixed a player that is already controlling an NPC having the ability to control another NPC at the same time using the context menu option
  • Fixed NPCs that have stop-movement state applied being able to move while controlled by a player
  • Fixed damage force not applying to NPCs with single bone corpses (Ex: Combine Turret)
  • Fixed RPG setting a visible rocket before the player/NPC has actually set it
  • Fixed rare error with VJ Corpse system when attempting to fade out a corpse
  • Fixed console error when attempting to play a player footstep sound on an NPC

Notable Developer Changes

  • Added comments describing functions, tags and variables to major parts of the base
  • Added Entity Tag System:
    • Stored in the variable self.VJTags
    • Tags can be added using self:VJTags_Add(...)
    • List tag enums and other information can be found in autorun/vj_globals.lua
  • Added global functions: VJ_CreateBoneFollower(ent, mdl), VJ_AddCorpse(corpse), VJ_AddStinkyEnt(corpse, checkMat)
  • Added self.VJC_Player_DrawHUD to the NPC Controller
  • Added enums for attack type system: VJ_ATTACK_NONE, VJ_ATTACK_CUSTOM, VJ_ATTACK_MELEE, VJ_ATTACK_RANGE, VJ_ATTACK_LEAP, VJ_ATTACK_GRENADE
  • Added enums for the attack status system: VJ_ATTACK_STATUS_NONE, VJ_ATTACK_STATUS_DONE, VJ_ATTACK_STATUS_STARTED, VJ_ATTACK_STATUS_EXECUTED, VJ_ATTACK_STATUS_EXECUTED_HIT
  • Added enums for the weapon state system: VJ_WEP_STATE_RELOADING
  • Added enums for the weapon inventory status system: VJ_WEP_INVENTORY_NONE, VJ_WEP_INVENTORY_PRIMARY, VJ_WEP_INVENTORY_SECONDARY, VJ_WEP_INVENTORY_MELEE, VJ_WEP_INVENTORY_ANTI_ARMOR
  • Added enums for facing status: VJ_FACING_NONE, VJ_FACING_ENEMY, VJ_FACING_ENTITY, VJ_FACING_POSITION
  • Added enums for model animation sets: VJ_MODEL_ANIMSET_NONE, VJ_MODEL_ANIMSET_COMBINE, VJ_MODEL_ANIMSET_METROCOP, VJ_MODEL_ANIMSET_REBEL, VJ_MODEL_ANIMSET_PLAYER, VJ_MODEL_ANIMSET_CUSTOM
  • Added 2 options to the spawner base: NPC_Class and FriToPlyAllies
  • Removed enums: VJ_WEP_STATE_NONE, VJ_WEP_STATE_MELEE, VJ_WEP_STATE_ANTI_ARMOR
  • Removed Globals: self:VJ_HasNoTarget, util.VJ_GetWeaponPos, self.VJ_DisablePickupableDanger, VJBASE_GETNAME, VJBASE_TOTALPLUGINS, VJBASE_PLUGINS, VJWelcomeCode, VJSPAWN_NPC, VJ_CreateSNPCCorpse (hook)
  • Removed self.EnemyToIndividual from Bullseye entity
  • SNPC Bases:
    • Added attack type system, this allows you to get what type of attack it is doing
    • Added attack status system, this allows to analyze the current attack status of the NPC
    • Added weapon inventory status system, allows you to reliably retrieve what is happening with the NPC's weapon inventory
    • Added: self:SetSightDistance(dist), self:MeleeAttackKnockbackVelocity(hitEnt), self:Follow(ent, stopIfFollowing), self:FollowReset(), self:CustomOnIdleDialogue(ent, status, statusInfo), self:VJ_TASK_COVER_FROM_ORIGIN(moveType, customFunc), self:GetMoveDirection(ignoreZ), self:SetIdleAnimation(anims, reset), self:CustomOnUnFollowPlayer(ply), self:Controller_Movement(cont, ply, bullseyePos), self:CheckRelationship(ent), self.EnemyData, self:OnCreateSound(sdFile), self.UsePlayerModelMovement, self.CanInvestigate, self.HideOnUnknownDamage, self.AttackStatus, self.AttackType, self.AllowMovementJumping, self.FollowData, self.IsFollowing, self.FacingStatus, self.FacingData, self.Medic_Status
    • Added (Human only): self.WeaponInventoryStatus, self.WeaponReload_FindCover, self.SoundTbl_OnDangerSight + all corresponding variables
    • Added (Creature only): self:CustomOnEat(status, statusInfo), self:EatingReset(resetType), self.CanEat, self.EatingData, self.PropAP_IsVisible, self.DisableDefaultLeapAttackDamageCode
    • Converted from Creature to Human base: self:CustomAttack(ene, eneVisible), self:CustomOnMeleeAttack_BeforeChecks(), self:CustomOnMeleeAttack_AfterChecks(hitEnt, isProp), self.HasMeleeAttackKnockBack, self.MeleeAttackDamageType, self.DisableDefaultMeleeAttackCode, self.DisableDefaultMeleeAttackDamageCode, customEnt parameter for self:MeleeAttackCode()
    • Added FirstP_CameraBoneAng and FirstP_CameraBoneAng_Offset to self.VJC_Data
    • Added parameters ene and eneVisible to CustomAttack()
    • Added BloodData to VJ Corpses
    • self:VJ_ACT_PLAYACTIVITY() now returns the animation play time
    • self.Weapon_TimeSinceLastShot is now based on CurTime()
    • self:CustomOnFollowPlayer() now only has 1 parameter ply, and fixed sometimes being called in wrong behavior
    • Renamed self.LastSeenEnemyTimeUntilReset to self.TimeUntilEnemyLost
    • Renamed self:SetNearestPointToEntityPosition() to self:GetDynamicOrigin()
    • Renamed self:SetMeleeAttackDamagePosition() to self:GetMeleeAttackDamageOrigin()
    • Renamed self:CustomWhenBecomingEnemyTowardsPlayer() to self:CustomOnBecomeEnemyToPlayer()
    • Renamed self.CanDetectGrenades to self.CanDetectDangers
    • Renamed self.RunFromGrenadeDistance to self.DangerDetectionDistance
    • Renamed self.NextGrenadeDetectionT to self.NextDangerDetectionT
    • Renamed self.AlreadyDoneLeapAttackJump to self.LeapAttackHasJumped
    • Renamed self.FollowPlayerCloseDistance to self.FollowMinDistance
    • Renamed self.NextFollowPlayerTime to self.NextFollowUpdateTime
    • Renamed self.VJDEBUG_SNPC_ENABLED to self.VJ_DEBUG
    • Merged self.LastSeenEnemyTime, self.TimeSinceLastSeenEnemy, self.LatestVisibleEnemyPosition, self.EnemyReset, self.ReachableEnemyCount into self.EnemyData
    • Merged self.RangeAttackPitch1 and self.RangeAttackPitch2 to self.RangeAttackPitch
    • Deprecated: self.MeleeAttacking, self.RangeAttacking, self.LeapAttacking, self.ThrowingGrenade, self.AttackTimersCustom, self.MeleeAttackKnockBack_Forward1, self.MeleeAttackKnockBack_Forward2, self.MeleeAttackKnockBack_Up1, self.MeleeAttackKnockBack_Up2, self.MeleeAttackWorldShakeOnMiss, self.MeleeAttackWorldShakeOnMissAmplitude, self.MeleeAttackWorldShakeOnMissRadius, self.MeleeAttackWorldShakeOnMissDuration
    • Removed: self:CanDoCertainAttack(), self:CustomOnIdleDialogueAnswer(), self:RangeAttackSoundCode(), self:DoPropVisibility(), self:CustomOnMeleeAttack_BleedEnemy(), self:CustomOnMeleeAttack_SlowPlayer(), self:FollowPlayerCode(), self::FollowPlayerReset(), self:MeleeAttackCode_DoFinishTimers(), self:RangeAttackCode_DoFinishTimers(), self:LeapAttackCode_DoFinishTimers(), self.IsReloadingWeapon, self.NextResetEnemyT, self.MeleeAttack_NoProps, self.EntitiesToDestroyClass, self.FollowPlayer_GoingAfter, self.FollowPlayer_DoneSelectSchedule, self.FollowPlayer_Entity, self.DefaultGibDamageTypes, self.DeathSkin, self.NextWeaponAttackAimPoseParametersReset, self.AlreadyDoneMeleeAttackFirstHit, self.AlreadyDoneFirstMeleeAttack, self.AlreadyDoneRangeAttackFirstProjectile, self.AlreadyDoneLeapAttackFirstHit, self.AlreadyDoneFirstLeapAttack, self.MeleeAttackWorldShakeOnMissFrequency, self.MeleeAttackKnockBack_Right1, self.MeleeAttackKnockBack_Right2, self.EntitiesToRunFrom, self.EntitiesToThrowBack, self.FriendlyToVJSNPCs, self.CanDoSelectScheduleAgain, self.RangeAttack_DisableChasingEnemy, self.IsDoingFaceEnemy, self.IsDoingFacePosition, self.VJ_IsPlayingSoundTrack, self.AlreadyBeingHealedByMedic, self.AlreadyDoneMedicThinkCode, self.Medic_IsHealingAlly, self.NextSetEnemyOnDamageT, self.RunAwayOnUnknownDamage, self.NextRunAwayOnDamageTime, self.NextRunAwayOnDamageT, self.AA_EnableDebug, self.VJFriendly
    • Removed LetBaseDecide option from self.NextMoveAfterFlinchTime
  • Weapon Base:
    • Added: self:CustomOnReload_Finish(), self:CustomOnSecondaryAttack(), self.LastOwner, self.Primary.SoundLevel, self.Primary.SoundPitch, self.Primary.SoundVolume, self.Secondary.TakeAmmo, self.Secondary.Delay, self.AnimTbl_SecondaryFire
    • Idle animation system for players is now automatically handled by the base without needing input numbers!
    • Return false on self:CustomOnReload_Finish() will now override the base code
    • Removed: self.NextIdle_PrimaryAttack, self.NextIdle_Deploy, self.Reload_TimeUntilFinished, self.DelayOnDeploy
  • Projectile Base:
    • Removed: self.ShakeWorldOnDeath, self.ShakeWorldOnDeathAmplitude, self.ShakeWorldOnDeathRadius, self.ShakeWorldOnDeathDuration, self.ShakeWorldOnDeathFrequency