Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. The Fog of War

The Fog of War

Scheduled Pinned Locked Moved The Lounge
announcementmobilegame-devcollaboration
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Many games have a "fog of war" and thought mine should too. It seems so obvious: blacken the screen (somehow). While I came up with a plan I decided to let (Bing) AI have a go:

    Quote:

    Here are some ways to implement fog of war in a game: Create a layer for the fog of war and cache a version of the world map (or sections) image(s) with a black+alpha rectangle applied to it. You can also apply a blur filter in this stage. Use a tablet or laptop for each player, which tracks which parts of a common map the player uncovers. Use a set of color-coded flip tokens with abstract symbols. Every area of the game board gets one token per player.

    (That's what I thought.) Instead, in the frame update cycle, when I look at each control, I vary their opacity based on the vicinity of foes and limits of sight (distance and contour) and which team is currently active (selected POV). About 20 minutes to implement using my existing targeting routine, and looks amazingly well as troops "come into view". You suddenly realize you have a functional framework.

    "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

    R 1 Reply Last reply
    0
    • L Lost User

      Many games have a "fog of war" and thought mine should too. It seems so obvious: blacken the screen (somehow). While I came up with a plan I decided to let (Bing) AI have a go:

      Quote:

      Here are some ways to implement fog of war in a game: Create a layer for the fog of war and cache a version of the world map (or sections) image(s) with a black+alpha rectangle applied to it. You can also apply a blur filter in this stage. Use a tablet or laptop for each player, which tracks which parts of a common map the player uncovers. Use a set of color-coded flip tokens with abstract symbols. Every area of the game board gets one token per player.

      (That's what I thought.) Instead, in the frame update cycle, when I look at each control, I vary their opacity based on the vicinity of foes and limits of sight (distance and contour) and which team is currently active (selected POV). About 20 minutes to implement using my existing targeting routine, and looks amazingly well as troops "come into view". You suddenly realize you have a functional framework.

      "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

      R Offline
      R Offline
      raddevus
      wrote on last edited by
      #2

      Gerry Schmitz wrote:

      and thought mine should too.

      What is your game? Is it available somewhere that we can see it? What kind of game is it? War simulation, I'm guessing. Tell us more. :)

      L 1 Reply Last reply
      0
      • R raddevus

        Gerry Schmitz wrote:

        and thought mine should too.

        What is your game? Is it available somewhere that we can see it? What kind of game is it? War simulation, I'm guessing. Tell us more. :)

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        It's a UWP implementation of the rules of Kriegsspiel (1824-1882). I plan to release it in the Windows Store. It's a question of where to stop. It's a simulator; teaching tool (strategy; tactics; evolutions); a war "game"; etc. Looking to add Bluetooth multi-player. [Kriegsspiel – How a 19th Century Table-Top War Game Changed History - MilitaryHistoryNow.com](https://militaryhistorynow.com/2019/04/19/kriegsspiel-how-a-19th-century-war-game-changed-history/)

        "Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups