How do I create a circular rts grid?

Like something like this:


done in blueprint, If you could point me to some reading to do i’d be grateful. I’m not even sure where to start from to be honest ! thank you for your time !

Your question is a little vague to me, but maybe this will be useful to you in someway - I had made a function for converting polar coordinates to cartesian for doing polar grids like that.
The function looks like this:

This is for 3 dimensions obviously, but you only need two, so you would just set theta to 90, for this function.

It could be used as below, to generate points on your polar grid. You have control of the number of sides, the spacing of the rings, and the initial radius to offset, like in your image actually.

Just to demonstrate what that does, you could draw the grid using debug lines like this:

And the result:

If you want to snap things to a polar grid, you could generate the points like that once, and store them in an array.

1 Like

Thank you! I wasn’t expecting such a detailed reply. What you posted is what i meant even if I don’t know what that “3Dpolar to cartesian” that you use a couple of times is.

Yep thatš just a custom function, it makes it easier to draw a polar grid, it could be done with regular coordinates but it would be more complex.

Worked like a charm. Thanks ! How would you go about storing the points once in an array ? Is there a way to store this information in the default values of the vector array ?

Well, in that first picture, the Grid Coordinates is just an array of vectors, but it has to be generated on construction. That should be fine though, I’m not sure of anyway to have it pre-set without generating them at runtime. I suppose if you really wanted to you could print all the values and manually enter them in the array heh.

It depends what you want to do with them, for most purposes storing them like that should work, you could make a function out of that entire thing and just call it on construction. Just be careful that nothing attempts to access the array before it has been filled

If I can’t find a better way I guess I could manually enter them, it’s a non issue there. I want to use the points to create an interactive grid so either spawn meshes pointing towards the center or working on a similar way in UMG. The end goal is making a prototype of a rtsesque sort of game but using that as a grid :slight_smile: In the first attempt to create this I used a blueprint for each grid component, in long run that was a bad idea haha