I’m not building a Grand Strategy game, so having the territory interactive is not my requirement. It should simply identify “who” the territory belongs to, and actors passing through borders should trigger “trespassing” events.
The borders are mostly shared between multiple provinces owned by different factions, so the border could be multi-coloured (Red on one side and Blue on the other side for example)
Every question similar to mine points towards this answer:
(and there are no recent similar questions. they are all from a while back)
Is this the only approach?
Or, are there even marketplace plugins that can help me out?
This seems to be a very common feature in Strategy games across, but finding very little documentation on how to implement. Or maybe I’m missing keywords in my search?
Would this work? The spline decal looks like it would do the job.
I can think of some other ways that this can be done too:
If your play area is a bunch of tiles, you could create a mesh for each edge of a tile, and then just show or hide those pieces based on the area a player controls and what each tile is connected to. Ie. If your tile is a hexagon, it will have 6 border pieces. If an edge is connected to the tile of another territory, show the piece, otherwise hide it.
You could have a post-processing material that highlights the edges of something. This could be controlled by setting tags on the actors you want to highlight.
I have already bought this plugin to give it a try. It would work, but there are a few issues (Not this plugin, going with splines as a method):
The Splines are added as Child Component to City’s Actor Blueprint. In the Level Editor, I got to do the Settlement Territory by manually arranging spline points (Which itself is a tedious job).
Considering 2 or more adjacent cities, I’ll have to manually create all City’s territories using the splines, even if they are shared. Which makes it way more tedious
As for your other suggestions:
We are opting out of Hex tiles specifically to avoid looking like Civ games first, and to give a more Natural look to the territory borders
Yes, that could work. the issue is identifying what that “Something” would be. Splines are good, but they have issues I mentioned earlier.
A spline is just a bunch of points in space. I don’t think you need to manually create anything. You could create a function to find the vertices on the edge of the mesh or actor and then create a spline with those points. How you find those points largely depends on your setup though.
That works if it follows a constant direction between the centre of the city and the territory border. It wouldn’t work if the territory borders structure vary. Like this image.
Or do you have suggestion or idea on how to come up with unnatural territory borders? not pure circle or other shapes? I’ll think on it too
Like I mentioned earlier, it depends on your setup. I don’t know how your meshes are structured. How do you determine your borders? If you can explain that, preferably with code and screenshots of your actors, then I can help.
I am thinking Hand drawn Territory borders placed around Hand Placed Cities on the map would look more natural. And can be customised to my needs.
The more I talk about this, the more I believe the below tutorial is what makes sense.
Modifying the tutorial to suit border highlighting rather than the entire territory.
Write logic to create Territory borders based around a Territory Range Parameter and Movement Cost Modifiers, I should be able to use grids and calculate around it with the city as the centre, for the First City. All the grid points that fall within the Range and Movement Cost calc, would then be used to find the borders, where spline points would then be populated.
Then, all subsequent cities will calculate territory border the same way until it hits a grid which is already part of another territory.
I’m marking the question as answered. I have to think deep about which option I am going with for the game.