@J.J. Franzen: It’s great to hear that you got it running on iphone! I had hoped I had made it efficient enough that it would work, and it’s great to hear that it does. I’m still working on some major optimizations for weaker hardware before I officially declare mobile support, though.
There aren’t really a game mode or controllers per say, but almost everything is handled through the event graph of the BP_Grid_Manager, except for camera control in BP_Grid_Camera and some minor construction script functions in the unit and tile parent classes.
I’ve managed to replicate the error you made a screenshot of. It annoys me that I didn’t discover it myself. This happens for every odd tile on the western side of hex maps, and is a result of the pathfinding stopping when it has reached the edge of the grid, while the even rows should really continue the search one step more to the north west and south west. I have just implemented a new way of checking if the pathfinding has reached an edge, by marking all the edges as unwalkable in the edge array. This will get rid of this bug, and also make pathfinding slightly faster still. I’ll get the update sent to epic as soon as I’m able. Thank you for making me aware of this issue.
As for the people who have been asking me for help in importing their own meshes, I’m afraid I won’t be able to make a video about it tonight, but I’ll give a quick rundown below:
Adding your own tiles:
- Import your own mesh as normal
- Make sure it has collision if it is not a default grid mesh that shall only be used on the level of the collision plane
- Create a child of the Tile_Parent blueprint or duplicate the tile closest to what you’re trying to make for less work.
- Add your new mesh in the components of the tile. If it is a walkable tile, make sure “path trace” is set to “block” under collision. If the mesh should block visibility set “range trace” to “block”.
- Parent the imported mesh to “CustomGridAnchor” to enable the possibility of custom grid snapping.
- If you want to predictably block visibility in a similar way to the default walls you can add the static mesh SM_Wall as a component, set its collision to block “range trace” and make it invisible. Increase its size to 1.0001 to block sight past corners or 0.9999 to allow it. If you instead use the collision of your own mesh it will block visibility as determined by that specific collision
- In the “Edge cost” local variable set the movement costs of entering various edges (north west means entering from the north west. Hex tiles do not make use of the east and west edges). 0 means the edge is impassable. 2 means movement to that tile costs 2 points of movement.
- Edit: If the mesh will be instanced (if it is the default grid mesh, one of the “move to” or “in sight” meshes or has “instantiate” set to true) make sure the material it is using has “Used with Instanced Static Meshes” set to true in its material properties.
Adding your own pawns with the default UE4 skeleton:
- Import your skeletal mesh. In import settings select HeroTPP_Skeleton as the skeleton.
- If you want to use the default toolkit animation skip to the next part. If not, read on.
— Create a child of the Pawn_Anim_BP_Parent animation blueprint in animations.
— Import any custom animations you want to use
— for custom attack animations make sure to copy the PunchEnd animnotify from either the Attack_Ranged or Attack_Melee animations and place it at the point of your animation where the attack connects.
— for custom idle/walk/running create a copy of blend_space_melee in animations and replace with your own animations in your animation blueprint.
— for custom death animations you don’t have to do anything special
— in the graph tab of your new child animation blueprint select “Asset Override Editor” (under the preview) and replace the idle_walk_run, punch and death animations with yor own
- Make a copy of any of the units under blueprints -> pawns. In the components replace the skeletal mesh with your own. Select your own custom animation blueprint as the anim_BP if you made one. If not use either Pawn_Anim_BP_Melee or Pawn_Anim_BP_Ranged.
- Set up health, movement, range etc. in the local variables of the graph
- You should be good to go!
I hope that’s enough to help anyone who might be having trouble using their own meshes. I’ll be making a video about this as soon as I have the time. By the way, for adding structures larger than a tile you do not have to split them up. Just drag the mesh into the world and place invisible walls where appropriate (located in blueprints->tiles->hex or square).