HexGrid

Requires Unity 4.5.2 or higher.
This is a basic tactical RPG or wargame with a hexagonal grid. It is built around the HexGrid and HexPosition classes.

The HexPosition class is designed to abscract away all the inherent difficulties of a hexagonal grid, and allows you to assign and read variables to and from positions on the grid.
 
Version: Version 1.2 (Aug 30, 2016) Size: 137.5 kB Visit Publisher's Website Support Website Support E-mail

Originally released: 1 July 2015
Package has been submitted using Unity 4.5.2, 5.1.0, and 5.3.5 to improve compatibility within the range of these versions of Unity.

Package Contents

AllAssets
Hexagon.obj
Hexagon.prefab
HexagonTiling.png
Materials
Blue.mat
defaultMat.mat
HexagonTiling.mat
pCone1Mat.mat
Red.mat
Networked.unity
OneComputer.unity
Player.prefab
readme.txt
Scripts
AI.cs
AStar.cs
HexEntry.cs
HexGrid.cs
HexPosition.cs
IPlayerInterface.cs
NegativeBinomialDistribution.cs
Player.cs
ServerGameController.cs
SimpleRNG.cs
Unit.cs
ProjectSettings
AudioManager.asset
ClusterInputManager.asset
DynamicsManager.asset
EditorBuildSettings.asset
EditorSettings.asset
GraphicsSettings.asset
InputManager.asset
NavMeshAreas.asset
NetworkManager.asset
Physics2DSettings.asset
ProjectSettings.asset
QualitySettings.asset

Recommendations

1-3 of 30

Customers also purchased

1-3 of 30

User Reviews

1 year ago

This review was submitted for a previous version of the package. Version: Version 1.0


Awesome!

(4 of 4 found this review helpful)

It has great functionality and upgraded to Unity 5 with no problems, thanks for the asset!

3 months ago

This review was submitted for a previous version of the package. Version: Version 1.1


Looks good and interesting

(1 of 1 found this review helpful)

As others have said, this asset looks like a good place to start your strategy game or learn how to make one. It contains exactly what you would expect looking at the pictures. (turn based game, selection, atacks, hexagon grid, positioning to grid, moving, obstacles, little A*, little AI)
And it's free. You have nothing to lose. :)

6 months ago

This review was submitted for a previous version of the package. Version: Version 1.1


Just a problem

(1 of 1 found this review helpful)

Updated post:

I raised the rating just by fast response by the developer in the comments sections.
Anyway, I recommend giving the information in a txt, at least indicating in what cs files are the explanations. This is a little but also functional product, but is a problem with bigger products (and paid) if it's not well explained.

Thanks!


Original post:

I din't see in the readme how to do this, published in the description of the product "and allows you to assign and read variables to and from positions on the grid.".

this is the thing I was merely interested in, integrating information in the different hexes, but seems like the hexgrid is just a sprite/mesh.

If I'm wrong, please correct me, and thanks for distribuying this code, the system works at least for unit movement and combat ;)

Reply from publisher

6 months ago

It's in the comments in HexPosition.cs. You use add and getkey. For example, if you have a cell called cell and you want to assign blue to a variable called "color", you'd use cell.add("color", Color.blue); and to read it you'd use cell.getValue("color"); which would return Color.blue.

This functionality is used in the Unit class, which sets the unit that's in a given cell to the variable "Unit".

You can also use clear(String key) to clear a variable, constainsKey(String key) to check if one exists, and flag(String key) to create one with a value null, which is nice if you only care if it exists rather than needing an actual value. This is used for the key "Obstacle", since I only care if one exists and I don't care about the type. A more advanced version of this might have different obstacles that certain units can cross, in which case Obstacle will be changed to be used as a variable instead of a flag.

The flag command is used in HexGrid.cs, and the containsKey command is used to check for one in AStar.cs. Also, the containsKey command is used to check the presence of a unit in AStar.cs.

All prices are exclusive of VAT