Commit Graph

2302 Commits

Author SHA1 Message Date
小月猫
62cf2ef21b small refactor to can_interact() so that borg range is fully respected (#60693)
Its a relatively small refactor that changes the previous machinery "can_interact()" proc that literally did a full override despite half of their checks already existing in not one, but TWO parent procs, so i removed the redundant checks, added callbacks to its parents and then added the cyborg range check on the can_interact_with() itself. in doing so i also moved the interaction range var from silicons only, to mobs as a whole and defaulted it to a single tile, silicons override it to 7 (so pAIs and borgs like before) but then set AI and AI.eye to "null", because i have a check in can_interact that if there is no range set, then the range is effectively unlimited. and i even added code for when AI is carded and their wireless transmission is disabled it sets their range to "0" aka, it has no range to do anything even if it could

this was really complicated for me so despite my extensive testing it probably would be a bad thing if any of you want to test my code yourself to ensure there isnt a bug with this (theres no runtimes ive come across)

note: i did a lot of searching and going through machinery to ensure i caught all the little snowflake overrides and added can_interact() checks to them, but i may have missed one or two things, especially maybe a altclick or ctrlclick somewhere, however i believe i caught most of them

one nice side effect of this refactor is that you can actually set another mobs range to something other than 1 tile and they can interact at range, rather than only silicons getting this ability, an admin could VV a human to have a 3 tile arm reach as a meme if they want
2021-08-31 13:59:39 -04:00
tralezab
4b202ab2c8 Update field_generator.dm (#60918) 2021-08-27 11:18:51 +02:00
TiviPlus
e629c36feb Refactor area and turf lighting (#60954) 2021-08-25 15:07:38 -07:00
Ghilker
d33fd446fa light code cleanup and update (#60785) 2021-08-23 13:00:39 -07:00
MMMiracles
74df74f3d8 Fixes solar stacking (#60799) 2021-08-20 09:55:50 -04:00
Colovorat
5590e28db8 unused proc begone (#60843)
Co-authored-by: Colovorat <lolqwert569@gmail.com>
2021-08-20 13:05:37 +03:00
Watermelon914
ffe2750744 Refactors connect_loc_behalf into a component (#60678)
See title. Also refactors caltrops into a component because they use connect_loc_behalf which requires them to hold the state.

This also fixes COMPONENT_DUPE_SELECTIVE from just outright not working.

connect_loc_behalf doesn't make sense as an element because it tries to hold states. There is also no way to maintain current behaviour and not have the states that it needs.
Due to the fact that it tries to hold states, it means the code itself is a lot more buggy because it's a lot harder to successfully manage these states without runtimes or bugs. 

On metastation, there is only 2519 connect_loc_behalf components at roundstart. MrStonedOne has told me that datums take up this much space:
image

If we do the (oversimplified) math, there are only ever 5 variables that'll likely be changed on most connect_loc_behalf components at runtime:
connections,
tracked,
signal_atom,
parent,
signal_procs

This means that on metastation at roundstart, we take up this amount: (24 + 16 * 5) * 2519 = 261.97600 kilobytes
This is not really significant and the benefits of moving this to a component greatly outweighs the memory cost.

(Basically the memory cost is outweighed by the maint cost of tracking down issues with the thing. It's too buggy to be viable longterm basically)
2021-08-17 12:16:12 -07:00
LemonInTheDark
cd576ab519 Del The World: Unit testing for hard deletes (#59612)
Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
2021-08-15 21:09:26 -07:00
LemonInTheDark
79dc58fe2a Redoes how alarms are handled, moves their behavior to datums (#60060)
* Adds in a set of datums to support sending, listening and storing alerts
In contrast to the old system, we now store a list of send alerts on the listener, rather then the area itself.

This makes clearing "our" alerts on destroy not a massive headache.

In addition, we now use a direct ref to the area's cameras list and signals to prevent camera hard deletes. This, combined with the aformentioned ability to clear, virtually eliminates hard deletes
sourced from alerts caused by strange senarios like the alert source moving its tile.

* Converts areas to the system, of note is the fact that areas no longer store a bool that determins if an alert
for power or atmos has been sent, that's instead handled by the alert sender datum. This means the sources list
on alert listeners actually means something

additionally, in order to prevent dumbassery with fire alarms since they're area based, fire alerts are sent by
an alert handler on the area itself
2021-08-13 11:54:44 -07:00
Ghilker
badc431a9c power/singularity folder small cleanup and update (#60783)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-08-11 14:57:12 -07:00
TemporalOroboros
9bbf63c75b Fixes rad collector ignoring access requirements for locking. (#60656) 2021-08-03 00:16:22 -07:00
Jordan Brown
c44d61c25b Fix APC power usage (#60472) 2021-07-26 20:02:53 -07:00
tralezab
43fd840b2f Kills _globalvars/misc.dm (#60358) 2021-07-26 16:58:18 -07:00
TheSmallBlue
686838e600 Hulks and larvas will now dust when punching the supermatter (#60307) 2021-07-20 00:43:57 -07:00
Kylerace
5d6e93510f makes a bunch of lists that use typecacheof() static. doesnt find out why its overtiming at all but what the hell it helps (#60147)
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2021-07-12 14:08:46 -07:00
Wayland-Smithy
70b9cded23 Makes Emitter locks silicon compatible (#60070) 2021-07-08 21:46:44 -07:00
Kylerace
19f047b34d makes some instances of x^y into x**y because thats what exponents are in dm (#60050)
caught by monster at yogstation13/Yogstation#11703
probably not intended, 2^15 = 13 in dm so dont call this proc more than 13 times sequentially i guess

I have a suspicion that it doesn't matter assuming it gets caught by tick_usage being different but just in case

also fixes two other instances in code shown to me by mso
2021-07-08 02:34:42 +01:00
Urumasi
1e5e3803ae Fix turbine exploit (#59934) 2021-07-03 20:35:57 +02:00
Wayland-Smithy
e361040c74 Fix incorporeal movers procing containment field effects (#59919) 2021-07-03 14:52:10 -03:00
LemonInTheDark
d368e4d49d Changes how weather sends sound to players, reduces sound loop overtime (#59284)
* Converts looping sounds from a list of play locations to just the one

* Updates all uses of looping sounds to match the new arg

* Adds an area based sound manager that hooks into looping sounds to drive the actual audio. I'll be using this to redo how weather effects handle sound

* Some structrual stuff to make everything else smoother
Timers now properly return the time left for client based timers
Weather sends global signals when it starts/stops
Looping sounds now use their timerid var for all their sound related timers, not just the main loop

* This is the painful part
Adds an area sound manager component, it handles the logic of moving into new areas potentially creating new
sound loops. We do some extra work to prevent stacking sound loops.
Adds an ash storm listener element that adds a tailored area sound manager to clients on the lavaland z level.
It's removed on logout.
Adds the ash_storm_sounds assoc list, a reference to this is passed into area sound managers, and it's modified
in a manner that doesn't break the reference in ash_storm (This is what I hate)

* Hooks ash storm listener into cliented mobs and possessed objects

* Documents the odd ref stuff, adds an ignore start var to looping sounds, fixes some errors and lint issues

* Applies kyler's review

banging

Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>

* Cleans up some var names, reduces the amount of looping we do in some areas

* Makes the code compile, redoes the movement listener to be more general

* fuck

* We don't need to detach on del if we're just removing signals on detach

* Should? work

* if(direct) memes

Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
2021-06-30 20:51:35 -04:00
Fikou
d0181eacad Fix singularity beacon (#59868)
Stops singularity objects from being added to the global singularity list,
this list is only for singularity components.

This fixes singularity beacons breaking because they expect that only
singularity components are in the global singularity list.
2021-06-29 20:50:29 +01:00
Time-Green
a915c7167e Refactors species stomach code, makes ethereal charge inherent to their stomach (#59801)
A stomach would literally just ask the species datum how to be hungry and made a bunch of exceptions for ethereals. I mostly just moved code around so that hunger is handled by a persons stomach, thus shrinking the species.dm bloat.

This also makes it so ethereal's charge mechanic is unique to their stomache, instead of this really weird inbetween where just nothing happens and you kinda starve to death. You can stick an ethereal stomach in a human and this will replace their hunger mechanic with the charge mechanic and lets them absorb power from APCs and everything. You can also give ethereals a normal stomach and they'll use the normal hunger mechanics
2021-06-27 12:35:53 -03:00
Mothblocks
23790c6c5e Fix missing SIGNAL_HANDLER (#59826)
Adds SIGNAL_HANDLER to everywhere that didn't have it that was picked up by dm-lua, which is now ready enough to catch these.
2021-06-27 15:43:49 +01:00
Rohesie
82dc71c3ae CanPass refactor (#59804) 2021-06-25 13:36:00 -07:00
LemonInTheDark
6fcbce39cd Makes turfs persist their signals, uses this to optimize connect_loc (#59608)
* Makes turfs persist signals

* Splits connect_loc up into two elements, one for stuff that wishes to connect on behalf of something, and one for stuff that just wants to connect normally. Connecting on behalf of someone has a significant amount of overhead, so let's do this to keep things clear

* Converts all uses of connect_loc over to the new patterns

* Adds some comments, actually makes turfs persist signals

* There's no need to detach connect loc anymore, since all it does is unregister signals. Unregisters a signal from formorly decal'd turfs, and makes the changeturf signal persistance stuff actually work

* bro fuck documentation

* Changes from a var to a proc, prevents admemems and idiots

* Extra detail on why we do the copy post qdel
2021-06-22 23:12:34 -04:00
Rohesie
0ec599786a Adds a setter for density (#59529)
Adds set_density()
Fixes one instance of a duplicate density assignment on an object.
Comments two hacky usages of density which will have to forgo using the setter for now.

Lets us append code to the event of density changing.
Pretty sure this is leading up to some multitile object thing -Lemon
2021-06-16 15:06:10 -07:00
Watermelon914
375a20e49b Refactors most spans into span procs (#59645)
Converts most spans into span procs. Mostly used regex for this and sorted out any compile time errors afterwards so there could be some bugs.
Was initially going to do defines, but ninja said to make it into a proc, and if there's any overhead, they can easily be changed to defines.

Makes it easier to control the formatting and prevents typos when creating spans as it'll runtime if you misspell instead of silently failing.
Reduces the code you need to write when writing spans, as you don't need to close the span as that's automatically handled by the proc.

(Note from Lemon: This should be converted to defines once we update the minimum version to 514. Didn't do it now because byond pain and such)
2021-06-14 13:03:53 -07:00
norill
4387998f7a - fixed various charge-related bugs of defib and defib wall mounts (#59366)
Co-authored-by: norill <4>
2021-06-10 00:07:28 -07:00
interestingusernam3
b891d89cdf Fixes comments for /obj/item/stock_parts/cell. (#59510) 2021-06-06 12:29:31 -03:00
vincentiusvin
1b69fd40fa Ghosts can open the NT CIMS TGUI by clicking the SM Crystal. (#59475) 2021-06-04 21:35:40 -07:00
peptron1
7ee65467de Allows ghosts to see the status of the power network by examining cables. (#59469)
Ghosts can now inspect cables to get the same readout that the multitool gives when you use it on a cable.
2021-06-04 11:58:11 -03:00
Emmett Gaines
43c5dc8bfa Makes obj_integrity only updated through procs (#59474)
Having things updating integrity directly is just going to cause more problems down the line as more elements and components depend on being notified of integrity changes. It's an easy mistake to make so making it private should deal with the problem.

get_integrity() might be useful in the future but is mainly a side effect of making obj_integrity private as that also disallows reads.
2021-06-04 11:48:05 -03:00
Celotajs
190d0a0384 Replace alert usage with tgui_alert (#58419)
Pretty much every alert() call is replaced with tgui_alert, except one I replaced with tgalert as a fallback. If tgui_alert exists, why not use it?
2021-05-20 22:43:27 +12:00
Mothblocks
bcaaa65e6a Stop singularities from consuming themselves (#58987)
This bug was fixed by one of the connect_loc PRs, but this is still useful as it contains a CRASH for when it happens if this bug comes back again.
2021-05-14 20:12:46 -07:00
dragomagol
c86aff9a82 The Wallening Approacheth: Adds directional variants to most wall mounts (#58809) 2021-05-08 02:57:36 -07:00
Kylerace
08df8798ce (code bounty) refactors all uses of Crossed() and Uncrossed() into signals sent to loc, tracked by connect_loc (#58340)
Co-authored-by: Jared-Fogle <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com>
2021-05-07 03:54:03 -07:00
LemonInTheDark
c906c44393 Fixes a fuck ton more harddels (#58779)
Redoes how geese handle eating shit, it was fucking stupid and caused harddels, and while this method is technically slower in the best case, it's a fucking goose
Fixes action related harddels, I hate how they work but at least this way they won't hold refs.
Fixes the hierophont causing its beacon to harddel
Removes the M variable from megafauna actions, it was used like a typed owner and caused harddels, so I burned it
Fixes target and targets_from harddels, replaces all setters of target with LoseTarget and GiveTarget, which should help maintain behavior. I'm not sure if this breaks anything, but if it does we should fix the assumptions that code makes instead of reverting this change
Fixes more area_senstive_contents related harddels, we need to allow the mob to move before clearing out its list.
Fixes marked object harddels (I'm coming for you admin team)
Fixes a language based human harddel
Fixes managed overlay related harddels (This was just emissive blockers, but I think this is a good safety net to have. If we clear the overlay list we should clear this one as well)
Fixes bot core harddels, I hate the fact that this exists but it has no reason to know who its owner is
Adds a walk(src, 0) to simple_animal destroy, it's the best bang for the buck in terms of stopping spurious harddels. Walk related harddels aren't that expensive in the first place, since byond does the same thing I'm doing here, but this makes finding mob harddels easier, so let's go with it
I fixed another source of part harddels, I hate fullupgrade so much
Fixes all the sound loop harddels
2021-05-05 10:57:27 -04:00
LemonInTheDark
27385e9d70 Converts the atmos senstive component over to connect_loc (#58266)
* Makes all uses of atmos_senstive pass in mapload as context

* Converts atmos senstive to connect_loc, does some general cleanup to the element, and makes it check the state of the tile the thing is on assuming creation didn't happen as a part of map loading

* Updates connect loc to match the new arg list
2021-04-30 18:35:47 -07:00
LemonInTheDark
a924226b50 React optimization + event based processing for tanks, canisters and pipelines (#58418)
* Makes tanks only process when needed, rather then doing it constantly

* Makes portable atmos machines only process when needed, makes adding and removing atmos machinery cheaper, makes the tank processing logic actually work properly

* Makes pipelines only react() when their mix changes, fixes a ton of misuses of update_parents that were causing about 10ms of load for atmos just from reconcile_air()

* Adds in a new reaction framework alongside the old one for profiling related reasons

* whoops

* Cleanup, removes the react profiling code, I've chosen a direction to go here

* Cleans up some code, adds comments describing how to interact with portable atmos machines/tanks and their
mixes, adds a blurb to Atmospherics.md about the topic as a whole, leaves a line of bread for someone to follow
if I get hit by a bus in 2 days (Knock on wood)

* Removes priority from reactions, moves priority groups to the defines file

* whoops

* Converts air_contents to _air_contents, replaces all the out of file things that used it with return_air()

* Replaces the canister air contents uses, converts it back to air_contents, I decided I didn't like the _

* Fixes
2021-04-30 12:29:29 +02:00
Ghilker
234d9cfd59 SM code improvements (#58457)
Just some code improvement of the SM
2021-04-28 19:45:04 -07:00
tralezab
8f420e7cca Removes Crystal Invasion (#58711) 2021-04-27 18:26:19 -07:00
MrZoraman
c7c17a849f Blind people no longer get hallucinations from supermatter crystals (#58718)
The Supermatter Crystal no longer causes blind people to get hallucinations. The SM causes hallucinations based on eyesight, which is why eye protection (meson glasses) can protect you from it. It makes sense that those who can't see don't get affected by the hallucinations.

It makes the mechanics more consistent. It also adds interesting situations, like if you can't find meson goggles, a blindfold will do in a pinch.
2021-04-27 16:53:15 -07:00
Ghilker
8749145282 More HFR interactions, better damage control, better Meltdown (#58506)
Some more gas interactions with the HFR
-O2 will help remove iron content
-Antinoblium accumulation or damage over 60% will now start zaps similar to those of the SM (useful to produce power too)
-Bz will make more particles shoot out
-Meltdown now spew the hot fusion gases around the machine too (20% of the total gases are randomly placed around the machine in 10 open turfs each containing only 10% of that 20%)
-damage system now uses cooling temperature instead of the internal fusion temperature
2021-04-27 15:30:29 -07:00
TemporalOroboros
9f598a9662 Makes the explosive compressor and blastcannon actually use the TTVs they're given + the explosion changes to support that. (#58015)
* Adds explosion SFX to the blastcannon and explosive compressor

- Extracts the explosion SFX and screenshake proc from the SSexplosions explosion handling proc and lets the explosive compressor and blastcannon use it.

* Miscellaneous changes

- Adds defines for the internal explosion arglist keys
- Reverses the values of the explosion severity defines
- Changes almost everything that uses `/proc/explosion` to use named arguments

- Removes a whole bunch of argname = 0 in explosion calls.

* Removes named callback arguments.

* Changes the explosion signals to just use the arguments list

Adds a simple framework to let objects respond to explosions occurring inside of them.

Changes a whole bunch of explosions to use the object being exploded as the origin of the explosion rather than the turf the object is on.

Makes the explosive compressor and blastcannon actually use the TTVs they are given.

Adds support for things responding to internal explosions.
Less snowflake code for the explosive compressor and blastcannon calculating bomb range.*
Less confusing explosion severity defines.
Less opaque explosion arguments

*does not guarantee that the solution to letting them actually use the TTV is any less snowflake.
2021-04-26 17:31:25 -07:00
TemporalOroboros
03164f4fcb Emissive system refactor (#58130)
The emissives system is the system that both lets computer screens and vendors glow in the dark and lets mobs and items block those glows. The current implementation relies on using filters to let mobs and items mask out the glow in the dark overlays on some structures. This is difficult to extend properly without massively increasing maptick. This PR changes the emissives system to use BYONDs native image layering to mask emissive overlays. This should prove to be a more extensible option.

tldr; There exists a system that lets computer screens glow on the dark and lets mobs and items block the glow. It isn't very extensible and this PR attempts to make it more extensible.

How emissive overlays used to work

Currently emissive overlays and the emissive blockers that mask those overlays are handled using a system of inter-masking planes. The emissive overlays and the emissive blockers are placed on separate, hidden plane masters. These are essentially rendering layers and groups. The emissive blocker plane is then used to mask the emissive overlay plane which effectively allows the emissive blockers to block the emissive overlays from being seen. After is has been masked the emissive overlay plane is used to mask the lighting plane, essentially creating holes in the shadows wherever an unblocked glowing thing exists.

Why this is a potential problem

This system works fine. In fact it works great! The computer screens glow, any person or item that winds up on a computer blocks the glow, and everything just works. However, this system runs into some issues when you try to extend it to work on things other than structures. Namely, the current system only supports emissive overlays on structures and emissive overlays that are completely unblockable by any means. As a result, several interesting uses to the system require extending the system.

As a result, if you want to apply emissive overlays to items (which exist between structures and mobs) or emissive overlays to turfs (which exist below structures) you must extend the emissives system to get the emissive overlays and emissive blockers to properly function. Doing this naively, by adding extra emissive overlay and emissive blocker planes and applying all of the relevant masking filters, is not exactly performant.

Maptick is a major contributor to lag and the higher the maptick the more free lag you, the player, get delivered fresh to your client. Trying the naive method resulted in #55782 (1f1b58bb26), an attempt to add glowing carpet to the game. Since the PR revolved around adding glowing carpet it had to extend the emissives system to allow for emissive turfs and emissive blocking structures. Extending the system was done naively as described above and you can see the results. 1.5 times the maptick across the board. Ouch.

So, we know that extending the system in it's current form is impractical. At least if done naively. Thus we are stuck.

tldr; The emissive system currently uses inter-plane masking to allow for emissive blockers to function. This is difficult to reasonably extend without murdering maptick. See #56496 (1f1b58bb26) for the results of naively extending this system.

How emissive overlays are going to work

Alright, so we know that the current system of using planes to let the emissive blockers mask the emissive overlays is difficult to extend in it's current form. The solution is to change how the system works so that it can be extended in a more efficient manner. What we want is a system that allows one set of images to be out masked by another set of images and for the first set of images to be capable of masking the light plane. Preferably, we would also like the ability to interleave the masking effect between emissives and emissive blockers with almost arbitrary layering.

Conveniently, this layering and masking is something BYOND already does to normal items and objects. If we put the emissive overlays and the emissive blockers on the same plane we can use their layers to interleave them almost arbitrarily like any normal structures and items! All we need is a way to mask away the emissive blockers from the resulting rendered plane and we can mask the lighting plane with the remaining emissive overlays.

Luckily, BYOND has provided a single filter that is capable of this task. The color matrix filter. This filter can be used to apply a color matrix to an image! Provided that the emissive overlays and the emissive blockers are different colors we can use a color matrix filter to effectively mask out the emissive blockers from the plane! The resulting emissive plane can be applied as an alpha mask to the lighting plane as it used to, to the same effect. The best part is, we get layering practically for free!

This is exactly what this PR does. It converts the emissives system from the old plane and masking based blocking to a new layer-based system which uses BYONDs native layer handling to mask the emissive overlays.
2021-04-26 15:56:37 -07:00
Mothblocks
7e4de07506 Remove all gamemodes except Dynamic (#58470)
Removes all /datum/game_mode except dynamic. Eventually, all of mode and game_mode will be removed, and Dynamic will become an ingrained system. Every single other gamemode was unmaintained at best and poisoned other code at worst. Currently all tg servers run 24/7 Dynamic, so the time to act is now.

* Remove gamemode references from age checks

* Monkey

* Remove heretics

* Remove BBs

* Refactor uplinks and remove clown ops

* Remove nuke ops

* Removes and refactors cult

* Remove extended

* Remove and move out meteors

* Removes wizard

* Remove sandbox

* Remove changelings

* Remove traitors

* Remove revs

* Remove gangs

* Remove changing mode and voting for new gamemodes

* get_candidates signature fix

* Summon ERT and NERD in their own panel

* Remove some old unneeded age_check stuff

* Fix old signatures of get_uplink_items

* Use Extended like config for dynamic.json

* Fix discounted gear
2021-04-25 01:55:10 -07:00
Seth Scherer
0dcc5410b4 weldies (#58560) 2021-04-21 20:33:46 +02:00
Ghilker
e582414f44 emitters and collectors code improvements (#58454)
Refactor of collector and emitters to current standards
2021-04-18 01:11:17 -07:00
LemonInTheDark
964e7374e5 Pluoxium can currently be created in mico amounts on a lot of tiles, which creates a lot of unneeded active (#58306)
turfs, and wastes processing time.
Let's only make pluox in cold mixes then, and since it's not gonna mitigate high power runaways quite as hard
now, let's make it a net negative on waste gas output for the sm.
2021-04-11 19:37:44 -07:00
Kylerace
24efbd6525 changes most uses of SSvis_overlays.add_vis_overlay() inside of update_overlays() to true overlays (#57985) 2021-03-31 13:54:07 -07:00