开发者

Efficiency problems about fog of war effect in Flash

开发者 https://www.devze.com 2023-04-05 12:12 出处:网络
Sorry for my poor English. I am busy making a game like Dota using Flash. Unlike some little webgames , the fog of war is very complex----trees can blockone player\'s view rang,etc.

Sorry for my poor English. I am busy making a game like Dota using Flash. Unlike some little webgames , the fog of war is very complex----trees can block one player's view rang,etc. I think tile-based fog maybe a good idea.But 开发者_JAVA百科the world in game is very large(3000*3000 or more),and the tile size is about 32*16 pixels and the view size is about 1920*1000 pixels.So there are too many small tiles in screen.Though I build every tile as a bitmap(using the same bitmapdata) and dont't build fogs out of screen ,but the frame rate is still so slow when scroll screen. Does anyone can help me?

PS: I want to use new Flash API to render these in GPU.But molehill allow combine normal stage(include my game world) and stage3D( include my fog of war ) in screen?


What technique do you use for hiding the non-visible parts of the map - scroll rect or mask? You should use scroll rect if you are using masks as it is far more performant than masks (here's an article http://gskinner.com/blog/archives/2006/11/understanding_d.html). You should also consider using some game engine (Flixel and PushButtonEngine are fine examples).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号