Commit Graph

29 Commits

Author SHA1 Message Date
John Willard e9384e10a2 Camera update: Monochrome photo-taking (#95656)
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
2026-04-23 16:57:25 +00:00
Lucy 9b6e752f3e Makes lighting objects objects again (#95332)
## About The Pull Request

Continuation of https://github.com/tgstation/tgstation/pull/78857

FOR TOOO LONG WE HAVE SUFF-
Ok yeah so like, we made them overlays to save on maptick, but with
threaded maptick that is potentially not an issue anymore.
I'm opening this pr so I can tm it and see. If it works, it'll save
about 50% of lighting object update costs, which is pretty damn good.

I'm also removing the fullbright light icon state, since it is barely
ever used (it was added as a clientside op, but we don't hit fullbright
very much at all so it does nothing but eat my cpu time)

Also also changing how SSlighting does its resolution. Rather then
waiting for all sources to process, then working on corners and objects,
instead we will do all the sources we had at the start, then all the
sources after, and so on.
The goal is to avoid churn causing the system to constantly choke. it is
better to potentially double operate then it is for things to feel
horrifically slow.

## Why It's Good For The Game

Faster. Also you won't be able to see lights through walls anymore, so
mesons will be less dumb. Can maybe bump their nightvision a bit idk
we'll see.

## Current Issues

to be found

## Changelog
🆑 Absolucy, LemonInTheDark
fix: You can no longer see lights through walls when using mesons or
when ventcrawling.
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2026-04-23 08:55:26 +12:00
Lucy 79e7aa569e fixes up some math defines to use byond builtins instead of workarounds (#95652)
## About The Pull Request

this translates some various
- `FLOOR(x, 1)` -> `floor(x)`
- `CEILING(x, 1)` -> `ceil(x)`
- `SIGN(x)` define is gone, just uses the native BYOND `sign()` now.

Also, the `MODULUS` define is just a wrapper for the [BYOND `%%`
operator](https://ref.harry.live/operator/modulomodulo) now.

would be nice if someone double checked to make sure there's no
potential subtle oddities resulting from this.

## Why It's Good For The Game

These procs presumably did not exist whenever the defines were written -
and they are BYOND builtins, meaning it will just be, say, one `sign`
instruction, instead of two comparisons and a subtraction.

## Changelog

no player-facing changes
2026-04-13 15:32:42 +12:00
SyncIt21 de1f01fe76 General maintenance for hand held camera (#95295)
## About The Pull Request
- Merged a lot of procs into procs `attempt_picture()` and
`interact_with_atom()` reducing proc overhead
- Taking pictures will now always use the cameras internal
`picture_size_x` & `picture_size_y`. It no longer accepts variable sizes
as parameters
- All camera operations are asynchronous and respects checks on if the
target can be captured on camera or not.
- A bunch of other code rearrangement that makes readability easier
- Fixes the following camera bugs. They fall under the same category
  - Fixes #95286
  - Fixes #95256

## Changelog
🆑
fix: camera devices work again, camera flash turns on in most instances
refactor: camera code has been refactored. Report bugs on github
/🆑

---------

Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
2026-04-04 12:41:39 -04:00
John Willard 096c032402 Adds a new halloween species: Spirits (#90711)
## About The Pull Request

Adds 2 new species: Spirits and Ghosts

Spirits are available roundstart during Halloween, Wabbajack and
Xenobio's black slime extract
Ghosts are available through Magic mirrors

They fly around, and don't have legs and instead float around. They also
can't get legs implanted onto themselves.

They also do have organs, so they are affected by flashbangs, they do
get hungry, they do need oxygen to survive (they don't take damage in
space but they do suffocate & get slowdown), and can process chems.
Gibbing a ghost gives ectoplasm, an ingredient for ghost burgers.

Chaplains also got a buff here, null rod-type weapons' bane is now
against Spirit mobs, rather than hardcoded revenants. This means it now
includes Spirits/Ghosts, but also Soulscythes & Cult shades.

Also re-adds https://github.com/tgstation/tgstation/pull/81630 which was
reverted in https://github.com/tgstation/tgstation/pull/86506 which I
assume was accidental.

### The difference between Spirits and Ghosts

Ghosts have an innate ability to become incorporeal, which allows them
to phase through walls and stuff. Using this will immediately make them
drop any non-ghost limb/organ (not implants cause I thought it would be
funny). This ability is not available if they have holy water in their
system, and like revenants they also can't walk over blessed tiles with
it. They are also invisible to cameras while using this (not the obscura
though).

Sprites taken from observers directly, if anyone wants to make custom
sprites for them feel free. If anyone wants to make this obtainable
somehow in-game as well I wouldn't be opposed, halloween is just where I
thought it would fit most.

This also adds a lot of fixes that I encountered trying to add this,
from systems that have been neglected throughout the years.


https://github.com/user-attachments/assets/e368d710-80a0-4c63-b271-1abe3dd41a5e

## Why It's Good For The Game

We haven't gotten a new halloween species in a long time and thought it
would be fun if you can play as an actual ghost, the soul that remains
after a person passes, so Halloween feels more haunted. It's overall
made in just good fun, with a bonus that Ghosts are a cool species to
play with as well for Wizards & maybe Chaplains in the future (Dead sect
when?)

## Changelog

🆑
add: Added a new halloween species: Spirits, a species without legs and
instead floats.
add: Added a new magic mirror species: Ghosts, like spirits but with the
ability to become incorporeal, traversing through solid wall.
fix: Mobs unable to use storage items now can't use storage items.
fix: Mobs unable to use items can now not open airlocks & closets
fix: Mobs unable to pick items up can no longer pick items up and
immediately drop, moving one tile at a time.
fix: Mobs with intentional missing limbs (Alien larva) no longer show
their limbs as missing on examine (again)
fix: Golems' pref page had a missing icon, it now has one.
/🆑

---------

Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
2025-06-22 10:02:06 +02:00
_0Steven f324e6dd0c Allows taking pictures over advanced consoles or looking up/down, and fixes some multi-z photography issues. (#91632)
## About The Pull Request

I wanted to allow you to take pictures over advanced camera consoles for
heist planning style point reasons, and parity with the AI, and in the
process found a small pile of bugs.
So, this aims to fix a pile of those, and slightly clean up the code in
the process.

The biggest part of this change involves making the multi-z part of
photography code properly account for turfs below open or glass turfs,
rather than trying to skip to the bottom. This needs to be done because
objects can exist above those open turfs, most commonly
lattices/catwalks, but also nograv stuff.

...Parallax is its whole own other issue with how photography works
right now, so uh. Yeah, no.

Sadly I couldn't get this to work with regular camera consoles, and as I
found it to be an entirely different can of worms that would only
slightly touch this code I decided that would be best explored in a
separate pr.
## Why It's Good For The Game

I think it's cute to be able to take a picture of your screen and show
it off to people, maybe even combine it with a detective board for a
cool little planning thing. And the AI can take pictures over the
cameranet so, y'know.
Doing so while looking up/down was a side-effect, but really I think
it's fine to let you photograph it if you can see it.

Less multi-z jank is good 👍

### Actual Pictures:
<details>
  <summary>Unfold</summary>
  

![image](https://github.com/user-attachments/assets/322ba400-e72e-4e0e-b974-6ba60372103f)

![image](https://github.com/user-attachments/assets/aaa0ffd4-7313-44ea-bc73-ac55b4c2a51b)

![image](https://github.com/user-attachments/assets/f5647b02-60c4-4d46-a9a7-6f1541550e1d)

![image](https://github.com/user-attachments/assets/49498845-9fdc-4907-b660-96989c0b28fb)

![image](https://github.com/user-attachments/assets/d8c19118-84f2-4ab6-b8c0-0d5427ed9262)

![image](https://github.com/user-attachments/assets/1ade6619-4d7f-42ce-8063-041e8fe58dfb)

![image](https://github.com/user-attachments/assets/b5d14478-4ce0-4f5c-a9bf-1ef927103d85)

</details>

## Changelog
🆑
add: You can take pictures over advanced camera consoles.
add: You can take pictures while looking up or down.
fix: AIs taking pictures in multi-z shows the objects of your floor and
the ones below, instead of just the ones below.
fix: Humans taking pictures through holes in multi-z actually shows the
floor below, instead of pitch-black nothingness.
fix: Taking pictures of glass floors in multi-z actually shows the floor
below.
/🆑
2025-06-19 18:53:25 +00:00
tonty 3f0b4abb8d Replaces world.icon_size (and some magic numbers) with defines (#86819)
## About The Pull Request

All usages of world.icon_size in code have been replaced with new
`ICONSIZE_X`, `ICONSIZE_Y` and `ICONSIZE_ALL` defines depending on
context

Replaces some "32" magic numbers with the defines

A few bits of code have been modified to split up x/y math as well

## Why It's Good For The Game

Magic number bad, code more readable, code more flexible and I'm told
there's an access cost to doing world.icon_size so minor performance
gains

## Changelog

🆑 tonty
code: made some code relating to the world's icon size more readable
/🆑

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-09-29 13:28:32 +00:00
Ghom 8a6dbb1a45 Gives detectives an ID that looks like an assistant ID when flipped. Also makes their camera silent. (#85912)
## About The Pull Request
This PR adds an ID subtype which the detective outfit uses. It that can
be flipped to go plainclothes as an assistant. Access retained. Spare
clothes not included.

I've also made the detective camera silent (a sound cue is still played
to the user, others won't hear it) and with the flash disabled.

## Why It's Good For The Game
I want to make it a little easier for detectives to go plainclothes.
Between clothings and inventory management, it's already quite tricky as
a gimmick and without doubt a double-edged sword that can lead to
goofy-ass situations where officers actually confuse you for an
assistant. As for the camera, it's just a stealth buff.

## Changelog

🆑
add: Gave the detective an ID that can flipped to look like an assistant
ID.
balance: The detective camera is now silent and doesn't flash.
/🆑
2024-09-15 11:48:09 -07:00
LemonInTheDark e90a9b4b68 Flattens The Floor Plane (Camera Update Too) (#84350)
## About The Pull Request

Ok so like, side map right? It makes things higher up in the world
render above things lower down in the world.

Most of the time this is what we want, but it is NOT what we want for
floors.
Floors are allowed to be larger then 32x32, and if they are we want them
to render based off JUST their layer.
If we don't allow this grass turfs and others get cut off on their
bottom edge, which looks WEIRD.

In order to make this happen, we can add TOPDOWN_LAYER to every layer on
the floor plane and disable sidemap.

I've added documentation for this to VISUALS.md, and have also
implemented unit test errors to prevent mixing TOPDOWN layers with non
topdown planes (or vis versa).
This new test adds ~1 second to tests, which is I think a perfectly
scrumpulent number.

EDIT:

I nerd sniped myself and implemented sidemap layering and lighting for
cameras (also larger then 32x32 icon support for getflat)
The lighting isn't perfect, we don't handle things displaying in the
void all that well (I am convinced getflat blending is broken but I have
no debugger so I can't fix it properly), but it'll do.

This came up cause I had to fix another layering issue in cameras and
thought I might as well go all in.

![image](https://github.com/tgstation/tgstation/assets/58055496/601b422c-f6aa-42ba-bcd9-b1faebe236e3)


## Why It's Good For The Game

Old:

![image](https://github.com/tgstation/tgstation/assets/58055496/d4102386-420d-4346-b05c-b819e62d98d0)

New:

![image](https://github.com/tgstation/tgstation/assets/58055496/1f5e303e-adee-427d-8fe3-76c8f2dbe098)


## Changelog
🆑
fix: Grass turfs will render properly now. Reworked how floors render,
please report any bugs!
fix: Cameras now properly capture lighting
fix: The layering seen in photos should better match the actual game
/🆑
2024-07-04 12:10:41 -07:00
Zephyr 1b96345e44 Multi-Z Support for Lazy Templates | Cleans up some turf flag misuse (#77786)
## About The Pull Request

Adds multi-z support for lazy templates
Also fixes some improper use and placement for turf flags
## Why It's Good For The Game

Shadow needs/wants this for bit runner maps.
Turf flags are also why lava has been generating in places it shouldnt.
(inside of ruins)
## Changelog
🆑
fix: Lava can no longer occasionally generate inside of previously
loaded templates and breach and/or destroy shit
/🆑

---------

Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2023-09-19 01:06:08 +00:00
Fikou a207eb3216 [Ready] Makes the admin-only high frequency blade !FUN! and adds it to the spellbook (#63861)
* makes the vibro sword fun

* AND IT WILL COME LIKE A FLOOD OF PAIN

* POURING DOWN ON ME

* AND IT WILL NOT LET UP

* UNTIL THE END IS HERE

* AND IT WILL COME THROUGH THE DARKEST DAY

* IN MY FINAL HOUR

* AND IT WILL NEVER REST UNTIL THE CLOUDS ARE CLEAR

* only love is with us now

* something warm and pure

* find the peace within ourselves

* no need for a cure

* MAKING WHOLE THE FABRIC OF SOCIETY

* COLLECTIVE CONSCIOUSNESS CONTROLLED AS YOU WILL SEE

* MIND CONTROL

* WOOOOOOOOOOOOOOOOOOOO

* YEAAAAAAAH

Co-authored-by: Urumasi <Urumasi@email.cz>

* decompose that matrix bitch ass

* sord

* you will die

Co-authored-by: Urumasi <Urumasi@email.cz>
2022-01-09 15:03:06 -08:00
Mothblocks 0f435d5dff Remove hideous inline tab indentation, and bans it in contributing guidelines (#56912)
Done using this command sed -Ei 's/(\s*\S+)\s*\t+/\1 /g' code/**/*.dm

We have countless examples in the codebase with this style gone wrong, and defines and such being on hideously different levels of indentation. Fixing this to keep the alignment involves tainting the blames of code your PR doesn't need to be touching at all. And ultimately, it's hideous.

There are some files that this sed makes uglier. I can fix these when they are pointed out, but I believe this is ultimately for the greater good of readability. I'm more concerned with if any strings relied on this.

Hi codeowners!

Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
2021-02-14 16:53:29 -08:00
Nicolas Nattis 8d2db7eeee Improves code 2020-10-02 14:34:32 -03:00
Nicolas Nattis b0bac2ea64 some improvement maybe 2020-10-02 14:19:24 -03:00
Nicolas Nattis ef152036c0 nemvar sugestion 2020-10-02 14:15:57 -03:00
Nicolas Nattis fb5ddaa8d2 . 2020-09-25 18:31:47 -03:00
Nicolas Nattis 28258332ac Fixes shifting 2020-09-25 18:27:57 -03:00
Nicolas Nattis efa53a27d8 Makes cameras process transforms instead of reading mob angles 2020-09-25 18:08:29 -03:00
jdawg1290 62676e72a8 Force LF line endings with gitattributes and convert repo (#52266)
Co-authored-by: Aleksej Komarov <stylemistake@gmail.com>
2020-07-16 03:02:40 +03:00
silicons b2f346b2a0 Update camera_image_capturing.dm 2020-07-08 11:00:19 -07:00
silicons d356db9023 maybe 2020-07-07 10:29:29 -07:00
Rohesie 528fc99f28 lying to lying_angle and set proc (#50018)
* lying angle

* duplicate

* Documentation

* Comments
2020-03-22 21:49:52 -07:00
spookydonut beca456c0f Add new lints (#49751)
Co-authored-by: Jordan Brown <Cyberboss@users.noreply.github.com>
2020-03-09 22:13:48 -07:00
JJRcop a1392847bd Remove ismovableatom macro (#9) 2020-02-17 15:03:16 +01:00
tralezab 47ec530b86 dead people don't appear upright on cameras anymore (#48986)
* there we go

* gg

* A > clone

* lint battles

* inside of you there are two wolves

* one is atom, one is appearance clone

you are bad code

* WOOP

* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

* ygutftckkckctg
2020-01-31 21:04:45 +01:00
Rob Bailey 2029163d33 playsound vary boolean define conversion (#46254)
About The Pull Request

Converts every single usage of playsound's vary parameter to use the boolean define instead of 1 or 0. I'm tired of people copypasting the incorrect usage.
Also changes a couple of places where a list was picked from instead of using get_sfx internal calls

This was done via regex:
(playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\)) to match 1
(playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\)) to match 0
full sed commands:
/(playsound\(.+,.+,.+, ?)1( ?\)| ?,.+\))/\1TRUE\2/ 1 to TRUE
/(playsound\(.+,.+,.+, ?)0( ?\)| ?,.+\))/\1FALSE\2/ 0 to FALSE

I'm not very good with regex and these could probably be optimized, but they worked.
Why It's Good For The Game

Code usability
2019-08-30 18:45:20 +12:00
skoglol 394066caab Removes cameras reliance on default icon state. 2019-08-05 05:22:28 +02:00
kevinz000 84c9f76569 Update camera_image_capturing.dm (#40109) 2018-09-05 22:19:37 +03:00
kevinz000 5b5e1ee577 Third time's the charm - Photography update: 7x7 cameras, photo logging with full metadata, persistent albums and wall frames! (#38944)
* Photography Update

* Pictures logged in their own /data/picture_logs folder rather than normal logs

* Pictures logged in their own /data/picture_logs folder rather than normal logs

* Photos broke, retrying

* Persistence stuff

* I'm almost done I promise!

* Persistence mostly working, compile, etc etc

* Persistence mostly working, compile, etc etc

* Remove something really not needed from the PR

* Prevents duplication

* default to off

* removes check tick

* increase slots in albums to 21

* Allows for singular loading

* Update camera_image_capturing.dm

* Addresses review

* Anturk

* Update camera.dm

* Update misc.dm

* Update datum.dm

* Update camera.dm
2018-08-01 14:52:41 +02:00