Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
8ac1d5d
Smart Mobs
Malerus Feb 13, 2026
bcabd66
Made mobs have a better memory of aggro and climbing up and down ladd…
Malerus Feb 14, 2026
c6654bd
Added z-pursuit logic to all hostile mobs
Malerus Feb 14, 2026
6f7ae16
Made a more uniform move_delay speed for hostiles and cleaned up new …
Malerus Feb 15, 2026
f265d5f
Hostile Mob Z-Level Pursuit & AI Coordination System
Malerus Feb 15, 2026
7b361c6
Update deathclaw.dm
Malerus Feb 15, 2026
61690c6
Can open simple_door now
Malerus Feb 15, 2026
1cb612f
Combat Standardization & Gunfire Alerts
Malerus Feb 15, 2026
211d4f2
Reworked SMs, Claws, Ghouls and Raiders to be a bit smarter and new m…
Malerus Feb 16, 2026
089b106
Mobs detect bullets and search areas better
Malerus Feb 16, 2026
19db438
Added Friendly Fire Resistance for Mob Types
Malerus Feb 16, 2026
2fbb16e
Cleaning up GC issues on live
Malerus Feb 16, 2026
7f5330d
More GC stuff
Malerus Feb 16, 2026
b8d71a0
Mobs Search Better, Mirelurk Rework, Added Armors to all F13 mobs
Malerus Feb 17, 2026
4be6d9b
Reduced Idle Aggro and Mob file clean up
Malerus Feb 17, 2026
dc8c6ee
Performance hardening and Fixing CI Compile issue
Malerus Feb 17, 2026
75dcdfa
Cleaned up searching issues
Malerus Feb 17, 2026
3a1e4b2
Update hostile.dm
Malerus Feb 17, 2026
b38999f
Mobs were speaking in dchat
Malerus Feb 17, 2026
c975d1f
Optimize subsystem initialization with batched CHECK_TICK calls
Malerus Feb 17, 2026
2a5a1f4
Added light detection and batched atoms to be a bit smoother on init
Malerus Feb 18, 2026
aceeb81
Added vision and sound cones for sneaking while walking/jogging
Malerus Feb 18, 2026
0e2c54d
Update hostile.dm
Malerus Feb 18, 2026
a1304c6
added low light vision to various mobs
Malerus Feb 18, 2026
ec43e12
Mobs stay in idle direction for 45 seconds now, instead of random
Malerus Feb 18, 2026
687ca15
Update hostile.dm
Malerus Feb 18, 2026
36091cc
Update hostile.dm
Malerus Feb 18, 2026
58d4cd9
Made sneak mode kind of work, still needs more fixes
Malerus Feb 19, 2026
9839dd3
Fixed sneak mode balance
Malerus Feb 19, 2026
9dc7aaa
Fixed vision cone overlay
Malerus Feb 20, 2026
e4f27b6
Aligned detection code with visual code
Malerus Feb 20, 2026
6f77f4c
Fixed sound ranges
Malerus Feb 20, 2026
c3e6405
Adjusted opacity and color changes to ranges
Malerus Feb 20, 2026
294894c
Accounted for stealthboy functions
Malerus Feb 20, 2026
9cedf10
Update hostile.dm
Malerus Feb 20, 2026
aeb2481
Added item thrown/shot location tracking v silenced/not silenced
Malerus Feb 20, 2026
6ec9c75
Fine tuning thrown/light shot system
Malerus Feb 20, 2026
ea2cb09
Adjusting stealthboy stuff
Malerus Feb 20, 2026
32c913d
QoL farm_animal changes
Malerus Feb 20, 2026
e85c932
Merge branch 'master' into Smart-Mobs
Malerus Feb 20, 2026
e232836
Added Assassination Ability, Made Sneak use up Sprint charges
Malerus Feb 21, 2026
82b53b6
Fixed CI Runtime
Malerus Feb 21, 2026
c89bcf6
Merge branch 'master' into Smart-Mobs
Malerus Feb 21, 2026
fd1bc6b
Merge branch 'master' into Smart-Mobs
Malerus Feb 22, 2026
ed82f46
Bug fixes and QoL changes
Malerus Feb 26, 2026
e1cc4d6
Fixed chemwiz references
Malerus Feb 26, 2026
639dc8e
Merge branch 'master' into Smart-Mobs
Malerus Feb 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
465 changes: 465 additions & 0 deletions code/__DEFINES/armor.dm

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
#define MOVE_INTENT_WALK "walk"
#define MOVE_INTENT_RUN "run"

// Vision cone definitions (cone-based directional vision system)
#define CONE_FRONT 1 // 90° front cone - best vision
#define CONE_PERIPHERAL 2 // 45° side cones - reduced vision
#define CONE_REAR 3 // Behind mob - no vision, sound only

// Sound cone definitions (rear sound detection)
#define SOUND_REAR_CENTER 1 // 90° rear cone - normal sound detection
#define SOUND_REAR_PERIPHERAL 2 // 45° rear side cones - reduced sound detection

/// Normal baseline blood volume
#define BLOOD_VOLUME_NORMAL 1000
/// The amount blood typically regenerates to on its own
Expand Down Expand Up @@ -176,6 +185,7 @@
#define MOB_SIZE_SMALL 1
#define MOB_SIZE_HUMAN 2
#define MOB_SIZE_LARGE 3
#define MOB_SIZE_HUGE 5

//Ventcrawling defines
#define VENTCRAWLER_NONE 0
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
#define TRAIT_NO_MIDROUND_ANTAG "no-midround-antag" //can't be turned into an antag by random events
#define TRAIT_PUGILIST "pugilist" //This guy punches people for a living
#define TRAIT_KI_VAMPIRE "ki-vampire" //when someone with this trait rolls maximum damage on a punch and stuns the target, they regain some stamina and do clone damage
#define TRAIT_ASSASSIN "assassin" //Can perform deadly assassination strikes on unaware enemies
#define TRAIT_PASSTABLE "passtable"
#define TRAIT_GIANT "giant"
#define TRAIT_DWARF "dwarf"
Expand Down
43 changes: 39 additions & 4 deletions code/controllers/subsystem/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ SUBSYSTEM_DEF(atoms)
/datum/controller/subsystem/atoms/Initialize(timeofday)
GLOB.fire_overlay.appearance_flags = RESET_COLOR
setupGenetics()

// OPTIMIZATION: Pre-allocate GLOB.machines to avoid repeated list resizing during init
// Typical maps have 1000-2500 machines, so pre-allocate to avoid performance hits
GLOB.machines = new /list(2500)

initialized = INITIALIZATION_INNEW_MAPLOAD
InitializeAtoms()
return ..()
Expand All @@ -30,34 +35,64 @@ SUBSYSTEM_DEF(atoms)
LAZYINITLIST(late_loaders)

var/count
var/batch_count = 0
var/list/mapload_arg = list(TRUE)
if(atoms)
count = atoms.len
for(var/I in atoms)
var/atom/A = I
if(!(A.flags_1 & INITIALIZED_1))
InitAtom(I, mapload_arg)
CHECK_TICK
if(++batch_count >= 100)
batch_count = 0
CHECK_TICK
else
count = 0
for(var/atom/A in world)
if(!(A.flags_1 & INITIALIZED_1))
InitAtom(A, mapload_arg)
++count
CHECK_TICK
if(++batch_count >= 100)
batch_count = 0
CHECK_TICK

testing("Initialized [count] atoms")
pass(count)

initialized = INITIALIZATION_INNEW_REGULAR

if(late_loaders.len)
batch_count = 0
for(var/I in late_loaders)
var/atom/A = I
A.LateInitialize()
if(++batch_count >= 100)
batch_count = 0
CHECK_TICK
testing("Late initialized [late_loaders.len] atoms")
late_loaders.Cut()

late_loaders.Cut()
// OPTIMIZATION: Batch camera visibility updates after all atoms initialized
if(atoms) // Only during mapload
testing("Updating camera visibility for all turfs...")
batch_count = 0
for(var/turf/T in world)
T.visibilityChanged()
if(++batch_count >= 100)
batch_count = 0
CHECK_TICK
testing("Camera visibility updated")

// OPTIMIZATION: Batch sunlight border smoothing after all turfs exist
if(atoms)
testing("Smoothing sunlight borders...")
batch_count = 0
for(var/turf/T in world)
if(T.sunlight_state == SUNLIGHT_BORDER && isnull(T.border_neighbors))
T.smooth_sunlight_border()
if(++batch_count >= 100)
batch_count = 0
CHECK_TICK
testing("Sunlight borders smoothed")
/datum/controller/subsystem/atoms/proc/InitAtom(atom/A, list/arguments)
var/the_type = A.type
if(QDELING(A))
Expand Down
5 changes: 4 additions & 1 deletion code/controllers/subsystem/icon_smooth.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ SUBSYSTEM_DEF(icon_smooth)
smooth_zlevel(2,TRUE)
var/queue = smooth_queue
smooth_queue = list()
var/batch_count = 0
for(var/V in queue)
var/atom/A = V
if(!A || A.z <= 2)
continue
smooth_icon(A)
CHECK_TICK
if(++batch_count >= 100)
batch_count = 0
CHECK_TICK

return ..()
2 changes: 1 addition & 1 deletion code/controllers/subsystem/idlenpcpool.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SUBSYSTEM_DEF(idlenpcpool)
name = "Idling NPC Pool"
flags = SS_POST_FIRE_TIMING|SS_BACKGROUND|SS_NO_INIT
priority = FIRE_PRIORITY_IDLE_NPC
wait = 60
wait = 2 SECONDS // Reduced from 6s to 2s for faster initial mob response
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME

var/list/currentrun = list()
Expand Down
15 changes: 12 additions & 3 deletions code/controllers/subsystem/lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ SUBSYSTEM_DEF(lighting)
if(!init_tick_checks)
MC_SPLIT_TICK
var/list/queue = GLOB.lighting_update_lights
var/batch_count = 0
while(length(queue))
var/datum/light_source/light_datum = queue[length(queue)]
queue.len--
Expand All @@ -41,29 +42,35 @@ SUBSYSTEM_DEF(lighting)
light_datum.needs_update = LIGHTING_NO_UPDATE

if(init_tick_checks)
CHECK_TICK
if(++batch_count >= 100)
batch_count = 0
CHECK_TICK
else if (MC_TICK_CHECK)
break

if(!init_tick_checks)
MC_SPLIT_TICK

queue = GLOB.lighting_update_corners
batch_count = 0
while(length(queue))
var/datum/lighting_corner/corner_datum = queue[length(queue)]
queue.len--

corner_datum.update_objects()
corner_datum.needs_update = FALSE
if(init_tick_checks)
CHECK_TICK
if(++batch_count >= 100)
batch_count = 0
CHECK_TICK
else if (MC_TICK_CHECK)
break

if(!init_tick_checks)
MC_SPLIT_TICK

queue = GLOB.lighting_update_objects
batch_count = 0
while(length(queue))
var/atom/movable/lighting_object/lighting_object = queue[length(queue)]
queue.len--
Expand All @@ -74,7 +81,9 @@ SUBSYSTEM_DEF(lighting)
lighting_object.update()
lighting_object.needs_update = FALSE
if(init_tick_checks)
CHECK_TICK
if(++batch_count >= 100)
batch_count = 0
CHECK_TICK
else if (MC_TICK_CHECK)
break

Expand Down
Loading
Loading