Search Unity

RTS Development Framework - create your own RTS with Unity [RELEASED]

Discussion in 'Assets and Asset Store' started by Emilo, Nov 7, 2015.

  1. Emilo

    Emilo

    Joined:
    Nov 26, 2014
    Posts:
    6
    I've been working on a Real Time Strategy game (RTS) using Unity since summer 2014. A few months back I noticed that there still weren't any real RTS development frameworks around on the asset store so I decided to convert this game that I've been working on into a framework for anyone to use and build upon. Creating an RTS is a rather large undertaking but with this framework at least some of the initial obstacles are removed and mitigated.

    The framework includes many features that you would expect to see in an RTS such as an RTS camera, minimap, unit command system (move/attack), pathfinding, resource gathering, building of structures, building of units with build queues, FOW/LOS/Shroud, item health indicators...

    Included are logic for tanks, infantry, airplanes (can drop bombs), helicopters and resource gatherers and structures such as Refineries (that will refine gathered ore) and factories.

    Creating new Items (unit/structure) and editing existing Items is easily done using an Editor menu which allows for easy manipulation of the most common variables.

    I decided early on to build an RTS with a classical gameplay similar to that of Age of Empires/C&C Generals/Starcraft. That means that you build bases, gather resources and build units from other buildings.

    Although not currently included I plan on adding the following features:
    * Customizable AI
    * Water movement
    * Tech tree
    * Multiplayer support
    And much more.

    Full source code in C# is included.

    Asset store link

    Official forum



    Demo video (poor quality, and two months old it doesn't show all features, I'm working on getting a proper demo rig and recording software)




    Who is this asset for?
    I'm clearly biased, but I would say that anyone who's interested in RTS games, particularly how they might function, would find this asset useful. Even if you're totally green on coding I hope that the source code will be easy enough to understand and extend. I've tried to comment as much as possible throughout the code and a 35 page manual is included to get you started with the basic setups.
    If you're an experienced coder, you probably won't find anything revolutionary in this package, but much of the time consuming groundwork has already been done so you should be able to kickstart your development.

    Can I use this asset on mobile?
    My main target platform has been PC. However, no DLLs or Windows specific code has been used so it's probably perfectly possible to run it on mobile. Though, you would need to reconfigure all input commands and use other 3D assets than the included ones (for performance reasons).

    Is this asset a finished game?
    It currently contains no enemy AI (just static enemies), no multiplayer support and no "win condition", so in that sense it's not a finished game, but rather a framework, a foundation on which you can build upon.

    This asset is under active development so new features and update changes will be released on a regular basis.
     

    Attached Files:

    Last edited: Nov 16, 2015
    SwiftTiger0228 likes this.
  2. primus88

    primus88

    Joined:
    May 14, 2013
    Posts:
    611
    Wow, great stuff man.
    Your asset looks to be exactly what I need for my next project.
    Can you please tell me some performance stats?
    How many AI agents can it support at a given time?
    Can the AI use height map terrain?

    Thank you!
     
  3. Emilo

    Emilo

    Joined:
    Nov 26, 2014
    Posts:
    6
    Hi,

    I've tested to move 500 units at the same time across a map with no difficulties, using six separate threads for path finding. However, I haven't tested what the absolute maximum would be since that will be very much dependent on the specific hardware it runs on. If you really want to know, I could of course run it to the max using my rig (i7, 6-core, 3,3Ghz) and let you know the specific performance readings.

    The pathfinding uses a grid that is projected onto the terrain layer. So units can move up and down hills depending on customizable traversable data values. However, the speed of the pathfinding algorithm is very much dependent on the complexity of the terrain geometry, and the resolution of the grid itself (customizable). Since it will have to calculate a path from point A-B for all agents very complex maps might not be able to handle as many agents as good.

    If you have a particular terrain I could test it out on my rig for you.
     
  4. primus88

    primus88

    Joined:
    May 14, 2013
    Posts:
    611
    Thanks Emilo. The numbers are really good. I needed something like 200 units maximum on a low-geometry terrain.
     
  5. zugsoft

    zugsoft

    Joined:
    Apr 23, 2014
    Posts:
    453
    In my mobile game "Orcwar RTS" , I use Unity Navmesh and on my iPad Air and I can move 500units with 60fps.
    Why do you use separate Thread for pathfinding?

    I use only a separate Thread to know the position between each unit
     
  6. Emilo

    Emilo

    Joined:
    Nov 26, 2014
    Posts:
    6
    Then you should have no issues at all with the AI agents.
     
  7. Emilo

    Emilo

    Joined:
    Nov 26, 2014
    Posts:
    6
    I don't use Unity Navmesh because at the time it didn't support dynamic updates in the free version.

    I found during development that if pathfinding ran on the same thread as the Unity engine itself, ordering a large amount of units from point A to B over a complex terrain would cause slowdowns when the move command was issued, that's why the pathfinding runs on a separate (or many separate) thread(s) so that no unit movement logic will interfere with the main game loop.

    But I will look into using the NavMesh to see if any performance is to be gained.
     
  8. xu-tom

    xu-tom

    Joined:
    Dec 20, 2015
    Posts:
    2
    Hi,Emilo
    I very like this framework,but I dont know this framework make mobile game it is ok? performance ok (android) ?
    Thanks!
     
  9. Emilo

    Emilo

    Joined:
    Nov 26, 2014
    Posts:
    6
    Hi Xu,
    This framework is built for Desktop. However, there should be no issues performance-wise to use this on any mobile platform as well, though you would probably want to use lower poly models... Be aware that you would need to rework all the control parameters since the framework has been built around the player interacting with a mouse+keyboard. So you would have to implement a touch-based input control system.
     
  10. OZAV

    OZAV

    Joined:
    Aug 9, 2013
    Posts:
    299
    ...Are the win-loss conditions inbuilt any soon ?