Map Database  •  FAQ  •  RSS  •  Login

Fog of War

<<

Danjb

Sword Fighter

Posts: 288

Joined: 14 May 2007, 22:00

Post 15 Nov 2011, 17:16

Fog of War

Hey,

I don't know if this has been done already but here's a little picture I made demonstrating a possibility of how fog or war might look:

Before
Image

After
Image

These pictures are just an example of the fog, obviously it doesn't really make sense for parts of the town to be covered in fog since I clearly own that town :p

Obviously it's a little rough (I no longer have Photoshop, and it shows), but what do you think?

Here are the rules I came up with:

1) Units are invisible in fog
2) Buildings are invisible in fog
3) Roads are visible in fog
4) Trees are visible in fog

This is not always so clear-cut though; what if a building is half covered by fog? We will need one of the following rules:

1) If any part of the building is not covered by fog, the whole building should be uncovered
2) The building is invisible if any part of it is covered by fog

Anyway, just some thoughts. I wouldn't be surprised if it's already been discussed...

Danjb
<<

pawel95

Castle Guard Swordsman

Posts: 1912

Joined: 03 Oct 2008, 22:00

KaM Skill Level: Skilled

Location: "Pawel95" on Youtube.com

Post 15 Nov 2011, 19:05

At first I will say how I think about the fog:
-It is not really a Knights and Merchants Feature, I THINK!

But ok, what i would say to your Draft of fog is, that it is so close to the serfs.
For example the builder on the edge of the fog, he should/could have a radius of NO FOG, for exampla 10 feets, or sth. But not still by the serf/army..etc!
You aren´t a good player if you have a good PT-Army. You should be able to use it correctly!

You want cheap new Computergames? No problem, you will get them here: https://www.g2a.com/r/pawel95
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 15 Nov 2011, 19:41

I think you should see the village the way you saw it when you first scouted it. So you shouldn't see additional roads/buildings/trees.
I guess that's not easy to program as the remake will have to remember how it looked and this changes continually, but that's just a guess.
<<

GreatWhiteBear

Knight

Posts: 578

Joined: 13 Sep 2011, 22:00

Location: The Netherlands

Post 15 Nov 2011, 19:48

he said that it was still a bit rough so it was intended to be like that but not in the actual fow.

I'd say you can only see the buildings you saw last time you had that area visible.
And by seeing the buildings I mean seeing what kind of building but not seeing what it is doing or what is being delivered.
Also, when building spots are marked or when a building is being build and it becomes shrouded in the FoW it remains as you saw it when it became shrouded.(also applies to marked roads and troops)
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 15 Nov 2011, 20:24

Hey Danjb,
Nice work there, but there is an easier way :P
Open up KM_Defaults.pas, and find or search for the line: (under the section "//Not fully implemented yet")
  Code:
  FOG_OF_WAR_ENABLE     :boolean=false; //Whenever dynamic fog of war is enabled or not[/quote] Change that to true and you'll find those screenshots a lot easier to make... :wink: Of course it's not finished so the information of what was last seen is not working, the edges should be smoother and the way the fog is revealed/unrevealed could look nicer. If you're ever bored and want some fun, take a look through that list of features and try enabling/disabled some, it can be amusing :P From a programmers point of view, for every player, for every tile on the map we must store the things last seen under the fog: (as these properties can be changed by another player while we weren't looking) - Terrain type - Terrain rotation - Terrain object - Terrain height - Tree age - Tile overlay (roads, burnt ground, fields, etc.) - Tile owner (so we can render minimap colors for roads under fog) Each of these takes 1 byte at the moment, making this list 7 bytes. Other properties that will need to be stored but NOT written to the save: (they can be recalculated on load) - Field borders (5 bytes, type and 4 booleans top left bottom right) - Light (1 byte) So doing the calculation on the maximum map size with 8 players: 192x192 tiles x 8 players x 7 bytes = 2,064,384 bytes (~2MB) That means the save files will be 2MB larger but we can probably offset that by making them compressed (at the moment they are raw) which should still make the files much smaller than they are currently. We'll also need a list of the houses as last seen, which will consist of: - House type (1 byte) - House owner (1 byte) But we'll only need 1 of these for each house, not 192x192 so it's not worth including in the calculation. This all makes it sound quite feasible, I had predicted it would take more space the store this information. Using this info shouldn't be hard. When the tile is visible, it is rendered from the real terrain, when the tile is under fog it is rendered from the last seen info. When a tile goes from visible to fog, this information is copied to the last seen info. I hope I haven't baffled you as by all this, I wrote this comment for Krom/Danjb/my benefit more than yours. It shows that fog of war will be quite possible to implement. Lewin. P.S. Danjb's screenshot doesn't show the fact that units will be able to see a long way through the fog (further than through unexplored areas)
<<

Danjb

Sword Fighter

Posts: 288

Joined: 14 May 2007, 22:00

Post 15 Nov 2011, 23:35

But ok, what i would say to your Draft of fog is, that it is so close to the serfs.
I was intending for the fog to be the actual radius of those units, I was just demonstrating fog might look; no actual sight radii are implied.
Also, when building spots are marked or when a building is being build and it becomes shrouded in the FoW it remains as
you saw it when it became shrouded.
That was the other way I thought of doing buildings, i.e. you still see them but only in the state they were in before they become "shrouded" (good word).
If you're ever bored and want some fun, take a look through that list of features and try enabling/disabled some, it can be amusing
Darn it, Lewin! I'm supposed to be doing coursework! :p

But seriously, I look forward to trying some of these things out.

Thanks for all the info by the way, it's very interesting to hear how it all works, and it makes a lot of sense; and 2-3MB for a save is nothing :wink:
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 16 Nov 2011, 01:48

Looks pretty good for a draft.
I agree this what has already been said: What the enemy village looked like before is how it should stay under the fog.

And I think that the buildings should be uncovered from the fog just like they are when uncovered form unexplored map.
I used to spam this forum so much...
<<

Encaitar

User avatar

Lance Carrier

Posts: 63

Joined: 13 Oct 2011, 22:00

Location: The Netherlands

Post 16 Nov 2011, 08:25

1) Units are invisible in fog
Including non player units I suppose (wolves, crabs, etc.)?
2) Buildings are invisible in fog
IMO the buildings should also be visible, but only those you already have discovered (it is also be done that way in AoE if I remember well). That makes more sense, because you know there are building there, as you did see when discovering the map.

[Because you can only see the buildings you did discover, everything can be changed when you come back. If the other player did destroy those buildings (let's say, the quarry, because the stone was depleted), you should see the buildings change when you come back (so the quarry is visible in the FoW, till you came back)]

Of course this is harder to implement, as the FoW is not up to date, but a 'last seen' status (the FoW gets different per player).
<<

T*AnTi-V!RuZz

User avatar

Former Site Admin

Posts: 1826

Joined: 03 Jan 2007, 23:00

KaM Skill Level: Fair

Website: http://www.knightsandmerchants.net

Location: The Netherlands

Post 16 Nov 2011, 09:27

I think there are some 'rules' to Fog of War, instead of us deciding what should be covered by FoW and what shouldn't..

There are lots of games with FoW, and all of these games use it in the same way (primarily).

For example: buildings are always visible in FoW. Just not what's happening in/around them. Also, roads should be visible, since it doesn't work to someone's advantage if he can only see enemy paths (without seeing the units walking on them)..

I tried Googling the 'rules', but couldn't really find any. Still I think we should just copy AoE's FoW-handling or something. Of course it'll have to be tuned to fit KaM, but that shouldn't be too hard if you have a 'standard' to work from :)
<<

GreatWhiteBear

Knight

Posts: 578

Joined: 13 Sep 2011, 22:00

Location: The Netherlands

Post 16 Nov 2011, 12:59

So roads in FoW should be visible like roads in the LoS?
I would have to disagree on that. It is a too big advantage to know what is going on on your opponents roads.
It is so unrealistic to be able to see what is going on beyond your sight.

Then another thing, can we make buildings block a units LoS?
Now units can just look "over" or "through" buildings.

I heard the idea of having height block the LoS and I think it is worth discussing.
<<

T*AnTi-V!RuZz

User avatar

Former Site Admin

Posts: 1826

Joined: 03 Jan 2007, 23:00

KaM Skill Level: Fair

Website: http://www.knightsandmerchants.net

Location: The Netherlands

Post 16 Nov 2011, 13:08

Also, roads should be visible, since it doesn't work to someone's advantage if he can only see enemy paths (without seeing the units walking on them)..
<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 16 Nov 2011, 15:01

I think you're just over complicating things:
- Units are never visible through fog (including animals)
- Terrain/roads/houses show the LAST thing that you saw at that location. So the idea is that nothing changes while fog is over it. When you next visit that location the old stuff will disappear and the new will appear.

That's how it is in other games and it makes sense to me.
Then another thing, can we make buildings block a units LoS?
Now units can just look "over" or "through" buildings.

I heard the idea of having height block the LoS and I think it is worth discussing.
If you can suggest a feasible way to implement this without drastically increasing our CPU/GPU requirements then I am all ears.
However I also think this just over complicates matters as units could hide in some hole behind a mountain and sneak into your base, and when you're attacking an enemy base all of the area behind building relative to your units would not be visible. That's just adding too much realism, it would make the game unplayable. Not to mention the fact that it would require ray tracing or something similarly complicated to compute the visibility, and this would have to happen every time a unit moved... So it will take a huge amount of CPU (or GPU if we do it that way) to compute this. Right now the Remake runs perfectly on an Intel Atom, and that's the way I like it.
<<

GreatWhiteBear

Knight

Posts: 578

Joined: 13 Sep 2011, 22:00

Location: The Netherlands

Post 16 Nov 2011, 15:12

Lewin, I guess you are totally right.
But since I don't understand anything about programming whatsoever, I just have to trust that what you say is true. :lol:
But, no, I can't suggest a feasible way to implement it. :(
<<

Danjb

Sword Fighter

Posts: 288

Joined: 14 May 2007, 22:00

Post 16 Nov 2011, 18:38

I think you're just over complicating things:
- Units are never visible through fog (including animals)
- Terrain/roads/houses show the LAST thing that you saw at that location. So the idea is that nothing changes while fog is over it. When you next visit that location the old stuff will disappear and the new will appear.
Sounds good to me. I know I made buildings invisible in my screenshot, but actually I didn't give it much thought. I prefer it the way you mentioned.
Lewin, I guess you are totally right.
Lesson 1: Lewin is always right :p
<<

Ben

User avatar

Former Site Admin

Posts: 3814

Joined: 08 Jan 2009, 23:00

Location: California - Pacific Time (UTC -8/-7 Summer Time)

Post 16 Nov 2011, 20:32

GreatWhiteBear wrote:
Then another thing, can we make buildings block a units LoS?
Now units can just look "over" or "through" buildings.

I heard the idea of having height block the LoS and I think it is worth discussing.
Personally, I think this isn't necessary at all. Much more work than it would be worth.
I used to spam this forum so much...

Return to “Ideas / Suggestions”

Who is online

Users browsing this forum: No registered users and 2 guests