Search Unity

Unity RTS Engine

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

  1. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Please try the following and let me know if it got you the behavior you wanted from the AI:

    - In the NPC Resource component, under Resource Collection Settings, try to increase the "Resource Need Ratio Range", having this higher than 1 means that the AI will only spend resources on something IF it has more than the required amount (which means that the AI will always have resources left after spending some and will not end up without resources). For example when that value is 2, the AI has only 100 wood and creating a soldier requires exactly 100 wood, the AI will be only able to spend that 100 wood if it has 200 or above meaning that it will be forced to collect wood in this case (collecting wood requires resource collectors and this how the AI will create resource collectors before attempting to create soldiers).

    - In the NPC Resource component, under Resource Collection Settings, try to modify the "Default Resource Exploit Range". This defines how the AI collects resource by default (without having any actual need for them at that moment) which guarantees that the AI will always be collecting resources no matter what.

    - In the NPC Army component, under Army Unit Management, try to increase the "Check Army Reload". That field defines how often the AI attempts to create army units. You can also have direct access to that value so you can write your custom AI behavior that (while having that field set to a very high value at the beginning of the game) decreases the that value periodically until you hit a minimum value that you define. This allows for the AI to take care of resource collection, basic building placement and other things at the beginning of the game and once all that's setup, the "Check Army Reload" will have a normal value and the AI will focus back on creating army units.

    - In the NPC Army component, under Army Unit Management, make sure that you have realistic values for both the "Non Attack Units Ratio" and "Max Non Attack Units" which basically imposes a limit on creating units that don't have an attack army (and thus unable to attack or defend).

    You can also exploit other fields in the 3 main NPC components and note the difference in the AI's behavior each time till you get the behavior you want. Any suggestion regarding NPC is as always more than welcome!

    Are you sure that you have assigned the model under the Building Model field in the Building component?
     
  2. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    You can pick boundaries for the camera movement (in the Camera Movement component, under Camera Movement) and not allow your camera to go over the dead zone you chose even though the flat terrain is larger than the main terrain.
     
  3. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    As I was tracing why the Main Obj hasn't been assigned, I have a question: is there a building center (one that has the Border component) in your scene for the faction that's trying to place the building?
     
  4. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    84
    Yes for both faction building centers, I noticed that when I enter play mode the game manager removes the faction manger of the faction that's giving the error. I don't know if that's supposed to happen.
     
  5. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Entering playmode directly inside the map scene? Or coming from the single player menu?
     
  6. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    84
    Entering the map directly.
     
  7. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Can you confirm it's not happening in the demo scene? I'd like to know if it has to do with the configuration of the building itself or another managing component. Simply try to use that same building that gets the error in the demo scene and let me know how it goes.
     
  8. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    84
    W
    Would it be ok to use the building center from the demo scene? those have all the necessary requisites.
     
  9. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Can you test once using them and once by replacing them with your own building center?
     
  10. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    84
    I get the same result. Could there be something wrong with my faction manger?
     
  11. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    After further looking into this, can you please check the following things:

    - Are you spawning the building by default? If yes, can you make sure it has a valid Faction ID?
    - Can you make sure that all factions that their Faction Manager components set in the scene?
    - Make sure if these faction managers are correctly assigned in the Game Manager?
    - Does each NPC Faction has its main 3 components (NPC Army, NPC Resource and most importantly in this case the NPC Building Placement) in the scene?
    - If all NPC components are present, are you sure they have a valid Faction ID in the inspector?
     
  12. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    84
    Yes it s
    Yess it seems i forgot the NPC building Placement, but now im getting the error code:

    Can't find the AI Faction Manager for Faction ID: 1
    UnityEngine.Debug:LogError(Object)
    RTSEngine.NPCArmy:Awake() (at Assets/RTS Engine/AI/Scripts/NPCArmy.cs:163)

    Can't find the AI Faction Manager for Faction ID: 1
    UnityEngine.Debug:LogError(Object)
    RTSEngine.NPCResource:Awake() (at Assets/RTS Engine/AI/Scripts/NPCResource.cs:157)

    Can't find the AI Faction Manager for Faction ID: 1
    UnityEngine.Debug:LogError(Object)
    RTSEngine.NPCBuildingPlacement:Awake() (at Assets/RTS Engine/AI/Scripts/NPCBuildingPlacement.cs:86)

    Can't find the AI Faction Manager for Faction ID: 1
    UnityEngine.Debug:LogError(Object)
    RTSEngine.NPCUnitSpawner:Awake() (at Assets/RTS Engine/AI/Scripts/NPCUnitSpawner.cs:60)

    that's because for some reason when i press play the game manger removes its faction manger.
     
  13. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    The Faction Manager only gets removed if it has an invalid Faction ID. Can you check the inspector of each one of your Faction Manager components in the scene and see if they have a Faction ID that is equal or bigger than the faction slots in the Game Manager?
     
  14. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    84
    I see what you mean I went back to the demo scene looked at the faction numbering compared to the Game manger and I was counting faction id as 1 and stated 1 in the faction manger when I should have started at 0. Thank you for the help, I would like to know if there is a way to increase the map size? I have edited the camera and increased the terrain size but I still cant place buildings outside of the map, there is a map boarder.
     
  15. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Sorry about the confusion regarding the faction IDs, that will change in the next update.

    To re-size the map, make sure to also re-size the Flat Terrain and to re-bake the navmesh in addition to increasing the camera's movement boundaries (under the Camera Movement component).
     
  16. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    84
    Thank
    Thank you
     
  17. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    84
    Is there anyway I can disable what shows up on the minmap? Also how would I get the minmap to show up in the inspector im try to design the UI around the minmap but that's kind of difficult when you cant see it.
     
    Last edited: Jul 12, 2018
  18. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Selecting the minimap camera will show it in the scene view.
    What would you like to disable on the minimap exactly?
     
  19. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    84
    I'm trying to disable the non walkable terrain on the boarder its just taking up space. Is there a way to get it on the canvas im trying to line it up with all the other UI.
     
  20. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Can you please specify what you exactly mean by the non walkable terrain? Do you mean the Flat terrain? Or the map borders from the demo scene?
     
  21. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    84
    I decided to just make the mininmap larger that fixed the problem. Is there a way to disable the minimap?
     
  22. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I can confirmed that the units with height >0 or with flyable option activated cannot attack ground units.
    I have pushed the range to 100 and nothing happened.

    On the other side, ground units can attack flying units.

    For the AI part, it is broken on my scene even with your help I can not achieve any valuable behavior but this is not important for now. I will see later.

    My main question of the day:

    What is the correct scale of an environment for your game engine?
    Do we need to have the same scale for buildings like the demo scene?
    Can we increase size or decrease it without problem?

    We are speaking about speed of flying units and youvsay that this is a high speed but for me a speed of 10 is just The base of the dynamic and I need to use faster units... really faster in some cases.
    Same thing for the range of targeting 10 is like shot on feet, 40 medium range, 100 and more begin to be the long range.

    So how is scalable the engine and its components?
     
  23. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470


    Here's a the "flying" archer attacking a unit from the air. The flying units will be fully fixed in the next update (which is pending review). Sorry for the late update but I wanted only to submit this when I make sure everything works as I wanted it to.

    As for the scale of the game engine, you can work on whatever scale you want to. The issue here is not the game engine itself but rather the pathfinding. I'd suggest to increase the stopping distance (which is set to 0.1f by default) in the Movement Manager since this is where the issue of the units shaking is coming from. Units are moving with high speed -> they have high acceleration and sometimes it's so high that 0.1f as a stopping distance won't be enough to detect whether the unit arrived in its destination or not. Try to increase the stopping distance and let me know how it works out.
     
  24. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    You can simply select the minimap camera, and set the viewport's width and height to 0.
     
  25. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Here's the v1.3.2 update list:
    • Bug Fixes:
      • Rally points have been fixed and can now be used by NPC factions.
      • Fixed a bug that didn’t allow buildings that have an attack component to attack enemy units (Fixed the Tower building in the demo scene).
      • Fixed resource generation in the demo scene.
      • Fixed a camera movement bug that appears when the map has a large size.
      • Fixed Flying Units.
      • You can now choose whether to automatically switch back to the basic attack type after launching another attack type or not from the Multiple Attacks component.
      • Improved the attack object delay: You can now create the attack object and only start its movement after the delay. When created and still in delay, you can also choose whether the attack object will be able to do damage when it’s still in delay or not.
    • New Features:
      • New Task System:
        • Creating tasks for buildings from the Building component has been deprecated.
        • Added a new independent component called “Task Launcher” which will handle creating and managing tasks for both units and buildings.
        • Task Types include: Unit Creation, Research, Self-Destruction and Custom Tasks. Custom tasks are tasks that only trigger events and pass all the task information entered in the Task Launcher.
        • In addition to the delegate events, each Task Launcher can now trigger events independently when the task is launched, completed and/or cancelled.
        • Improved the Task Panel UI management in the UI Manager for better performance.
        • User-Friendly custom editor for the Task Launcher component.
      • NPC factions can now place buildings that required to be placed next to certain resources.
      • Buildings can now be placed in their original rotation (the one set in the prefab Transform component).
      • Added a custom event that’s called whenever an object collides with an object that holds the Selection Obj component.
      • The Unit Animator Controller has been improved in order to have smoother transitions between different states.
      • Added audio clip triggers when a building upgrade is launched and when it’s completed.
      • Added Line of Sight (LOS):
        • When LOS is enabled, the attacker will only be able to attack if the target is in its line of sight.
        • As a reference, you can choose whether the main attacker object or the weapon object (if assigned) will be used to see if the attacker is in LOS of the target or not.
        • You can define how strict the LOS is from the Attack component inspector.
        • You can also choose to ignore one or more rotation axis when calculating the LOS.
        • You can now assign a destruction object + an audio clip that goes with it for units that will appear on the unit death.
     
    jobo22 likes this.
  26. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    Thank you for this solution.
    A simple value of 0.5f solved the issue for my common fighters.

    Happy to see a system of LOS in the new update.
    I'm waiting for the new published version in order to update my version.

    I have some requests which can be done simply I think to enhance the possibilities:
    - allow the converter to convert buildings with a boolean yes/no in the component
    - offer the possibility to obtain resources by capturing neutral resource buildings which generates resources when owned

    One maybe more advanced:
    -> Could you move the option to build in or out border to the building component itself?
    Because, if we want to do a faction with restricted area for the main base but with some advanced warp gate or outposts this is not possible since the option is define for all factions.
    And it would help to create some factions without limits.

    I like assymetric factions and possibilities and this is a good way to develop the gameplay for each faction.
     
  27. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    84
    Im getting a movement error:

    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index

    IndexOutOfRangeException: Array index is out of range.
    RTSEngine.MovementManager.LaunchAttackLocal (System.Collections.Generic.List`1 UnitsList, UnityEngine.GameObject TargetObj, AttackModes AttackMode) (at Assets/RTS Engine/Units/Scripts/MovementManager.cs:543)
    RTSEngine.MovementManager.LaunchAttack (System.Collections.Generic.List`1 UnitsList, UnityEngine.GameObject TargetObj, AttackModes AttackMode) (at Assets/RTS Engine/Units/Scripts/MovementManager.cs:498)
    RTSEngine.SelectionManager.ActionOnBuilding (RTSEngine.Building HitBuilding, TaskTypes TaskType) (at Assets/RTS Engine/Selection/Scripts/SelectionManager.cs:646)
    RTSEngine.SelectionManager.Update () (at Assets/RTS Engine/Selection/Scripts/SelectionManager.cs:134)

    Its says it had something to do with the stopping distance.
     
  28. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Added to the to-do list. Won't be probably in the next update because I'm planning to concentrate on having a universal faction/resource definer for that one (which will mean that some changes are to be expected in various components).

    I like this one, will be added.
     
  29. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Can you specify when does this error occurs?
     
  30. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    84
    When i order my units to attack an enemy building.
     
  31. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    This is weird, but it doesn't happen with units? There might be something wrong with the setup of the buildings. Can you test if the same unit can attack buildings from the demo scene?

    ----

    I also wanted to let you know why the update is taking a long time to get accepted. The Asset Store team mistakenly declined it and I have re-submitted it again and cleared the situation with the store and it should be available soon. Thanks a lot for your patience.
     
  32. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I'm not sure... but I think that this new version has some issues... :eek:

    The RTS Engine menu doesn't appear when we create a new Project and...

    The Demo Scene doesn't work...

    ... I have also several alerts without doing anything :
    ERRORS :
    Unable to parse file Assets/RTS Engine/Buildings/Sources/Library.meta: [could not find expected ':'] at line 4

    Assets/RTS Engine/Buildings/Scripts/Building.cs(7,7): error CS0246: The type or namespace name `FoW' could not be found. Are you missing an assembly reference?

    Broken text PPtr in file(Assets/RTS Engine/Units/Sources/Animations/Controllers/UnitAnimator.controller). Local file identifier (1102752838175216358) doesn't exist!


    WARNINGS :
    There are inconsistent line endings in the 'Assets/RTS Engine/Standard Assets/ParticleSystems/Shaders/PriorityParticleAdd.shader' script. Some are Mac OS X (UNIX) and some are Windows.
    This might lead to incorrect line numbers in stacktraces and compiler errors. Many text editors can fix this using Convert Line Endings menu commands.

    ImportFBX Warnings:
    Mesh 'lid' has 40 (out of 600) invalid UVs (NaNs) in UVMap #0. They will be assigned value (0,0). The list of vertices: 1, 4, 7, 10, 13, 16, 19, 22, 25, 28 and so on...

    Lighting data asset ‘LightingData’ is incompatible with the current Unity version. Please use Generate Lighting to rebuild the lighting data. Realtime Global Illumination cannot be used until the lighting data is rebuilt.
    UnityEditorInternal.InternalEditorUtility:GetGameObjectInstanceIDFromComponent(Int32)
    UnityEngine.GUIUtility processEvent(Int32, IntPtr)
     
  33. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Please either remove or comment that line out. That's supposed to be enabled only if you have the FoW asset and its integration pack with the RTS Engine. Forgot to disable that before the upload.

    Will fix this in the re-upload.

    If you directly imported the asset into the existing project you were working on then these warnings might appear, try to simply re-bake the lightning and see if the warning persists.

    Need to check more about this one, but please let me know if it disappears after the re-upload or not. I'll let you know when it's available.

    ----

    By the way the only thing game-breaking here in the first issue I addressed (the one that has to do with FoW). By fixing that you may continue working without a problem.
     
  34. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    Suppressing FoW reference has solved the problem.

    Thank you.
     
  35. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    It seems that the tasks have an issue. I have the taskmanager in the gamemanager
    I use the same configuration that your example to build a unit from the HQ.
    I can see the icon and all information on the panel but when I click on the build button nothing happend.
    No error message in the console.
    No sound played for error of the task nor for the start.

    Any idea ?

    EDIT : some tests to help :
    - checked the health limit of building - no change
    - checked resources with/without - no change
    - full empty scene with only a new building and new unit from menu - doesn't work
    - tried to override the boolean tests to validate the launch of the task - no effect

    I have deactivated the task_manager in the demo scene and the creation of units is no more active like in my scene and with the empty test scene.
    So it seems that the task_manager is no working in my scene and when we start from nothing.
     
    Last edited: Jul 25, 2018
  36. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    It's probably an issue with the task panel button itself. Can you have a look at the following documentation page (section: Tasks) and let me know if the task button has all its correct settings?
     
  37. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    Which settings should I check ?

    The Add Task button ?

    EDIT : I think you speak about the UI manager ?
    In this case I have exactly the same view that in your documentation for the task entry.

    Have you added some new parameters for the UI between this version and the previous ?

    Note 1 : the button for creating a unit is flashing like when it is active but the building bar doesn't appear.
    Note 2 : the AI manages to produce units without problem
     
    Last edited: Jul 26, 2018
  38. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Really sorry, I wanted to refer you to the UI Manager, and exactly in the tasks section.

    Your "Base Task Button" should have the same events as in the screenshot below.

     
  39. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    Wow...

    On.Click () -> Runtime Only but "missing taskUI message"

    OK when I define this entry like your screen I can produce units. Thank you for the solution.

    How this parameter has been removed?
    Linked to the new version?

    I have never entered in this part of the Engine.
     
  40. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Yes, sorry for any convenience this may have caused. The "UnitTaskUI" component has been deprecated and replaced with the "TaskUI" component. Therefore this had to change. This fix wasn't also included when you configure a new map from the RTS Engine menu so thanks for bringing my attention to this, I just uploaded the fixed version and submitted it for review.
     
  41. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I have another question maybe linked also to the update.

    My builder can put the building model on the map but he cannot build - no progress for the building state.
    Same for the AI.

    Something linked to task also ?

    I don't have an animator for my builder but previously this was not required to work

    EDIT : it seems that you have changed something which requires now an animator in all cases.
    When I add an empty animator to my units, builder in his case can now build.
    Good to know - This new version is a bit hard to integrate in an existing Projet :rolleyes:
    This could be good if the next versions stabilize the whole environment or keep previous work to be active or converted to the new templates.
     
    Last edited: Jul 26, 2018
  42. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I've just found a bug with the population limit.
    The new task system seems to ignore the limit (example : 11/5)
    I can produce more units than the limit without any warning.
     
  43. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I have just attempted doing this in the demo scene but I couldn't create more than the maximum amount. Can you please let me know how I can reproduce this exactly?
     
  44. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I've tested a unit (which had no animations) and commanded it to construct a building and I can see the building's health going up during the construction. Anyway you could import the newest re-submission of the update and let me know if those errors/issues persist? The newest update just got asked a while ago by the way.
     
  45. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I’ll see how to do that.

    The great thing today is that I have finally managed to have a working AI.
    I forgot the parameter linked to the description of buildings inside border...
    Now I have lot of enemy units produced with a big enemy base.

    But since the limit check is down... the enemy has a very huge army :D:D

    I have also solved the problem with warheads made with particle system only and the rigid body.
    The aircrafts are working. Really a good day, thank you for this fix.
     
    Last edited: Jul 27, 2018
  46. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I have overwrite the folder of your asset and the problem is solved.
    Don’t know why I had this issue. I modified only the attacks scripts to get the ballistic behavior.

    I have questions concerning the AI:
    - how is defined the priority between resources, army and buildings ?
    I see that sometimes the AI is stuck because she focuses on one of these three category and completely forget to create the basic units to be sure to run the common task of another (example : build five collectors when the limit is set to five and no more slot for the builder to extend this limit)
    - I see that the AI try to put all buildings needed (depending of the relaxation time between two checks) before creating an army or a defense team - the AI is completely defenseless against a basic rush.
    Is there a solution to force a early army defense without crippling the economy ?
    - One big thing : how the AI handles the fact that we can have two buildings which are used to extend borders or a buildings which regroups borders and population and building of units for example ?
    - Can the AI control several groups or she is limited to only one attack group ? No harassment sperarate team ?
    - What are the limitation of the AI ? Can she use portal ? APC ? Special behaviors like invisibility ?
    - Can the AI put some turrets near a resource point ?
    - And a last one for now : is there a priority during selection of targets for an attack such as collectors or HQ ?

    I could dig in your AI code but before doing this I prefer to grab quicker the answers :)
    This will help to see what I need to complete on the AI part or rewrite from scratch depending of the behaviors I want.
     
  47. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    The actual design for the AI assumes that the builder is also able to collect. So this issue is coming from that assumption. Will have to change how things work for this.

    Hmm, are you suggesting something like defining a list of units for the AI to create and make that its initial task when the game starts? This way you could ask the AI to create 2 army units, 1 builder and 1 collector which will be the main task for the AI when the game starts, as soon as that is fulfilled then the AI can go back into its usual behavior. Would that work?

    Two things, you can define how the NPC faction plans to extend its borders without need in the NPC Resource component and then this will be one of the NPC goals: to occupy a certain amount of the map's territory. The other case is when the NPC faction needs to collect resources and it doesn't have those inside its current territory, so it searches for the closest required resource, then attempts to build a building center around it in order to be able to collect it.

    Like assign different tasks to groups of attack units? If that's the question then no, the current AI only controls the army units as one group BUT the actual units with attacking behavior have their own independent behaviors which in some cases allows them to ignore what the NPC Army component asks them to do if they're doing something that contributes in the end goal of the NPC faction.

    Current limitations include the above mentioned features: APC, invisibility and portals. This is definitely coming soon.

    If you make the turret placable near the resource type then the AI will place it there.

    Yes, so the NPC Army will attack mainly buildings, however if the enemy units attack back and damage the attacking units, the attacking units in close range to the damaged unit will ignore attacking the building and defend themselves against the enemy units and if there's builders who are constructing a building that's being attacked then the attackers will briefly attack the builders and finish them off before getting back to attacking the building.
     
  48. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    So I made several tests now since the AI components are working better and I think according to my need but also for most cases of users, the AI behavior needs some strong tweaks.

    The first one is to offer the possibility to have a builder separated to the collector in order to extend the possibilities of gameplay without crippling the actions of the AI.
    I can do this now but for the AI I use the spawn components to be sure that the AI will not be stucked.

    The second one is to help to define build orders like in all RTS.
    You idea to define a behavior which calls the requirements depending of needs is good but I think that it is completely ruined by the fact that :
    - you don't have a tech tree function for a faction to define requirements to build one or another building;
    - the AI just try to put all buildings without taking into account that she wastes all resources in this.
    For this, I have used the border component for each building to define which building will be built after another one with a special timer but this is not comfortable also. It works but this is not the best way to do that.
    In an other hand, the border component is very interesting to design some AI behaviors to place buildings. It is a good tool. I would take this as a sub designer for AI behaviors to put turrets around resources or mines for example to protect a special area. I think that this could be extended to be more usefull.

    One simple way to do this I think :
    Use the NPC building component and in the list of buildings add a timer for each building (with a random factor or not) in order to define exactly the order of production for the AI.
    You can use a list of a list in order to define several build orders picked randomly for each game.

    The main fact is that for example in this case below I have destroyed her factory and the AI doesn't rebuild it. She spams generator which generates a resource not used and she's completely without any defense except with the airfighters (cannon fodder)...
    I really would like that the AI rises the factory as fast as possible.



    Linked to this and discussed before, could you add a tree for buildings dependancy to have several tiers with ou without upgrades of buildings?
    Maybe you can add a tech level variable and a list of requirements for each building component?

    Continuing for AI topic :
    The AI definitely needs several attack groups.
    I would split the NPC army component or create a list of attack groups.
    I saw that she attacks when the common group is filled and strike the HQ, ignoring the players units.
    This is not really fun to counter or play with.
    Balance between fun to play and challenge to survive :rolleyes:

    I have also seen that the local AI of each unit prefer to select its own target over the player choice if something seems to be more relevant and if something is attacking the AI.
    It is fine for the AI side, but this behavior is not acceptable when you are the player since your units don't react to your orders. Bad experience for a RTS player in all cases.
    The player's order should not be modified during an active phase - but we can have automated behaviors in a passive stance.

    I have noted that the option to select several units by a dragged rectangle doesn't work if we cover a part of a building.
    This is annoying.
    I have also seen that sometime the double click only select few units of the same type on the screen and some other are not selected.
    These two points need to be investigating since this reduces the control of player on his army and this is very difficult to do fast actions during a fight.

    I have also a request concerning the AI goto point and maybe this can be applied to the player also : could you are a small area around the goto point where the AI can select a destination in order to avoid the flower of units which look at the same point? Some RTS use with to avoid this effect or create a grid to park the new units.
    The bad thing now is that the AI produce units and if they are several units they are blocked on the entrance of the factory. Sometimes stucked completely.

    An other way to avoid this, used in most RTS, is to define a rally point for the AI only where she locates her army before a strike to avoid this effect. This could be usefull.

    EDIT :
    One additionnal question: if the AI doesn't have a LoS on the target, the AI unit will move to a location with a valide LoS or will she stay passive at its location?
     
    Last edited: Mar 6, 2019
  49. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    On my to-do list.

    So a system that defines buildings that the AI can place with amount required per building center and with priority should solve this issue.

    A tech tree has been previously requested but I believe with the new Task System, it should be easier to add now.

    You're right, this needs to be tweaked.

    In addition to this what do you think about an AI Wandering behavior that makes a certain amount of the army units wander inside the faction's territory?

    It will rotate until the enemy is in its LoS.

    --

    The next update will feature a global faction & resource definer so that you don't have to re-create everything for each map you're configuring. That will be the main theme of the upcoming v1.3.3. However v1.3.4 will only feature AI improvements and I will take into consideration all what you mentioned above, so I ask for some patience for this.
     
  50. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    This could be an interesting behavior to have a more dynamic opponent.
    In a previous modded game, I used something like this to make some patrols around the AI base to avoid attacks from behind.