How can I make a grid for a turn-based strategy game?

I’m doing a turn-based game project for school to learn more about Unreal Engine and C++. I’m using the Top Down template (the C++ version) to start off but I don’t know how to start making the grid needed for a turn-based game. Any help on this would be appreciated.

There’s a thing for this in marketplace.

https://www.unrealengine.com/content/a22867b136314748af7437c635b9ddba

I saw that, it’s just I wanted to try doing it from scratch using C++. Maybe I’ll ask my academic adviser and see what she says.

If you don’t want to buy my toolkit you can check out a very early version of what was to become the toolkit here (I think you’ll need to install UE4.4 for it to work, though). It does show how to spawn a grid and how to relate the tiles on the grids to data in an array. It’s done in blueprints, but if you know both blueprint and C++ it is easy to convert blueprints to C++. In any case it might be good as inspiration.

Thanks for the link.

So it turns out my adviser is ok with me using the toolkit. So now I’m wondering if it’s possible to select an individual tile in the toolkit?

Ok, cool! I’ll need you to clarify a bit. What is it you are trying to achieve? The locations of all tiles are stored in an array, and there are multiple arrays corresponding to the indexes of this array that store the data of the tiles. The data of a tile can be accessed by getting the appropriate index of these arrays. I have included functions for clicking a tile and convert the clicked vector to the corresponding index, but there are several other ways to do this depending on what you’re after. I recommend taking a look at my tutorial videos if you want to get an overview of what the toolkit is capable of :slight_smile:

I was trying to make it so that if the player lands on a special tile they get an item or something. Kinda like those items you can find in the middle of battle in Fire Emblem.

Ok, that’s certainly possible. There are manyways do this, but the easiest is probably to simply use powerups with collision on the tiles in question and fire your “find item” event when a unit overlaps it (note that the default units do not have collision enabled by default, so make sure it is enabled and overlaps the same channel as your units. Also have the collision ignore PathTrace and RangeTrace as otherwise this will screw with tile clicking and visibility)

http://www.unrealenginetutorials.com/unreal-engine-4-c-or-blueprints/
They said that all of C++ is visual orchestratable

Sorry, I’m not sure what you mean by orchestratable and Google is not helping. Good article, though. C++ has the benefit of being much more performant than C++, but blueprints make for much faster iteration in most cases. My personal strategy is to use blueprints until I experience poor performance for the hardware I am targeting. If this happens (hasn’t so far, though) I convert the needed parts to C++. It is also worth noting that though C++ is potentially a lot quicker, bad C++ code can still be slower than good blueprint graphs.

Well any code I make for this has to be in C++. All the blueprint classes in the asset can be accessed in C++ right?

Like Monokkel said. Get his toolkit. The buisness terms state that you can alter anything on assets you purchased. Add to etc. All those assets are like video tutorial. All the info an plans are there and yours. They show you blueprints and eveything. Good idea. Thats why I bought some to see how others did what they did. The builders of engine swear u can do anything that C++ can do

http://www.unrealenginetutorials.com/unreal-engine-4-c-or-blueprints/

I already bought it, I was just wondering if the blueprint classes in the asset can be called in C++ code. I’m still new to Unreal and just want to know how C++ communicates with blueprints?

Blueprint functions can be called in C++ code, though I have not played around with this myself yet. Here is an AnswerHub thread discussing calling blueprint functions in C++. You should further look at Epic’s C++ tutorials or ask in the C++ subforum to learn more.