Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Unity RTS Engine

Discussion in 'Assets and Asset Store' started by OussamaB, Feb 7, 2017.

  1. lifeisbetter

    lifeisbetter

    Joined:
    Nov 23, 2017
    Posts:
    3
    If this engine can work on mobile device, I will buy it.:)
     
    Deleted User likes this.
  2. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Unfortunately there's no support for mobile right now. Might change in the future though.
    What features do you think would be essential to have a mobile RTS game? I mean how do you expect the map navigation, UI, selection, etc.. to be?
     
  3. Castells

    Castells

    Joined:
    Jan 30, 2015
    Posts:
    3
    Hi, i'm using unity 5.5.4p4
     
  4. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    The minimum supported version is 5.6.1. That's why you're having these issues.
     
  5. Castells

    Castells

    Joined:
    Jan 30, 2015
    Posts:
    3
    Oh, crap! Thanks, i wasn't able to see that ^^' (now i looked like an idiot >.<)
     
  6. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Hello everyone, today marks the first year anniversary of the RTS Engine in the asset store. Thanks for everyone who supported the asset and thanks to all of you for your help with the bug hunting and the amazing suggestions! This is the most passionate project I'm doing and I hope you're satisfied with the asset.

    An update will be submitted with a lot of improvements for the attack component and the long-awaited integration for the Fog of War asset will be available as the update hits the store.

    Here's the update list:

    * Attack component improvements:

    - Merged the "AttackBuilding.cs" (for buildings) and the "Attack.cs" component (for units) into one "Attack.cs" component (for both buildings and units).
    - Refactorted the code in the "Attack.cs" component for better performance.
    - Fixed a bug in NPC behavior when creating drop off buildings.
    - Fixed the smooth rotation of the attack weapons (turrets).
    - Added an idle rotation for the attack weapon that the unit/building reverts to when not having a target to attack.
    - Added two new attack-related delegate events: one is called when the attacker locks a target and the other is called when the attacker performs an attack (either applies direct damage or send the attack object).
    - Added Attack Delay: it can either be a timer or a trigger that you toggle by code from another component.
    - Added Damage over Time attacks: attacks can now cause damage over time, options for this attack type include the lifetime, cycles and the option to make infinite (with access via code to stop it).
    - Added the option to disable/enable the take damage animation for units.
    - Added the option to force stop the movement of a unit when it takes damage for some time that can defined in the inspector.
    - Added the option to disable attackings either all units or all buildings for units/buildings that have the Attack component.
    - Merged effect objects pooling and attack objects pooling into one component.
    - Added the Attack Manager component which handles everything attack related instead of the Unit Manager.

    * Other changes:

    - Added an option to ignore/consider the UI when moving the camera on the screen edges.
    - Slight NPC behavior improvements.
    - Fixed the end game conditions.
     
    jobo22 and Paul-Swanson like this.
  7. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    RTS Engine v1.2.3 has been just submitted to the asset store.

    For everyone using Unity Plus or Pro, you can get the RTS Engine for 36$ instead of 45$ during the Plus/Pro sale!
     
  8. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Hey guys, I'm looking for a level designer who'll be willing to create a good looking demo map for the RTS Engine. It's a paid job of course, is anyone interested?
     
  9. fau7

    fau7

    Joined:
    Jan 24, 2018
    Posts:
    48
    Hi Oussama,
    Thank you very much for the asset. I loved it. I have gone through the documentation throguhtly. Nicely prepared. Congrats.
    I wanted you ask you about something. This thread is quite huge and I started searching my problem in the thread. But if I could have a tip I would be very glad. I have modified the terrain in the demo scene. I have regenerated the NavMesh accordingly. And then done the steps you have mentioned in the documentation. The issue is that when I generate a character for example a civililan
    - the character spawns on the area where the map is not changed ( the central building is on the unchanged area) Here are the screen captures. He can easily go uphill and find resources etc..

    guy1.PNG He spawned on the unedited terrain guy2.PNG
    And he has no problem just wandering around.


    - the caracter spawns and immediately falls below the terrain (the central building is on a hill) and lost forever(edit: actually just below the modified terrain):D I have added the screen capture here..
    lostguy.PNG

    I have tried doing what you have said here :
    http://soumidelrio.com/docs/unity-rts-engine/maps-terrain/
    many times. Am I missing something? Could you please comment on that?

    Thanks again for the asset. Wish the best
    Fau
     
    Last edited: Mar 5, 2018
  10. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I guess your forgot to update the spawn position of the building when you've put it over the hill. You can configure the spawn position of each building like this:
    - Go to the "Building" component's inspector
    - Under the "Building Components" section, you should see this:

    - Select the "Unit Spawn Position" and it will highlight the current spawn position (empty) object in the scene.
    - And finally, move the spawn position object over the hill.

    (Also make sure that the spawn position object is a child of the main building object).
    Let me know how this works out for you. Also thanks a lot for your kind words regarding the RTS Engine, they keep me motivated!
     
  11. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    RTS Engine v1.2.3 is now available on the store. If you encounter this error in "Building.cs" (line 7) regarding the namespace "FoW" not being found then simply remove that line. I was experimenting with the Fog of War asset for the integration package and forgot to remove that. An update has been already submitted to fix this small issue. Thanks for your understanding.

    Also expect the integration pack for the FoW by tomorrow!
     
    jobo22 and fau7 like this.
  12. fau7

    fau7

    Joined:
    Jan 24, 2018
    Posts:
    48
    FoW!! :) I was into that... Good news then! Updating right away. Cheers
     
  13. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    It's available yet but it will be tomorrow
     
  14. fau7

    fau7

    Joined:
    Jan 24, 2018
    Posts:
    48
    I was not succesful. Need to make a fresh start I guess. Also thanks for the FoW integration Oussama. It was crucial.
    Cheers
     
  15. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    jobo22 and fau7 like this.
  16. EmeraldThunder

    EmeraldThunder

    Joined:
    Jan 10, 2016
    Posts:
    50
  17. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Thanks a lot for your kind words. I would appreciate a rating/review on the asset store.

    I'm already working on the next update which will include mainly improvements for multiplayer.
     
  18. purnamasari

    purnamasari

    Joined:
    Mar 8, 2018
    Posts:
    17
    upload_2018-3-16_10-52-19.png

    Hi, I tried DemoMap scene, and run it without modify anything, but the player spawning always stuck like this. Can you point me how I can fix this?
     
  19. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    So the task is not progressing? Please try the following and let me know:

    - Try creating another unit and see if the same problems persists.
    - Are you getting any errors when launch the civilian creation task?
    - Which version of Unity are using?
     
    purnamasari likes this.
  20. purnamasari

    purnamasari

    Joined:
    Mar 8, 2018
    Posts:
    17
    Hello, I just updated to the latest Unity version and it's works fine! The only one is problem is the Unity itself, not your code. My previous version (2017.3.0f1) is so buggy and had a lot problem. If anyone had the same problem with me, update your Unity to the latest version.

    And also, I love your engine :D
     
  21. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Glad you solved the issue.
    If you have any further questions and/or suggestions for the RTS Engine, don't hesitate to let me know!
     
  22. purnamasari

    purnamasari

    Joined:
    Mar 8, 2018
    Posts:
    17
    I want to know how and what function that running when I spawn a unit, I need it to spawn unit based on network command. Where the .cs that I supposed to change?
     
  23. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    The Building.cs component handles unit creation. For the time being I advise you not to do many changes in the networking-related code because the next update will deliver a completely re-written multiplayer behavior and it's going to be way much better.

    P.S: I will share more information about the next update soon, it's going to be a big one!
     
    purnamasari and Paul-Swanson like this.
  24. purnamasari

    purnamasari

    Joined:
    Mar 8, 2018
    Posts:
    17
    Okay, let's ignore the networking code first, I'm afraid to changing it too. But is there any reusable function or anything else that needed to create an unit? Where I can find it? Everything is task-based, I don't know how to call it.

    I'm sorry for asking a lot question, I'm so new in unity :( Thank you.
     
  25. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    If you want to apply changes on newly created Units, there is a delegate event called that is called each time a new Unit is created that you can use. Check out the Custom Events component for a complete list of various delegate events and checkout the Custom Events Example component which shows you how to implement these delegate events yourself.

    If you want to modify the code that actually spawn units from buildings, you should find that in between lines 702 and 776 in the Building component. But as I mentioned before, please don't modify the networking related code because it will be changed in the next update as I'm working on a way better lockstep model along a couple of other new features.
     
  26. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    So I will start sharing some details about the next update, which as I said is going to be a big one and will probably be v1.3.0 (yes from v1.2.3 straight to v1.3.0). Below are some of the updates that you should expect:

    Hover health bar for units and buildings:

    - Enable/disable feature through the UI Manager.
    - Enable for all factions or player faction only.
    - Pick the height for each unit and building from the inspector.

    Attack Warning Manager:

    - Show flashing attack warning icons in the minimap when player units/buildings are getting attacked.
    - Use custom art as the attack warning icon.
    - Pick how long these icons will stay in the minimap and the minimum distance from already existing warning icons required to draw a new icon.
    - Object pooling for attack warning icons.

    Minimap Icons:

    - Icons for units, buildings and resources to be displayed on the minimap.
    - Faction units/buildings use the faction color and free units/building use a color for free factions only.
    - Each resource type can use a different color.
    - Object pooling for minimap icons.

    Tooltip Manager:

    - Easily added tooltips for any UI element so that when you hover on them a tooltip menu appear with the text that you want.

    God Mode:

    - God mode allows to launch and finish tasks instantly and place buildings instantly without having to construct them + not lose resources, very useful for quick testing.

    ---

    In the upcoming days I will be sharing more information about the new multiplayer system + attack system.
    In addition to all features, the code is getting heavily refactorated and a lot of parts are getting re-written from scratch for better performance. I'm also planning to have a new demo scene by the new update so stay tuned and let me know what do you want to have in the next update.
     
    jobo22 and purnamasari like this.
  27. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Yes there's a demo map in the package equipped with various unit, building and resource prefabs.
     
  28. Warspawn

    Warspawn

    Joined:
    Apr 12, 2017
    Posts:
    34
    I'm having trouble creating a building. I added what I think is all of the things based on the demo buildings, but for some reason it sticks into the ground. I see in the BuildingPlacement that there is a height to add for all buildings, I wonder why that wouldn't be on an individual building or why the player would need a per map amount added? Anyway, any clues how to get this house to work? Also is there a way to rotate it?
     
  29. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    - What do you mean it sticks to the ground? Do you mean that when attempting to place the building on the map it sticks instantly and does not allow you to move it? Or do you mean that once placed, some parts of the building are hidden by the map?

    - To have a different rotation for the building simply rotate all its child positions to the desired rotation, the main building object will have the same identity rotation.
     
  30. Warspawn

    Warspawn

    Joined:
    Apr 12, 2017
    Posts:
    34
    Sorry, maybe sticks was the wrong word. This is when I am trying to build it, it is half way into the terrain. The side shot shows that I have all the colliders and stuff. I mimicked the house from the demo. It appears that it is being placed at 0.05 Y which is coincidentally the same amount as the BuildingPlacement adjustment value.
     
  31. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    That value represents a positive offset for the position of the building on the terrain where it is getting placed. So even if you have a hill with the heihht 10, the building's position on the y axis will be 10,05 (assuming that the offset value is set to 0,05 in the Building Placement component). So try increasing that field and see how the building is placed but make sure to use the same structure for all your buildings.
     
  32. Warspawn

    Warspawn

    Joined:
    Apr 12, 2017
    Posts:
    34
    Since the setting in the Building Placement component is global for all buildings, if I change it for my house then the others are floating in the air. As far as I can tell they are identical except the model and size. I must be missing some setting...

    Also, is the faction color only achievable by tint? or can I change material?
     
  33. Arkolis

    Arkolis

    Joined:
    Feb 6, 2015
    Posts:
    34
    Bought your pack recently, great work btw.
    One integration suggestion would be Ice Creature Control or Behavior Designer for free units, example would be deer that move around in flocks using ice til they are tamed by converters.

    Again Awesome stuff Thank you for the asset!
     
  34. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    See in the transform (position on the y axis) of both buildings in the editor if they are indeed identical or not.

    Yes currently it's only achievable by tint.
    However you could use the delegate event: OnBuildingPlaced which passes the building as a parameter and access the list of materials that will be colored and change their textures based on the faction ID of the building.
    I will be more than happy to write that for you in case it wasn't clear enough, just let me know.
     
  35. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Thanks a lot for the kind words. Behavior Trees for units behavior is something I'm looking forward to implement after the next update.
    However something that will be introduced in the next update will solve how to create animal behavior for example.

    A wandering behavior for units will be introduced where you can set the unit as free (not controlled by a faction) and enable the wandering behavior by default and pick settings such as the center of wandering, if the unit wanders inside a center or can free go anywhere, the range of the movement each time and the time needed between each different movement.
    Another behavior for units will also be added and that is the "escape on attack" behavior which makes units escape to random position inside a defined range when they are attacked and that behavior can be added for animals that do not attack. For animals that attack back you can simply turn on the option: "Attack In Range" or "Attack When Attacked" which will either make the unit engage into attack or simply defend itself when attacked.

    ---

    I would appreciate it if you guys could write a review on the store at some point. It really helps.
     
    Arkolis likes this.
  36. Warspawn

    Warspawn

    Joined:
    Apr 12, 2017
    Posts:
    34
    Hmmm for the building, which transform does it use for the terrain anchor? The selection plane is down on the ground, but all of the other objects are in the middle-ish of the building. The demo building I guess the main object is at the top, otherwise I think it's basically the same. Here is a comparison of the 2 objects:
    For the building I ended up just changing that part of the texture to grayscale so that it works better with tinting. I think for the units however that won't work as well. Then I think there is the issue that in the faction info it just has a Color and that isn't easy to match up with something like "Green". I am thinking maybe I can/should create an enumeration of specific faction color choices so that the color can be set based on that (for things that use tinting) with a matching name for material switching. Maybe I can use faction code? I haven't gotten to the multiplayer selection screen yet so maybe I'm thinking too far ahead.
     
  37. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Imagine you are placing your building at the terrain which has a height that equals to X (for example 0). The main building prefab will be placed at X (0) plus the offset value you choose in the Building Placement (for example 1) component (so this equals to 1 in this example). So you need to create the building prefab according to that.

    It's not about the order of the objects in the hierarchy but rather the actual position of these objects (which you can in the transform component in the inspector when you select an object).

    You can send me the building prefab you are trying to create and I'll have a better look at it and fix it up for you and let you know what went wrong during the configuration of the building.

    That is one way to do but using the delegate events in a separate class that you create would much better.
     
  38. Warspawn

    Warspawn

    Joined:
    Apr 12, 2017
    Posts:
    34
    I finally figured it out. The parent empty game object that contains all of the building parts needs to be a Y = 0. Really I guess everything does, problem is that the models I have the origin is not at the bottom. The origin needs to be at Y = 0. So, the child meshes need to be moved so that the bottom is at Y 0 (or slightly over for the terrain)
     
    OussamaB and Paul-Swanson like this.
  39. Warspawn

    Warspawn

    Joined:
    Apr 12, 2017
    Posts:
    34
    Is there a discord server for this asset? I think it'd be nice to ask questions in real time...

    Is there a way to create a Unit that you can only have 1 of (or some limited amount). I was thinking of maybe to use an upgrade, but I'd want the unit to be able to be made again if it dies. For example, say there is a lumber mill building, and I want it to have the option to create a "mighty lumberjack" unit when fully upgraded. But, I only want to allow 1 Mighty Lumberjack on the field per team. I was thinking maybe I could use events to check on when a unit has been spawned, and when it dies and then scan through all of the buildings and if they have that task, enable or disable it... but I'm not sure that is something possible. I don't think the tasks have codes (other than faction specific)...
     
  40. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    A discord server is planned to launch when the next update is available on the store.

    That is a pretty good suggestion, the next update will include a list in the Faction Manager component where you can add unit/building prefabs and set a maximum amount for the prefab in the game per faction.
     
  41. Warspawn

    Warspawn

    Joined:
    Apr 12, 2017
    Posts:
    34
    Cool, I have another suggestion :) can we have a way to upgrade the Bonus Resources for a building? Same example of a lumber mill, I want to place it down and have it give a .1 bonus to Wood gathering. That's already there. Then I want to have a research task called something like "Sharper saw blades" or something that can increase the Bonus resources by another .1 amount.
     
    OussamaB likes this.
  42. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    You can expect that in the next update as well!
    Keep those suggestions coming.
     
  43. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Here are some details regarding multiplayer for the next update:

    - Added an Input Manager component which handles collecting input commands from the local player, receiving commands from the server/host and executing them. This component is separated from the UNET-related components which makes it extremely easy to add your own networking service without digging into the other components.

    - The Input Manager handles spawning factions, units, buildings and destroying them. Everything is now created locally and the Input Manager keeps track of each synced object and manages it.

    - Resources do not get destroyed and re-spawned at the start of a multiplayer game as the Input Manager now handles identifying and syncing them for all clients without having to re-create them.

    - Main components such as the Unit & Building components are no longer derived from the NetworkBehavior but rather the MonoBehavior, all RPC and Command calls in all components than the UNET-related components have been removed in order to separate completely the networking components and other components making it even easier to implement your own networking service for multiplayer.

    - Free units and free buildings can now be used in multiplayer games (as the server/host takes responsibility in administrating them and syncing them for all other clients).

    - The UNET multiplayer components (from the components that handle the multiplayer menu and the components that manage the game) have been refactored (some completely re-written) in order to improve performance.

    - Improved the UNET lockstep model that is being used for multiplayer.

    - A Sync Test feature has been added to the lockstep model: this allows the server/host to check if clients are now on the same lockstep turn to avoid any sync issues. As soon as a client syncs out, the game freezes and that client is given a specific time (can be chosen from the inspector) to catch up before getting kicked for timing out.

    - Clients will receive different messages when they disconnect, get kicked or time out from a multiplayer game.

    - Added a Game Version attribute for the UNET Network Manager component: In order to play together, two players must have the same game version in order to avoid two players getting into sync issues when playing with different versions of the game.

    And these are basically the main updates regarding the multiplayer, it's now smoother than ever!

    More details about the next big update will be shared soon (even more features and a whole new map is coming!).
     
    purnamasari and jobo22 like this.
  44. WithinAmnesia

    WithinAmnesia

    Joined:
    Oct 31, 2016
    Posts:
    20
    Hello I have a few questions. What can you tell myself about your R.T.S. engine about the following:

    - Does the engine come with animation support for basic movement, walking, idle, stun, death, hit, attack etc.
    - Moving up and down elevation (hills); can your engine support this?
    - Cut-scene options for story and missions. A menu system to support unlock-able missions for campaigns.
    - A hero system akin to Warcraft III (levels, attributes, abilities, items etc.)
    - Neutral shops (for heroes) / capture-able neutral bases / nodes that create units for the occupying force.
    - Bleed / poison / damage and or healing over time effects.
    - Different faction tech trees and unit appearance / unit compositions.
    - Dead bodies / corpses that can be resurrected / converted into 'undead'.

    I am asking these questions for the online demo was basic enough to merit discussion regarding these feature requests / engine feature support.
     
  45. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Yes, the RTS Engine comes with full support for unit animations. That does not show in the demo because I don't have the actual animations for the units used. That will change in the new demo scene which will come with the next update.

    Yes, again that is not displayed in the current demo scene but in the one I'm working on right now there's going to be a couple of hills spread over the map.

    That's unfortunately not available right now but I'm studying the option of doing an integration pack with an asset that is dedicated to creating quests and missions (like the Dialogue System).

    Units can't collect items and don't an inventory but they can level up and their abilities can be changed using the research tasks.

    Neutral buildings can't be captured and used for a faction as of now, neutral units however can be converted.

    Yes damage over time is available.

    Yes you can different units/buildings for different faction types.

    That's not available right now.

    Yes I do believe the current online demo doesn't really represent the RTS Engine enough and doesn't really showcase all of its features, that's a new one will be live soon!
     
    WithinAmnesia and digiross like this.
  46. dkstrong

    dkstrong

    Joined:
    Aug 17, 2013
    Posts:
    16
    Hi, I have a strategy game that I've been working on for a few weeks. and I've been looking in to how to incorporate deterministic multiplayer in to it (keeping positions, health, etc in sync) .

    How "modular" is the multiplayer component of your rts engine? would it be possible for me to use the multiplayer feature without the rest of the engine?
     
  47. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    It is possible but you'll have to make a lot of code modifications in order to separate the multiplayer components from the RTS Engine which can be a bit challenging.
     
  48. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    I bought this asset a while back but never used it yet. Was waiting for to get better and I can see it has. Really good work with the progress.
    Looks amazing now. So glad it has multiplayer now.
    What networking does it use?
    I think I asked this question a year ago but do you include a separate test seen showing performance results on how many units can be runningat a time?
     
    Last edited: Apr 5, 2018
  49. okito122

    okito122

    Joined:
    Dec 25, 2015
    Posts:
    3
    Hey, I've bought the asset some time ago and started working with it. I must say it really sped up my development as it has a ton of features! Though i had to do a bunch of changes/rewriting for my needs but haven't touched much in the MFactionManager. My game is heavily focused on online multiplayer though I must say Im experiencing a lot of position snapping guessing the position is getting desync'd a lot. Have i messed something up or is it to be improved in the next update?

    Also I have few more questions, you've mentioned rewriting/redoing a bunch of things regarding the code, will you include a more detailed update log so it's easier to update own modified projects?
     
  50. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    It did have multiplayer since quite some time now but with the next it's getting hugely improved, when the update is done (which should be sometime next week), I will add a performance test.