Open-Source Real-Time Strategy Plugin for Unreal Engine 4 developed by the original creators of Hostile Worlds for Unreal Engine 3.
We really love the spirit of Unreal 4 moving to open-source, and we'd love to give something back.
Note that we're still in heavy development. Some things are already in place, such as
- Camera Movement & Bounds
- Initial Unit Placement
- Single Unit Selection
- Movement Orders
- Stop Orders
- Attack Orders
- Health, Damage (and Healing), Cooldown, Range
- Victory Conditions
All of this is already completely working in multiplayer as well, and has been fully exposed to scripting, enabling you to update UI and play animations and sounds.
We're now moving on to more advanced stuff, such as units automatically returning fire using an acquisition radius, minimap or fog of war.
Also, we're going to add it to the Unreal Marketplace for free soon (tm).
- Create a player controller deriving from RTSPlayerController.
- Create a game mode deriving from RTSGameMode using that player controller. Compile and save.
- Use the new game mode in the world settings.
- Create a controller deriving from RTSCharacterAIController.
- Set the Character Behavior Tree Asset of the new controller to RTSCharacterBehaviorTree.
- Set the Character Blackboard Asset of the new controller to RTSCharacterBlackboard.
- Add RTSPlayerStarts to the map.
- Add RTSCameraBoundsVolume to the map.
- Add a NavMeshBoundsVolume to the map, and build Navigation. You may press P to review your results in the viewport.
- Bind the action Select (e.g. to left mouse button).
- Add SelectableComponents to everything selectable.
- Listen to the OnSelectionChanged event broadcasted by the RTSPlayerController.
- Create a RTSPlayerPawn blueprint.
- Add a Camera component.
- Set the Location of the Camera component as desired (e.g. X = 0, Y = 0, Z = 1500).
- Set the Rotation of the Camera component as desired (e.g. X = 0, Y = 270, Z = 0).
- Use the RTSPlayerPawn as default pawn in your game mode.
- Bind the axis MoveCameraLeftRight (e.g. to Left and Right keys).
- Bind the axis MoveCameraUpDown (e.g. to Up and Down keys).
- At your RTSPlayerController, set the CameraSpeed (e.g. to 1000).
- At your RTSPlayerController, set the CameraScrollThreshold (e.g. to 20).
- Create a new RTSCharacter blueprint.
- Set skeletal mesh, position, rotation, animation, capsule size and max walk speed as usual.
- At the CharacterMovement component, you may set the Max Acceleration property to a high value to avoid stuttering when changing move orders.
- Set pawn AI controller class to your RTSCharacterAIController.
- Add a SelectableComponent.
- Ensure Pawn > Auto Possess AI is set to "Placed in World or Spawned".
- Bind the action IssueOrder (e.g. to the right mouse button). This will enable typical smart orders, such as moving when right-clicking ground, and attacking when right-clicking enemies.
- Bind the action IssueStopOrder (e.g. to the S key).
- Add the RTSAttackableComponent and RTSHealthComponent to any actors that can be attacked.
- Set the Current Health and Maximum Health properties of the RTSHealthComponent for these actors.
- Add the RTSAttackComponent to any actors than can attack.
- Add an attack to the RTSAttackComponent of these actors, setting its Cooldown, Damage, Range, Acquisition Radius and Chase Radius.
Setting the Damage Type is optional. Remaining Cooldown is handled by the framework and just exposed for scripting purposes.
- Create a new RTSProjectile blueprint.
- Set the Impact Threshold property.
- Set the Replicates property to true (this might change in the future, as we don't really care about exact projectile positions on client-side).
- For all RTSAttackComponents that should use this projectile, reference the new projectile.
- Set the Initial Actors for your RTSGameMode. This will spawn initial units for each player at their player start.
- Optionally, set the Defeat Condition Actor type for your RTSGameMode. This will check whether any actors of the specified type exist for a player whenever he or she loses a unit. If no actor of the specified type remains, the player is defeated. Note that it is up to you to define how defeated players should be handled, e.g. whether you've making a 1v1, FFA or team game.
We are sorry that you've experienced issues or are missing a feature! After verifying that you are using the latest version and having checked whether a similar issue has already been reported, feel free to open a new issue. In order to help us resolving your problem as fast as possible, please include the following details in your report:
- Steps to reproduce
- What happened?
- What did you expect to happen?
After being able to reproduce the issue, we'll look into fixing it immediately.
You'd like to help make this plugin even more awesome? Seems like today's our lucky day! In order to maintain stability of the tool and its code base, please adhere to the following steps, and we'll be pleased to include your additions in our next release.
Note that this plugin is distributed under the MIT License. So will be your code.
If you've got no idea how to help, head over to our issue tracker and see what you'd like to do most. You can basically pick anything you want to, as long as it's not already assigned to anyone.
If you know exactly what you're missing, open a new issue to begin a short discussion about your idea and how it fits the project. If we all agree, you're good to go!
Real-Time Strategy Plugin for Unreal Engine 4 is developed using the GitFlow branching model. In order to contribute, you should check out the latest develop branch, and create a new feature or hotfix branch to be merged back.
Real-Time Strategy Plugin for Unreal Engine 4 is based on Unreal Engine 4.16.1.
Finally, open a pull request so we can review your changes together, and finally integrate it into the next release.
Real-Time Strategy Plugin for Unreal Engine 4 is dual-licensed:
- everything beneath Source\RTS\Content\StarterContent is governed by the Unreal® Engine End User License Agreement
- everything else is released under the MIT License