[quote:17s5gilo]Your slices idea was more or less what I meant with my less attractive solution. But I don?t understand why it would be that slow. It would only need to retrive the value when an object is moving, and let?s say there would be 20-30 objects moving at most which need to have their height checked, would that really make such a punch in performance? I could probably get away with checking a units height every 3rd or 4th frame or so, and, if using the slices-method, all it would do is a simple collision check "is unit touching height object x". If using the check-color-value I guess it would be similar, no?
actually, checking color is a whole very different process, color values require gpu/cpu transfers for the texture data, which is the absolute WORST thing you can have for a real time application. collision checks are highly optimised and dont have this bottleneck.
[quote:17s5gilo]Or is collision checking in general slow? I haven?t really read that much about constructs performance, but to my understanding it is quite fast, no?
as i said collision checks arent slow, but GPU/cpu transfers with value checking is very much so.
[quote:17s5gilo]And about smooth variations, no. I was thinking that if I have a layout of maybe at most 4096x4096, then I would stretch a 512x512 grayscale map over it. Making slices would complicate that idea, as I would have to stretch several objects, and make sure they all match up when stretched. Also, say I would make 16 slices, that would mean 512x512x16, not an attractive solution when I think about it.
no youd only need to run a loop to spaw the 16 or wtv number of sprites, they could all be the same sprite type, all you need to do is spawn 16, and change the animation frame to wtv loopindex they were spawned on, and store that loopindex in a private variable. just make sure the animation speed is set to 0.
i have no idea why you think 512 by 512 by 16 isnt an attractive solution. a huge sprite that has to be transfrered to vram, into the gpu, to the cpu, the cpu has to check a value out of a 512x512 array of pixels, 30 plus times, every 15th of a second if you do it every 4 frames is?