Search Unity

  1. Dismiss Notice
  2. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  3. Dismiss Notice

Unity RTS Engine

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

  1. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    I agree that the current documentation is more like a reference of the components that the asset has.

    However, going through the documentation in the order it is set up will actually guide you through how to navigate the asset and answer your above questions:
    - You start here: http://soumidelrio.com/docs/unity-rts-engine/getting-started-create-a-new-map/ (first documentation page) and this allows you to create a new map and spawns all required components.
    - The next page will teach how to setup the terrain for your map and how to bake the navmesh.
    - Next page will introduce you to the grid search that each RTS Engine map needs to use.
    - Next one will teach you how to create a new faction type.
    - Next one will be about setting up the Game Manager, the main component of a RTS Engine map scene (this where you set the faction slots for example).
    - Next one is regarding how audio is handled in the RTS Engine.
    - Then it gets into Buildings and that teaches you how to create a building from scratch and what components each building can have (+ the building related manager components).
    - Then it gets into units and that teaches you how to create a unit from scratch and what components each unit can have, etc..
    Until every feature of the asset is covered.

    I recommend that you go through the doc pages at least once so you know what is covered and where you can find it in the future.

    But again, I know this can get quite overwhelming. Another strategy that new users employ is going through the demo game and updating it to get used to how the system works together.

    I am currently in the process of developing RTS Engine 2.0 where major changes will occur (hopefully, it will be released this summer). I will be releasing new API documentation, guides for components and starter guides and videos. But for the current RTS Engine, the documentation will not receive any radical changes.

    If you have any specific questions, please let me know or join our discord server (https://discordapp.com/invite/BsdQNKY) where the community can help you faster than I can mostly.
     
  2. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    As promised, just submitted an update full of crucial bug fixes that you have been reporting over the last weeks.
    Here's a list of 1.5.5 changelog:
    • Fixed a game breaking bug that is triggered when a NPC faction is defeated while having its resource collector units actively collecting a resource.
    • Fixed the "collection modification" error when NPC faction is attempting to place multiple buildings.
    • Fixed a bug where NPC factions ignore the building requirements when attempting to place a building.
    • Fixed a bug that resets a building center (building with a Border component) resources in range for a NPC faction when destroyed.
    • Fixed a bug that occurs when a NPC faction upgrades a faction entity using an upgrade task from a task launcher and the NPCUpgradeManager keeps tracking the used upgrade task.
    • Fixed a bug that renders a faction's capital building unassigned when it is upgraded.
    • Fixed a bug that allowed resource collectors to continue collecting resources when they have reached their maximum capacity with no drop off building available.
    • Fixed a bug that allowed units that can move and attack to attack their targets even when they are outside of their assigned attack ranges.
    • Fixed a bug that blocked attack units from engaging with their targets when they are already inside the assigned attack range when their target is locked.
    • Fixed an issue with applying the panning limit to the camera position when updating it via clicking on the Minimap camera.
    • Fixed a bug with the ResourceGenerator component where generated resources are still produced even when required resources are not available.
    • Fixed a bug where a resource's minimap icon becomes visible when its secondary model is enabled while it is supposed to remain invisible in FoW.
    • Fixed an issue where the color of disabled tasks does not get reset.
    • Fixed an issue where the local player's faction ID is set after resource UI elements are initiated which leads to the resource amount not being updated correctly (happens mostly for clients in a multiplayer game).
    • Added the option to make the attack object's trigger effect look at the target when it is created.
    • Added the option to specify the initial rotation of an attack object when it spawns in delay mode.
    • Updated the building placement requirements so that required entities can be either spawned units or buildings and added the option to set the amount of the required spawned faction entities.
    As always, the full changelog can be found at: http://soumidelrio.com/assets/rts-engine/changelog/
     
    spalamas likes this.
  3. RelitNadami

    RelitNadami

    Joined:
    Jan 3, 2020
    Posts:
    11
    Hello! I have a new problem! I'm here to get help!
    I've created a NPC faction, but I can't solve a regulator problem! I can't find the setting to fix for it to work.
    I can not find or insert the regulator, I put regulators in the Hierarchy/Building/Regulator data but its does not correct the default code

    Thank you in advance for your reply.

    AssertionException: Assertion failure. Value was False
    Expected: True
    [NPCBuildingConstructor] NPC Faction ID: 1 doesn't have a builder regulator assigned!
    UnityEngine.Assertions.Assert.Fail (System.String message, System.String userMessage) (at C:/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBase.cs:29)
    UnityEngine.Assertions.Assert.IsTrue (System.Boolean condition, System.String message) (at C:/buildslave/unity/build/Runtime/Export/Assertions/Assert/AssertBool.cs:20)
    RTSEngine.NPCBuildingConstructor.ActivateBuilderRegulator () (at Assets/RTS Engine/AI/Scripts/NPCBuildingConstructor.cs:92)
    RTSEngine.NPCBuildingConstructor.Init (RTSEngine.GameManager gameMgr, RTSEngine.NPCManager npcMgr, RTSEngine.FactionManager factionMgr) (at Assets/RTS Engine/AI/Scripts/NPCBuildingConstructor.cs:54)
    RTSEngine.NPCManager.OnFactionDefaultEntitiesInit (RTSEngine.FactionSlot factionSlot) (at Assets/RTS Engine/AI/Scripts/NPCManager.cs:74)
    RTSEngine.CustomEvents.OnFactionDefaultEntitiesInit (RTSEngine.FactionSlot factionSlot) (at Assets/RTS Engine/Scripting/Scripts/CustomEvents.cs:469)
    RTSEngine.FactionSlot.SpawnFactionEntities (RTSEngine.GameManager gameMgr) (at Assets/RTS Engine/Game Managers/Scripts/FactionSlot.cs:247)
    RTSEngine.GameManager.InitDefaultEntities () (at Assets/RTS Engine/Game Managers/Scripts/GameManager.cs:335)
    RTSEngine.GameManager.Awake () (at Assets/RTS Engine/Game Managers/Scripts/GameManager.cs:180)
     
    adamcheong likes this.
  4. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    You need to assign a builder unit (that has a valid NPC regulator assigned to its Unit component) to the NPCBuildingConstructor component.

    Please note that this assertion will be removed and replaced with a simple warning as you might want to have a NPC faction without a builder unit since this is not really game breaking.
     
  5. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    Update 1.5.5 is now live on the Asset Store!
     
    spalamas likes this.
  6. RelitNadami

    RelitNadami

    Joined:
    Jan 3, 2020
    Posts:
    11
    Thanks for the response OussamaB
     
  7. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,532
    Thanks for all your hard work OussamaB
     
  8. RelitNadami

    RelitNadami

    Joined:
    Jan 3, 2020
    Posts:
    11
    Hi it's still me, I know it's on the long list of improvements you'd like to make to your asset RTS engine water units tag.
    In one of my new projects I would like to use this feature so I got into changing the code! But I'm very novice to see downright a finished beginner!
    But I'm trying! Could you give me your sure opinion how to do this?
    I understood that I had to use the layers, I fiddled the code a little clumsily but I'm blocked I can not integrate my problem code of Monobheviurs, and also a problem I change the code but it "
    Using RTSEngine. Movement;
    Using RTSEngine. Animation;
    Using RTSEngine. IU;"
    I do not know (probably because I start in code) how to change his "stuff" I do not find them in script!
    I hope I don't disturb you! If you could give me your altering tracks to create boats!
    Thanks in advance I would do my best, I hope to get there
     
  9. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    By water units, do you mean units that can only move on certain areas? If yes then having water units in the RTS Engine is already feasible. You just need to have the NavMeshAgent component "Area Mask" set to the water area that you create from the Navmesh tab.
    It is basically the same technique used for air units that have their own navmesh area mask baked into the air.

    You don't really need to modify any code to have water units. If the above tip is still unclear, I can go into further details to help you set up water units. Let me know!
     
  10. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    Just submitted 1.5.6 to the Asset Store. This update is concentrated again on more bug fixes and small additions that have been requested lately. At the same time, more work is being put into RTS Engine 2.0 and more details about that will be shared soon.

    Here are the main changes:
    • Fixed an error triggered when an entity is (de)selected while not having a default cursor texture assigned in the TaskManager's inspector.
    • Fixed issue that activates the NPC Defense Manager when its "Can Defend" property is disabled which makes the defense status activated forever.
    • Fixed an issue where the population slots of upgraded unit instances are reset.
    • Fixed assigning targets to Converter.
    • Fixed auto behavior for Converter, Healer and Builder.
    • Fixed triggering healer and converter animations.
    • Fixed an issue that disallowed NPC factions from placing buildings outside their borders.
    • Fixed an issue where NPC faction buildings are not tracked on a global scale (for the whole faction) and not just on a building center scale when the latter option is disabled.
    • Fixed an issue where air units look down at their creator building for the first frame they spawn at.
    • Fixed an issue where Line of Sight can be enabled for attack buildings.
    • Added a "spacing" option when defining a movement formation which allows to increase space between units in formation.
    • Updated NPC attack entities to search their usual search range around their position and the territory of their faction when NPC faction defense status is active.
    • Added the option to have multiple interaction positions for APCs (this feature might not work as expected but it will be fully added in V2).
    As always, the full changelog can be found at: http://soumidelrio.com/assets/rts-engine/changelog/
     
  11. EGSDarknuke

    EGSDarknuke

    Joined:
    Dec 6, 2012
    Posts:
    16
    I made a new unit with a custom 3d model, rather than the built in capsule. With the capsule, it works perfectly, but as soon as I put in the 3d model, it can be selected, but it won't move and the UI info (like name, hp, description, buildings) won't appear. Do you know why this is happening?

    I attached an image: https://imgur.com/a/ozKGQJN

    There is literally nothing different about the 3d modeled unit except that I dumped the capsule and added the model. I did also drag the model into the "model" slot on the unit component and set the new model to "unit" layer.

    Solved: Made a new unit from scratch and added it in under the root of UnitModel, instead of replacing it. Kept all references as is. That seemed to fix it for whatever reason, but I'll take it.
     
    Last edited: Jun 17, 2020
    OussamaB likes this.
  12. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    I know you solved the issue by now but were you having any errors before? That usually helps identify what the issue is and will help you prevent it in the future.
     
  13. EGSDarknuke

    EGSDarknuke

    Joined:
    Dec 6, 2012
    Posts:
    16
    Yeah I was getting errors. It was a null reference for the unit component, which I imagined was the associated model. I'm still not 100% sure why it happened, but it fixed itself when I made the model a child of the "UnitModel" gameobject instead of the actual model's parent.

    New question, though: Is there any way to restrict audio so that one unit only plays one sound to completion before playing another? It is incredibly annoying when I spam right click and get a stopped and restarted sound from the unit. Starcraft has one sound to completion, the another. It's much easier on the ears.
     
  14. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    You're right, this should be the default behavior actually. I have added this to my todo list. Expect this in the next patch.
     
  15. spalamas

    spalamas

    Joined:
    Aug 30, 2019
    Posts:
    26
    Hello,

    I need some help with a problem I have. I have made a Cannon Unit which works fine on land. However I want to place some cannons on the walls of a castle. When I place the Cannon high on the wall the cannon will fall and land on the ground when I run the game. Actually this happens with every unit. If I place a soldier unit on the wall it will fall as well. I noticed that this happens due to the navigation agent component attached to the unit. I dissabled it but RTS seems to enable it when running the application. I removed it and the RTS will through exception RTSEngine.Wander.Update. Note that I don't want the cannon Unit to move around. I just want it there sitting on the wall and attacking closing enemies. What can I do?

    Thanks!
     
  16. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    The navigation agent component is required for pathfinding. The RTS Engine uses Unity's navmesh pathfinding for unit movement so disabling it will actually break the asset.

    What you can do here is bake the navigation mesh over the wall objects where you want your units to stand and move. That way, the navmesh agent component will recognize the walls roofs as a navigatable area and they will be able to move to it and stay there.
     
    spalamas likes this.
  17. EGSDarknuke

    EGSDarknuke

    Joined:
    Dec 6, 2012
    Posts:
    16
    I have a question: I'm noticing that when I use the Attack Override Animator, that it just plain overrides the normal Override I'm using, perpetually. My assumption is that the base Override is for all default animations for a unit and the Attack Override is only used when attacking. If not attacking, it goes back to normal.

    In application, this is what I'm using it for:

    By default, my soldier runs with their rifle down. If I attack, without the attack override, they will bring the gun up, then put the gun down, back into the idle stance. It looks unnatural.

    With the Attack Override, while attacking, I change the idle stance to be the same as the attack stance, so when it changes back to idle, it doesn't change poses. This looks much more natural, but looks weird when they aren't targeting anyone.

    Am I using Attack Overrides wrong or this maybe a bug?

    ---------

    Second question: With projectile attacks, I'm noticing that no matter what I do, my projectiles will prematurely detonate on objects in their path, no matter if I set the obstacle layer mask to nothing or everything. I want the projectile to go straight to the targeted enemy. Am I doing something wrong here? https://imgur.com/a/ti0QPsn

    Edit: Worked second question out. I needed to set my sphere collider to trigger and my rigidbody to kinematic. Woops!
     
    Last edited: Jun 28, 2020
  18. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    It's a bug yes, the animator override controller does not get reset when the attack state is stopped!
    The fix will be part of the next update but you can send me your invoice number in a PM or via e-mail and I'll send you the fix.

    Thanks a lot for reporting this.

    Glad it worked out!
     
  19. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    Hello everyone, I have announced recently that I am working on a major upgrade for this asset (RTS Engine 2.0).

    I have decided to start posting dev updates about the major upgrade in the Discord server so if you haven't joined yet, come join us in Discord: https://discordapp.com/invite/BsdQNKY
     
  20. spalamas

    spalamas

    Joined:
    Aug 30, 2019
    Posts:
    26
    I found a workaround that seems to work for me. As I don't want the unit to move around on the wall just sit there and attack whenever something comes close, I discovered that setting on the Nav Mesh Agent component the "Area Mask" property to "Nothing" does the trick for me. The unit stands on the wall, animates and attacks. I just get a warning "Failed to create agent as it's not close enough to Nav Mesh" but that's not a game breaker.

    I tried your solution however and it works like a charm! No warnings, everything fine!

    Thanks for you reply!
     
    Last edited: Jul 7, 2020
  21. RelitNadami

    RelitNadami

    Joined:
    Jan 3, 2020
    Posts:
    11
    Hello today I still have a problem!
    My unit selects it has a life bar but refuses to move it has animation.
    Son of my error code
    NullReferenceEXeotuib; Undefined object reference on an instance of an object
    RTSEngine.EntityComponent.unitMoment.fixedUdpade () (active/rts engine/units/sctipts/UnitMovient.cs229
    And when I click to move the unit on UnitComponent.cs:104
    I do not understand according to the code line my unit and dead yet I do not have the animation dead.
    In short my character refuses to move
     
  22. RelitNadami

    RelitNadami

    Joined:
    Jan 3, 2020
    Posts:
    11
    I noticed during my bake navmesh my unit was not detected by the navmesh!
     
  23. EGSDarknuke

    EGSDarknuke

    Joined:
    Dec 6, 2012
    Posts:
    16
    New problem: I have a particle projectile I'm firing and I'm getting the error message after every 3rd shot (4 on the first one):
    MissingReferenceException: The object of type 'EffectObj' 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.

    According to the breakpoint, it looks like it's coming from the child pairing of the hit effect with the target. I confirmed this when I unticked "Destroy on Damage" from the projectile Attack Script. That caused the hit effect to spam itself a ton and cause a lot of copies. I believe your pool of effects are trying to access this hit effect AFTER it's been destroyed or seek another hit effect in the pool. If there are no other hit effects in the pool, it throws the error.

    The weird thing is, it seems like this only occurs when the PROJECTILE is deleted from the pool, not the HIT. It looks like it creates the projectile on the first shot (which is the error after the first cycle), reuses it, then deletes it, requiring it to be remade after (on the error shot). So maybe the script is trying to access the hit BEFORE the projectile is spawned?

    Things that don't make a difference that I've tried: Enabling/disabling Lifetime in the EffectObj script, changing the lifetime or duration to any number in either the EffectObj script or the particle's own script, removing the hit or trigger particle from the Attack Script, or setting "Child on Damage" to true.

    The only thing that reliably fixes this is turning off "Destroy on Damage." Am I doing it wrong or is this a bug?

    Oh and thanks for the offer on the fix. I will wait till 2.0 releases. If I somehow manage to get my game beta ready before you get 2.0 out, I'll message you, but I doubt I'll beat you haha. I can pretend like they are fixed and just let them work themselves out with updates.
     
  24. RelitNadami

    RelitNadami

    Joined:
    Jan 3, 2020
    Posts:
    11
    Hi other my model problem I look for put water! Its ma indeed the possible area with the manager field as for the area! Now I have to voice if I get put a building that creates units in the water area and see if it moves.
     
  25. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    Hello, was how you fixed the issue below or is this another symptom of the issue? I assume it is the former but just making sure!

     
  26. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    I am not entirely sure what is the reason behind this.

    The archer's arrow attack object is configured exactly like you described above: It has "Destroy On Damage" and has "Child On Damage" enabled.

    The effect objects pool does keep any reference to any active effect object. Only when is the effect object disabled (from the EffectObj component), will it be re-added to the pool to be re-used again.

    Maybe I have missed something here?

    Is the PROJECTILE here the same object as the HIT object? The sentence in bold is the one I'm having trouble interpreting.

    How can I reproduce this issue on my end with demo game assets or with a fresh RTS Engine map? Would appreciate if you can either set up a test scene to reproduce the issue or give me clear instructions on how to configure the attack objects. Thank you!
     
  27. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    It is definitely feasible. You have to create a new navmesh area for the water and make sure that your water units have that and not the default "Walkable" one in their NavMeshAgent "Area Mask" field.

    As for the building that would create the water units, you can have one that is placable on the ground terrain but has its spawn position in the water. That way, you make sure that the created water units will spawn in the water navmesh area!
     
  28. spalamas

    spalamas

    Joined:
    Aug 30, 2019
    Posts:
    26
    Hello,

    a question: What can I do to make an RTS scene to start directly with a default scenario? On your sample game the "battle" scene is loaded with a scenario by a preceeding menu scene which uses a ScenarioLoader object and calling it's load method. The scenarioLoader object is transfered on the buttle scene and there the GameManager finds it and assigns the loaded scenario on the missionmanager.

    I want the scene to directly start with a scenario loaded. I tried to put a ScenarioLoader object directly on my battlescene and assigned it from the inspector the scenario I wanted, but it is just destroyed by the GameManager when it starts since the ScenarioLoader.Load() method was not called during the loading of the scene and the scenario is ignored.

    I hope I made clear what I am asking.

    Thanks.
     
  29. spalamas

    spalamas

    Joined:
    Aug 30, 2019
    Posts:
    26
    Something other I noticed today. After the last update of the RTS I get some exceptions when NPC units are getting killed (The game does not stall however). From the exception messages I was able to track the source of the problem. It is the NPCDefendManager. If "Unit Support Enabled" is checked it causes these exceptions. I suppose units are "calling from help" from other NPC Units which are in the meantime getting killed. If I dissable the "Unit Support Enabled" I get no exceptions.

    MissingReferenceException: The object of type 'Unit' 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.NPCDefenseManager+<>c__DisplayClass18_0.<OnUnitSupportRequest>b__0 (RTSEngine.Unit unit) (at Assets/RTS Engine/AI/Scripts/NPCDefenseManager.cs:227)
    System.Linq.Enumerable+WhereListIterator`1[TSource].ToList () (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
    RTSEngine.NPCDefenseManager.OnUnitSupportRequest (UnityEngine.Vector3 position, RTSEngine.FactionEntity target) (at Assets/RTS Engine/AI/Scripts/NPCDefenseManager.cs:226)
    RTSEngine.NPCDefenseManager.OnFactionEntityHealthUpdated (RTSEngine.FactionEntity factionEntity, System.Int32 value, RTSEngine.FactionEntity source) (at Assets/RTS Engine/AI/Scripts/NPCDefenseManager.cs:99)
    RTSEngine.CustomEvents.OnFactionEntityHealthUpdated (RTSEngine.FactionEntity factionEntity, System.Int32 value, RTSEngine.FactionEntity source) (at Assets/RTS Engine/Scripting/Scripts/CustomEvents.cs:183)
    RTSEngine.FactionEntityHealth.OnHealthUpdated (System.Int32 value, RTSEngine.FactionEntity source) (at Assets/RTS Engine/Faction Entity/Scripts/FactionEntityHealth.cs:180)
    RTSEngine.UnitHealth.OnHealthUpdated (System.Int32 value, RTSEngine.FactionEntity source) (at Assets/RTS Engine/Units/Scripts/UnitHealth.cs:34)
    RTSEngine.FactionEntityHealth.AddHealthLocal (System.Int32 value, RTSEngine.FactionEntity source) (at Assets/RTS Engine/Faction Entity/Scripts/FactionEntityHealth.cs:134)
    RTSEngine.FactionEntityHealth.AddHealth (System.Int32 value, RTSEngine.FactionEntity source) (at Assets/RTS Engine/Faction Entity/Scripts/FactionEntityHealth.cs:100)
    RTSEngine.Attack.AttackDamage.DealDamage (RTSEngine.FactionEntity target) (at Assets/RTS Engine/Attack Behavior/Scripts/AttackDamage.cs:156)
    RTSEngine.Attack.AttackDamage.TriggerAttack (RTSEngine.FactionEntity target, UnityEngine.Vector3 targetPosition, System.Int32 sourceFactionID, System.Boolean updateDamage) (at Assets/RTS Engine/Attack Behavior/Scripts/AttackDamage.cs:124)
    RTSEngine.Attack.AttackObject.ApplyDamage (UnityEngine.GameObject targetObject, RTSEngine.FactionEntity target, UnityEngine.Vector3 targetPosition) (at Assets/RTS Engine/Attack Behavior/Scripts/AttackObject.cs:216)
    RTSEngine.Attack.AttackObject.OnTriggerEnter (UnityEngine.Collider other) (at Assets/RTS Engine/Attack Behavior/Scripts/AttackObject.cs:210)​
     
    Last edited: Jul 15, 2020
  30. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    You can pre-assign the scenario in the MissionManager component in your scene and it should activate that scenario for you when the scene starts. In this case, you do not really need the ScenarioLoader.

    There is however a small issue with directly activating scenarios which has been fixed and will be part of the next patch. You can contact me privately with your invoice number and I'll send you the fix directly so you do not have to wait for the patch.
     
  31. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    Thanks for reporting this issue. The fix will be part of the upcoming patch.
     
  32. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    Just submitted a patch with fixes of the bugs that have been reported in the last couple of days. As I mentioned before, more work continues to be done towards releasing V2 major upgrade soon and details regarding that progress can be found in the discord server! Here's main the changes list of patch 1.5.7:
    • Fixed missing key components in the NewResource prefab.
    • Fixed a bug where the unit animator override controller does not get reset after the unit exists its attacking state.
    • Fixed a bug that causes the minimap icon of spawned units to be distorted when they created from a building whose height (position on the y axis) is different than 0).
    • Fixed a bug that allowed a faction to have its defeat procedure executed more than once when it has more than one building marked as a faction capital and one of them gets destroyed when the defeat condition is set to "Destroy Capital".
    • Fixed an issue where a unit instance inside an APC is upgraded by leaving its old instance marked as still inside the APC even after it is destroyed due to the upgrade.
    • Fixed a bug that rendered the MissionManager inactive when there's a pre-assigned scenario.
    • Fixed an issue that arises when NPC faction attack units are actively engaging their assigned target(s) while the NPC Defense Manager component unit support option is enabled.
    • Updated Camera Controller pan, zoom and rotation logic from FixedUpdate to LateUpdate to make sure that all other objects can move first before the main camera moves to avoid stuttering issues when the camera is following/centering a target unit for example.
    • Added the option to allow a builder to construct buildings assigned in its restrictions list but just disable its ability to place them.
    • Updated the APC component to only allow unit ejection when the ejection position is within a movable area for the unit to eject.
    As always, the full changelog can be found at: http://soumidelrio.com/assets/rts-engine/changelog/
     
  33. RelitNadami

    RelitNadami

    Joined:
    Jan 3, 2020
    Posts:
    11
    Thank you OussamaB I was able to resume the construction of my game thanks to you!
     
    OussamaB likes this.
  34. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    Patch 1.5.7 is now live on the Asset Store!
     
  35. blafed

    blafed

    Joined:
    Sep 24, 2015
    Posts:
    5
    hey how can i use 2d animated
    sprites with 2.5D isometeric look
     
  36. shubhank008

    shubhank008

    Joined:
    Apr 3, 2014
    Posts:
    88
    ----UPDATING FOR ANYONE USING SYNTY ASSETS-------
    fixed. Synty's map comes with its own main camera which is hidden in 2 levels of game objects, disabled it (so scene only has 1 main cam) and its running as it should now
    ---------------------------------------------------------------------------------


    okay I just created a blank scene, imported rts engine following the docs and configured my map

    I disabled the default terrain and imported a synty studio map instead

    selected all its ground objects, changed layer to terrain, made them walkable via navigation system and baked them
    they are navigation static, tried static too but nothing

    but when I select the unit and click to move my unit doesnt move (neither my custom nor the default capsule)
    however clicking on minimap moves them

    further, I can only select my unit by click and drag/selecting them and not by directly clicking on them (i.e. click on unit 1 to select it)
    movement aside whats even weird is why can I select units by clicking on them if using default terrain but as soon as I disable it and enable my map, I can only select units by dragging a selection box and not by clicking on them

    both of these work in default plane terrain but just not in custom terrain map I am using





    This is my character setup
    Unity_m3AYQPoQlO.png





    The tiles/ground part of map do not have any colliders on if it matters, I tried adding mesh or box collider but no effect. All of these ground tiles are marked terrain and walkabled and baked into navmesh
    Unity_x3oZnwW6nh.png
    but still no movement or character selection

    here is how my grid looks

    Unity_0lNnrWXbKR.png


    covers whole map
    Unity_uJk5aSm0J3.jpg

    As a random test, I added a plane disabled its mesh render and added a mesh collider on it. Now I can drag select my units and click on map to move them but they move oposite direrction. Like if I click somewhere top, they move bot, if I click right they go left

    Unity_LJqDnQnITj.jpg



    however clicking on minimap makes them move proper target location and direction
    search grid is within terrain's ground meshes (no collider) but extends beyond the plane (collider)
    I disable that plane object and directly add colliders to the ground tiles/objects it again doesnt work no matter if I add box collider or mesh
    I think this movement issue and cannot select unit issue are related as I ccan only select my units if I drag and create a selection box. I cannot click and select them

    Somehow it works in default plane terrain but not any custom one

    ----UPDATING FOR ANYONE USING SYNTY ASSETS-------
    fixed. Synty's map comes with its own main camera which is hidden in 2 levels of game objects, disabled it (so scene only has 1 main cam) and its running as it should now
    ---------------------------------------------------------------------------------
     
    Last edited: Jul 30, 2020
    OussamaB likes this.
  37. spalamas

    spalamas

    Joined:
    Aug 30, 2019
    Posts:
    26
    Hello,

    I have installed the last update (1.7). Something's going on with the death animations of my units. Sometimes they are not played and some times they are. Sometimes the units just die and they are destroyed (I have se the destroy option so they dissapear after a while). I have death animations set on the overideControler (I use the same animationOverideControler on both the Unit and the Attack Components).

    After a more closer inspection I think the death animation is not played if the unit is getting killed while in attacking mode. However on the attack animation overide I have defined Death animation.
     
    Last edited: Aug 2, 2020
  38. alexmcmanaway

    alexmcmanaway

    Joined:
    Aug 3, 2020
    Posts:
    2
    So, I just bought this a few hours ago and I've been looking through it...I can't make heads or tails of it lol. Is there a tutorial I can read, or a video I can watch just to help me figure out to do...anything? 'Cause I found all the prefabs and I see how you can edit them, but I don't know how to make new units or buildings, how to make attacks or abilities, how to make new factions, how to make maps...I can't even make it copy and paste existing game objects. If anyone could help, I'd greatly appreciate it.
     
  39. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    Hello, the RTS Engine currently supports 3D out of the box and what I mean here is that components rely on 3D physics callbacks (for collision for example) and not the 2D ones, since in Unity, these are separate.
    So a solution here would to be use 2D or 2.5D elements but hook them up with 3D physics components which will work in Unity.
    In the future, the RTS Engine will have native support for 2D physics!
     
  40. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    Hello there,

    Thanks a lot for reporting this issue. I have made changes to the animator in the last update and this led me to discover an issue with it (especially with the help of your report so I appreciate that you took closer inspection and determined where the issue happens exactly).

    I have fixed it and will be submitting a patch to the 1.5.7 update to include the fix (and any other I am going to add today). If you want to have this fixed before the patch hits the store, please e-mail me with your invoice number! Thank you!
     
    spalamas likes this.
  41. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    Hello there, I am aware that the documentation could use better beginner guides and that is going to happen for the major upgrade I am currently working on (which you will get for free since you bought the current version), I am currently dedicating most of my time available to work on the asset to work on the upgrade.

    But for now, I have started adding basic getting started guides so please take a look here and let me know if this helps or not, depending on your feedback for these two tutorials, I will work on adding more regarding getting basic stuff up and running in the RTS Engine: http://soumidelrio.com/docs/unity-rts-engine/beginner-tutorials/
    There are currently two main tutorials: one is for setting up a new map scene and the next one highlights the documentation pages that will linearly guide you through creating a building from scratch. The documentation is lied in such a way that it allows you to pick up the basic functionalities of the asset as you read it linearly but with the tutorials (especially the one about creating a building) aim to highlight what doc pages allow you to achieve exactly that. So please let me know how it goes with these first two here.
     
  42. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    I have submitted patch 1.5.7.1 which includes fixes to issues that I have fixed earlier today:
    • Fixed a bug that triggered TaskLauncher related events when it is attached to a building and the building is destroyed before it is fully constructed for the first time.
    • Fixed an issue that resets the unit's animator parameters and states when its override controller is changed while the unit is in its "dead" state.
     
    spalamas likes this.
  43. spalamas

    spalamas

    Joined:
    Aug 30, 2019
    Posts:
    26
    Hello there! A question. I have a castle and some canons on its walls. I want the canons to fire on enemies but only when they are on a ceratin angle range. I have set the anglevelocity of the canon to 0 so it won't rotate, just look ahead. I have tried to set the LosAngle value but it does not work as I expected. Also the documentation says little about the LOS adjustment. So I have some questions.
    1. The X,Y.,Z axes are those of the model or the world axes (I suppose they are model axis)? Couse while Y axis remain the same the X and Z model and world axes differ in orientation when my Unit is placed with rotation around Y axis.
    2. The left-right rotation of the canon is defined around Y axis right? So if I want the canon to shoot only ahead and not too far on the left and right side then I have to adjust a small LOS angle (e.g. 30 degrees) and I am axpecting it to shoot only 15 degrees on its left and 15 on its right. However the canon shoots even in extreme left and right corners. The same happens to height. If I want it to shoot only on relatively far targets (a canon would not shoot an enemy which is right "under its nose".

    Can you please help me? Maybe I haven;t understand how LOS works. Can you please tell me which parameters would make my canon (which I repaet is high on a wall) shoot only ahead and distant and not shoot targets that are either to close (under the wall where the canon is placed) or far on the sides (too left or too right)?

    Thanks! canon.png
     
    Last edited: Aug 5, 2020
  44. alexmcmanaway

    alexmcmanaway

    Joined:
    Aug 3, 2020
    Posts:
    2
    Sorry it took me so long to respond, especially after your own speedy response. This is immensely helpful. I'm looking through the tutorials now. I think they will help me figure things out, but if I have any more questions, I will let you know. Thanks again!
     
  45. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    This seems to be the issue with Line of Sight not respecting obstacles. This has been fixed and the LOS will be able to handle obstacles under a layer that you can define for each attack type so that the attack is only launched when there's no obstacle standing in the way of the attacker.

    Thanks for the detailed report.
     
  46. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    While most of my time is going into working on the major upgrade at the moment, here are some bug fixes that have been recently reported + some features from v2 that have been requested by a couple users in the last few days. Update v1.5.8 is now live on the asset store.

    Here's the changelog:
    • Fixed a bug that distorted the attack object's rotation when it is enabled while in delay time.
    • Fixed a bug that occurs with the most recent versions of Mirror where factions are not assigned their correct IDs from the network lobby components (because they get reset when the game starts) by allowing RTS Engine components to determine the faction IDs.
    • Fixed a bug that occurs when a resource has the same primary and secondary selection objects hooked to it.
    • Added basic obstacle line of sight checking using Linecast and a LayerMask for obstacles that can be individually chosen for each attack type.
    • Added AudioClipFetcherCooldown class to be used for the audio clip fetcher for a selection audio of an entity so that spamming the selection of the entity does not trigger the selection audio to be played every time. This feature will be further extended in v2 to support optional cooldown for all audio clip fetchers in the RTS Engine.

    As always, the full changelog can be found at: http://soumidelrio.com/assets/rts-engine/changelog/
     
  47. spalamas

    spalamas

    Joined:
    Aug 30, 2019
    Posts:
    26
    Hello!

    Today I upgraded Unity to 2019.4.9f1 from 2019.4.8f1. I upgraded my project to 2019.4.9 and noticed that something is broken with the villagers collecting procedure.

    Everything worked fine until 2019.4.8 but in 2019.4.9 the villagers:
    1. Will start collecting resources but they won't execute the animation overide defined for collecting the SPECIFIC RESOURCE. If there is no special overide for the specifc resource on the "RESOURCE COLLECTOR" componet the GENERAL collection overide WORKS!.
    2.
    After the unit finishes collecting it will animate back to drop off collectted resources and this works fine.
    3. After drop-off the villager will stop animate (won't execute the walk animation back to the resource) it will just slide there.
    4. Once the villager reaches back to the resource it will stand there doing nothing! You have to assign a different resource to collect in order to start moving again and repeat all the above.

    During the above there are no exceptions raised in Unity.
     
    Last edited: Aug 27, 2020
  48. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    Hello, I have located the issue. It seems that changing the animator override controller now resets the parameters of the animator. I am going to include this fix into the next patch but I can send it to you if you provide me your E-mail and invoice number in a private message. Thanks for reporting it!
     
  49. spalamas

    spalamas

    Joined:
    Aug 30, 2019
    Posts:
    26
    Ι can wait for your next update. For the time being I switched Unity back to 2019.4.8 . Thanks!
     
  50. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,469
    Alright. I have sent you the fix through Discord anyway.
     
unityunity