Generating A Hex Map With Fog Of War in Unity

preview_player
Показать описание
Procedural Generation of a Hex Map, Hex Based Pathfinding, and revealing the map via Fog Of War are three key mechanics of any great strategy game. Let's take a look at how we can use Unity to procedurally generate a hex map and have a character explore it!

--------------------------------------------------------------------------------
Want to support the channel?

Use these links to grab some cool assets from the asset store:

--------------------------------------------------------------------------------
Socials and Other Stuff:

Рекомендации по теме
Комментарии
Автор

Watching this is making me want to see a multiplayer RPG built from this starting point. You explore the world on this screen then get a pop up window of the "dungeon" you've found yourself in and you can explore that on everyone else's turns. Turn based games can involve a lot of waiting so I think it's god to give players something to do while they wait, especially if the other players are just competing with you rather than actively fighting against you. If you don't have anything to do on your turn the game will progress everyhting you're waiting for in the background without interupting your dungeon crawl. When there Finally is something to do, you'll get a message that something needs your atention and the dungeon window will hide itself. As soon as that's dealt with, the window reopens. Turns in the dungeon are seperate to turns on the map but, when multiple players are in the same dungeon, they'll naturally be in the same turn counter. If everyone was in the same dungeon the turn counters might match up because no one in needed on the world map. Now I really want to make this with someone.

lexibyday
Автор

If you want an even cheaper fog-of-war effect, you can use a smoke sprite (doesn't even need to be animated) and have one single particle per tile which you rotate slowly in a random direction. As long as the sprite is over 1.5 times the size of the tile, they'll overlap enough on the grid to look like continuous fog. I did this on a square-grid and the effect looked really good. If you're unhappy with the amount of overlap onto visible tiles you could make the particles smaller but have them at the corners (neighbouring other fog) as well. You can do this with a single particle system too if you manage the particles yourself.

Merivio
Автор

This implementation seems like it would hit perfomance hard.

JM-dcrn
Автор

For civilization 6 fog of war I highly recommend a guide from LEXDEV. He recreated it just like in the game.

PurpleDaemon_
Автор

Very cool. I especially like the fog-of-war effect.

midniteoilsoftware
Автор

Cool but it would be nice if you showed the whole scripts or attach them somewhere to download

kantholzwerfer
Автор

Currently working on a very challenging project where I have an Icosphere built out of mostly hexagons (with a few pentagons because geometry) which looks and works great but referencing and addressing the connections between hexes is a real challenge!

JohnVanderbeck
Автор

As someone who recently implemented fog of war, I could have used this 2 weeks ago. That culling mask trick with the camera is great.

AnEmortalKid
Автор

DUDE! I was literally thinking about hex maps yesterday and planning on working on it today.

MatthewCaldwell
Автор

Why I can't see this video in a list of channel

SychMedia
Автор

8:55 "I'll only gloss over the basics of A* pathfinding" *proceeds to walk through the entire process step by step*

HurriO
Автор

I found this very very hard to follow along to. The first grid video wasn't as bad to follow.

iangraham
Автор

Really good information here, I love hex tile based games. I do have a question though, at 4:27 you show [EditorButton("Layout")] I have searched the Unity API attributes and have not found this

timowen
Автор

i like your content but it's really hard to follow especially if you use extensions or jump from script to script. Please tell us where you attach your scripts and what extensions you use in your next videos <3

hxlxna_
Автор

How would you outline a collection of tiles like the city influence borders in civilization?

mykl
Автор

11:21 why dont you show it all? what is currentPath, what is nextTile, where do I declare them, how do I pass them to the controller, etc.?

micca
Автор

@GameDevGuide
5:53 Where did you get that separately? Did you create a new script?
usually you write in the upper right corner what script it is, but you didn't write it here, I didn't understand

dominicburenok
Автор

Muchas gracias no hablo ingles pero gracias a ti podre hacer mi juego de estrategia :)

alexandraclaretguarenas
Автор

How could you do it, that when you leave visited Hex, they become partly foggy again if not in vision of any character.

Xeakerr
Автор

On the raycasting: both this video and the Outline PostProcess video use `InputEvents.current.mousePosition`, but I don't see where `InputEvents` is setup or is defined. Can anyone assist?

nathanwakefield