When looping through the city blueprint get the faction variable of each city. Do not add a city as a possible target if its faction variable matches the faction of the current unit (from ATBTT_game_mode)
Edit: Looking into you problem, . Just don’t have an answer yet.
Ok, , I’ve checked out the issues with changing edge costs at runtime. The Make Tile Passable function really only works properly for single tiles and not large areas of impassable tiles, as edges are not added to surrounding tiles that are themselves impassable. Below is how you can add edges manually. I’m also changing the height of the vector field array to 0. This only works well if your game is uniformly flat. If not you should use a line trace to find the new height, similar to how I do in the Add Viewport Terrain to Arrays function. I’m doing this stuff in the event graph of BP_GridManager, but you can of course do it anywhere by getting a reference to the grid manager.
Still looking into the heightmap stuff. I’ll get back to you when I’ve figured it out.
Edit: Seems like the spawning unit on heightmap is a twofold problem. The first is simply that the grid manager of the heightmap example map is not placed at 0,0,0 and the Spawn Unit function is not correcting for this. This can easily be fixed by adding the location of the grid manager from the spawn location. A second problem seems to be that the construction script of Unit_Parent is run through when a unit is spawned, causing it to search for the ground beneath it twice and being placed below the ground. This might not be a problem in your game if there is nothing blocking pathtrace below ground level. Try out Spawn Unit in a different level than the heightmap one and you should not have any problems. I will look into it and find a fix as soon as I’m able, however.
Hey thanks for the speedy reply, however I clicked your link and got this
“Invalid Attachment specified. If you followed a valid link, please notify the administrator”
Hey!
I tried that out, initially it half worked because some tiles were still blocked.
But i think that was because it was the size of the cube, I increased the range and it cleared right up. what would happen if an enemy unit was caught in this function? Would it be unaffected or would you be able to walk onto its tile?
Really helpful function because now I can remove/move things around in-game.
Thanks!
Due to the odd shape of some of the actors I was trying to remove, I had to scale up the range of the “Get Indexes in Range” to make sure they were all gone
It didnt affect units but if walls or other tile items were caught in the crossfire their cost was set to 1 and so I could walk onto them.
So instead I decided to add two arrays into my tile base (VectorIndex and IntegerIndex)
During the “Add Viewport Terrain to Arrays” linetrace I cast to the hit actor to see if it was the tile_base if so add the vector and index value to appropriate arrays.
When It came to removing the base I didnt bother getting indexes in range, Instead I looped through the integer array of the base, using the element value (indexes of the base) and changing the cost to 1 before the actor was deleted.
Its probably not that efficient so if you have any suggestions or feedback id appreciate it, but atleast this way It alters the indexes in question only and not any others surrounding the tile.
Edit: Thinking about it, I just needed the IntegerIndex array
Good to hear that it worked! As you found out it will not affect walkability when it comes to moving into tiles occupied by other pawns. All it modifies are the edge costs between tiles, and pathfinding does a check independent of edge costs for pawns blocking tiles. But as you also noticed, any and all tiles in the affected area will become connected to all surrounding tiles, meaning that units might be able to walk inside walls and such which are caught in the collateral. The way you have solved it seems smart and sensible. As a rule of thumb it is a good idea to do as many calculations you are able to before the game starts. Your solution sounds like it should be pretty efficient, and looping through small arrays contained in the bases during gameplay should not be a problem at all.
I’ve sent a new update to Epic updating the toolkit to UE4.13. This is not the big feature update I’m working on, but does introduce several minor fixes. The biggest change by far is that ATBTT now supports blueprint nativization. If enabled when packaging this causes massive improvements in the performance of some blueprint. I’m talking 50 times(!) quicker in some cases. Hope you guys like the changes!
From the changelog in the second post of this thread:
v1.61 (being processed by Epic)
UE4.13 support.
Now supports blueprint nativization causing massive performance improvements when packaging.
Custom Pathfinding types were not working in AI controller. This has been fixed.
Spawn Unit and Move Unit on Grid functions now take into account the location of the grid manager if it is not at 0,0,0.
The blueprint name for the sea-monster head in the 2D game example was too long and caused issues when packaging. Name has been shortened.
Pathfinding per tick caused issues for child actors based on BP_GridManager. AI controller has been altered to not use the per tick function by default. Using it should still not cause any issues if using the BP_GridManager parent blueprint.
Walls in the heightmap example were not turning translucent on mouse over as intended. This has been fixed.
Free roam mode now takes into account custom pathfinding.
Red “tiles in range” markers no longer appear under the current unit.
Changed the function for determining if the game is over once only one faction remains. This still causes problems after nativization (see known issues above) and is thus disabled by default at the moment, though can be activated by setting nativization to false in BP_GridManager.
All tiles now cast shadows as if static by default, improving performance.
I recently purchased your ATBTT. It’s very well put together. I am primarily interested in utilizing it for V.R. Specifically, I’d like to use it to set up A.I. within a level that could contain several A.I. characters in which the VR-player could interact when they came in proximity of various A.I. characters.
Is there currently a way to set the GameMode/Camera so I can ‘wander around’ the ATBTT level I create with ATBTT A.I. while in VR (Vive)?
If I’m able to use the system in VR and I come within a certain proximity of an ATBTT A.I. can the A.I. be made to ‘detect me’ and perform some specific action or animation based on my proximity to them or an action I perform?
not by default yet, have a look into the documentation of vr-pawns, you will need to build it by yourself as of yet
have a look at the dungeon crawler example
so here are my own questions: given you have a working vr-environement, how would i manage to get proper dynamic shadows? atm i have a 1/100 vr unit scale, would changing those relations improve my quality (changing scaling of VR instead resizing all the assets to be smaller?) how did you achieve the small game in your roomscale demo (having the grid controller in chessboard size)?
Hello clutch, hope you’re enjoying the toolkit. The update I’m working on at the moment will include VR support, but it still far from finished.
For your camera question I would simply use a different camera than the default one. Here is the documentation page that describes how to setup a VR pawn (as B1337 suggested). For interaction with the grid you could then fire line traces from the motion controllers (using the PathTrace trace channel), get the hit location and feed that into the mouse click logic in ATBTT_PlayerController. That’s what I’m doing and it works pretty great.
For your second question I think you mean if you can get pawns to animate if the VR headset is close to them, am I correct? Something like if you look close at a pawn it would turn to you and wave (I had something like this planned for a game before). There are multiple ways to do this, but the easiest is probably to have a collision sphere around your VR headset mesh, have the units and the collision sphere overlap the same collision channels and using overlap events. Hope that helps!
I’m really not an expert when it comes to the rendering part of Unreal Engine. I haven’t experienced issues similar to the ones you are mentioning, but maybe I simply wasn’t paying attention to the shadows. I’ve been using two methods. One was scaling the units and grid, the other was changing the VR world scale. The chessboard demo, if you’re thinking of my old video, is simply a grid using tile meshes that are 1/100 of normal scale as the default grid mesh (this will automatically scale down the grid), and resizing the skeletal meshes of the units the same amount.
Greetings,
This looks like a wonderful toolkit. I have a few questions before I can understand whether or not this is what I need to get my project / idea running. I intend to use a turn based combat system that relies on cover or environmental factors like X-Com or uses action points and perhaps and underlying hexagon grid movement system like Divinity: Original Sin. Like the latter, I also intend to add an ability system with cooldowns that will have effects on either self or others (players, allies, or enemies). I don’t know the engine well but it seems like a good platform to learn and use. I predict the answer will be that I will be able to implement these things to the systems within the toolkit, then add my own artwork to make it a unique game. The reason I still ask is that I am not very familiar with the engine, but so far it seems easier to learn and use compared to a lot of other engines. I just want some confirmation and perhaps some guidance as to where I should start. I am not in a rush and I think its healthier to sort the combat system before moving on to anything else (and so I can have something to pitch when looking for people to work with me). The system will also make use of character stats that will affect movement, range, weapon and ability damage much like any standart tactical combat game with rpg elements, along with loot drops (weapons, armor, and new abilities etc.)
Thank you in advance to those who find time to give direction to a newbie like me, and good luck to you all in whatever projects you are working on.
glad you like how the toolkit looks. I’ll try to answer your questions to the best of my ability. XCOM was one of my main inspirations for the toolkit, and is a kind of TBS game the toolkit is especially well suited for. I am working on a cover system at the moment, and I can share my solution with you if you’re intested. It will be in the next update. Abilities with cooldowns is certainly possible to add. I’m working on an ability system as well at the moment.
You will need to be quite comfortable with both Unreal Engine and my toolkit befor you begin to make major modifications, however, so it is good that you are not in a rush. All of what you are describing is certainly doable, but will take work. I’ll be happy to assist you along the way through this support thread.
Hey ! Great kit, was just about to comment asking about the Raycast stuff but I saw the solution in another post. Copying over the engine ini worked for me too. Cheers!
Glad you like the toolkit, Jiyko! Good job finding the solution buried in this thread. There are quite a few pages to search through at this point. Let me know if you have any other problems
Good job finding the solution buried in this thread. There are quite a few pages to search through at this point.
[/QUOTE]
This post is both great and annoying at the same time! It is great that you are continuing support of this toolkit and the forum post is a testament to the dedication and hard work you’ve put into this product/service (where does this sort of IP come down I’m not sure! haha). You’re a great creator and I want to take the chance to thank you! However trying to find a specific reply can be difficult and frustrating for users and I was trying to think of a way to make finding solutions that have already been answered easier.
Now that I’ve thought about it a search thread feature is actually available built into the forum at the** top of the page below the thread page** navigator thingy where you can choose the page you want to go to (for anyone looking)
However, I was also going to suggest a FAQ on the op for anyone to use. This could use hyperlinks to send people to the relevant post and all posts about the given subject. What do you think?
I realise its a bit of work to go through but may save you time, pointing people in the right direction. I’m sure some appreciative customers would be more than happy to help with the skim through especially if it’ll save you and others time in the future?
Also I was wondering if you missed or are maybe working on replying to a previous post I made #970 on page 25]([SUPPORT] Advanced Turn Based Tile Toolkit - Marketplace - Epic Developer Community Forums) I realise I asked alot so I apologise, I just wondered whats happening. I realise there’s a lot to answer from other people too so I do not wish to seem impatient and I can understand it may take a while.
Finally congratulations on the marriage and all the best!
Hello , first I’m very sorry that I ignored your last post. That was not intentional and I do not know how I missed it. I will try to answer all your questions now.
I agree that a FAQ would be a good idea and one that I have considered. One of the reasons I’ve been putting it off is that there are surprisingly few repeat answers that are obvious candidates for a FAQ, but there are certainly some I could include. As for going through the thread and providing links to all answers, that is also something to consider, but it would be quite time consuming and at present I prefer to spend the little spare time I have working on the next feature update. I will consider adding something like that after the update is done. Now to your old questions:
I am already doing this in the 2D game example. Take a look at my latest tutorial video. For a 3D game you could use dark instanced static meshes, decals painting everything gray or possibly some sort of post processing effect instead of the instanced square tiles I use in my example.
It all depends on what you are after. If you want doors that automatically open or close as you move through them this can easily be done by adding collision to your units and doors, have them overlap the same channel and have an overlap event on the door that swings it open when overlapping a unit. If you want the door to influence pathfinding you would need to modify the edge array by adding and removing edges between the tiles at each side of the door as appropriate. Use the add and remove edge functions in BP_Grid_Manager.
There are a couple of ways to do this. The simplest is probably to add collision to an invisible collision box at the base of the grid camera and have a frame around the grid blocking the same channel as the box. Make sure the collision box is not also blocked by any tiles or actors in your level.
It is absolutely possible, but how difficult it is to implement varies greatly depending on what you want to do. This is too general of a question for me to give a specific answer, though. Be aware that it is usually much easier to add new abilities to player units than it is to get the AI to use them appropriately. For healing you would basically do the same thing as I was do in the Attack Victim and Receive Damage events in Unit_Parent, but adding instead of subtraction health.
For winning when picking up an item you could for example add collision to your target and your units as described above and when a unit overlaps the objective you could end the game and display a victory message similarly to how I do in the event connected to the Destroy Unit event in the event graph of Unit_Parent.
For storing what units are in your team between levels I would probably store it in an array in the game state, though this is not something I’ve tried out myself. If you search the forums for anything where information is retained between maps you should probably find a solution that should also work well with the toolkit.
I hope the answers I could give were helpful. I apologize again for missing your questions the last time. Let me know if there is anything else you are wondering about.
Hello erWilly, for each unit you can choose whether or not it is AI controlled, what its faction is and what it considers its enemy factions. Therefore you are free to create any number of factions where some, all or no units are AI controlled. Thus player versus AI, AI versus AI, hotseat PVP or anything in between is possible. Networked multiplayer is not currently a feature.