revealing area? how?[solved by me lol]
-
- Posts: 616
- Joined: Wed Nov 01, 2006 6:26 pm
- Location: Cairo,Egypt
- Contact:
revealing area? how?[solved by me lol]
like in strategy games your unit is standing and the map is black and then u move your unit and the map reveals and the only lighted and active area is the area around the unit!!?
Last edited by omar shaaban on Sun Jun 24, 2007 9:22 pm, edited 1 time in total.
... or have a Texture applied on a quad above the scene (between camera and scene) and use alpha channel for holes. If you use antialiasing it will also make the gray area effect. Then just edit your texture with white/black pixel for your fog-of-war (that's the name). As for unit to bu unselectionable under the fog, check the tile it's on against a dual array or your texture (array would be faster but then you got information in double). Anyhow, experiment alone a bit before asking, think, search forums like gamedev, gamasutra, etc. Don't expect an easy ride to your game creation. Some modules you'll implement might even take weeks...
-
- Posts: 157
- Joined: Tue Mar 20, 2007 8:30 am
And a few more weeks of tweaking them because the person you got to test them found some massive bugs...Some modules you'll implement might even take weeks...
Anyways, dorth's idea seems like it should work, textured quads on each tile or something like that. Just remember, if you look at any other RTS game units aren't visible under the fog or war but any buildings you've seen are. Just get a basic implementation going and then tweak it so it acts more fog of war like
Tell me what you cherish most. Give me the pleasure of taking it away.
AHHHH! I never suggested a quad per tile! That's way more than is needed. Just use a single quad and alter it's texture...
P.S.: The reason I suggest a Quad instead of a billboard node is simple. Imagine if you start supporting rotation of camera like Warcraft 3 Or just if your camera is at an angle... meh, way better off with a quad ^^
P.S.: The reason I suggest a Quad instead of a billboard node is simple. Imagine if you start supporting rotation of camera like Warcraft 3 Or just if your camera is at an angle... meh, way better off with a quad ^^
If you're using models, you could hide the mesh's for the enemy pieces unless they're in a certain radius of your pieces/buildings...using a class for the pieces wouldn't be that difficult...
Mesh (pointer returned by loading the mesh - use it to hide/show the units)
Affiliation (Yours/Enemy 1/Enemy 2/Enemy 3...)
Unit Type (Person/Building - used to determine viewing distance)
Location X/Y
Movement Speed
Hitpoints
Mesh (pointer returned by loading the mesh - use it to hide/show the units)
Affiliation (Yours/Enemy 1/Enemy 2/Enemy 3...)
Unit Type (Person/Building - used to determine viewing distance)
Location X/Y
Movement Speed
Hitpoints
-
- Posts: 616
- Joined: Wed Nov 01, 2006 6:26 pm
- Location: Cairo,Egypt
- Contact:
Oy, then seriously, read a bit more and practice with the engine too.
Simple idea. You have a camera at point A. You got your map and units on a plane placed on point C. Place a Quad (a rectangular mesh with only 2 dimension) on a plane with the same normal as your map (aka, parallel to it)
Then, on that quad, apply a texture that is at first fully black. For the Alpha Channel, put it all to opaque. Then, either choose white as your alpha channel or change the pixel's alpha channel yourself. Second method would likely give you a better result in the end, but if you are somewhat new to textures and images manipulation, go with the first method. If you need help with that, search either the web for ways to edit an image in memory, read the Irrlicht demos and API or search the forum for RTT and anything linked with that. I'll assume you will find a way to do that (because I will not write that code for you...). From there on, you find a way to determine which tile should be seen and which shouldn't. You apply full opacity to the hidden tile on the corresponding pixel (or pixels if you want to have round-ish kinda fog-of-war) on the texture and transparency on th others (or a degree of transparency, if you want to do hidden previously explored part) and apply said texture to the quad. Maybe you can even directly manipulate the quad's texture, though I'm not sure about that.
Since english doesn't seem to be your first language (nor is it myn, for that matter), do not be scared by blocks of text or skip something you are not absolutely sure you have understood. Read A LOT! Then some more. Then think about your problems. In the shower. In the bus. In the washroom. Before going to bed. While reading forums. While coding. While doing nothing else. Eventually you'll connect a lot more dots, become a better, and most importantly, more resourceful coder this way.
Simple idea. You have a camera at point A. You got your map and units on a plane placed on point C. Place a Quad (a rectangular mesh with only 2 dimension) on a plane with the same normal as your map (aka, parallel to it)
Then, on that quad, apply a texture that is at first fully black. For the Alpha Channel, put it all to opaque. Then, either choose white as your alpha channel or change the pixel's alpha channel yourself. Second method would likely give you a better result in the end, but if you are somewhat new to textures and images manipulation, go with the first method. If you need help with that, search either the web for ways to edit an image in memory, read the Irrlicht demos and API or search the forum for RTT and anything linked with that. I'll assume you will find a way to do that (because I will not write that code for you...). From there on, you find a way to determine which tile should be seen and which shouldn't. You apply full opacity to the hidden tile on the corresponding pixel (or pixels if you want to have round-ish kinda fog-of-war) on the texture and transparency on th others (or a degree of transparency, if you want to do hidden previously explored part) and apply said texture to the quad. Maybe you can even directly manipulate the quad's texture, though I'm not sure about that.
Since english doesn't seem to be your first language (nor is it myn, for that matter), do not be scared by blocks of text or skip something you are not absolutely sure you have understood. Read A LOT! Then some more. Then think about your problems. In the shower. In the bus. In the washroom. Before going to bed. While reading forums. While coding. While doing nothing else. Eventually you'll connect a lot more dots, become a better, and most importantly, more resourceful coder this way.
-
- Posts: 616
- Joined: Wed Nov 01, 2006 6:26 pm
- Location: Cairo,Egypt
- Contact:
Well i think i am more experience than uDorth wrote:Oy, then seriously, read a bit more and practice with the engine too.
and for the method , i got it my self and even better for my tile based system but anyway thanks
and yes my first language isn't English but i read all the English text in any post and i am very good at English and maybe even better than u offffSince english doesn't seem to be your first language (nor is it myn, for that matter), do not be scared by blocks of text or skip something you are not absolutely sure you have understood. Read A LOT! Then some more. Then think about your problems. In the shower. In the bus. In the washroom. Before going to bed. While reading forums. While coding. While doing nothing else. Eventually you'll connect a lot more dots, become a better, and most importantly, more resourceful coder this way
are u kiddingdo not be scared by blocks
and your method will not work as i want because the buildings will disappear too or it will appear and the units around it will appear also!! and that what i don't want
Do not confuse posts number on this forum and experience
I might be new to Irrlicht, but not to coding, nor creating game.
Also, you never specified you wanted the building to stay visible
Furthermore, your aggressivity is childish and annoying. The same goes to keeping that attitude towards me in other threads. Glad you stop the multiple punctuation marks (almost), though some punctuation would still be needed. Anyhow, you seem to want to learn and create, and that I respect very much. Making a project alone is quite a task, and you certainly didn't pick the least. But then again I'm the lead Programmer for the Game studio I work for. And before I went as a programmer (or while I was studying) I was a Game Tester, First for EA, then for another big Game Testing lab (where, btw, some of my tasks were language proofing ). I've seen many projects rise or fall.
The advice I gave you where in good will and I'm happy you succeeded in doing what you were looking to do (even more so if the solution came from you.)
Anyhow, have a nice day, I'm off to bed...
I might be new to Irrlicht, but not to coding, nor creating game.
Also, you never specified you wanted the building to stay visible
And even so, I gave you part of the solution by telling you that you could set your alpha shading to an in-between level (like 128) and thus having the grayed out area. Of course I did not tell you how you might hide units after they had been discovered because a)you did not ask about it and b) fvapres gave you a good way to do it already and telling things twice is useless.like in strategy games your unit is standing and the map is black and then u move your unit and the map reveals and the only lighted and active area is the area around the unit!!?
Furthermore, your aggressivity is childish and annoying. The same goes to keeping that attitude towards me in other threads. Glad you stop the multiple punctuation marks (almost), though some punctuation would still be needed. Anyhow, you seem to want to learn and create, and that I respect very much. Making a project alone is quite a task, and you certainly didn't pick the least. But then again I'm the lead Programmer for the Game studio I work for. And before I went as a programmer (or while I was studying) I was a Game Tester, First for EA, then for another big Game Testing lab (where, btw, some of my tasks were language proofing ). I've seen many projects rise or fall.
The advice I gave you where in good will and I'm happy you succeeded in doing what you were looking to do (even more so if the solution came from you.)
Anyhow, have a nice day, I'm off to bed...
-
- Posts: 616
- Joined: Wed Nov 01, 2006 6:26 pm
- Location: Cairo,Egypt
- Contact: