Road To A Full RTS Game

can you show us how to make it a FPS/RTS hybrid games like Fable Legends or ZombiU ?
like 4 players play co-op in FPS mode and 1 player play in RTS mode

Do you have any videos on how to do the movement in your welcome to video? It seems more sophisticated than whats in the tutorial but they are pretty long so I could have missed something. One thing I would really like to know is how you determine your locations in your grid. I am doing division and modulus to get a row/column based on the index of the a selected unit in an array but if a point that is calculated for any given entity happens to be off the navmesh they don’t nav at all. I was wondering how you solved that (if you did) since it seems like the formation in your welcome to video is really nice.

I also have the units poke holes in the navmesh when they are not moving so that other units can more easily path around stationary units but I am not sure how thats gonna work out in the long run.

This is really basic and I plan to add quadrants like you have to position them around the point I pick a little better but figured I’d share the basic idea. If you have any advice on this what would be great.



newLocation.X = Location.X + (FGenericPlatformMath::FloorToInt(idx / rows) * 200);
newLocation.Y = Location.Y + ((idx % rows) * 200);

I ended up looking at how MoveTo was implemented and used “ProjectPointToNavigation” with a my own extent since the extent it uses is based on Agent height/radius.

https://docs.unrealengine.com/latest/INT/BlueprintAPI/AI/Navigation/ProjectPointtoNavigation/index.html

It’s actually the same as the Welcome Video so actually not that sophisticated lol. I don’t poke hole because i don’t know how beside using crowd control AI so would love it if you show me how and i havent tested what happen if there are things in the formation way yet.

if you watch my lobby video you’ll see that i set the default pawn to spawn so instead of setting the default pawn to the RTS Commander, select the default pawn to an FPS Character.

I am not sure if poking a hole or even changing the nav area around units is a good idea at all yet but here’s how I did it. I went to File > Project Settings > Navigation Mesh > Set runtime generation to “Dynamic Modifiers Only”. Then, in the actor class you want to be able to modify the navmesh set “CanEverAffectNavigation” to true, set “DynamicObstacle” to true and “AreaClass” to “NavArea_Null” (or whatever NavArea you want). Once you do these steps it should update the navigation mesh.

I have my characters set the “CanEverAffectNavigation” to true only when they are not moving.

BaseCharacter.cpp



ARTS_BaseUnitCharacter::ARTS_BaseUnitCharacter()
{
  GetCapsuleComponent()->AreaClass = UNavArea_Null::StaticClass();
  GetCapsuleComponent()->SetCanEverAffectNavigation(true);
  GetCapsuleComponent()->bDynamicObstacle = true;
}


oh ok i tried that before but didn’t work i guess i was missing the dynamic modifier only.

Well if they are allowed to affect the navmesh while they are in motion they usually get stuck and don’t move very far.

Currently redoing formation to give it more flexibility - YouTube

Awesome, looks very cool. Are you going to share the demo project for this? It would be fun to analyze it and see how you did it.

because it’s complicated i’m not gonna share the project but i’ll make a video on how to do it.

Some side stuff
Line trace arc: Unreal Engine 4 Line Trace Arc - YouTube
Spline movement: Unreal Engine 4 AI Moving Along Spline - YouTube

A little preview on something i quickly made for fun.
Custom Formation - YouTube

That’s pretty cool.

Is there a part 7 coming to the RTS tutorial series or is it finished?

I’m still working on it but it’ll be about formation containing line, square, and custom.

how to update my project to 4.10 Unreal Engine 4 RTS Series Part 7 4.10 Update - YouTube

Awesome tutorial series. Any eta for the formation and fog of war videos?

line formation is up Unreal Engine 4 RTS Series Part 8.0 Line Formation - YouTube the other two will follow after.

Awesome. Do you have an updated example project you’d be willing to share?

If you do fog of war, I recommend taking a look at the link below. I used it for my game and it works really well.

  • Edit -
    Sorry forgot I had already asked you for the example project. Only thought I had meant to ask.

Cover system progress - YouTube hopefully it’ll resemble that of gears of war ue when it’s done.