Turn Based Strategy Grids [Released] [Many images]

Cool … I am looking forward to Hex grid support. 8-}

I am making good progress on adding hex support, its going quite fluently thanks to this great, great article. I expect many of you have seen it before but if you haven’t, its a great read:

I will post video material on the hex grids soon. I expect it to be working (at least minus the LOS checK) within a week and the LOS check soon after. Despite developing it rapidly I will be testing it thoroughly before placing the update, of course.

I have two pieces to show of incoming features with the next update. First up is hex grid support, its working locally and fully featured with the exception of line of sight check which I will push in a future update. You can now compute action grids for hexagon tiled levels that feature six-directional movement and attack ranges:

All search options for square tiled action grids are available to hex tiled action grids as well:

  • retrieving paths
  • retrieving a list of friendly, neutral or hostile targets you can attack from a tile
  • searching for tiles that satisfy conditions, such as tiles within movement range or from which there are enemies to attack
  • merging multiple grids together, for determining combined move and attack range

Another feature that I’m excited about is sparse level grids, which allow you to create multiple areas that are automatically link them together (path finding will treat them as a whole):

The idea behind sparse level grids is that it is wasteful to create tile data for areas that will never be reached. So instead of creating one large rectangular map with lots of unused space in some cases, you can now choose to composite a large map using smaller rectangular areas. If you’re creating dungeons with long hallways or fields with large unpassable areas sparse level grids will make storing your tiles very cheap. Hope you guys like these incoming changes. :slight_smile:

Hey
Good job on the Hex Grid!

But to be honest, i want your promised comprehensive user guide even more.
Or at least some youtube tutorials.
I have been clicking around in your project for around 30 minutes, and i still don’t know how to make my own action grid…

So hurry up with that user guide! :slight_smile:

another question:
Can you make a big boss actor, who occupies 4 tiles ?

Hi Gaara, thanks for your support!

So sorry the user guide isn’t working yet, I got sidetracked working on features. Its helpful for me to know that there is a demand for the user guide, I’ll work extra hard on that now, I promise. :slight_smile: Once I get the core how-to-use info in I’ll put a draft online.

As for your question about boss characters: actors are assumed to be 1 tile large. Its easy to make actors occupy multiple tiles, but ‘proper’ path planning with actors larger than 1 tile (for example, making sure a 2x2 character can’t pass a 1x1 hallway) is not possible. To make a boss character occupy multiple tiles, I recommend placing him in one of his overlapped tiles and set the terrain types of the other tiles to blocking. I’m afraid I don’t have more advanced utilities for multi-tile characters right now. If you could describe to me what kind of things you would like to do with multi-tile characters I can try to come up with ideas for future releases.

Will sparse level grids also support hex tiles?

Yes. :slight_smile:

hex_sparse.png

For those who are struggling with figuring out how to use the plugin, please check out this early version of the user guide:
www.zkshao.com/downloads/TBSGrids%20-%20User%20Guide%20(Incomplete).pdf

I’m still working hard on this, so this guide will be vastly improved over the coming week. In this guide I am already discussing which blueprints you will be mostly working with, how to manage your LevelGrid and how to compute and use ActionGrids that represent a unit’s movement and attack options. Please be aware that some of the information discussed in the guide reflects the update that I’m working on that I will submit to Epic within a week, including:

  • The guide talks about compositing your level grid from multiple smaller grids, that isn’t available yet in the current version on Marketplace
  • The guide talks about square and hex grids, hex grids are also not on the current version yet
  • Finally the guide mentions functions on IGridActor to retrieve a unit’s interaction with terrain and other units, in the current version on Marketplace the interaction is defined through extending LevelGrid and overriding functions CanAttackActor, CanPassThroughTerrain, etc. In your current version, see ExampleLevelGrid on how to define terrain-unit and unit-unit interaction.

I’m posting this early version of the user guide so that no one is bottlenecked by lack of instruction. I hope it helps and I’m sorry for the confusion it will bring when reading a guide targeted at a version that isn’t released yet. I also encourage everyone to check out the included ExampleController blueprint in the current version that contains most of the logic for the interactive demo.

Invalid attachment … 8-{

I was sitting at my desk last night looking at this pack and trying to figure out if I could use and how I would use it … then it hit me … I have a concept on my shelf that I need to dust off and bring back to life. Stay tuned for an announcement about a project specifically designed to use your pack. 8-}

I reuploaded the image, strange that it broke.

I couldn’t be happier knowing people are using my stuff! Looking forward to your announcement. ^^

Edit: A note to people that are working with the UE 4.7 preview. Due to changes to how blueprint interfaces work the current Marketplace version is incompatible with 4.7. I will address this with next update.

Hi everyone, I have just submitted the first update to Epic. Once they are done processing it, it should appear on Marketplace and you should get a notification in your launcher that an update is available. I will summarize the changes as well as reintegrating steps if you’re already actively using the plugin in your project.

New features:

  • Support for hex grids. Line of sight check is not implemented yet for hex. All other features are implemented including path and attack range computation, tile searching, target storage, grid merging.
  • Grid composition. You can now compose grids from multiple smaller rectangular grids. This enables you to represent irregular shaped grids (dungeons with long hallways, large unused spaces, etc) efficiently.
  • Targeting by allegiance. Units now have an allegiance towards each other, either neutral, friendly or hostile. Single tile queries are updated to return allegiance when applicable: when retrieving from an ActionGrid the occupant of a tile, his allegiance to the acting unit is returned as well. When retrieving a list of all targets within the attack range of a tile, a list can be retrieved based on allegiance, for example GetTargetableEnemies(X, Y). When searching, conditions for tile occupants and target list can be specified by allegiance.

Changes/bug fixes:

  • All customization functions are moved from LevelGrid to IGridActor interface. This means that all unit-terrain and unit-unit interaction is now defined by IGridActor. Your implementation of the customizing functions dicitates the behavior. Please refer to the User Guide - Section 3 on how to implement the IGridActor functions.
  • Due to a change to blueprint interfaces in 4.7 the previous version of the plugin would give compile errors. This has now been solved, the plugin has been tested and works with 4.7 Preview 8.

Last but not least, the user guide is now complete! Its targeted at the newest version of the plugin. You can download it from: http://www.zkshao.com/downloads/TBStrategyGrids_UserGuide.pdf

How is performance with hexagons? Is it suitable for a mobile game? How hard is it to get rid of the hexgrid outlines?

When working with numbers that I’m used to seeing in square grid TBS games, like computing 6 movement steps combined 1 or 2 attack range, computing a hexaon grid this size shows a slight noticeable delay. If high movement capacity per turn is your standard then I would advise to display movement attack separately. If you do that, you won’t ever have to worry about performance. Otherwise, you can work with ‘normal’ movement costs for TBS games, around 5 or just live with the delay.

I plan to smoothen the experience out by spreading the computation of action grids across frames. After all, there is no need to force all computations into one frame.

Edit:
Its hard to express performance in numbers due to so many factors being involved, but please check out the video below where I compute 6 movement steps and 1 attack range. Halfway I turn off computing attacks so you should notice the difference.

https://youtube.com/watch?v=EtCtm0Vjx1M

Thanks, but I think I asked the wrong question. I’ve got my own pathfinding, etc. written in C++, I was thinking about using your library as a front-end to save me some time instead of creating my own.

I’m concerned about the drawing speed. On a PC, I’d like to be able to display a 80x50 grid with textures. Actually, I’ll probably need to implement a virtual grid and do some of my own scrolling for larger maps, up to about 200x200 or larger.

On a mobile device, I could probably get by with about 30x30 onscreen or possibly less.

On another thread on this forum I saw someone complaining about the performance he was seeing while drawing hexagons. Since each hexagon has only 4 triangles, performance shouldn’t be an issue, but I don’t know how you wrote the library or how unreal engine combines the triangles.

I’ve done a prototype in OpenGL and it flies but would be hard to convert as it is, and senseless if I can buy something instead ;).

Thanks,
Ralph

I picked this up today, and it really doesn’t compile. Is this up to date for 4.7?

Edit: Looks like a lot of ‘cast’ nodes need to be replaced with ‘isvalid’ checks, I think?

Edit #2: Nope, cannot check if valid, since it’s an interface. Cannot cast it to a valid type and check if it’s valid either. Not quite sure what to do with this D:

Hey ambershee,

I’ve addressed this issue in the first update, I have sent it to Epic a week ago for them to update the version on Marketplace but they haven’t processed it yet. Check your PM, I’ll be sending you a copy to a fixed version. :slight_smile:

Edit: For anyone else using 4.7, there are issues with the current version on Marketplace. PM me and I’ll send you a fixed copy. Please include a screenshot of the errors you’re getting in 4.7. The fixed version (which is also update 1) should be available on the Marketplace very soon.

The display of the hexagons is done using instanced static mesh components (ISMs). The LevelGrid creates an ISM for every terrain type during its construction script- where the mesh of each ISM is a hexagon plane (no sides/3D) and the material is the simplest color material where the color is selected from terrain type. I don’t think there is any more performance to be gained other than advanced manual culling mechanisms.

You mentioned wanting to get rid of the outlines before- the scale of the tiles is what causes the hex outlines, I scale my tiles by 0.9 to create the outlines but you can have them align perfectly if you leave the scale at 1. You can modify the scales used in the LevelGrid ‘RefreshTerrainPreview’ function.

My LevelGrid blueprint should be perfect for displaying tiles as simple colored tiles, and managing unit positions if you want that. I understand the preference to do path finding in C++ perfectly. :stuck_out_tongue:

Hey everyone, I just wanted to mention quickly that the promised update still hasn’t been processed due to most of Epic staff being occupied by GDC. Here’s a reminder for anyone who is itching to get the new version for its compatibility with 4.7: just send me a screenshot of the errors you are getting with the current Marketplace version and I’ll send you the latest version so you won’t have to wait for the Marketplace version to update. :slight_smile:

Hi all! Content Curator here. We’ve had a couple issues propagating changes to the backend for content updates recently, and we’re working on fixing this pack right now. This issue is solely our responsibility. I’ll post back here when I confirm with that it’s been updated and is working as intended. I apologize for the inconvenience.

Thanks for the update. The first update is now available on the Marketplace everyone. :slight_smile: The Marketplace description has also been updated to link to the user guide, though here it is once again: http://www.zkshao.com/downloads/TBStrategyGrids_UserGuide.pdf

I would love to get some feedback on whether the user guide is clear and what you think of the plugin in general. Ideas, suggestions and complaints are all welcome, let me know!