Thank you for your interest in this package! I’m sure it will serve you well and help you realize your game ideas in Unity!
In case you run into any problems or if you need any help with something related to this package, feel free to contact me by joining the discord server using the button below.
The Ultimate Grids Engine it’s a framework for grid-based games, which allows you to create grid-based games quickly and effortless.
Among other things it provides you with: entities system, grid based movement, range and path finding algorithms, full level editor which allows you to populate grids with tiles and entities, modular attack system, interactive objects, packed with games and mechanics examples, and a lot more.
Fully supports Rectangle, Hexagon and Isometric grids for both 2D and 3D games.
Well right now you're reading the documentation which means you're in the right place, it is recommended you read through at least all the way to the "Basic Principles" section. The engine is built with Unity good practices in mind. So if this is not your first Unity project, you’ll probably be ok on your own. And you can always go back here if something’s not clear.
That said, you can use the menu on the left to go to specific sections. This documentation is functional. If you have questions about the code itself, you'll rather have a look at the code’s comments directly, usually they cover most questions you might have.
And if that doesn’t help, you can always join the discord server using the link on the Introduction Section.
Whatever version of Unity you’re using, remember to always import the asset in an empty project, so the engine’s project settings get properly imported.
This asset relies on a few unity packages to function properly. On import this will very likely cause errors, that’s normal, and easily fixed. It’s all explained here.
To keep everything organized, all package assets are contained in one root folder (’Character Movement
Fundamentals’). This ensures that your project files stay separated from the package’s files.
Inside the root folder, assets are separated by function.
This folder contains all scripts, meshes, animations, materials, fonts and prefabs that don't belong to any specific scene/demo.
The assets are organized by their use - "Runtime" contains all of the core scripts of the engine, "Editor" contains the editor scripts such as drawers, the welcome window and grid brushes, etc.
This folder contains all the demos included in the engine. Usually each demo aims at showcasing one or more particular aspects of the engine or how you can achieve different types of games using the engine.
"Chess" is a demo chess game, "Dungeon" verby noun game example, "Minimal Hex" minimal scene with the basic settings for a hexagon grid, "Minimal Rect" minimal scene with the basic settings for a rectangle grid with 4 directional movement, "Path Visualizer" demo showcasing the pathfinding algorithm (A*), "Room Generation" a demo showcasing how to add and more tiles and gridobjects at runtime from the script, "Sandbox Hex" basic hexagon level shocasing several features, "Sandbox Rect" basic rectangle level shocasing several features, "Tactics" turn based tactics game example.
Before gettings started there is a few basic concepts you should understand.
Before creating tiles and adding them to the grid, lets start by setting up the Editor correctly to facilitate things later.
Now that we have a tile prefab we need to create a tile collection, you can add as many tiles to a collection as you want and you can have as many collections as you want, tile collections allow you to easily pick tiles from it and paint them to the scene.
We'll create a new character which tries to pathfind towards the hovered tile every time you click.
Now that we have a GridObject prefab we need to create a GridObject collection, GridObject collections allow you to easily pick GridObjects from it and paint them to the scene.
You can instantiate tiles at runtime by calling the method "InstantiateGridTile" on the GridManager, like this: GridManager.Instance.InstantiateGridTile(gridTilePrefab, gridPosition, heightInGrid, offsetPosition, rotation);
You can instantiate tiles at runtime by calling the method "InstantiateGridObject" on the GridManager, like this: GridManager.Instance.InstantiateGridObject(gridObjectPrefab, gridPosition, initialOrientation);
To try and make a character move you should call either the "TryToMove" or "TryMoveToPosition" methods on the GridMovement component attached to the character:
TryMoveTo(targetGridTile, andAnimate, andRotate, checkMovementCooldown);
.
TryMoveToPosition(targetGridPosition, andAnimate, andRotate, checkMovementCooldown);
.
You can calculate a path by using the "Search" method on the AStar class, passing the start tile and the target tile, it will return a list with the tiles in the path: AStar.Search(startingGridTile, targetGridTile);
It is recommended that you declare a public RangeParameters variable which you can modify in the editor and pass as a parameter when calling the method "SearchByparameters" on the RangeAlgorithms class: RangeAlgorithms.SearchByParameters(startGridtile, rangeParameters)