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
    I just tested having 3 archers with one them able to attack only buildings and commanded the three of them together to attack an enemy unit and only two of them went to attack while a message appeared on the message panel informing me that one unit can't attack the assigned target. I also checked the code and it does indeed check for each individual unit if it's able to attack the target or not before issuing the attack command. Maybe this is related to something else?
     
  2. WoogyIM

    WoogyIM

    Joined:
    Oct 2, 2015
    Posts:
    16
  3. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    83
    Yes I use the category for my own custom scripts, and it works very well for what I need.
     
  4. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    Yes, something like that should be great.

    I haven't modified anything - the parameters are the same than before.
    Just wanted to know, I will see the impact later.
     
  5. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    What I call feedback is more a visual "alert" for player where we have an effect or a message attached for each action.
    For example, in all RTS, when you heal a unit, the healed unit have an effect on the model or near the model to show what is the effect.

    This is the same case for a building which produces a unit - we should be able to attach an effect object for each task running.
    When we produce a unit, the building should show some sparks for example or some lights to say that this building is producing something.

    The visual feedback is important and even more the enemies who are scouting the base to show what the opposing for is doing.

    See above, so just during the production of the unit.
     
  6. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I have also another request concerning the management of buildings with special activites like center, drop off, population.

    Currently we can only define one building for each task and when we check the code for AI for example, the AI can only plan to attack a center depending of the list of centers.

    According to the way it is done, we can not define for example a main HQ which costs lot of money and an other model which is an outpost, cheaper, but which can help to expand faster and which could be also a part of the victory condition and an opportunity of target for AI.

    In my mind, we should be able to define a list for each type of buildings, not limited to only one entry.

    And for the AI, the targeting could be filled with more locations on the maps and different types of targets like drop off buildings, collectors, population buildings for harasment and small raids, and bigger targets like factories and main HQ or outpost for bigger forces.
     
  7. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I have also a report for the new asset faction file:

    The function linked to the limit of units seems to have some critical issues:
    - the biggest one is that when I set a limit of two constructors, I produce two constructors, the button goes to red and I cannot produce anymore units - fine behavior - BUT if I leave the game and return to the scene and launch again the game the button is ALWAYS red and I cannot produce constructors.
    It is like if the limit was not reinitialized after exiting the game and saved in memory the already reached limit.
    - the second problem is that when a constructor is destroyed in a game session, the availability is not adjusted, I cannot produce another constructor according to the limit.
    - a smallest problem also : when the button to produce the unit goes red, the color is not reinitialized when we move to another panel - for example my constructor button is red and I click on a unit so the move button is now red. It seems that the status of the button depends on the canvas of the button and not of the function.

    Sorry for all of these posts, I'm testing lot of things in parallel :p
     
  8. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    But what do you think how would showing the requirement buildings list in the UI go then?
     
  9. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    A building can have different tasks. For example, the center building is also a drop off building. But specifying a drop off building and a population building for the AI means that the assigned building will be the goto building for the AI when attempting to place a building for the sole purpose of that specific task.

    Yes, true.

    Makes sense to have different buildings that have the Border component (can expand the faction's territory) and it is already feasible. You can define a capital building in the Faction Type Info asset for each faction and that'll be used as the main building that when destroyed, the faction is defeated. And then you can define another building with the Border component and assign it to the Building Center field in the NPC Building Placement component and that'll be used when the faction decides to expand its territory.

    The way it is currently set up, the AI targets a building center and then targets the closest building that belongs to that building center and attacks it until it reaches the center. If the AI army is met with resistance from the enemy faction, it shifts its attacking power to eliminate units/buildings that are doing damage to it and then continues destroying buildings. I do agree that there should be more dynamic decision-making in the process of NPC factions attacking another faction and I'll be testing out some things in the upcoming weeks and seeing how it goes.
     
  10. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    All the above reported issues have been fixed.

    I have to thank you for taking the time and reporting all these bugs, I really appreciate it!

    I will upload a fix for the latest update which includes the above and other bug fixes soon.
     
  11. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    A small request concerning the construction object of each building:

    Could you add something like this to the start function of the building component in order to be sure that the construction object is hidden when we place buildings directly on the scene?

    Code (CSharp):
    1.      
    2. void Start()
    3.  
    4.         {
    5.          if(PlacedByDefault)
    6.  
    7.             {
    8.  
    9.             ToggleConstructionObj(false);  
    10.  
    11.             }
    12.  
    I have for example a HQ with a large construction model around and since this is placed by default at first, the construction object is visible - I need this to be sure that the object is not visible.
     
  12. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    Not sure to understand the perimeter of the question.
    In the game or in Unity ?
    I don't see the difference between the way you are already doing this with buildings and the way it need to be done with the tasks.

    Yes, but the victory condition remains to the destruction of the main HQ and all of its clones on the map to defeat a faction.

    The main problem with this is that this is really easy to defeat an opponent since on the HQ is the real and only objective.
    You can completely ignore the other buildings.

    So if we could define more capital buildings with different levels of action which count in the victory condition we could expand the challenge to gain victory.
    Everything can be done by modifying your code of course, but it would be interesting to have by default the possibility to fill a list of buildings which are part of the condition of victory.
    A first advanced level after the destroy HQ only condition.
     
    Last edited: Aug 28, 2018
  13. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Sure, just added it.
     
  14. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Do not worry about this one, already figured it out.

    So a list of building/unit types assigned to each faction type that defines which buildings and units so the faction must have in order not to be defeated. Added to my to-do list!
     
  15. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    If you add also units, this is a really good idea indeed since this opens the way of a simple trigger for missions without lot of cost of development to do goals like building protection, vip or convoy protection or destruction, capture special unit etc...
     
    OussamaB likes this.
  16. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I just submitted a new small update (mainly bug fixes for issues that appeared within the last major update). Here's the update list:

    • For each element of the required buildings list under the Building component, you can assign a list of possible buildings where you only need to have one of them placed and built in order to fulfill the requirement.
    • Building construction model is now disabled on start when the building is placed by default.
    • Fixed refreshing the panel task button colors.
    • Attack Order Audio is now triggered through the movement manager component and not the Selection Manager component.
    • Fixed updating the faction unit/building type limits.
    • The Drop Off model (Gather Resource component) is now disabled on start if it's assigned.
    • Fixed enabling/disabling rotation on idle for units.
     
  17. Pete12345

    Pete12345

    Joined:
    Aug 28, 2018
    Posts:
    5
    Hello,
    I am interested in buying this. However I would like to know more about its performance. I ran it on a low range laptop and it began to struggle with ~300 units when they were doing something. Has there been tests of more units?
    I also found a bug in the demo where a new capital can't be built, the construction site creates new territory and can be used to drop food but workers are unable to be assigned to build on it and it cannot be selected.
     
  18. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    On my game prototype, I have personnally pushed a previous test without any problem with 400++ units but with a i7+16Go.

    The only issue I saw concerning performance is linked to the multiple selection - when we select 200 units in the same group the engine takes two secondes of reaction but I think that this is not really the scale of selection which fits the way it is done (according to Unity possibilities)
    I think that if the scale of the battleground is near a starcraft/act of/FB/CoH there is no problem.
    A level like Supreme Commander should be more problematic.
     
    Pete12345 likes this.
  19. meTonne

    meTonne

    Joined:
    Apr 30, 2016
    Posts:
    70
    Hello all ! :)

    I want to know, if resource are finish, villager don't go on dropOff building and I can't order it with right click. How can I make it ?

    Thanks for your answers
     
  20. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    Time to speak about the sound environment :D

    - I have a boat with a basic laser weapon.
    I added a sound for the movement action and the firing action.

    When I move 20 units the sound of the engine is very loud.
    Same case when the units are firing at the same time.



    This is the same problem in this old dicussion concerning Unity:
    https://answers.unity.com/questions/715288/sound-effects-volume-adding-up-too-loud.html

    I understand that all sounds are added that's why I get this loud outlet.

    Is there something in the RTS engine which can help to normalize the volume in this case?

    - I have also seen now that when I add a sound for the movement of a unit, if the unit has not reached its destination because of several units already at the location, she's waiting few seconds to stop and we hear the sound of the engine without any realistic reason for the player.
    I think that this is linked to the pathfinding limitations mentioned in the past, how can we solve this?

    - When the AI produces a unit, we hear also the sound when we are far from her HQ - is it normal?
    Is there something to define to limit the noise of the enemy except for the enemy units or only for near environment of actions? Something to define in the camera parameter maybe ?

    - The sound linked to the warning when a unit or a building is attacked is played for each attack of the enemy on a unit.
    Could it be possible to introduce a delay in the function to avoid to hear the warning too many times, for example at the first attack, and only play it again after 2 minutes - leaving the warning sprite on the minimap flashing during the mute time?
     
    Last edited: Mar 6, 2019
  21. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    As mentioned in previous posts, the performance depends highly on how complex your unit/building models are. The simpler they are, the faster and smoother everything will be. My last performance test was quite some time ago on a mid-high range laptop and I was able to get it to about 700 units issue-free.
    Now a lot has changed since that test (especially regarding unit movement) and a lot of updates have been pushed since then so I would really like to make another stress-test soon but that'll be after the next update where I'll be focusing mainly on AI to improve its performance, decision-making and add new features to it.

    Thanks for reporting this, I've fixed it in the demo.
     
  22. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    This is indeed a missing feature, shouldn't be that complex to add though. Added to my to-do list. Thanks for pointing this out!
     
  23. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Not currently, I've been away of similar issues but didn't really think it was this serious.

    Shouldn't be this way, will be changed.

    This is already in the RTS Engine. Do you hear sound effects from enemy factions even if you don't have the camera looking at them? If yes which sound effects exactly?

    Added to the to-do list, except this in the next update.
     
  24. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    83
    Hi, I have a few issues. First, I have selected to not delete my units when they die, because I want my dead units to stay visible on the map. But when they are dead, you can still select them and move them. Second, I have some units using the Escape on Attack function, but if they are killed while escaping, they will still try to escape even though they are dead.
    My third issue is that in the multiplayer lobby, when I change maps, it won't update the playable factions for that map, and also when someone else joins the room, they can't see when the host changes the map.
    Also, I know this was brought up before, could you add a squad system so that units can be built as squads with individual units in it? Thanks!
     
    Last edited: Aug 30, 2018
  25. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    This is one important difference between a prototype and the beginning of a game.

    When I look at the doc of Unity I find this:
    https://docs.unity3d.com/Manual/class-AudioManager.html

    I see that in the gamemanager of the RTS Engine we have a Audio Manager but it doesn't contain the list of options shown in the doc.

    Where is located the Audio Manager of the scene to access to this?
    The doc says that we can limit the global volume and channels used which seems to be a first step to solve the issue.
     
  26. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    All mentioned issues have been fixed. I will drop another patch in one or two days where the fixes will be available. Thanks a lot for reporting this.

    Task completion audio effect will be played in the task launcher's owner from now on and it will be only played for the player's faction only. Will be included in the next patch as well.

    I also identified another issue where the attack flash selection and the attack order audio was getting played over and over again when the target keeps moving, maybe this might the source of the problem you reported in one of your last replies?

    Agreed. It will be eventually fixed and improved but as you know, my number one priority for the upcoming is to fix urgent issues and handle AI. So huge improvements to how the RTS Engine handles audio might have to wait a little.

    So the Audio Manager component is at the "GameManager" game object and the General Audio Source can be chosen from the Game Manager component. In the demo scene it is set to the main camera.
     
    jobo22 likes this.
  27. jobo22

    jobo22

    Joined:
    Dec 1, 2016
    Posts:
    83
    A couple more issues. First, the Attack component won't shoot all the bullets I have in the "Attack Sources" array, it will only shoot one bullet, and then wait until the reload time finishes before shooting again. I have it set to shoot five bullets before reloading, and I have attack type set to In Order. I know this worked before, so maybe a recent update did something to it. Second, not really a bug but the units will get funky when they have a target that is moving and right at the edge of their range. They switch back and forth between their move and shoot animation, and it looks weird. I'm not really sure what can be done about it though. Thanks :)
     
  28. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    One request concerning the list of buildings that we can build.

    Concerning my need, and to extend the possibilities, I would like to be able to define a specific list of buildings created by each builder. For example builder level one for basic buildings, builder level two for more advanced structures etc...

    Currently all builders can only built the list of buildings defined in the faction components.
    It would be amazing if we could divide buildings by specific builder units.

    To a more global view which could fit to the need of several persons, and maybe not far from your task system, maybe it would be more interesting to have a builder component where we can define the list of possible buildings and which can be added to a building (c&c style without builder in this case with direct placement) or to a unit (Starcraft style like this is done now).
    This would be also more clear concerning the interactions of the builder component and the list of buildings.
     
  29. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    It seems that the destruction sound doesn't work anymore.

    The other sounds are working but this one, linked to building or unit is not played.
    I tried several sounds for this entry and no one has been played.

    Something suppressed during an update?
     
  30. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    This has been fixed, it will be included in the patch as well.

    Have you tried increasing the "Update Mvt Distance" value in the Attack Manager?
     
  31. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Make sure that the destruction effect object has an Audio Source. The destruction audio clip won't be played on the building/unit object itself (because that'll be gone) but rather on the destruction effect object.
     
  32. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    This would indeed allow for more customization. Added to my to-do list.
     
  33. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I don't manage to hear the soud effect.

    I have added an audio source on the explosion effect but I get this error which seems to be strange since I have precisely an audio source:

    A destruction audio clip has been assigned but the destruction effect object doesn't have an audio source!
    (...)

    EDIT : Found the problem :

    //Check if the destruction effect object has an audio source:
    if (NewDestructionEffect.GetComponent<AudioSource>() == null)
    {

    Your test is defined to == null and we need !=null ;)
     
    Last edited: Sep 4, 2018
  34. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    For the AI improvement part, I saw that if we destroy a secondary HQ, the AI keeps her civilian units on the location where there is no more border so no more action possible.

    It would interesting if after a short time, the units could be called to a valid HQ around.

    Another point also: I have seen that the AI always built the builds required around the last building created. I think this is linked to the order in the list of corresponding building.
    Maybe this should be interesting, if there are several time the same building to have a randomized choice to avoid all forces and buildings at the same location after a short time.
     
  35. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    Oh well, thanks for letting me know. Fixed!

    --

    Other than that, here's the v1.3.3.2 patch release note:
    • Fixed destruction audio triggering for both units and buildings.
    • Attack behavior:
      • Added the toggle field "Reload Attack Anim" in the Attack Source array. When enabled, the attack's animation will be reloaded for the attack object launch.

      • Fixed transitioning between different attack object launches under the "In Order" attack type.
    • Audio clip for task completion is now played from the Task Launcher's object and it is now played for player faction only.
    • Movement Manager now handles the escape on attack behavior for units.
    • MFactionLobby_UNET component code refactoring: Less data transfers in the multiplayer lobby menu and improved response time.
    • Fixed a bug where maps and faction types couldn't be synced between players in the multiplayer lobby menu.
    • Selection Audio for buildings, unit and resources is now triggered by the Selection Obj component instead of the Selection Manager component.
    • Selection audio for dead/destroyed units/destroyed buildings is no longer played on mouse click.
    • Dead units and destroyed buildings which still have their models visible can not be interacted with.
    • Stopped attack order audio clip and flash selection from getting triggered even if the attack is not assigned.
     
    jobo22 likes this.
  36. OussamaB

    OussamaB

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

    Easy to implement but will make the AI look much more diverse. Thanks a lot for the suggestion!
     
  37. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    The version 1.3.3.2 is submitted ? It seems to take a long time to be seen on the asset store.

    A request : could you add a forbidden area around resources or a test to avoid such situation where the AI creates a building near a resource point.

    Below is an exemple where the factory built near the resource point creating some problems of production and resource collection.
     
    Last edited: Mar 6, 2019
  38. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I found a bad behavior concerning expansion fo AI.
    It seems that if we have two resources point in the initial border she creates the first expansion building on the second resource point...

    Could you exclude from the expansion process the resource points which are already in borders ?
     
  39. Kuoin

    Kuoin

    Joined:
    Feb 3, 2017
    Posts:
    6
    Anyone have any ideas on how to convert a building instead of a unit?
     
  40. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    I have already requested this feature but not available in the current version.

    If you want this before an update you need to code this by your own.

    I tried to code such a function for my need but since the unit and the building doesn’t share the same basis as component you need to double all tests and validations for the converter and there are several issues with the AI and her list of tasks when we suppress a building in all lists she handles to produce.
     
    Last edited: Sep 10, 2018
  41. Kuoin

    Kuoin

    Joined:
    Feb 3, 2017
    Posts:
    6
    I see, well to specify I want the faction that got a building to 0 health to take over ownership (convert) if that might be simpler to implement if anyone has any ideas.
     
  42. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    There has been an issue with my publisher's page but it's now solved and the patch is available on the store. Sorry for the inconvenience.

    What you can do in this case is to make the collider of the main resource object bigger so that buildings can not be built around it. That collider is exactly used for these situations.
     
  43. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    I've tried reproducing this situation, but I don't get the conditions that you described in your post exactly. Are the two resource points in the initial border? Is one inside the initial faction's territory and the other outside?
     
  44. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    In the next update, you'll be able to pick what happens if a building is destroyed:

    1) Becomes a building belonging to the faction that destroyed it and gets minimum health.
    2) Gets destroyed and disappears from the map.

    if a center building uses the first destruction mode, then there's be field in the Border component which will allow you to specify what happens with the buildings belonging to that center (either make them all join the new faction or leave them intact).
     
  45. Kuoin

    Kuoin

    Joined:
    Feb 3, 2017
    Posts:
    6

    I'll be looking forward to it then :)
     
  46. Fabyanno

    Fabyanno

    Joined:
    Aug 27, 2015
    Posts:
    6
    Posso usar meus modelos? você tem o modo multiplayer?
     
  47. Fabyanno

    Fabyanno

    Joined:
    Aug 27, 2015
    Posts:
    6
    Can I use my models? do you have multiplayer mode?
     
  48. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    The asset is defined to let you use your own models, sounds, pictures, icones... all graphic components can be costumized.

    And yes, the engine handles multiplayer part for you.

    A great work of the author of this asset.
     
    OussamaB likes this.
  49. Seling

    Seling

    Joined:
    Apr 26, 2018
    Posts:
    97
    Just moved to the new version - all of the informations concerning the required buildings to build another are gone in the prefabs.

    Do you know why everything is cleaned and to be done again?

    Is there a solution to bring is defined content over each version without loosing all parameters in prefabs?
     
  50. OussamaB

    OussamaB

    Joined:
    Feb 8, 2013
    Posts:
    1,470
    The way information concerning required buildings was structured change in 1.3.3.1. So that means you have to build that again.

    Do not expect such radical changes to features that have been in the asset since a long time but since this a relatively new feature (was introduced in 1.3.3), I assumed such radical change in the way it worked made sense.

    However, my apologies if this has caused any inconvenience. But I recall that this change was made specifically for a problem that you encountered with required buildings and building upgrades.

    In next updates, the changelog will also include info about what you should consider in terms of losing data in prefabs so you can be better prepared. But those radical changes are usually rare.