Advertisement

Shroud

Started by October 05, 2000 06:49 PM
1 comment, last by Khaos 24 years, 3 months ago
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~ =======
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
Mike BarelaMikeB@yaya.com
Advertisement
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~
=======

This topic is closed to new replies.

Advertisement