ID:170320
 
I'm in the middle of making a game where you can turn in degrees and I was wondering if there would be less lag if I made all the directions in world/New() like Theodis' AltMoveDemo or if I made them as I needed them. I think I read somewhere Icon.Turn can't be done client-side and the icon it generates has to be re-downloaded, but I'm not sure.

All help is helpful³
Well, imagine creating 360 new icons, it would take you a little while, but after that it's clean cake. I did something like that on my car racing game, I generated loads and loads of graphics in the beginning, it takes about 20 seconds for 1000+ icons to be generated, this is a lot better than choosing from icon_states because with icon_states, you'll have to download the resources, and with the generated icons, there's no loading whatsoever (except at the beginning, when most likely only the host has logged on)
DarkCampainger wrote:
I'm in the middle of making a game where you can turn in degrees and I was wondering if there would be less lag if I made all the directions in world/New() like Theodis' AltMoveDemo or if I made them as I needed them. I think I read somewhere Icon.Turn can't be done client-side and the icon it generates has to be re-downloaded, but I'm not sure.

Odd. I thought I posted a response earlier, but I must have just hit preview.

Any dynamically-created icon will have to be made on the server and downloaded by the clients. Unfortunately icons aren't processed client-side yet, though that's something we're considering for the future.

Making your icons in world/New() is okay. The only real difference between that and making icons during play is that during play, it'll suck up CPU cycles.

I'd also recommend limiting the number of states in your icon by choosing an angle increment other than 1°. Any divisor of 45° is a good value, like 5° or 9°. (I'd avoid 3°; it's too small.) I think you may find 9° acceptable.

15° is also doable, though it may look a little too abrupt. I used it once in a game, though with the graphics available at the time the limited number of directions mattered a lot less. That limit was also applied to the mathematical calculations, so it was a bonus in terms of speed because I could use a lookup table.

Lummox JR
In response to Lummox JR (#2)
Ok,thanks =)