[A17] [RELEASED] Real Fog of War (v1.0.0 - 29-07-2017)

Started by Luka Kama, December 31, 2016, 11:03:55 AM

Previous topic - Next topic

Luka Kama

#60
Beta 0.1.15

Change log:

  • Mannable turrets that require a line of sight (not present in vanilla game but provided by various mod) now:

    • use the manning colonist view range to check if a target can be hit.
    • if long ranged, increase the manning colonist view range over time (like long range weapons)


Steam page
Zip to manually install here

nosferato

#61
Items from both random drop pods and drop pods from traders are no longer showing (0.1.15),
Just checked and reverting back to 0.1.14 did reveal the hidden items from the latest drop pod

Luka Kama

Beta 0.1.16

Change log:

  • Fixed items not made visible when dropped from ship crashes, merchants trades, drop pods and trade beacons.
  • Tried to workaround an error caused by other mods patching the command toolbar.


Steam page
Zip to manually install here

Luka Kama

Quote from: NoImageAvailable on February 18, 2017, 10:57:37 AM
I think you overestimate the amount of processing power required for this.

Let's assume for the sake of argument that the vision and visibility stats are set up such that the maximum distance you can spot something is vision - visibility. Your code might look something like this:

float distance = (pawn1.Position - pawn2.Position).Length(); // Euclidean distance is very easy to calculate
if(pawn1.vision - pawn2.visibility <= distance)
{
if(pawn1.HasLineOfSightTo(pawn2)) // You can use your cached data here
{
cachedListOfVisiblePawns.Add(pawn2);
if(pawn2.vision - pawn1.visibility <= distance)
{
cachedListOfVisiblePawns.Add(pawn1) // Since you already checked positively for LOS you can save CPU cycles by calculating the other way round immediately
}
RegisterForNoLOSCheck(pawn1, pawn2) // We already know whether pawn2 can see pawn1 and don't need to calculate that anymore
}
}
else
{
if(pawn2.vision - pawn1.visibility <= distance)
{
... // Since we already calculated distance we can save a few cycles by running the LOS check for pawn2->pawn1 straight away
}
}


The only real addition here would be calculating the stats and the euclidean distance between two pawns, neither of which is very CPU intensive. For terrain features like trees and walls you could just skip the calculation entirely and assume they're visible from any distance.

Thanks for the POC. It could work, but I think that the actual view range is too short to have any sense with this approach... maybe it should be doubled. I need to make a POC to see how it works.

Another way to achieve a similar result would be by tracking a "visibility score" on the mod grids instead of a simple "is / is not visible" flag, but that would be a sum of all pawn visibilities, so two pawns seeing a cell at 50%, would make this cell 100% visible (allowing to see smallest things). It is also true that it would be heavier to compute, as it would be calculated for every visibile cell in a Field of View... I need to think about it. Meanwhile, thanks for your suggestions :) .

Luka Kama

Beta 0.1.17

Change log:

  • Doors now correctly update the fog of war when opened and closed.
  • Added dependency to HugsLib for preferences management.
  • Added preferences to adjust the fog alpha level and the fade effect speed.


Steam page
Zip to manually install here



Luka Kama

#67
Beta 0.1.20

Change log:

  • Some optimizations.
  • Only light blocking objects now block the field of view.
  • Fixed a bug preventing the fow update of near things when the view blocker object is removed.
  • Surveillance cameras re-balancing: much more power consumption (3.3x), more materials needed (3.3x more steel and 2 components), more work to build (5.8x), added light negative beauty, added stealability, added specific research requirement.
  • Watch towers re-balancing: more work to build (2x), more material needed (2.6x) and added negative beauty.


Steam page
Zip to manually install here

Luka Kama

Beta 0.1.21

Change log:

  • Fixed a bug causing the FoV not disappearing when caravans was leaving (or pawn was dying in) bottom or left sides of the map.


Steam page
Zip to manually install here


Luka Kama

Beta 0.1.23

Change log:

  • Fixed a bug preventing bills on workbenches to be performed.


Steam page
Zip to manually install here

Genesis92x

Thank you for the bug fix! This is an awesome mod :)

Luka Kama

Beta 0.1.24

Change log:

  • Performance improvements.


Steam page
Zip to manually install here

After this release, I will move the mod out of "Unfinished" forum. It is true that there are a lot of nice things that could be added, but at least core features are complete and stable.

Soupy Delicious

#73
Is this mod effectively stable for play and does it compliment or at least work with all the game systems?  Also, the only thing I can really picture going wrong is enemy Ai behaving slightly off, breaking their believability, which is super important to me! 

Actually, really, this mod seems to good to be true and I'm flabbergasted that one: I just used the world flabbergasted; two, that this mod is just here... Sitting here, in existence, being so thoughtfully crafted.

------

Well, disregard that first stupid paragraph.  I've actually played with the mod and been through multiple raids, and hunts, and events... being raided doesn't feel unnatural or cheaty like I feared.  Actually, it feels more natural now, not seeing the AI act kinda stupid, and so much more tense.... everything's so... directionally tense!  What does that MEAN!?

An escape pod came crashing down, and I actually had one very natural, very human decision to make: do I want to save person or do I not; or can I not?.  That is, instead of 'do I like his stats or do I not?'

Can't go back from this mod.  Thank you, guv, for your efforts.

Luka Kama

Beta 0.1.25 (Release Candidate)

Change log:

  • Buildings without vision or with vision but turned off don't provide vision anymore in their occupied cells.

Steam page
Zip to manually install here