tgstation / dev-cycles-initiative

Hub for tracking issues in the Dev Cycles Initiative
1 stars 0 forks source link

Replace spritesheet assets with ref based appearance renders #6

Open LemonInTheDark opened 1 year ago

LemonInTheDark commented 1 year ago

Asset loading is damn slow, even with the delaying we do. Delaying is dumb as heck too.

Estimated Cost

6 seconds

Solution

New with 515 we gain the ability to pass references into html, and have the html render it for us "client side" We can't make a change taking advantage of this until 515 is the default, but when it is we could add support for this feature to tgui, and start replacing our uses of spritesheets with appearances.

This would work for small things like "show me this fish", and even larger ones like the antagonist buttons, since an appearance can be transformed, filtered, colored, etc.

Tastyfish commented 1 year ago

I wonder if the ref based appearances will make the alt+click turf stat panel tab thing work half decently.

LemonInTheDark commented 1 year ago

they would help yeah. maybe we could use entered/exited to update it alongside the refresh too

LemonInTheDark commented 1 year ago

Ok so the idea does work (still need to figure out cropping cause we need that for spritesheets) It requires having the client render everything onto an html window tho, which is a bit annoying. workable, but annoying. The window needs to remain in scope, and get fed via a browse() to work here, which is why we can't just pass refs along via ui_data.

I need to build a system to preload, request and generate these icons (preferably clientside if that's possible) so clients don't get choked to death when they open like, the preferences menu. We'll see how things work out.

MrMelbert commented 4 months ago

This is very feasible now, since we've got a full system to do generic icons, thank to anturk and jlsnow. Loadout menu and loot panel use it.

Off the top of my head the crafting menu, prefs menu, and RND / lathe menus could benefit greatly greatly from this. It's also super easy to do, all you have to do is pass dmi and icon_state via ui_data.

Only downside is that it requires an up-to-date-ish client version but that's a skill issue on the player's part