[SUPPORT] Advanced Turn Based Tile Toolkit

Is whether or not a tile is deployable something you want to be able to change after the game has started? If so I see why you might want to keep a reference, but even then it is not really necessary, as you can add or remove tile indexes from the set at any time. When using the GetHitIndexAndLocation function you can just get the index and check whether the deployable tiles set contains this value. If it does, then you know that you can deploy there. But maybe I do not fully understand how you intend this to work in-game and there is something I’m not seeing.

You are correct. However, having the data of deployable or not in the tile itself is good practice, right? What you argued in the last post is simply using set vs using map, just so I understand you correctly?

Another question now that I’ve come this far:
The multiplayer works with connection and traveling very nicely, but the client does not have control over any units. Is there something I’m doing wrong or is that not yet setup in the toolkit? If so, do you gave some plan on where to set that up most logically?
For my project each player will control only one unit (with some exceptions) but I would like for them to all be the same faction.

Cheers man, the further I get into this toolkit the more I like it :smiley:

Edit:
Yet another question related to the deployability of the tiles. I would like to add a new static mesh on the tiles that are deployable in the deployment phase. I’ve tried duplicating your M_Blue_Transparent, SM_Marker_Move and SM_Marker_Move_Hex and did a M_Green_Transparent, SM_Marker_Deployable and SM_Marker_Deployable_Hex.
Now, I’m having a hard time figuring out where and how you are applying your static meshes to the tiles. What I’ve done so far (all in the GridManager) is:

  • Function Add Mesh Components

  • Function Select Default Meshes

  • Function Setup Grid Hex Tiles (personally created function)

SetupGridHexTiles.png

  • Function Find Deployable Hex Tiles (personally created function)

FindDeployableHexTiles.png

Now, I’m assuming I’m implementing this ConvertIndexesToLocations and SpawnTileMarkerAtLocation wrong. I found your function called FindTilesInRange and tried to implement in a similar way. Can’t really figure out what I’m doing wrong, maybe there is ā€œa pieceā€ missing?

Hello there again,

I figured out how to check if the unit passes the tile, the damage part works but activates when the unit reaches the clicked target index instead of on the trap index. I tried breaking the loop on simulate movement but it just keeps running. Where do i need to put the branch? Isnt is possible when the player click on a target location and the trap in the pathway to change the target location to the trap location and simulate movement again?

Thanks for the fast reaction and sorry for the newbie question

All depends on how you’re going to use it. If which tiles that are deployable are never changed during gameplay then you are using slighly less memory for storing the information and less time to access it if using a set, so that can be seen as best practice if you look at it that way. In this case the impact should be completely negligable, though, so do whatever makes senst to you.

There is a controlling player variable in the config variables of BP_Unit. Set this to the same value for all units that should be controlled by a single player.

Good to hear! I put a lot of thought into structure when I refactored the toolkit and hope it all makes sense.

Hmm, I honestly don’t see what is going wrong here. Try debugging it. Use print nodes at various points throughout your new functions to print the values generated along the way and try to see where it breaks. For instance, loop through and print the locations you are getting and check if they correspond to the locations of your deployment tiles.

Hey, you’re solution sounds like a pretty good one actually, and probably more elegant than my own in this case. So you need to remember that you need to do things twice, in a sense. Once when simulated and once when animating. If you are breaking movement whensimulating (which is what you are doing with my suggestion), but still outputting all the same locations when animating movement it will seem like the units is still moving all the way, even though grid-wise it has stopped at the trap tile.This leaves you in a situation that whay the player sees and what the computer has to work with is different, which you obviously don’t want.

One way to implement your suggestions would be to add output nodes to the SimulateMove function. A boolean designating whether movement stopped early and an integer with the path index where the movement stopped. Now you can create a new path array where you include only the indexes up to and including the path index where movement broke. Convert these to locations in the same way that it is done regularly with the path indexes array and use this for input to animate movement if you bMovementBroke (or whatever) boolean is true.

Hey man, thanks for the help. I got it working finally with the new static meshes for the deployable tiles. I’m not sure actually what was the problem, I think it was partly me calling the meshes before GridManager had activated AND me finding that slot name for the material in the Static Meshes for the markers. Anyways, seems to work nicely now so I will not tinker anymore.
Do you want the information on how I’m handling the ServerTravel and OnPostLogin-issues created by ServerTravel btw or is it redundant?

Take care man, make sure to rest aswell between aswering my noob questions and work :slight_smile:

Glad it is working, as I did not see anything wrong with the graphs themselves, so that the ordering was wrong makes sense.

I’d love to see how you’re handling OnPostLogin and ServerTravel. I have not had the time to look at that myself yet, so seeing a working implementations should save me a lot of time.

@ I don’t have a background in coding so I’m curious where I should start learning. I was reading online that either VisualC# or C++ would be helpful but in your opinion what programming language should I focus on learning to get the most out of your toolkit? I would love to be able to expand upon what you have already in the toolkit but I find myself lost trying to figure out where and how a lot of things are called for in the blueprints. I’ve noticed that your blueprints are very organized so it’s probably just a matter of me not really knowing much about programming. I’ve also tried to learn what I can from your support thread here but I understand a lot of the earlier pages may not be as applicable anymore with the changes from the recent updates. I’m honestly up for any advice you can give to a complete novice trying to make a solo project.

Edit : I should probably note that I’m slowly working my way through all of the Unreal Library Blueprint tutorials on youtube so that might help me a bit.

@OperatorCrux: If you want to develop games in Unreal Engine I would certainly recommend you choose to learn C++ over C#, since that is the language UE4 uses. The main reason you would want to learn C# for game development is is you want to use Unity, since it uses C# as its scripting language (even though the engine is built in C++). Know that UE4 uses a version of C++ that uses a lot of custom macros and so is a bit different to work with than regular C++. However if you are proficient in blueprints you will find a lot of these quirks particular.

Know that you do not need to know C++ to develop games in UE4, though. This toolkit is developed entirely using blueprints, for instance. I personally didn’t begin to learn C++ until long after I released this toolkit. What stuff should be coded in C++ and what is better done in blueprints is a contested issue you can see discussed frequently on these forums and other places, but you can be confident that almost anything you would do in C++ for game development can also be done in blueprints, though one approach is sometimes more practical than the other.

For Unreal Engine I would recommend first becoming proficient with blueprints, then do some basic tutorials on C++ and then learn UE4’s particular implementation while working on a project. Personally I first did some introductory programming tutorials before learning blueprints just to understand some basic programming concepts. For this the language does not really matter that much, as the introductory courses for all languages will go through stuff like variable types, if-statements, loops etc. that are common to all languages (and blueprint scripting is a scripting language). I did the Python tutorial on Codecademy before learning blueprints and felt it helped me a lot, but any similar tutorial for any scripting language should do. After that going through Epic’s official blueprint tutorials is what I would do next. After that you could try to make a simple game in blueprints. When you feel proficient enough in blueprint scripting you could consider learning C++. Ben Tristem has a great tutorial series on C++ in Unreal Engine on Udemy which I learned a lot from. Note that this is costs money and if you want to buy it make sure to do it when it is on sale. Udemy tutorials should as a rule never be bought for full price, but only when they are discounted by like 90% (which they do all the time). It is a bit of a scummy business practice, but I guess it sells more tutorials.

Anyways, if UE4 is your engine of choice I would begin mastering blueprints even if you want to use C++ somewhere down the line because of all the custom macro stuff that will make a lot more sense if you know blueprints. Others might give you different recommendations but those are my five cents.

@ Thank you so much for the recommendations. I checked Udemy and they’re actually having one of those sales right now for Mother’s Day where it’s $10. I went ahead and picked it up for future use. I’m gonna start on Python with Codecademy and move on to learning blueprints from there. Cheers.

@OperatorCrux I would second what said in every way. That is an awsome answer. I am myself in excactly your shoes, I started watching some Java-tutorials before I knew about UE4 but it still helped a ton with the basic programming concepts. Also, two things I would add.

  1. Give it time. It will sink in eventually, even though you have no idea what is what at the beginning. I’m just now starting to understand this toolkit somewhat but sometimes it’s hard not to get frustrated because of something not working and you can’t understand why. Which leads me to…
  2. Stick with it. Eventually you will find the answer. Walk away when you feel it get’s too boring, come back later. I was just now when starting working on this toolkit banging my head for like 1 month at one problem, which turned out to be an engine bug. Was super boring just debugging and debugging but I realize now when it’s done that it gave me a lot of understanding, deeper understanding than when everything works on your first try :slight_smile:

Also, take my advice with a grain of salt as I’m still just a n00b :smiley:

To everyone: ATBTT version 1.82 has been sent to Epic and should hopefully be live soon. It includes several bug fixes as well as the re-adding of the 2D example. The 2D example has been remade from scratch using many of the new systems introduced in 1.8, including the action system and the GridObjects array. Check it out if you need inspiration for ways to have interactable objects and tiles as well as fog-of-war ++ Big unit support has also been improved, though is still experimental.

Ok, sounds good. As mentioned the tutorials there are on sale more than half the time, so it is really just a sly marketing trick to increase their percieved value. Thankfully the actual practical value is still much higher than what you pay for the tutorial on sale.

Some good input for motivation, Mivke. If any of you are interestred I did a write-up on my experience of developing and releasing this toolkit soon after it was done. At that point I had used UE4 for a bit less than a year, so closer to where you guys are now.

This is great, Thanks!

Any tips on the best way to update an existing project to 1.82?

btw, i get a message ā€œwaiting for other playersā€ and cant move any units when i play the example map. This is on a fresh create project after updating to 1.82.

@elec2ron: Darn, that’s what I get for doing last minute multiplayer testing before sending the update out. I forgot to reset the DefaultControllingPlayer variable value to 0 for one of the player units in the example map. I’ll do this minor fix and send out a new one tonight.

For converting, the safest way is usually to migrate and copy over your own additions to a fresh ATBTT project. I have tried to mark all changes with a boolean named 1.82, which you can search for though the find window, but I’m likely to have skipped marking some very minor changes. I’m afraid there is no simple way to automatically update a project.

Got it updated without too much hassle, have a better setup now so i can deal with future updates better.

Thanks again for the updates and all the support you provide.

Ok, I fixed the minor bug. Epic should soon upload a new version. No reason to wait for this if you have already downloaded the version I uploaded yesterday. Just set DefaultOwningPlayer for all units in the example map to 0 if you want this to work in single player.

v1.82 (15.05.18)

  • Re-added refactored version of the 2D example map ā€œHydra’s Lairā€
  • Added object system for interacting with custom objects on tiles (see weapons in Hydra’s Lair for an example)
  • Various minor changes and bug fixes (see Trello for details).

Awsome job man!

Now I’m back here with another question of course :smiley: In my project I will partly have the deployment phase prior to the activation of units (which works nicely now, as far as I have come with it). But I will also have one more phase that will be repeatable every round prior to the activation of units (a phase where you choose which abilities you’d like to use). After this the units will be ordered on initiative and take their respective turns. Do you have already some kind of round counter and some kind of Unit_Has_Acted_This_Round boolean? If not, do you have some idea on how and where to implement that? That will of course be the deciding factor if we should proceed to End Turn at once or if the Unit should activate.
I’m thinking a check inside of BeginUnitTurn in BP_TurnManager but where is a tougher choice :slight_smile:

Yep, these things already exist. It is the Exhausted variable in BP_Unit and the CurrentTurn variable in BP_TurnManager. Check out the SetNextTurnIfUnitExhausted function in BP_TurnManager to see how and where it is implemented.

Hey I was wondering how I could change it so that the spline path from the unit is visible at all times when selecting it to move and the cursor is always present. Currently the spline path for me only appears when holding right click, but I want to use right click for UI navigation as a ā€œBack buttonā€, and I think it’d be weird to have it have those two unrelated functions. I am currently using the advanced units and grid manager.

When I look at the default map and how it used to be, it seems like it didn’t use to happen. I must have changed something that ruined it, do you know what blueprint I have to edit to change it back?

Hey , very appreciative for all the hard work you put into these updates and bug fixes. 1.8+ is vastly more efficient, readable and adaptable. Burning the hours up on development now after a bit of a time-consuming upgrade.

Cool! I checked that function out and if I understand correctly when a Unit Pending Activation is exhausted then you loop through all the other units and set them to not exhausted and when that is done you set CurrentTurn to the one after the exhausted unit? I tried unplugging the loop in that function and go straight from Exhausted True to CurrentTurn ++ to see if eventually all Units would be exhausted and no turn would activate but that didn’t happen :slight_smile: Will test further when I can, for me what I would want to make is list of exhausted (or un-exhausted) Units. When that list is full (or empty :D) Start New Round would fire instead of Begin Unit Turn.

Cheers man, gotta run to work now! :slight_smile: