Page 1 of 2

LOS Request

Posted: 01 Jul 2012, 14:46
by Jazcash
Is it possible some sort of doohickey could be devised to completely blacken unvisited areas of a map? Much like StarCraft really, where units' LOS reveals areas of the map which then become unblackened forever, but it doesn't allow you to see enemy units there unless you have current LOS on it.

Image

I already asked Beherith about this and his answer was pretty much that it would be too resource heavy and I fear he's right, I just wanted to ask around to see if anybody had any alternative ideas or solutions.

Re: LOS Request

Posted: 01 Jul 2012, 15:05
by gajop
A trivial implementation would be resource heavy, yes, but it should be possible to use what Spring is currently using for regular LOS. And you can probably create a Lua version of what's in the engine for LOS, but it may be somewhat slow.

It's in my TODO list, as it's needed for any story-based scenario where you'd leave room for some sort of surprises, just not a priority now.

Re: LOS Request

Posted: 01 Jul 2012, 15:35
by Jools
No need to refer to Starcraft for benchmark: the feature exactly as the OP described was implemented in OTA v1.0 from '97. It was a gameoption, and most people preferred to play with the area explored instead of black (to save from one peeper rush in the beginning).

Eventually the explored option became standard and that's alos why spring was done that way, I suppose.

But note that OTA is quite clever with LOS. Here's a table that I think summarises how it works:

Code: Select all

Effect                               LOS      explored     
------                              -----     --------
Weapon trigger sounds                 yes         no
Projectiles visible                   yes         no
Explosion sounds                      yes         no      
Explosions visible                    yes         yes
Spring is inconsistent with regard to these values.

Re: LOS Request

Posted: 01 Jul 2012, 16:50
by gajop
do you have a screenshot of it?

also, not sure about the cleaver LOS, but it's probably ok if you can set those which shouldn't be too hard

Re: LOS Request

Posted: 01 Jul 2012, 16:52
by knorke
Not sure if I understand right, you want fog of war with 3 states?
is in los
was in los
was not in los yet

well, actuelly is boxx. u mad?
Image
adjust the local fogAlpha = 1 to something like 0.7 if you do not like that unexplored terrain is totally hidden in darkness.
Personally I think I noticed (despite boxxyness) that fog of war somehow feels strange when sight distances are quite large. (basically all *a games)

Re: LOS Request

Posted: 01 Jul 2012, 18:07
by Jazcash
knorke wrote:Not sure if I understand right, you want fog of war with 3 states?
is in los
was in los
was not in los yet

well, actuelly is boxx. u mad?
Image
adjust the local fogAlpha = 1 to something like 0.7 if you do not like that unexplored terrain is totally hidden in darkness.
Personally I think I noticed (despite boxxyness) that fog of war somehow feels strange when sight distances are quite large. (basically all *a games)
This is exactly what I'm after! Just a couple problems with it:

Image
  • The edges of the map are kinda strange, is that animooted fuzzy border intentional?
  • It doesn't seem to render perfectly. It gets better as you zoom in but as you can see in the image, fully zoomed out still shows some parts of the map
  • Blocky - would need it smooth, fluffy and faded
  • Still shows features
It's pretty awesome though.

Re: LOS Request

Posted: 01 Jul 2012, 18:58
by gajop
yeh I'm getting the same results as jazcash.
although possibly not the issue of the widget, minimaps should be forced to display the LOS/unexplored states as well.
Image
It's also considerably slowing the game for me.

Re: LOS Request

Posted: 01 Jul 2012, 21:56
by knorke
The edges of the map are kinda strange, is that animooted fuzzy border intentional?
on purpose. why does nobody like it :/
to remove:

Code: Select all

	for x=-10,TileMaxX+10,1 do
		for z=-10,TileMaxZ+10,1 do
-10 :arrow: 1
+10 :arrow: delete
It doesn't seem to render perfectly. It gets better as you zoom in but as you can see in the image, fully zoomed out still shows some parts of the map
zoomed in very steep terrain spikes sometimes can show through. zoomed out i think it is because spring decreases LOD for terrain and then real terrain becomes != terrain that gets drawn = clipping.
Idea would be to change the black-squares-to-ground offset as camera distances increases but have not tried.
Blocky - would need it smooth, fluffy and faded
umad? no idea how to do that. (well, have some ideas but would likely be very slow)
Still shows features
mod decides if features are visible outside los. not sure if possible to change with widget.
It's also considerably slowing the game for me.
It is quite a big map you have there. Since it draws fog of war everywhere (even outside visible screen area) it is not efficent and on big maps that hurts worse. Should be possible to optimize that.
It is a bit lol to waste so many fps on something like that but hey - zk does the same with its ui? :wink:
Mah mod has fewer units per player than BA and the maps are smaller, so it will hopefully not be such a problem there. Even on my old amd 2800+ computer fps were good enough to leave it enabled.
minimaps should be forced to display the LOS/unexplored states as well.
should be possible but just did not try yet.

Re: LOS Request

Posted: 02 Jul 2012, 00:40
by Forboding Angel
Problem is, that it doesn't cover features well, and if it does (by raising the height), then it is offset and so the borders are no longer correct (unless you angle the camera to be 100% top down).

I tried like hell to come up with a solution, but alas, I could not.

Re: LOS Request

Posted: 02 Jul 2012, 02:07
by Das Bruce
Forboding Angel wrote:Problem is, that it doesn't cover features well, and if it does (by raising the height), then it is offset and so the borders are no longer correct (unless you angle the camera to be 100% top down).

I tried like hell to come up with a solution, but alas, I could not.
Don't render features outside of explored area?

Re: LOS Request

Posted: 02 Jul 2012, 06:57
by knorke
mod decides if features are visible outside los.
modrules.lua featureVisibility

Re: LOS Request

Posted: 02 Jul 2012, 08:06
by Forboding Angel
Doesn't play well with tall units either.

Edit:
Nevermind, I see what you're after. Yeah that would work.

Edit2:
It works, but it isn't pretty in any shape or form :-(

http://pastebin.com/81PaJAZN << changed a few things around to fit my liking a bit more. Set res to 152 so that instead of losing 10fps, I only lose 2fps.

While this is functional, It is in no way a solution :-(

It's kind of sad that we can't even manage to have proper engine fow after 7+ years...

This widget would be much better if the fow areas were octagonal, and had very fuzzy edges. Is that even doable without bringing GPUs to their knees?

Re: LOS Request

Posted: 02 Jul 2012, 09:08
by knorke
This widget would be much better if the fow areas were octagonal
Image

Re: LOS Request

Posted: 02 Jul 2012, 09:16
by Forboding Angel
That was a real question.

Re: LOS Request

Posted: 02 Jul 2012, 17:20
by FLOZi
Mr. Forb, octagons do not tessellate, please report to remedial 'math'(s!). 8)

Re: LOS Request

Posted: 02 Jul 2012, 17:26
by AF
Perhaps he meant to say hexagons? I can see forb playing Civ 5 now

Speaking of which we could render clouds over the top, things don't have to match the terrain precisely, they just need to obscure it

Re: LOS Request

Posted: 02 Jul 2012, 17:35
by Jazcash
AF wrote:Perhaps he meant to say hexagons? I can see forb playing Civ 5 now

Speaking of which we could render clouds over the top, things don't have to match the terrain precisely, they just need to obscure it
Could they be black clouds? :mrgreen:

Re: LOS Request

Posted: 02 Jul 2012, 18:12
by AF
Save the mission target from getting wet?

Re: LOS Request

Posted: 02 Jul 2012, 18:16
by gajop
yeh i think gradients are definitely a good thing to have, even if you're using simple rectangular tiling

without gradient:
Image

with gradient:
Image

Re: LOS Request

Posted: 02 Jul 2012, 18:20
by Jazcash
gajop wrote: Image
<3 Would definitely use that.