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

VV editor can now see /appearance types #10885

Merged
merged 22 commits into from
Apr 22, 2024

Conversation

EvilDragonfiend
Copy link
Member

@EvilDragonfiend EvilDragonfiend commented Apr 14, 2024

About The Pull Request

VV editor can now see /appearance types
These ones are kinda blackboxed, and we have no idea what these are in general.
I made it investigatable, but because of the nature of /appearance, the code is super janky, but it's inevitable curse.

I left an important comment inside:

Comment

< OH MY GOD. Can't you just make "/image/proc/foo()" instead of making these? >
	/appearance is a hardcoded byond type, and it is very internal type.
	Its type is actually /image, but it isn't truly /image. We defined it as "/appearance"
	new procs to /image will only work to actual /image references, but...
	/appearance references are not capable of executing procs, because these are not real /image
	This is why these global procs exist. Welcome to the curse.

Why It's Good For The Game

Debugging tool is good for us

Testing Photographs and Procedure

image

image

image


image

I can see things are duplicated inside.


image

some /appearance types are editable in specific situations (usually client only images like atom_hud)
Actually it was /image and vv editor bug thought it's appearance. This pr fixed that too

Changelog

🆑
code: /appearance type references are now investigatable in vv editor.
fix: Fixed /image ref was identified as /appearance in vv editor
/:cl:

@EvilDragonfiend
Copy link
Member Author

Putting this on high priority - It's helpful to sort out wrong overlays from stuff, which means good for aiming better performance.

@EvilDragonfiend
Copy link
Member Author

image

Okay, I figured how to identify /image and /appearance

@EvilDragonfiend
Copy link
Member Author

I'll fix more tomorrow. It only needs to do a few nitpick points

@EvilDragonfiend
Copy link
Member Author

Actually I did already. This is now ready for the full review again.


/// appearance type needs a manual var referencing because it doesn't have "vars" variable internally.
/// There's no way doing this in a fancier way.
/proc/debug_variable_appearance(var_name, image/appearance)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the thing coming in isn't an image, then it shouldn't be typed as an image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Welcome to Byond

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least it's a single case. I converted it to movable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats even worse, its definitely not an atom/movable. Its a variable type and should be untyped, with the type being resolved later on.

Copy link
Member

@PowerfulBacon PowerfulBacon Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why even bother typing it with the wrong type, just use the unsafe access operator, :, and keep it untyped

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aight changed

@PowerfulBacon
Copy link
Member

Just going to wait and see what the TG folk have to say, since there are some things in here which seem really cursed but I can't think of many immediately better ways to do them due to the lack of a solid appearance type.

@san7890
Copy link
Contributor

san7890 commented Apr 22, 2024

Just going to wait and see what the TG folk have to say, since there are some things in here which seem really cursed but I can't think of many immediately better ways to do them due to the lack of a solid appearance type.

This was resolved in the implementation we went with going with by abusing parent_type. Do let us know if you can iterate on the model we're using to make it better. Thanks.

@PowerfulBacon
Copy link
Member

This was resolved in the implementation we went with going with by abusing parent_type. Do let us know if you can iterate on the model we're using to make it better. Thanks.

Feels super cursed, but theres probably not a whole lot we can do since byond gives no access to the appearance type, the only alternate would be to entirely use unsafe accesses with the : operator instead of typing it to an incorrect type. I'm slightly more partial to that, since we are usign types wrong and expecting failures anyway, but since its just a VV extension, if it works, it works.

Copy link
Member

@PowerfulBacon PowerfulBacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR hurts my soul

@PowerfulBacon PowerfulBacon added this pull request to the merge queue Apr 22, 2024
Merged via the queue into BeeStation:master with commit 80711b2 Apr 22, 2024
8 checks passed
@EvilDragonfiend EvilDragonfiend deleted the appearancevar branch April 22, 2024 23:33
@san7890
Copy link
Contributor

san7890 commented Apr 23, 2024

This was resolved in the implementation we went with going with by abusing parent_type. Do let us know if you can iterate on the model we're using to make it better. Thanks.

Feels super cursed, but theres probably not a whole lot we can do since byond gives no access to the appearance type, the only alternate would be to entirely use unsafe accesses with the : operator instead of typing it to an incorrect type. I'm slightly more partial to that, since we are usign types wrong and expecting failures anyway, but since its just a VV extension, if it works, it works.

yeah some maintainers who weren't up to date on reviewing their prs got slightly :( with me but i figure that people will iterate on this framework and make it better in the long run (if it sucks for the time being at least we made it in a way to catch any failure we could have). do flag us down if someone tries to enhance it here. thanks

DrDuckedGoose pushed a commit to DrDuckedGoose/BeeStation-Hornet that referenced this pull request May 11, 2024
* appearance debug code

* It's not actually working

* clean up

* Putting important comments

* nitpicking

* Improving QoL

* fixing the spelling

* isappearance actually does its thing

* static to read only

* real appearance type and image type

* it actually fixes

* nitpick

* Try catch isn't necessary anymore

* Clean up v2

* convert into movable

* change them all to unsafe access

* Follows TG review

* Makes sprite file viewable

* fixes correct var name

* Final version

* Final version_real

* Fix comment
DrDuckedGoose pushed a commit to DrDuckedGoose/BeeStation-Hornet that referenced this pull request May 11, 2024
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