Archived

This topic is now archived and is closed to further replies.

Shroud

This topic is 6277 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, for my RTS game, we, of course need a shroud. Well, I think I might have an idea, but I want to be sure. How could you code a shround like C&C? And also, how do you code a shroud like Sudden Strike? Any help is appreciated. I would kinda like to know how to do both, and go from there. Thanks a lot. P.S.- C&C shroud is all black, and uncovers slowly when you are in X distance from it. You uncover as you go along, at the start, all is black. When you leave an area, the shroud behind you stays uncovered. Sudden Strike shroud, the whole map is uncovered. The only thing you can''t see is enemy positions. As you move along, a "light from above" shines on you, and in that area, you can see enemy positions. Once you move on, it goes back to the "darker" color, and the "light" follows you. The shroud does not stay uncovered, changes as you go. ======= ~Khaos~ =======

Share this post


Link to post
Share on other sites
For the first type you just need to mark tiles as visited and ''unshroud'' them in like say a 4x4 area as your character progresses through the territory. The tiles really just need a flag like m_shrouded. At the beginning most of the tiles are m_shrouded and should just be rendered black. Once visited a tiles m_shrouded flag gets flipped so that its actually drawn instead of rendered black.

The second type is easier. Since the building''s are effectivly sprites, they should have a m_visible(or something like that) as part of there class. Once your character moves close enough to the building to see it, its m_visible variable becomes true.

Actually, now that I think about it, they are really the same solution, heh. Oh well, there is a quick and dirty way to implement fog of war. Take it easy...



Mike Barela
mbarela@earthlink.net

Share this post


Link to post
Share on other sites
Thanks a lot Mike, that does help. I was sorta thinking that, but didn''t know if it wpuld look gay or not, but I will try it
Anyone, are there any other more advanced or more effective ways to create a shroud?
Thanks!

=======
~Khaos~
=======

Share this post


Link to post
Share on other sites