ID:133104
 
Summary:
Alternative to creating new /icon objects to Flip/Rotate/Colour an icon for an object. Hopefully lowering wasted bandwidth on sending a flipped version of an existing icon for example.



Problem:
As far as I'm aware, in order to 'rotate' an object to display it upside down a new /icon is created, rotated, then applied to the object. This new icon is then downloaded by any players which view it.
(For example, in a card game cards may need to be rotated to face north/south/west/east)

One possible method around dynamically creating these rotated icons is to manually create the directional states when making the icons. While effective, it increases resource size.

The problem is extra data is sent either way. I understand this may be minimal for most games, however it can be inconvenient for larger games.



Possible Solutions:
Using variables attached to the object which the client is able to interpret. (Similar to invisibility?)
(examples)
obj.flip = WEST // Object would appear mirrored (useful in platformers, although they aren't officially supported)
obj.rotate = 90 // Rotation could be limited to North/South/West/East and would remain useful
Variables for simple colour alterations could be considered also.

Another option would be to process some resource related actions client-side. Instead of sending an entire 'flipped icon', the server would send a request to the client to create it then adding it into the resources client-side.

I personally would prefer the first method for simplicity and convenience.


Benefits:
Reduced bandwidth for servers using icon operations.

In some cases players experience freezing/delays while dynamic icons are being downloaded. This would almost be eliminated in most situations.

In games where characters have control over the colour of hair/clothes overlays(changing your hair to a shade of #FF00FF for example) characters usually appear to be running around naked while resources are downloading.


Thank you.
Kajika wrote:
This new icon is then downloaded by any players which view it.

The icon isn't sent to the client; it's the instructions on how to rotate the icon that are sent. The client then rotates the icon by itself, and stores the result.
In response to Android Data
That was essentially what I was suggesting, I wasn't aware it functioned like that already. Topic can be erased/locked in that case.

Thanks for the response.
In response to Android Data
Android Data wrote:
The icon isn't sent to the client; it's the instructions on how to rotate the icon that are sent. The client then rotates the icon by itself, and stores the result.

Actually that isn't the case--not yet. Prior to BYOND 4.0's release we worked on client-side image processing, but ran into all kinds of unexpected performance problems. The feature was stripped out and has not been put back yet. We do intend to revisit this again at some point.

Lummox JR