Is a Fog of War system possible to make with Roblox Studio

You can usually make anything in Roblox studio, but to my knowledge fog of war cant optimally be made with the tools currently available. I know games like territory-conquest have a fog of war system, but that system is fairly simple as it shows you what you border unlike the average RTS that show all units and building views. Basically my question is, how can a Fog of War system be made similar to Command & Conquers Fog of War, (if it can be made).

1 Like

Can you add picture of the effect you want? Otherwise I don’t know what you want or are talking about.
If you are talking about having fog limited to certain regions (as in real life) then I would make some mesh parts and mess with their transparency. Then whenever a player goes in that region a local script changes the skybox to a flat greyish color and sets the fog to the same color as well.

On roblox you would have to render and de-render parts of the map yourself.

Sure, it’s possible. How good does it have to look?

Slap some big white bricks down that cover the obscured areas. Done.


Fully visible = You can see everything moving around etc
Foggy = You were there but now you aren’t. and wont be able to see any movement there
Unknown = You cant see anything in there and you haven’t been there

1 Like

This is accomplishable with Region3 | Roblox Creator Documentation or checking the players position with (HumanoidRootPart.Position - RegionBorderPart.Position).Magnitude. However, in this situation I’d say that Region3 is the way to go.

well, make some 0.5-0.7 transparency black blocks??!???!?!??!?!

easy and simple, but idk why people are talking hard stuff

would I have to constantly check for each player owned unit right?

Its not that simple. They cant just be permanently invisible, when you send a unit into the black fog the fog would have to become fully transparent.

…well delete the block when player touch it ;-;?

You could use an Atmosphere or adjust the Fog settings under Lighting. Those aren’t perfect solutions though. What you might instead do is create some black walls out of Neon parts or something and automatically place them around your grid on the client. This is effectively what the game above is doing.

You could also hide objects outside of the visible area, and, place black tiles in hidden areas for example.

There are plenty of ways you could do this, and, there are a lot of options.

For the foggy area, you can darken those areas in similar ways, and, just hide anything outside of the range of that area.

The game you posted a screenshot of above uses a tile system, and, usually that’s what I’d recommend for FOW, since, you can much more easily decide on different shapes than circles or spheres. You can mark each tile as unknown, hidden, or visible, and then for any objects within those tiles you can show or hide them.

Whenever a tile is made visible, you just find anything on that tile and show it, and, optionally hide any fog parts on that tile that border visible tiles.

or you want only a area of it to be visible

Cant be deleted, as the player could leave the territory soon after. Also keep in mind its not just the player im checking for, its his whole army.

You could make use Workspace | Roblox Creator Documentation and have all the parts already in the region on the ignore list. Then iterate through the parts returned and use Players | Roblox Creator Documentation on their parent. If the function returns a player you can then have the fog, current, and unknow areas change for the players client via by communicating with their LocalScript | Roblox Creator Documentation via a RemoteEvent | Roblox Creator Documentation.

Ill look into both responses you two gave me, Thanks

If you want to account for the players army you can use CollectionService | Roblox Creator Documentation and CollectionService | Roblox Creator Documentation to check if the part is part of the players army.

note that i did not test this out so there might be some errors
hmm…sounds easy to me, just make a script inside the block and write:

local part = game.Workspace.Part
if part.Touched:Connect(function(hit) then
part.transparentcy = 1
else
part.transparentcy = 0.6 --or whatever you want the part transparentcy be before it become 1

This isn’t what they asked? They simply asked if it is possible to make different regions of fog and hide parts in them. This is possible with a Region3 btw @OP.

Also:

  1. Please use indentation in your code. It makes it so much easier to read.
  2. You spelled “Transparency” wrong which would error the script.
  3. You forgot an end at the last line of your code.

Btw I’m not criticizing you or anything, I’m just pointing out some mistakes that could cause others to be confused.

6 Likes