Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Unity RTS Engine

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

  1. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    116
    jobo22 likes this.
  2. mediaticsvc64

    mediaticsvc64

    Joined:
    Nov 7, 2015
    Posts:
    27
    Hi and thanks for this great asset. I don't know if you told something about that before but i wonder if there is any way to add a save system ?
    I would also know if it is possible to put buildings in a specific area like a house near water for fishing....
     
  3. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    116
    He hasn't put in a save system yet.

    I'm going to see how allSave works on this though. I'll let you all know how it works when I get to it. It broke my Ufps project already...but that system is ...hard... so shady so far
     
    OussamaB and jobo22 like this.
  4. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    72
  5. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    This is really awesome. Thanks for taking the time to write this and share it with everyone. I will attach this to the first post.

    I would like to also congratulate you on the newborn!
     
    Paul-Swanson likes this.
  6. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    The save system is yet to be added.

    Expect this in the next update.
     
  7. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    I unfortunately have no experience with that asset. But after taking a small look at it, I would say it won't interfere with the RTS Engine code since the RTS Engine components use their own namespace.
     
    jobo22 likes this.
  8. mediaticsvc64

    mediaticsvc64

    Joined:
    Nov 7, 2015
    Posts:
    27
    I just want to give some ideas, maybe i'm not the first to ask but i think that will be pretty cool

    - Fog of war
    - night/day cycle
    - weather
    - ability to kill a character to get some food ( hunting )
    - walls
    - Fishing
    - deal resources
    - auto task - when a character try to get resources and there is no resource anymore, then he goes somewhere else to look for.

    I know that make a lot of job, cause that's what i'm trying to implement for my game, so, if there are some updates,with a few of this ideas i will be very happy...:)
     
  9. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    72
    @OussamaB can you make it so that when the attack object looks at the target it can have a rotation speed? I have tanks that I want their turrets to face the target, but I want them to rotate and not just flip in that direction. Thanks!
     
    Paul-Swanson likes this.
  10. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    116
    Yeah a Lerp on that would be really nice!
    any chance there is a place where we can simply add 1 line to fix this? or would it require a logic rework?
     
    Last edited: Jan 13, 2018
    jobo22 likes this.
  11. mediaticsvc64

    mediaticsvc64

    Joined:
    Nov 7, 2015
    Posts:
    27
    hello, I have an error when resource is destroyed ( i think ) :


    MissingReferenceException: The object of type 'Resource' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    RTSEngine.NPCBuildingPlacement.SendCollectorsToBuild (RTSEngine.Building TargetBuilding) (at Assets/RTS Engine/AI/Scripts/NPCBuildingPlacement.cs:610)
    RTSEngine.NPCBuildingPlacement.ConstructBuilding (RTSEngine.Building NeededBuilding) (at Assets/RTS Engine/AI/Scripts/NPCBuildingPlacement.cs:526)
    RTSEngine.NPCBuildingPlacement.CheckAllBuildings () (at Assets/RTS Engine/AI/Scripts/NPCBuildingPlacement.cs:723)
    RTSEngine.NPCBuildingPlacement.Update () (at Assets/RTS Engine/AI/Scripts/NPCBuildingPlacement.cs:111)
     
  12. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    These two will be available in the next update.

    These will be available really soon.

    Thanks for the suggestions, love them!
     
  13. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    Expect this in the next update.

    It shouldn't be that complicated.
     
  14. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    Will be fixed in the next update. Thanks for reporting the bug.
     
  15. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    Excuse me but this one has been already added on v1.2.0. There's an auto behavior for both builders and resource collectors.
     
  16. mediaticsvc64

    mediaticsvc64

    Joined:
    Nov 7, 2015
    Posts:
    27
    Oh seems not working on my project then, maybe it's because of the error message i posted just before ?
     
  17. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    116
    If your going to take a crack at it can we have it so there's 2 parameters? Max angle before vehicle has to turn into it, and rotation speed. default be 360 max angle for people that don't want this feature and a public variable for both parameters for those of us that do want/need.
     
  18. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    I don't think that's the problem. Have you tried making the "Search Range" in the "GatherResource" component bigger?
     
  19. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    For each "Attack" & "AttackBuilding" component there will be a toggle called: "Direct Rotation" and a float called "Rotation Damping". The first will allow you to enable/disable smooth rotation and the second will allow you to determine how smooth the rotation is. Would that work too?
     
    jobo22 likes this.
  20. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    116
    I can work with that. Much appreciated!
     
  21. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    So by the end of next month. The RTS Engine will be 1 year old (YAAY!)
    And to celebrate that, I would like to create integration packages to officially support other assets that you guys use with the RTS Engine.

    Therefore I need suggestions for other assets that you have implemented or want to use with the RTS Engine. And by the end of next month, the will be officially compatible with this asset.

    P.S: They can even be units/buildings/environment models.
     
    jobo22 likes this.
  22. Paul-Swanson

    Paul-Swanson

    Joined:
    Jan 22, 2014
    Posts:
    116
    I'd like to suggest this one:
    https://www.assetstore.unity3d.com/en/#!/content/51344

    This would take care of the fog of war that everyone's been asking for. And it's cheap only 20$ $ usd. That author already put in multithreading and a team selector. But a bridge does need to be built for it.
     
    OussamaB and jobo22 like this.
  23. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    72
    I think the fog of war one would be great. I also would love to see the behavior designer one I mentioned earlier. It will give a lot more flexibility for AI. I don't have the asset yet, but it looks like it will be great, especially some of the add-on's they have available.
    Asset - https://assetstore.unity.com/packag...or-designer-behavior-trees-for-everyone-15277
    Add-on - https://assetstore.unity.com/packages/tools/ai/behavior-designer-formations-pack-28980
    Add-on - https://assetstore.unity.com/packages/tools/ai/behavior-designer-movement-pack-16853
    Add-on - https://assetstore.unity.com/packages/tools/ai/behavior-designer-tactical-pack-6182
     
    OussamaB likes this.
  24. mediaticsvc64

    mediaticsvc64

    Joined:
    Nov 7, 2015
    Posts:
    27
  25. sanuvin

    sanuvin

    Joined:
    Feb 11, 2014
    Posts:
    58
  26. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    I have been already talking to the publisher of this asset and I will have an official integration for it.

    This is definitely something I'm interested to do. But I'm not sure if this alone can be done till next month, I will contact the developer though and see how it goes.
    Let me know what tasks do you want to have.

    This is unfortunately not going to make it till March as it's not really the direction I want to go with for now. Still will consider this for future integration packs.

    Interesting, how do you see yourself using this in the RTS Engine? I'd say for unit/building upgrades, anything else?
     
    Last edited: Jan 20, 2018
  27. sanuvin

    sanuvin

    Joined:
    Feb 11, 2014
    Posts:
    58
    Definitely for buildings and units
    units - would have a small skill tree as they level up
    buildings probably based on factions - allow other buildings/units/perks/spells/resource increases or upkeeps to happen
    research tree for spells probably
    from warlock below which is turn based but same idea
    upload_2018-1-20_15-29-31.png
     
  28. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    72
    Hi, I think the main thing is for the AI to have the ability to control strategic parts on the map and defend them, maybe some other things like ambush, hit and run, and hide. Thanks!
     
  29. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    Alright guys, thanks for the suggestions.
    I'm going to start with the fog of war first. I'll keep you updated.

    Is there any suggestion for a units/buildings pack that you use and want to have the unit/buildings directly set up in the RTS Engine (probably even a ready-to-play demo scene).
     
  30. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    A new update has been submitted, mainly providing more options for resources and improving the way NPC Factions handle resource collection. Bellow is the full update list.

    v1.2.2:

    Bug fixes:
    - Fixed a bug that affected NPC Factions when a resource is destroyed.

    New features:
    - Place buildings only within a certain range from a resource type.
    - Resource drop off buildings can now accept either all resources or a list of resource types.
    - Resources can now force collectors to drop off at a certain range from the resource position (meaning that a drop off building must be placed in that range in order to gather that resource).
    - If a resource requires a drop off building within a certain range from it, then the NPC Faction will provide this building in order to start gathering that resource.
    - Each time a faction attempts to collect a resource type, it first makes sure that there's a suitable drop off building for the resource gatherers.
    - NPC Factions can now send units that can construct buildings and who are collecting a resource in case there's saturation in the population or no resources to create new builders, to construct buildings. Then the same units will resume their resource collection jobs after the building is built.
    - NPC Factions can now send some units that are already collecting resources in order to collect another resource that the faction urgently need to create other units/place buildings.
    - A new resource list called "Destroy Award" has been added to both Units/Buildings: This represents the resource that the faction who destroyed a unit/building will receive as a reward.
    - Turrets in buildings and units can now be smoothly rotated to face the target instead of instantly facing them.
    - Units can now have custom damage points against certain types of Units and Buildings (enabling a unit to perform better against some units and worst against some others).

    P.S: Just a request to new RTS Engine users, it would be super appreciated to receive a review from you guys in the asset store page. Let me know what do you think!
     
    TIMTAN_DRM and jobo22 like this.
  31. WoogyIM

    WoogyIM

    Joined:
    Oct 2, 2015
    Posts:
    15
    What about the network code? Is it possible to add a connection on the Ip (without NAT)?
    Also when creating a network game - units behave very strange, they are thrown back ... No interpolation?
     
  32. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    Only connections through UNET servers are now available.

    Yes there are some issues with the current multiplayer code as the implemented lockstep model is not really complete. I will mostly switch to Photon soon as they offer already a lockstep model under TrueSync.
     
  33. WoogyIM

    WoogyIM

    Joined:
    Oct 2, 2015
    Posts:
    15
    Where can I get acquainted with Photon? and will it be in your asset?
     
  34. mediaticsvc64

    mediaticsvc64

    Joined:
    Nov 7, 2015
    Posts:
    27
    I ask myself if that would be possible to create a post apocalyptic zombie survival with that kit.
    If I create a Zombie faction who just need to eat other units and then convert them into zombies, would it be possible to change the new unit's animations to make them move like zombies ? It sounds simple but i don't know if it is possible.
    And if it's possible then I realy need to make walls around faction's camp....

    Do you think it's hard to do ?
     
  35. mediaticsvc64

    mediaticsvc64

    Joined:
    Nov 7, 2015
    Posts:
    27
    another question :

    I wonder if it's possible to instantiate random prefab from a list of specific prefabs when we create a new unit ?Just to have different character prefabs instead of always the same...

    And last question :

    I noticed that when i get many units on the map, sometimes it's difficult to find where they are, so maybe it would be great to have a list of units to click for finding them or something like that....
     
  36. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    Expect that in the middle/end of March. There's still a lot of work to be done.
     
  37. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    You can always use the delegate events for this purpose. For example there's one called when a unit is converted which has the converter and the converted units as parameters, so you can check if the converter is a zombie unit. If yes then you can change the animator controller.
     
  38. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    That's a pretty nice feature that's missing from the asset, on my to-do list.

    Hmm yeah, minimap icons are something on the to-do list as well.
     
  39. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    So v1.2.2 is now available on the asset store, let me know what do you guys think of the new features.
     
  40. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    72
    I have been trying the new smooth rotation for turrets and it seems like you have to have the smooth rotation unchecked to get it? It says if SmoothRotation is true then automatically change, else use slerp. I can't really get it to work even without it checked but here is the code you have.
    Code (CSharp):
    1. //Make the attack object look at the target:
    2.                                                         if (AttackSources [AttackStep].WeaponObj != null) {
    3.                                                             Vector3 LookAt = AttackTarget.transform.position - AttackSources [AttackStep].WeaponObj.transform.position;
    4.                                                             //which axis should not be rotated?
    5.                                                             if (AttackSources [AttackStep].FreezeRotX == true)
    6.                                                                 LookAt.y = 0.0f;
    7.                                                             if (AttackSources [AttackStep].FreezeRotY == true)
    8.                                                                 LookAt.y = 0.0f;
    9.                                                             if (AttackSources [AttackStep].FreezeRotZ == true)
    10.                                                                 LookAt.z = 0.0f;
    11.                                                             Quaternion TargetRotation = Quaternion.LookRotation (LookAt);
    12.                                                             if (AttackSources [AttackStep].SmoothRotation == true) { //if the rotation is automatically changed
    13.                                                                 AttackSources [AttackStep].WeaponObj.transform.rotation = TargetRotation;
    14.                                                             } else {
    15.                                                                 //smooth rotation here:
    16.                                                                 AttackSources [AttackStep].WeaponObj.transform.rotation = Quaternion.Slerp (transform.rotation, TargetRotation, Time.deltaTime * AttackSources [AttackStep].RotationDamping);
    17.                                                             }
    18.  
    19.                                                         }
    Also you have if FreezeRotX == true then LookAt.y = 0.0f, shouldn't that be LookAt.x = 0.0f?
     
  41. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    Really sorry about this, the fix will be in the next update.
     
    jobo22 likes this.
  42. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    72
    No problem, your asset is awesome! :)
     
  43. TIMTAN_DRM

    TIMTAN_DRM

    Joined:
    Nov 29, 2017
    Posts:
    1
    Hi Oussama,

    Today I have time to take a look at the whole project, found it's really an awesome asset I ever had. And the online doc is so helpful and so detailed. Hope author will upgrade this project gradually.
    Sorry I'm new guy to Unity , and two questions from my side,
    1. How can I convert this project to mobile game? I think maybe just little work to do here, but pls share your points. Thx.
    2. Do you have plan to use Photon in this engine?

    Looking forward to your reply, thx.
     
  44. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    Thanks a lot for your kind words.
    Regarding your questions:

    1) The main challenge here is to make the camera movement and selection work for mobile. That would require quite some code modifications. Official support for mobile might come really soon as a separated package or an upgrade to the current one. But there are other urgent things to add in the meantime. I will keep you informed.

    2) Yes. Expect Photon (TrueSync) to be available at the end of March.
     
  45. vertigostudios

    vertigostudios

    Joined:
    Oct 1, 2012
    Posts:
    91
    Hi OussamaB,

    Im unsure whether or not this has been mentioned before, but here goes.

    When you try and move around the screen with the mouse and you move your mouse over a UI panel, the mouse pointer wont move the screen around.
     
  46. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    I disabled that intentionally. I'll add an option to toggle that in the next update. Send me your e-mail address and invoice number over a PM if you want me to send you the feature before I submit to the asset (submission will be in a week or so).
     
  47. kmayfield

    kmayfield

    Joined:
    Jan 1, 2017
    Posts:
    9
    I have an issue going on with selection and camera height. Seems to start at a height of 30 and gets worse the higher the camera is set. At a height of 60 only the bottom half of the screen will detect a "move to" selection for a unit. Any thoughts on how to resolve or what may be causing the problem.
     
  48. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,115
    Please check the following things:

    - Are you changing the height in the camera position (y axis in the camera's position) or are you referring to the field of view?
    - Open the "SelectionManager.cs" component and search for this line:
    Code (csharp):
    1.  
    2. if (Physics.Raycast (RayCheck, out Hit, 80.0f, RaycastLayerMask.value)) {
    3.  
    Try increasing the length of the raycast and see if the problem persists or not.
     
  49. kmayfield

    kmayfield

    Joined:
    Jan 1, 2017
    Posts:
    9
    That did the trick. Thank you. FYI in case someone else runs into the same problem, this occurred both with y axis and FOV. My first solution was to just scale everything down but that created a whole new set of problems. Anyway, thanks for the quick answer.
     
  50. Castells

    Castells

    Joined:
    Jan 30, 2015
    Posts:
    3
    Hi every one! I just get the RTS Engine. I was very excited about it, but i'm not really experienced with messing around in rts architecture, and i just isntalled the engine and when i wanted to try if it works smooth, i wasn't able to move any unit (neither the IA was). It throws at me the following warning:

    upload_2018-2-20_22-26-6.png

    I debbuged and i think its somethig just when the unit is created, after the building.cs update finishes. But i can't figure out what it is... anyone knows? :/

    Thanks!
     
    Last edited: Feb 23, 2018