Search Unity

Unity RTS Engine

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

  1. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    83
    If I set a units height to anything above 0, they can't attack. Is there a way to fix this? Thanks :)
     
  2. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    If this is for a plane of something like this, the air terrain need to be defined and linked to the terrain manager and the unit must be defined at flyable. This will put the unit to the level of the air terrain.

    The nav component of the unit must be set also to the layer of the air terrain to be sure to move.

    With this a flyable unit should fire on ground and air.
    Worked for me.
     
  3. digiross

    digiross

    Joined:
    Jun 29, 2012
    Posts:
    323
    Awhile back I had asked about how this worked with terrain, such as if I used Gaia to generate it and at the time the terrain was limited to basically flat. After all the updates, has this changed or in the near future. I really like what I see about the asset but having varied terrain and the AI work on it is crucial to any decent RTS.

    Thanks for any input. Cheers!
     
  4. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I have a question concerning the behavior of unit when they move:
    When a unit is attacked she stops and can not flee if the enemy has a rapid gun but the option to stop moving under zttack is unchecked. Is it normal ?
    Second point, you have defined an option which is called attack on move but is this functional ? I don’t manage to use this with a unit with a turret.
     
  5. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    It seems that the air units don't work anymore.
    If I set the flyable area as the nav mesh for the pathfinding Unity freezes when I produce a air unit.
    In the past with the same setting and flyable option activated on a unit, the air unit were spawned at the level of the air terrain.

    Maybe something has changed in the past two updates?
     
  6. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    83
    I'm not sure about the air units, I wanted to have my land units be able to be up in the air a little bit (navmesh base offset), for a special function in my game.
     
  7. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Well, this hasn't only been fixed but it's now very simple to create a flying unit: No need to have an air terrain anymore, the target position object of a flying unit just needs a different layer assigned to it to differentiate it from ground units.

    Does the unit have the Escape On Attack behavior enabled? And do you force it to stop its movement when it receives damage?

    Got this fixed as well.

    Do you guys require these fixes ASAP? I can submit a patch for them (probably with other small things) but if this can wait, then it'll be included in the 1.3.4 version (next update).
     
  8. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    As long as the terrain works issue-free with Unity's navigation mesh then this shouldn't be a problem at all.
     
  9. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I don't understand this.
    Flying units should work like this in last 1.3.3.2 version ?

    Is the option flying unit always usefull?
    With or without this option air units don"t fire now on other units.

    If we set the height à 0 units can shoot/ if >0 units can not shoot like the past problem. Same behavior describe by jobo.

    I don't understand the way to define a specific target position object in this case.
    Could you illustrate a bit more of the process?
     
  10. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    No escape option defined - no force to stop.
    I just move the unit away and she stops when she's hitted.

    EDIT : I have made some tests and I think that the local AI is the problem.
    When I want a unit to flee, if she’s hit by an enemy, it seems that she tries to target the enemy and so stops the movement define by the player.

    There should be a difference between an order done by the player znd an order done by the AI.
    If the order comes from the player the unit should ignore the defend script abd only activate this script when she’s idle (good old guard mode - a button to manage this stance for player units could be useful)
     
    Last edited: Sep 18, 2018
  11. MAeStROx

    MAeStROx

    Joined:
    Mar 20, 2015
    Posts:
    15
    Hi, cool asset, got one question though:
    Any plans for a future upgrade to use unity's new Entity Component System and make it parallel??
     
  12. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    83
    When I place any unit's height at something > 0 then it can't attack. Also, sometimes I get a message on my screen saying "Can't attack with selected unit(s)", even when I don't have a unit selected, and when I do have a selected unit that attacks just fine. Another problem is that if I have LOS for a unit, but am not using a weapon object for it, the unit will not rotate to face its target.
     
    Last edited: Sep 17, 2018
  13. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I agree, with or without LOS activated, the unit should turn to her target before firing in all cases except if she has a turret (behavior works fine now with turrets).
     
    jobo22 likes this.
  14. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    One question concerning double click on a unit to select a group of same units.
    Is it normal that the double click results of the selection of near sale units and that some units at a far distance but visible on screen are not selected ?
    In common games the double click select all same units visible on screen.

    It seems that the area of selection is limited to an limited hidden circle.
     
  15. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Nope.

    Yes, I found the issue and fixed it and will be shipping it as a patch along with few other small things.

    Flying units will from now on defined by having the "Flying Unit" in their Unit component enabled and by having a different layer for its target position collider object). Having a different layer is way more efficient since it makes it faster to differentiate between ground and flying units while picking a destination position for a unit.
     
    jobo22 likes this.
  16. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I thought you had the Escape On Attack enabled for that unit but I guess you are trying to move the unit manually?

    I will only enable defensive attacks mode for local player units that are idle.
    This will however need more refining and a general component that could handle local AI behaviors and orders done by the player must be introduced.
     
  17. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Yup. Really sorry for this, I fixed it and I'm shipping the patch tomorrow.

    This is because the unit rotation while it is idle is handled solely by the Unit component. Therefore you need to have the "Rotate while idle" option enabled for units in this case. The unit's weapon rotation is handled by its the Attack component that it is assigned to.
     
    jobo22 likes this.
  18. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    In the Selection Manager component, there's a field called: "Double Click Selection Size". This field defines the range from the initial unit that got doubled clicked at which units with the same type will be selected.
     
  19. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Yes. That is definitely plan. When transitioning into that mode, all code of the RTS Engine will be refactored and will become even more modular to fit the new system.
     
  20. Durakell

    Durakell

    Joined:
    Sep 17, 2018
    Posts:
    1
    Hello, I'm currently thinking about buying this impressive Unity RTS Engine and I have just two short questions about it:
    As far as I know it is not possible to mix humans and NPCs in one multiplayer match/session at the moment. Someone in this thread also wrote that both modes 'work completely different' and it would really not be easy to change this... This point about NPC+Multiplayer is the one single thing that bothers me/I'm worried about, regarding your RTS Engine.
    Is it true that NPC+Multiplayer is impossible at the moment, and that it would be difficult to change that?
    If this is the case, are you planning to change this in the foreseeable future?
    (It would be awesome if things like 'humans playing cooperative vs. NPCs' would be possible in the future too.)
    Thanks for any reply! :)
     
  21. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Hey there, I answered you over an e-mail a couple days ago. But here's my reply so everyone can see it:

    NPC Factions are getting a huge update and all the code regarding their behavior will be re-written. The goal is to improve the NPC Factions, make the code that modifies them more modular and more importantly make the code more independent. A long term goal is of course having AI in multiplayer games. But that will have to wait for Unity's new multiplayer system to be available. I can not say exactly when this feature will be available but I can definitely see it coming through.
     
    jobo22 likes this.
  22. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    So the NPC update is taking a lot of time as I'm trying to design a good architecture for the whole NPC components. So that you guys stay in touch, I'll be sharing my progress every now and then:

    - The regulations of different unit types by the NPC factions will be now done by a new component under the name: NPC Unit Regulator. This component will have a couple of inputs that will determine how and when the unit type that it is regulating can be created. This way, each unit will be regulated independently.
    - The creation of units will be now handled exclusively by the NPC Unit Creator: It keeps track of all the instances of the NPC Unit Regulator components and with their help, it will command the appropriate task launchers to create units. Any other NPC component that wants to create a unit will have to request it from the NPC Unit Creator.
    - NPC Population Manager will independently handle the NPC faction's population, if the NPC Unit Creator requires more population slots to create units, then it will request that from the NPC Population Manager which might accept or decline depending on how it has been configured to work.

    This might sound more complicated to the system we already have but trust me it isn't. The new AI system will be just more modular allowing you to modify it easily.
     
    digiross, Seling and jobo22 like this.
  23. Gatskop_Software

    Gatskop_Software

    Joined:
    Sep 21, 2014
    Posts:
    86
    i am looking at the asset to buy and got some noob questions
    1. Will I be able to setup single play senarious for example first story only specific building can be available
    2. Will I be able to add rifle shooting units like civil war
    3. Will horse mounted units work
    4. Can i build trenses or buinkers builindings so if units are in the trenses they have more protection

    Sorry for my bad english
     
  24. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Yes, you'll have to set up the maps the way you want.

    Regarding single player and campaign mode, a mission creator is planned but won't be available any time soon. An official integration of a quest/mission builder asset might be available as well but can not be promised soon as well.

    Yes, that is possible. The RTS Engine can handle those types of units.

    You'd have to implement this yourself. I'd say it's fairly easy to do, you simply create a component that checks if certain types of units are in range, if yes then it'll add health to them or something like that and just attach it to the building that delivers this job.
     
  25. Gatskop_Software

    Gatskop_Software

    Joined:
    Sep 21, 2014
    Posts:
    86
    Thanks for the replay I did buy your asset today its very cool do you have a road map for updates?
     
  26. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    Not sure to have seen an answer on this before : is there a simple way to add a save system in the engine ? Something planned maybe ?
     
  27. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    83
    Any timeline for when the next update will be out? And what about the patch that was supposed to fix the units being able to shoot if they are above the ground? Thanks :)
     
  28. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I do have a roadmap for the next three updates and they will mainly target AI & refactoring of the base code in order to improve performance along with probably some small features added and definitely bug fixes. Not the most detailed roadmap I know, but expect more details in the future.
     
  29. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    There's nothing planned right now regarding a save system but there might be something for the future.
     
  30. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    In exactly 15 days the next update will be available. I know I'm taking longer than usual for this one but it's just because of personal commitments, university and me trying to re-write the whole NPC code from scratch. So I'd ask for your patience as always.

    Regarding the patch, I decided not to release it but simply include it in the next update. I'm sorry I didn't inform you about that but I really hope the issues that were supposed to be fixed in the patch aren't stopping you from advancing in creating your RTS. If they do, please let me know and I'll send you the fix privately.
     
    jobo22 likes this.
  31. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    83
    Totally fine, I have plenty of other stuff to work on. Not a rush at all. Was just curious. Excited for the next update though!
     
    OussamaB likes this.
  32. Gatskop_Software

    Gatskop_Software

    Joined:
    Sep 21, 2014
    Posts:
    86
    Thanks for the continues work on updates and support
     
  33. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I tried to build my whole game with the main menu and the single player menu.

    When I launch the game the first time everything is fine, I can create a game and play - win or loose and I return to the main menu.

    But when I click again to start a game, the game is created but the game scene is frozen.
    It is like if the final state of the previous game was always active since we clearly see that the engine stop all actions when we loose or win.

    Is there something missed during the initialization of a new game in the single player menu - maybe in the task of the launch button ?
     
  34. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I have also another question:

    I don't know if it is linked but after I added the MainMenu scene, when I start a game from Unity the camera is not centered on my HQ.

    It is like the function or the parameter linked to the centering of the camera on the player's HQ was deactivated.
    How or where can I verify that the parameters are fine ?
     
  35. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Yes, this is it. The game resets the time scale when the game is finished and setting back the time scale was missing. It was apparently removed by mistake in one of the most recent updates.

    The fix is quite simple. Just open the Game Manager component's script and add the following line at the beginning of the Awake method:

    Code (csharp):
    1. Time.timeScale = 1.0f;
    The fix will be included in the next update for sure.
     
  36. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Weird, whenever I open the map from the menus, the camera is centered on the faction's capital. Can not reproduce this.

    Can you please try the above fix and let me know if this problem gets resolved or not?
     
  37. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    83
    Is there somewhere in the Unit script that locks the x axis rotation of the unit to 0? I can't get it to rotate on that axis. I want to be able to rotate it so that I can align the unit to the terrain when it's going up or down a hill.
    Another thing is that I have made a 1024 x 1024 map and made it so that you can zoom out a decent ways, and when I clicked on certain parts of the map there were dead spots where the selection flash wouldn't show up and my unit wouldn't move. I noticed all your raycasts are sent with a length of 80, I changed some to mathf.infinity and it resolved my problem. Can you change it so they all have a higher length, or make a public variable that we can enter our own length? Thanks! :)
     
    Last edited: Oct 8, 2018
  38. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    Is there already an existing function which calls an effect at a specific location and where we decide to play it in loop or only once?

    In some cases I want to spawn a effect in an update function but the call to the effect pool create lot of instances of the same effect at the corresponding location until the task is done.
     
  39. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    Changed nothing for the camera displacement but I will wait your next update to see if the problem is cleaned by the new files or not.
     
  40. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    Just a feedback concerning turrets:

    When the turret acquires a target near the limit of its range, the turret is flickering between the target angle and the idle angle.

    Could it be possible to add something which avoids the turret to return to her default angle by default and have the turret oriented to last position ?
     
  41. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    If you enable the rotation when the unit is idle, it will only allow rotation on the Y axis. Please disable that and see if the problem persists.

    Oh thanks a lot for pointing this out, I thought I had already changed but somehow not.
     
    jobo22 likes this.
  42. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Attach the Effect Obj component to the effect object you want to spawn and then use the Effect Obj Pool to create it. Check out the Effect Obj Pool component (which is a component of the Attack Manager in the demo scene) and have a look its "GetEffectObj" method.
     
  43. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    83
    @OussamaB Thanks for the help. One more thing is that when I set the main camera's height to 70 or higher, the mini map cursor doesn't follow my camera anymore. And also, I have some hills in my map that when the mini map cursor moves to that area, it doesn't render above the ground so I can't see it. Is there a way to have it always render above the ground?

    EDIT: I just tried disabling the rotate when idle, and I still can't rotate on the x axis.
     
    Last edited: Oct 8, 2018
  44. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Thank you, I'm trying hard to get the NPC thing out of the way and focus on these little issues but it's taking some time. Thanks again for your patience.

    Yes, I just added it and it will be available by the next update.
     
  45. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Updating the minimap cursor occurs in the Camera Movement component and it also uses raycasting with fixed raycast value, can you try to set that value to Mathf.Infinity and see if the issue is fixed?

    The minimap's camera is angled to look at the map from the top view, maybe that's why you can not really differentiate the hills from the flat terrain? Or is the minimap camera buggy when you're moving over hills?
     
  46. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    83
    Changing the raycasts length to Mathf.Infinity fixed the issue of it following the camera. My problem with the hills is that when I move the main camera over them, the mini map cursor doesn't render on the mini map camera, because it goes below the terrain. I see that its height is set to 0, but I can't move it high enough to be higher than my mountain, otherwise it goes above my actual camera and then it won't render either.

    And still can't get the x axis to rotate on my unit, even with rotate when idle disabled.
     
  47. Huntah666

    Huntah666

    Joined:
    Aug 23, 2018
    Posts:
    12
    Hello, great asset this is, just started using it.

    I've searched but haven't found any answer yet, is there a simple way to make one unit type do greater damage to another certain unit type, for example spearman having increased attack while attacking mounted units.
     
  48. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    This is a simple curiosity. Do you plan to create a mobile city building game template like Class of Clan?
     
  49. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Are you attempting to the rotate the unit when it is in idle or not? If not then this may be due to the fact that the Navigation Mesh Agent component is modifying the rotation on movement. Have a look at that component and try decreasing the value of the "Angular Speed" field and let me know if it works.
     
  50. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    This has been requested and will be implemented as soon as possible.
    But you can already implement it using the delegate event OnAttackPerformed which is called whenever an attack is performed.