Page 1 of 1

Access to sprite filenames for entities and items and other things with sprites

Posted: Thu Apr 11, 2019 7:06 pm
by sparr
For entities that have sprites, I would like to be able to find out what file they were loaded from, in the control phase.

Re: Access to sprite filenames for entities and items and other things with sprites

Posted: Mon Apr 15, 2019 3:34 pm
by danielbrauer
Example use case is DiscoScience, where the most resilient way to map colours is by icon rather than tech name (Bob’s Tech, for instance, switches some icons around).

Right now I’m sneaking data out through flying-text, and I can feel Wube glaring at me.

Re: Access to sprite filenames for entities and items and other things with sprites

Posted: Mon Apr 15, 2019 4:15 pm
by Bilka
I saw disco science doing the flying text hack when I recently pointed out some specifics about memory leaks and desyncs. My immediate thought was "why don't they just read the setting that controls the colors in bobs mod and calculate the colors from that (during runtime)", so for this specific use case, why don't you do that?

Re: Access to sprite filenames for entities and items and other things with sprites

Posted: Mon Apr 15, 2019 8:04 pm
by sparr
Because that would mean duplicating a bunch of code from Bob's mods in every other mod that wants to know what color the science packs are, and getting it wrong any time Bob changes the order, which is silly for information that's directly available in the data stage.

PS: Why do the science packs use different sprites instead of tint in the first place?

Re: Access to sprite filenames for entities and items and other things with sprites

Posted: Wed Apr 17, 2019 9:35 am
by danielbrauer
Bilka wrote:
Mon Apr 15, 2019 4:15 pm
"why don't they just read the setting that controls the colors in bobs mod and calculate the colors from that (during runtime)"
If I understand correctly, that would be code written just to support one mod. I don’t really care about Bob’s mod in particular: I would like a robust and generic way of associating colours with ingredients.

Re: Access to sprite filenames for entities and items and other things with sprites

Posted: Wed Apr 17, 2019 6:49 pm
by Rseding91
I don't consider that a valid use for wanting to read file names. You should be using something like a remote interface to ask the mod what color(s) the packs are otherwise it's just another hack and I won't support it.

Re: Access to sprite filenames for entities and items and other things with sprites

Posted: Wed Apr 17, 2019 8:20 pm
by sparr
Asking each individual mod what color its entities are is a silly hack that won't ever scale.

Re: Access to sprite filenames for entities and items and other things with sprites

Posted: Wed Apr 17, 2019 8:22 pm
by Bilka
sparr wrote:
Wed Apr 17, 2019 8:20 pm
Asking each individual mod what color its entities are is a silly hack that won't ever scale.
Right now it's using file names and hardcoding the color and then transferring that to the control stage using a hack. That's not any better :p

Re: Access to sprite filenames for entities and items and other things with sprites

Posted: Wed Apr 17, 2019 8:49 pm
by sparr

Re: Access to sprite filenames for entities and items and other things with sprites

Posted: Wed Apr 17, 2019 8:56 pm
by Rseding91
Additionally, there is no such thing as a "color" for a science pack. That's a made up concept by you/others. That's why you're having such a hard time making it work: it's not a real thing. Like trying to nail imaginary jello to the wall - you're 5 problems deep in something you just can't do.

Re: Access to sprite filenames for entities and items and other things with sprites

Posted: Thu Apr 18, 2019 9:09 am
by danielbrauer
Rseding91 wrote:
Wed Apr 17, 2019 8:56 pm
Additionally, there is no such thing as a "color" for a science pack. That's a made up concept by you/others. That's why you're having such a hard time making it work: it's not a real thing. Like trying to nail imaginary jello to the wall - you're 5 problems deep in something you just can't do.
Right, but there are icons for science packs, and most humans can look at one and tell you what colour it is. Saying that colour is a made up concept is ignoring a real meaning of this data to users.

Nonetheless, it makes sense to me that graphics in general aren’t something you want gameplay to depend on. Analyzing or mapping values to specific graphics after the data stage is simply not a problem your API is trying to solve.

I think that’s completely fine. It just means that mods like DiscoScience are using the API for something it’s not intended for, and they’ll end up resorting to hacks.