Author Topic: "grey" fog of war  (Read 15633 times)

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
"grey" fog of war
« on: August 26, 2011, 11:48:24 pm »
I was having fun with a custom blit function - it gives the opportunity to have very fast effects on the color per pixel - almost like a pixel shader.
Blitting certain tiles in a grey-scale color for example. See screenshot.
It could serve a purpose some time?

Offline michal

  • Commander
  • *****
  • Posts: 636
    • View Profile
Re: "grey" fog of war
« Reply #1 on: August 27, 2011, 05:17:17 am »
Probably ;)

Also, what about bliting in green color? It could be used for example in night vision devices.

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: "grey" fog of war
« Reply #2 on: August 27, 2011, 12:17:21 pm »
Yeah. Or a special treatment of a blue tint towards yellow and red tint, depending on the heat of the object/unit ;)

Offline Istrebitel

  • Sergeant
  • **
  • Posts: 46
    • View Profile
Re: "grey" fog of war
« Reply #3 on: August 29, 2011, 11:45:27 am »
It is insanely useful.

If you have an option to grey out the tiles your operative / squad has no vision of. Vision=can detect enemy in that tile.

It is awlays a PITA in such games to understand where you can and where you cannot see, since this often costs a life of your operative when one single tile is left unnoticed and enemy from that tile can counterattack when you are very close to him (most evil for me in JA2, where death of your merc is much more serious loss than that of X-Com operative, and sometimes its just insanely hard to understand wether you see every tile where enemy can possibly be or not)
By having a clear understanding which tile does an operative see and which he does not, playing this game will get lot less frustrating and allow you to focus more on thinking rather than calculating tiles by hand... multiple times... for multiple tiles and multiple operatives.

Also after researching certain alien X-COM operatives could incorporate that data to be able to see alien's sight range (like in JA2 1.13 you can see your "danger zone" which equals to enemy sight range, adjusted to your stealthiness, camo and land cover). This could help players study the way to play against aliens, study dead zones like those pesky corner ambushes, learn about how to generally approach aliens and make door ambushes and so on with in-combat on-demand help.

Also we could add a very stylish "Motion Scanner 3D view" or "Motion Detection Headgear" or something, where using the item would turn everything to dark gray and tiles where movement was detected would be transitioned to bright yellow, depending on the amount of movement done.

Maybe also make an additional research option unlocked after having researched several alien corpses and probably live aliens - Alien Lifesigns Scanner - which would again turn everything to dark gray and nearby tiles where aliens are would be tinted in a color which signifies a kind of an alien (machine, coldblooded, humanoid, etc) is there - possibly with a chance of a false positive or with a chance to show PREVIOUS alien position based on agent's reactions (meaning, imagining this all actually goes in real time, agent was a slowpoke and since the time he managed to scan the alien location, alien already moved itself). Or maybe it could show trace of alien movement, with more color = more recent position and less color = position further back in time, this would make reading the scanner's output harder and at the same time would not need to "break" it in any way by false readings to prevent it going too imbalanced good, on the other hand allowing players to study alien behavior from playing the game, not from reading WIKI articles on AI and looking at waypoint maps. Would make sense too, as often seen by special ops in movies (i suppose they take it from RL, not imagine) where they use thermal and other kind of scanners to check the movement patterns of the terrorists before making an attack, to minimise casualties.
« Last Edit: August 29, 2011, 11:51:00 am by Istrebitel »

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: "grey" fog of war
« Reply #4 on: August 29, 2011, 09:01:17 pm »
Talking about motion scanner... I always found it a bit silly:
I quote ufopaedia:" This sophisticated device uses a variety of detectors..."
so I assume it has at least the very basic detectors like sonar and infrared, right?
And then: "Static units will not be detected."
I mean, what's the story behind it? Since when does either sonar or infrared not detect static objects? I would say the opposite: static objects are the easiest to detect :p

Ok, the device would become slightly overpowered, but you could compensate in more realistic ways for example : 100% TU use instead of 25%, a detection radius of only 4 tiles instead of 9...

Offline winterheart

  • Colonel
  • ****
  • Posts: 180
  • Fellow Squaddie
    • View Profile
Re: "grey" fog of war
« Reply #5 on: August 29, 2011, 09:26:26 pm »
Talking about motion scanner... I always found it a bit silly:
I quote ufopaedia:" This sophisticated device uses a variety of detectors..."
so I assume it has at least the very basic detectors like sonar and infrared, right?
And then: "Static units will not be detected."
I mean, what's the story behind it? Since when does either sonar or infrared not detect static objects? I would say the opposite: static objects are the easiest to detect :p

Maybe it based on Doppler effect. Or maybe this is reference to Alien movie. Who knows.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2135
    • View Profile
Re: "grey" fog of war
« Reply #6 on: August 29, 2011, 11:58:17 pm »
It's probably for gameplay reasons, I'd be more worried about enemies moving around. :P

Volutar

  • Guest
Re: "grey" fog of war
« Reply #7 on: August 30, 2011, 10:37:18 am »
100% it's the reference to Aliens movie. And I really don't know what kind of real or unreal physics lies beneth it. Doppler sounds a bit more realistic explanation than others, if any. :)

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: "grey" fog of war
« Reply #8 on: August 30, 2011, 11:04:56 am »
Hmm, yes, it's indeed from the Aliens movie.
It might have been easier to do a motion detector in the movie technically or the kind of aliens did not show up on infrared, so it adds some more to the tension, also the blobs on the motion detector are not realtime, they have a low update frequency = also more tension.

Hudson: [reading a motion detector] I got signals. I got readings, in front and behind.
Frost: Where, man? I don't see shit.
Hicks: He's right. There's nothin' back here.
Hudson: Look, I'm telling ya, there's somethin' movin' and it ain't us! Tracker's off scale, man. They're all around us, man. Jesus!
Dietrich: [looking through an infra-red scope, walks right past an Alien] Maybe they don't show up on infra red at all.
[the Alien pounces on her and drags her up to the ceiling]

Volutar

  • Guest
Re: "grey" fog of war
« Reply #9 on: August 30, 2011, 11:56:20 am »
https://www.worthpoint.com/worthopedia/aliens-1986-film-uscm-combat-motion-134391565
Quote
The modern motion tracker is a simple surveillance device originally designed for use by rescue and police services. Essentially, it is a high-powered ultra-sound scanner that Uses Doppler-shift discrimination to filter out moving objects from the stationary background.

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: "grey" fog of war
« Reply #10 on: August 30, 2011, 04:20:56 pm »
Allright, thanks for the info  - I'm starting to like the x-com motion scanner now :)

So on topic: it makes no sense to have some kind of fancy motion scanner 3D view I guess.
Having a "greyed-out" fog of war to visualize your soldiers's current field of view, is probably the only realistic and useful application for this effect.

EDIT: a cool blip-blip-blip sound effect when the blobs light up would be nice though :)
« Last Edit: August 30, 2011, 04:23:10 pm by Daiky »

Offline Yankes

  • Commander
  • *****
  • Posts: 2157
    • View Profile
Re: "grey" fog of war
« Reply #11 on: August 30, 2011, 07:20:22 pm »
heat-vision  - dont use normal LOS simply reduce power when pass objects, blinded by fire (its block LOS in that direction) , snakeman barely visible (every object will have temperature, more heat means more visible).
you cant see terrain when you using that. i think easer way to implemented is made it black&white when for every color:
Code: [Select]
dest = (src/32)+ ((src%16)/8) - heat;`-heat` because more white mean more hot.
night-vision - similar to normal vision except you cant see in bright light (this mean `shade` in current blit function can be negative). additional we could cast every color group to green.
Code: [Select]
dest = GREEN_GROUP + (src%16) + shade

Offline Yankes

  • Commander
  • *****
  • Posts: 2157
    • View Profile
Re: "grey" fog of war
« Reply #12 on: September 06, 2011, 04:04:51 pm »
i have new idea how to use custom blit function.
we can use it to change color of skin and hair in your solder.
fast check show that 2 different colors group are used for hair and skin and their arent used for any other thing in solder graphic.
this mean we can replace this group with another one to made different skin and hair color solder.
function should look like:
Code: [Select]
inline uint8 face_color(uint8 orgin, int shade, int skin_color, int hair_color)
{
int temp;
if(FACE_COLOR == orgin&COLOR_GROUP)
{
temp = (orgin & SHADE_VALUE) + shade;
if(temp>15)
return 15;
else
return skin_color | temp;
}
else if(HAIR_COLOR == orgin&COLOR_GROUP)
{
temp =  (orgin & SHADE_VALUE);
if(temp>15)
return 15;
else
return hair_color | temp;
}
else
{
temp =  (orgin & SHADE_VALUE);
if(temp>15)
return 15;
else
return (orgin&COLOR_GROUP) | temp;
}
}

to easy add different color function to blit function, it should be template function. this will allow us avoid function calling inside loop. 

Offline Daiky

  • Battlescape Programmer
  • Administrator
  • Commander
  • *****
  • Posts: 904
    • View Profile
Re: "grey" fog of war
« Reply #13 on: September 06, 2011, 08:39:02 pm »
hehe Yankes, that's great. It's a bit like how JA2 does it's different skin, hair and pants colors

Offline Yankes

  • Commander
  • *****
  • Posts: 2157
    • View Profile
Re: "grey" fog of war
« Reply #14 on: September 06, 2011, 10:16:52 pm »
it will be bit harder with first armor because hair and face belongs to the same color group. i think that every armor class could have separate blit function (alien could have this too, like red muton form intro)