Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit Test for Smoothing (and fixes for some uncaught issues) #10066

Merged
merged 51 commits into from
Jan 13, 2024

Conversation

HowToLoLu
Copy link
Contributor

@HowToLoLu HowToLoLu commented Oct 21, 2023

About The Pull Request

The sequel to #9834

It's finally here after 2 months

Adds a unit test for icon smoothing, which goes through every single turf and obj to see if they have a smoothing mode enabled. If they do, the test initializes an atom of that path so that it can check if there's any issues that may arise, such as missing icon states, bad list order for caching, etcetera.

Managed to find and fix a few bugs as a result of this test being made.

Why It's Good For The Game

The Unit Test can prevent any further issues with smoothing from going undetected, making it easier and faster to spot any issues related to Icon Smoothing behaviours.

Testing Photographs and Procedure

De-invisibilizing Stuff

/obj/machinery/computer/bank_machine

image

/obj/machinery/computer/, from left to right:

  • cryopod
  • pod/old
  • pandemic
  • shuttle_flight/syndicate/drop_pod

image

The rest of the fixes

Clockcult Walls (/turf/closed/wall/clockwork)
image

Alien Weeds and Nodes (/obj/structure/alien/weeds and /obj/structure/alien/weeds/node respectively)

  • StrongDMM
    AlienWeedsNode

  • Still Working in game
    AlienWeedsNode-Ingame

Ashplanet plating (Rock and Ash shown, /turf/open/floor/plating/ashplanet and /turf/open/floor/plating/ashplanet/rocky respectively)
Lavaland Ashplating

Vault Wall not smoothing because it can't (/turf/closed/wall/vault)

VaultNoSmooth

Jungle chasms (/turf/open/chasm/jungle)

  • In Game
    JungleChasm-Ingame
  • In StrongDMM
    JungleChasm

These falsewalls and mineral walls smooth once again:

2023-12-26.21-58-54.mp4

Rock wall (/turf/closed/mineral/ash_rock)

image

The Advanced Camera and Xeno Arch Consoles

Discovered a bug in each of these consoles' destroy logic;

The Advanced Camera Console:

  • Apparently runtimes when it is deleted before ever being used by someone.
The Bug
2023-12-26.22-48-23.mp4

image

Fixed in this PR
2023-12-26.23-00-08.mp4

The Xeno Archeology Console:

  • Runtimes if destroyed without a linked pad.
The Bug
2023-12-26.22-44-14.mp4

image

Fixed in this PR
2023-12-26.22-59-14.mp4

Changelog

/:cl:
code: There is now a Unit Test for Icon Smoothing
fix: The following computers are now visible: Bank Machines, Cryopod Console, Old pod terminals, Pandemic 3000s, and Syndicate Droppod computers.
fix: Alien weeds, Alien nodes and Jungle Chasms now appear correctly in the map editor.
fix: The Advanced Camera and Xeno Archeology consoles no longer runtime under certain conditions.
fix: Copper, Bamboo and Clockwork walls/falsewalls have working smoothing values.
fix: Copper falsewalls stay visible when used.
fix: Bamboo falsewalls are now visible.
fix: Resolved a small visual issue on Bamboo and Titanium falsewalls when used.
fix: Clockwork walls now appear smooth when in line of sight
fix: Ash rock walls now actually show up
/:cl:

@HowToLoLu
Copy link
Contributor Author

I realized there's just gonna be a ton of these PRs if I don't do something smart. I'm gonna write a unit test locally so I can narrow down everything that iis broke by that initial smoothing PR in one fell swoop.
As a side note- cryogenic oversight consoles need fixing as well.

@HowToLoLu HowToLoLu marked this pull request as draft October 27, 2023 05:42
@HowToLoLu HowToLoLu changed the title Some Icon State Fixes FINAL FIX FOR Computer Smoothing Oct 27, 2023
@HowToLoLu HowToLoLu marked this pull request as ready for review October 27, 2023 20:31
@HowToLoLu
Copy link
Contributor Author

HowToLoLu commented Oct 31, 2023

The Unit Test is now removed from this PR, making another PR with a better variant to cover all atoms that smooth.

@PowerfulBacon
Copy link
Member

Having a unit test that only tests for computer smoothing is better than having no smoothing test at all.

@HowToLoLu
Copy link
Contributor Author

Having a unit test that only tests for computer smoothing is better than having no smoothing test at all.

Then I guess I can draft this till I can resolve @itsmeow 's issue with it

@HowToLoLu HowToLoLu marked this pull request as draft October 31, 2023 18:28
@PowerfulBacon
Copy link
Member

I don't see what the issue was, having a check that only runs specifically for computer smoothing since computers have additional requirements that normal smoothing doesn't have is fine. If other checks can be moved out to other smoothed atoms, then that can be done later on.

@itsmeow
Copy link
Member

itsmeow commented Oct 31, 2023

The unit test only tests for smoothing_groups being null and not NONE for subtypes of computers, not subtypes of computers having icons at all. That's what the problem was, it's a code test not a function test.

@HowToLoLu
Copy link
Contributor Author

The unit test only tests for smoothing_groups being null and not NONE for subtypes of computers, not subtypes of computers having icons at all.

Yeah, that was pretty much the main issue with it. It couldn't be translated to other atoms and it could have false positives if someone else made a subtype have their own special smoothing icon and state names.

@HowToLoLu
Copy link
Contributor Author

I'm thinking this next test may need to use icon procs to scan all possible icons that can smooth- and iterate through every single subtype of atom quickly checking if they have smoothing flags.

@HowToLoLu
Copy link
Contributor Author

image

image

Just made a new test that runs successfully on local, and cleaned up several issues with many other icons as well using it (still have yet to clean up the weirdness that is /turf/closed/mineral)

@HowToLoLu HowToLoLu changed the title FINAL FIX FOR Computer Smoothing Unit Test for Smoothing (and fixes for some uncaught issues) Nov 15, 2023
@HowToLoLu
Copy link
Contributor Author

@PowerfulBacon @itsmeow I need another opinion on this:
So I've tried writing a unit test for smoothing and I just keep running into all sorts of issues from elements on turfs not unregistering signals (even tying the unregister logic to change_turf didn't help) to needing to build a new test map with a holodeck... Should I keep trying to write this unit test or should I just scrap it all together?

@PowerfulBacon
Copy link
Member

Turfs don't unregister their signals when they change, the signals and components (should) be transfered to the new turf and then the component/element is responsible for removing itself on turf change. What's the exact issue you are having with them?

@HowToLoLu
Copy link
Contributor Author

HowToLoLu commented Dec 5, 2023

Turfs don't unregister their signals when they change, the signals and components (should) be transfered to the new turf and then the component/element is responsible for removing itself on turf change. What's the exact issue you are having with them?

/turf/closed/wall/rust Consistently has issues deregistering signals put on it by their element /datum/element/rust. I can't get it to not have these issues for some reason, even after modifying elements to register Detach to COMSIG_TURF_CHANGE (not a pushed changed; on local right now.)

@HowToLoLu HowToLoLu force-pushed the more-fixes-for-computers-guh branch from 365bc2d to b04147c Compare December 19, 2023 19:13
@HowToLoLu
Copy link
Contributor Author

I figured out my massive skill issue behind why turfs and stuff were complaining (Note to self; turfs are 1000% different to everything else, not just 100%)

PR should be ready soon as I put the finishing polishes on it.

Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@HowToLoLu HowToLoLu marked this pull request as ready for review December 27, 2023 05:08
Copy link

github-actions bot commented Jan 8, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@HowToLoLu

This comment was marked as outdated.

@HowToLoLu HowToLoLu marked this pull request as draft January 9, 2024 07:50
@HowToLoLu HowToLoLu marked this pull request as ready for review January 9, 2024 08:11
@itsmeow itsmeow added this pull request to the merge queue Jan 13, 2024
Merged via the queue into BeeStation:master with commit 0082282 Jan 13, 2024
8 checks passed
@HowToLoLu HowToLoLu deleted the more-fixes-for-computers-guh branch August 13, 2024 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants