These are the files with just tiny tweaks. Mostly modify an object's attackby so it does "return ..()" instead of "..()".
If there are other things in this commit, the PR's description will explain them.
- I renamed some vars of datum/hud to be more selfexplanatory
- Moved all datum/hud mob code into the hud folder.
- fixed alien's zone selection button not using the correct sprites.
- I removed the update_hud() proc (that needed to be removed).
- Fixed a typo in /mob/living/carbon/ContractDisease , using "internals" instead of "internal" (very different things)
- Fixed doTeleport() calling Entered() twice on the destination area.
- To reference a mob's selected zone, you now use a direct mob var ("H.zone_selected" instead of "H.zone_sel.selecting")
- mobs lose certain screen objects var ("healths", "zone_sel", "internals", etc) which are now vars of the mob's datum/hud instead.
- the Blind spell is now done via the blind mutation instead of the blind disabilities.
- Give to mobs a version of forceMove(), so the mob is always properly unbuckled, his pull stopped, his vision updated, etc.
- The "user" var of mob/camera/aiEye/remote is renamed to "eye_user" to avoid confusion.
- reset_view() is replaced by reset_perspective(). Now all changes to client.eye and client.perspective are done with this proc.
- I reworked /obj/machinery/computer/security code, changing camera is instantaneous now, as well as cancelling.
- I reworked /obj/machinery/computer/camera_advanced code as well.
- I changed /obj/item/mecha_parts/mecha_equipment/mining_scanner's meson view to be constant instead of by intermittent.
- Fixes not being able to use /obj/item/device/camera_bug while buckled.
- removed admin_forcemove() proc, admin force moving now uses forceMove() simply.
- Removed the client var "adminobs"
- Added var/vision_correction to glasses.
- Added a thermal_overload() proc for glasses, to remove copypasta in emp_act code.
- Remove the hal_crit mob var
- We no longer delete the mob's hud everytime he logs in.
- Added a stat == dead check in mob's metabolize() so we immediately stop metabolizing if one of the chem kills the mob.
- Being inside disposal bin lowers your vision, like wearing a welding helmet.
- removed the remote_view mob var.
- I changed advanced camera EYE, some fixes, removed unnecessary code when the eye moves, now the mob client eye properly follows the camera mob.
- fixes mob var "machine" not being nullified on logout.
- larva/death() was calling two "living_mob_list -= src"
- I made the Blind screen objects into a global_hud instead of giving one to each mob (like damage overlay).
- I untied tint and eye_blind, TINT_BLIND doesn't give you eye_blind=1.
- gave a visual overlay when inside locker (vimpaired)
- when inside disposal/gas pipes you get sight |= (BLIND|SEE_TURFS)
- glasses toggling updates (atmos meson toggle): DONE
- The new adjust procs serve to properly change eye_blind etc and call vision update procs when needed.
- I added an on_unset_machine() proc to handle perspective reset for camera consoles.
- I moved consequences of eye_check fail inside eye_check() procs themselves.
- I fixed vision updates being fucked by forceMove, especially pipe vision.
- I decided that damage overlay not appearing when dead.
- mob's hud_used is no longer deleted on each login()
- I refactored mob huds a bit, creating subtypes for each mob (/datum/hud/human)
- f12's hud toggling is now available to all mobs
- gave borgs a low_power_mode var so unpowered borg do not use stat= UNCONSCIOUS (which made things weird since you were unconscious but not blind)
- Fixed double Area entering when forced teleporting.
- I fixed larva pulling not being broken when cuffing them, and larva not seeing handcuff alert (and they can resist by clicking it)
- I removed pull updates from life() since it onyl checked for puller's incapacitation.
- I renamed camera/deactivate() to toggle_cam() to be more accurate.
- I fixed mmi brain being immortal (by removing the brain and putting it back)
- I simplified mmi brain emp damage.
MC:
No longer tracks a subsystem's cpu usage. This was basically worthless and took up space on the stat panel
Can calculate wait down to a tenth of a decisecond to make it fps/world.ticklag agnostic
Now allows subsystems to have a dynamic wait, that is based on a ratio of how long that subsystem has been taking to process(cost). (This system allows for upper and lower bounds, and an changeable cost delta for each subsystem)
MC can now be told to init a zlevel
All Subsystems:
Stats panel now allows child subsystems to pass it a message to add to its stats entry. All subsystems have been moved over to this system - This should cut down on subsystems having to copy and paste the stats proc in order to add to it
All subsystems now properlly handle being given a zlevel in their init proc
Subsystem changes:
Air:
Added air to the dynamic wait subsystem. upper bound: 50, lower bound: 5, cost delta: 3 times process cost
Air now fires 4 times faster when it can do so without lagging things up
Pipenet has been merged into air
Atmos machinery now processes with process_atmos(), ticked by air, not machinery.
Hotspots (the fire object) are now object pooled
Pipenet:
Deleted, added to air
Machinery:
Moved all atmos calcualtions in all objects's process() to process_atmos().
Lighting:
Added Lighting to the dynamic wait subsystem. upper bound: 20, lower bound: 5, cost delta: 3 times process cost
Ticker:
Fixed ticker not updating the lobby panel when game start delayed
Fixed the game start timer updating rapidly from queued fires when game start delay is removed
Garbage/qdel:
qdel will now limit its process time to 2ds a fire.
qdel can now be given hints as a return to Destroy() as to what should be done with the object.
the options are:
queue: (default) this is the normal behavior.
letmelive: old default to non-null/zero. does nothing with the object
iwillgc: functionally the same as above, mainly to let people working with objects know that the object will not be queued for GC checking
harddel: this will queue the object to be deleted without storing a soft reference, mainly to save locate() processing time.
harddel_now: this will del() the object. To allow for a clean removal of every del() not in qdel
All objects have been updated to the new system, harddel and iwillgc was not added to any new objects.
Fixed some objects not GCing because they didn't properlly clear references in Destory()
Fixed some objects getting qdel'ed preventing other objects from getting GCed because they did not null their reference to that object.
Misc:
+Fixes unreported issue with initializing lighting on a specific zlevel
+Fixes two similar issues with moveElement and moveRange. Where fromIndex or toIndex could be adjusted incorrectly in certain conditions. Potentially causing bad-sorts, or out of bound errors.
+Rewrites listclearnulls(list/L) to no longer iterate through L.len elements for every null in the list (plus 1). i.e. went from L.len*(number_of_nulls+1) list-element reads (best-case), to L.len list-element reads (worst-case)
+New proc/getElementByVar(list/L, varname, value) which finds the first datum in a list, with a variable named varname, which equals value. You can also feed it atoms instead of lists due to the way the in operator functions.
+Fixes an unreported issue with Yota's list2text rewrite. Under certain conditions, the first element would not be converted into a string. Causing type-mismatch runtimes.
+New global map_ready variable. This is not fully implemented yet, but will be used to avoid duplicate calls to initialize() for map objects.
+All turfs now maintain references to all lights currently illuminating them. This will mean higher memory use unfortunately, due to the huge number of turfs. However, it will speed up updateAffectingLights significantly. I've used list husbandry to reduce baseline memory usage, so it shouldn't be any worse than some past atmos modifications memory-wise.
-Removed 'quadratic lighting', can add this back at some point. Sorry.
+modified the way lum() works slightly, to allow turfs to have overridden delta-lumen. i.e. space cannot be illuminated more than its default ambiance. This allowed removal of some iffy special-snowflake lighting areas implemented by somebody else.
+Lighting images in the dmi can now use arbitrary naming schemes. It is reliant on order now. This allows the dmi to be replaced by simply dropping in a new dmi.
-Removed all subtypes of /area/shuttle. Shuttles now create duplicate 'rooms' of /area/shuttle. (More on this later). This will conflict with most maps. Guide on how to fix to follow.
+All verbs/tools relating to world.tick_lag were refactored to use world.fps. However old config text for setting tick_lag will still work (it converts the value to fps for you)
+MC stats improved using smoothing. They now have their own tab so they dont get in the way when you're playing as an admin.
-removed the push_mob_back stuff due to conflicting changes. Sorry Giacom.
_OK, NOW THE ACTUAL INTERESTING STUFF_
Following systems moved over to subsystem datums:
air_master
garbage_manager
lighting_controller
process_mobs (aka Life())
nanomanager
power
sun
pipenets
AFK kick loops
shuttle_controller (aka emergency shuttle/pods), supply_shuttle and other shuttles
voting
bots
radio
diseases
events
jobs
objects
ticker
Subsystems hooks and variables should be commented fairly in-depth. If anything isn't particularly clear, please make an issue.
Many system-specific global variables have been refactored into
All tickers which previously used world.timeofday now use world.time
some subsystems can iterate before round start. this resolves the issue with votes not working pregame
Also removed some mob vars like sdisabilities and merged the usability
with disabilities
Removed need for mutations var, they are not handled in dna
Removed blinded var, now its handled by eye_blind being bigger than zero
Ands lots, lots of other shit in files that used mutations
RESULTS:
sorting 10 random lists of length 3 to 303 in increments of 3
(Meh, I forgot to refresh this one, there were only 338 trials rather than 1010, can't be bothered to recode the test)
Profile results (total time)
Proc Name Self CPU Total CPU Real Time Calls
------------------------------------------------- --------- --------- --------- ---------
/proc/sortList 0.672 16.141 16.243 171226 <--TG's current mergesort(recursive, hence the higher number of calls)
/proc/sortTim 0.008 3.278 3.274 338 <--TimSort
/proc/sortMerge 0.011 2.839 2.855 338 <--new mergesort
/proc/sortInsert 0.010 2.124 2.103 338 <--binary insertion
Sorting 10 presorted lists with 3 inversions (3 elements shuffled up), Lists of length 3 to 303 (increments of 3)
Profile results (total time)
Proc Name Self CPU Total CPU Real Time Calls
------------------------------------------------- --------- --------- --------- ---------
/proc/sortList 1.290 23.056 23.254 308050 <--rather cataclysmic
/proc/sortMerge 0.015 4.077 4.068 1010 <--
/proc/sortInsert 2.639 3.472 3.464 1010 <--
/proc/sortTim 0.014 1.567 1.576 1010 <--TimSort is faaar more effective in these cases,
Timsort can exploit runs effectively
sorting 10 presorted lists which have been reversed
Profile results (total time)
Proc Name Self CPU Total CPU Real Time Calls
------------------------------------------------- --------- --------- --------- ---------
/proc/sortList 1.234 23.193 23.295 308050
/proc/sortMerge 0.023 4.681 4.686 1010
/proc/sortInsert 2.875 3.750 3.765 1010
/proc/sortTim 0.020 3.294 3.284 1010 //This can be lower by using a different comparison method
*Corrected: /proc/sortTim 0.017 0.665 0.663 1010 //Using a non-strictly ascending comparison
sorting 10 presorted lists
Profile results (total time)
Proc Name Self CPU Total CPU Real Time Calls
------------------------------------------------- --------- --------- --------- ---------
/proc/sortList 1.199 21.391 21.517 308050
/proc/sortMerge 0.018 3.724 3.729 1010
/proc/sortInsert 2.497 3.302 3.309 1010
/proc/sortTim 0.024 0.586 0.584 1010
Summary, all the new procs are faster than the old ones. TimSort is ever so slightly slower than Insertion and Merging on random lists. But on lists with natural runs (partially sorted data) it is far faster than all others.
The old merge sort was removed and replaced with timSort. Other algorithms are provided as alternatives.
All algorithms use a central datum, so accept many of the same parameters. For instance, setting associative=1 will make them sort associative lists by their associated values, rather than keys.
They also accept a cmp argument. This allows sorting of lists of datums, text, numbers or whatever. The pre-existing helpers in lists.dm were rewritten as examples.
Move all atom/Destroy() behavior to atom/movable/Destroy() so turf/areas that get qdel()'d just get del()'d like they're supposed to. Also do tag = null, which should make more things GC.
Make cameras GC correctly and some misc grammar fixes.
Make smoke grenades GC.
Tell camera bugs to del() because I'm not working on complex behavior for one item.
There wasn't much feedback, so I just threw together something acceptable, not being able to think of anything particularly clever.
- Universal bug: atmos analyzer or subspace analyzer
- Sabotage bug: Igniter, infrared tripwire thing, or subspace amplifier
- Network bug: Radio, signaler, or subspace transmitter
- Advanced bug: Detective scanner, pAI card, or scanning module stock part
Adds an associative list sorter to the helper procs. This will sort a list while maintaining the key=value structure.
The tracking functions of the camera bug will now auto-refresh if you keep the window open. The functionality was there but broken previously. This allows you to creepily stalk someone or observe a sensitive area.
The camera bug is now extensible. If you add an extension of certain types, the bug will have additional functionality. A screwdriver will remove the existing extension. Additionally, an admin/testing version of the camera bug can be created with the research admin spawnable item.
This is not the final version of this code; sane item types for the extensions must be chosen. I do not have any that are feasible right now.
* Vanilla - Sees its own bugs only
* Universal - Sees all bugs
* Networked - Sees all cameras
* Sabotage - Sacrifices a bug to EMP a camera
* Tracker - Lets you monitor who is near a camera and what camera a person is near. Some limitations.
Camera bug acts as a mini-camera computer with access to all bugged cameras.
Adjusts camera checks to determine who is looking through them; instead of checking their machine, it now checks the client eye.
Adds camera bug to the uplink list with a cost of 2TC.
Camera bug acts as a mini-camera computer with access to all bugged cameras.
Adjusts camera checks to determine who is looking through them; instead of checking their machine, it now checks the client eye.
Adds camera bug to the uplink list with a cost of 2TC.