Limitations

Updated on August 11, 2022

There are some limitations when using grid builder 2 which are outlined in the following article. Most of what the system can be expanded however, see ‘Expanding’.

Grid size

Although this system is set up to run smoothly on most devices, increasing cell counts to high numbers especially on modes except simple. If you need the most performance, but do not need auto cell blocking, use Simple mode.

On single cell and chequered I have tested up to 90,000 cells before a slowdown on my midrange machine.

On simple mode, I have tested up to 250,000 cells, with absolutely no slow down at runtime. For this kind of application such as painting or anything using high cell counts, I would turn off gizmos or use Draw Simple under GridSquare>Debug so working in the editor is useable.

Cell size

Currently, the Grid Selector only checks once for the cell size of the first grid it finds. So it sets its own size based on that. If you decide to have different cell sizes for different grids, then it would not match up. You could however do this check for cell size when entering each different grid. In the Grid Selector class, this should be fairly easy, I have left it to check once purely for performance as in most games the size of the grid/grids will be the same.

Grid amount

There is no limit to how many different grids you can place, and where. The grid selector will work on all of them. Some below on the ground, some on mountains, and some in between, all good.

Axis

The grid is limited to running on the XZ axis with Y being up. You could if you are comfortable with coding dive into the classes to change the XYZ values around with whatever you choose.

2D

If you are a running a 2D game, the traditional 2D mode button will be useless. Instead you can follow some simple steps to recreate this. Create camera and point downwards. Make the camera orthographic or perspective based on your game type. Then hit the top of manipulator tool in the top right of the editor to work in that view. You can then hit the word <Persp or <Iso depending on your camera setup. You can also change the direction of gravity. So you may want to turn off Y gravity and enable it on Z for example. Apart from that, you will need to use 3D versions of functions, as 2D versions will only work on the XY plane.

Placeable Objects

The objects you place are limited to taking up a maximum of 25 cells for objects that do not move on points and 16 cells for objects that do.

For most games this is enough, however you could add more. Take a look in the SelectObject script and look for the ObjectSize. You will see lots of booleans which represent positions in the GridSelector.

Placeable objects larger than 1 cell big will also have to be set up correctly. In other words, you will need to do some pivot matching. This is easiest in 3D software like Maya, but can also be done by adding your prefab under a parent with the correct pivot. You will need the yellow pivot point under the SelectObject component inspector to match your objects pivot point.

Simple mode

Simple mode is designed for exactly that, simple grids. High cell counts are fine, however, this does not have the auto cell block feature.

Design

The design aspect of this system is totally in your hands. I have supplied a few prefabs and Materials/Textures to get started but the look of it is totally up to you.

Renderer

This package can be used with any renderer. It is created in the legacy renderer so all materials are standard. However, a simple material conversion to URP or HDRP is all it takes. See the Unity Documentation for how to do that.

Expanding

Grid Builder 2’s system can be upgraded with a lot of features. Take a look at the code, it is all commented so you should have a clearer idea on where to place your code.

Many more options such as object switching, building upgrades and multi object selection are all things that could be easily added.

If you have any questions on how to go about adding additional code, please feel free to contact the below email. I also work on a freelance basis when I get the time if you are not comfortable with coding.

Still need help? Contact support at support@golemitegames.com

Please describe your issue in detail and if possible, provide screenshots to help us understand your problem better and answer your question more effectively.