LOS Request

LOS Request

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

LOS Request

Post 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.
Last edited by Jazcash on 01 Jul 2012, 15:10, edited 2 times in total.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: LOS Request

Post 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.
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: LOS Request

Post 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.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: LOS Request

Post 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
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: LOS Request

Post 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)
Attachments
tp_FogOfWar.lua
(4.56 KiB) Downloaded 119 times
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: LOS Request

Post 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.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: LOS Request

Post 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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: LOS Request

Post 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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: LOS Request

Post 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.
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Re: LOS Request

Post 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?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: LOS Request

Post by knorke »

mod decides if features are visible outside los.
modrules.lua featureVisibility
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: LOS Request

Post 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?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: LOS Request

Post by knorke »

This widget would be much better if the fow areas were octagonal
Image
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: LOS Request

Post by Forboding Angel »

That was a real question.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Re: LOS Request

Post by FLOZi »

Mr. Forb, octagons do not tessellate, please report to remedial 'math'(s!). 8)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: LOS Request

Post 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
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: LOS Request

Post 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:
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: LOS Request

Post by AF »

Save the mission target from getting wet?
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: LOS Request

Post 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
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: LOS Request

Post by Jazcash »

gajop wrote: Image
<3 Would definitely use that.
Post Reply

Return to “General Discussion”