A curious animated Fog of War problem - need help
Posted: Fri May 24, 2019 8:01 am
Hey there. I made a game with a 'fog of war' mechanic in it.
There's a sample screenshot - I have black squares that are unexplored, semi-black squares which are currently unseen but were previously visited, and clear squares which are in my direct field of vision.
The Fog of War gets updated for every 'step' my character makes. (It's held into a grid).
Now, when I started it I just made the colors 'snap' into place. And it does so nice and instant!
But then I tried to polish it a bit, by making the colors 'fade in' with tweening. (By using the Hump library's Timer:Tween module).
I gave each block a 'visibility' variable, and at the end of the function that generates the current fog of war status, I go over each square and tween it.
Problem is, it seems to have a weird 'delay'- the tweening starts after a short while, instead of instantly. All the tweens start and end at the same time, but with a delay.
I tried testing some things:
Using Flux instead of hump's timer module: Didn't help
Seeing if it's due to running on all the squares: Doesn't seem to be it. It also happens when I only run it on the top-left 5x5 squares instead of the entire 16x16 screen.
I can't seem to figure out the problem. Anybody has a clue?
There's a sample screenshot - I have black squares that are unexplored, semi-black squares which are currently unseen but were previously visited, and clear squares which are in my direct field of vision.
The Fog of War gets updated for every 'step' my character makes. (It's held into a grid).
Now, when I started it I just made the colors 'snap' into place. And it does so nice and instant!
But then I tried to polish it a bit, by making the colors 'fade in' with tweening. (By using the Hump library's Timer:Tween module).
I gave each block a 'visibility' variable, and at the end of the function that generates the current fog of war status, I go over each square and tween it.
Problem is, it seems to have a weird 'delay'- the tweening starts after a short while, instead of instantly. All the tweens start and end at the same time, but with a delay.
I tried testing some things:
Using Flux instead of hump's timer module: Didn't help
Seeing if it's due to running on all the squares: Doesn't seem to be it. It also happens when I only run it on the top-left 5x5 squares instead of the entire 16x16 screen.
I can't seem to figure out the problem. Anybody has a clue?