Search Unity

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

Unity RTS Engine

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

  1. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    Did you assign the Selection Obj correctly in the Building inspector? This seems like it's the case.
     
  2. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    37
    I have, I removed it reapplied it restarted unity I don't know what it needs from me.
     

    Attached Files:

    • 1.png
      1.png
      File size:
      324.2 KB
      Views:
      65
  3. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    So I've been digging into this issue and here's what I found:

    - When the speed of a NavAgent is too high, then it's recommended to have "Auto brake" set to true.
    - This issue is not connected only to flying units, I was able to reproduce the same bug with normal ground units as well.

    So a big change for how flying units work will come in the next update:

    - Creation of the air terrain will remain the same but it must now have its own set of layers (you can multiple layers for the air terrain tiles if you ever needed to) that need to be assigned in the Terrain Manager's inspector.
    - Air terrains must have their own layer while baking the nav mesh.
    - Air terrain must have trigger colliders so that they can be recognized by the Terrain Manager.
    - The height parameter in the Unit component role will be simply to simply define the base offset in the NavAgent (yes, I want to avoid any direct modifications of the NavAgent component).
    - Movement of flying units has been improved to avoid any issues while moving a group of flying and normal units at the same time.
    - There was an offset that made flying units have a greater position on Y axis in comparison to the air terrain, with the new Movement Manager in the last update this now poses a problem, therefore it has been removed.

    Again thanks a lot for pointing this out, it led to me investigating a ton of stuff and improving some small details which will have a great impact on unit movement.

    I guess I answered most of this with the above information.

    As for the flying units attack issue, are you sure you have increased the attack range for flying units so that they're able to target ground units?
     
  4. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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?
     
  5. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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.
     
  6. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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?
     
  7. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    37
    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.
     
  8. OussamaB

    OussamaB

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

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    37
    Entering the map directly.
     
  10. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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.
     
  11. MegaCo

    MegaCo

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

    OussamaB

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

    MegaCo

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

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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?
     
  15. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    37
    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.
     
  16. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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?
     
  17. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    37
    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.
     
  18. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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).
     
  19. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    37
    Thank
    Thank you
     
  20. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    37
    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
  21. OussamaB

    OussamaB

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

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    37
    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.
     
  23. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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?
     
  24. MegaCo

    MegaCo

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

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    80
    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?
     
  26. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097


    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.
     
  27. OussamaB

    OussamaB

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

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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.
  29. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    80
    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.
     
  30. MegaCo

    MegaCo

    Joined:
    Jan 24, 2018
    Posts:
    37
    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.
     
  31. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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.
     
  32. OussamaB

    OussamaB

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

    MegaCo

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

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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.
     
  35. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    80
    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)
     
  36. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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.
     
  37. Seling

    Seling

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

    Thank you.
     
  38. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    80
    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
  39. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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?
     
  40. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    80
    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
  41. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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.

     
  42. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    80
    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.
     
  43. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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.
     
  44. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    80
    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
  45. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    80
    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.
     
  46. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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?
     
  47. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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.
     
  48. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    80
    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
  49. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    80
    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.
     
  50. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,097
    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.