1. We've introduced thread tags, search within a thread and similar thread search. Read more here.
    Dismiss Notice
  2. Learn how you'll soon be able to publish your games to China in four simple steps with Xiaomi. Sign up now for early access.
    Dismiss Notice
  3. Get further faster with the Unity Plus Accelerator Pack, free for new Unity Plus subscribers for a limited time. Click here for more details.
    Dismiss Notice
  4. We've released our first Timeline Experimental Preview, our new tool for creating cutscenes and more! To check it out click here.
    Dismiss Notice
  5. Unity 5.5 is now released.
    Dismiss Notice
  6. Check out all the fixes for 5.5 in patch releases 1 & 2.
    Dismiss Notice
  7. Unity 5.6 beta is now available for download.
    Dismiss Notice

uRTS: toolkit

Discussion in 'Assets and Asset Store' started by chanfort, Jun 6, 2014.

?

Which phase of RTS Battle Simulator need improvements?

  1. search

    50.0%
  2. approach

    36.4%
  3. attack

    59.1%
  4. self-heal

    22.7%
  5. death

    18.2%
  6. rot (sink)

    22.7%
Multiple votes are allowed.
  1. Don-Megel

    Don-Megel

    Joined:
    Dec 4, 2016
    Posts:
    16
    I was thinking of rifles. I fear that rendering the projectile would be a waste of resources, would it be better to just check to see if the bullet hit and then inflict damage?

    Great about Gaia, do you think an abundance of trees would cause an issue with the pathfinder? Like a forrest
     
  2. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    Oh, if it's bullets you may not need projectiles at all. You can try straight lines, i.e. rays from the rifle to target. Then you can check which targets are close to that line (I think there is basic detection in selection manager for click selection). Finally for these targets, which are close to the line you can add MeshCollider just for a single Update frame to do more precise check through ray casting if bullet hits the target, and finally remove MeshCollider.

    I think if it causes problems with trees for pathfinding, you can try to reduce avoidance radii for trees to leave more walkable space around.
     
  3. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    uRTS version 5.3 has just been released. All the following features and fixes are now live:
    - Renderer upgrade (fixed flickering and improved performance)
    - Updated unit models
    - Added procedural rock placer and in-game falling rocks
    - Improved birds flying AI
    - Environment sounds now are placed on all generated terrains
    - Added player in game controls for RTS and RPG cameras, Graphics settings and Notifications
     
  4. Don-Megel

    Don-Megel

    Joined:
    Dec 4, 2016
    Posts:
    16
    How much would it hurt performance to have some random objects attached to some of the infantry to make them look less like clones? Say, different hats, different swords, different textures, different sash, etc.
     
  5. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    I think it depends how large is your variety. If you have 10 different hats and 100 infantry units, on average 10 of each unit will wear the same hat. So you would probably still benefit from instancing. Another way could be to use hats, swords, etc as separate objects - then they could be instanced or batched separately from the character. One way or another, performance scales down with increasing variety of objects with the worst case scenario when all objects are unique and there is nothing to instance/batch. But I guess it's hard to get to that point, as you would need to have hundreds of variations. So there is probably in most cases some level of benefits from instancing/batching.
     
  6. Don-Megel

    Don-Megel

    Joined:
    Dec 4, 2016
    Posts:
    16
    I was thinking maybe two or three hats per unity type (So all Knights are one unit type, for example). What about different textures?
     
  7. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    I guess it depends what texture actually represents. If it's the whole UV map of the character, then you can use the same characters with different materials, which uses different UV maps. If the texture is a small detail of the character (i.e. cloth, flag in the hands, etc.) then I would use the same object but also with different materials - in that case you could also benefit from instancing/batching.
     
  8. Don-Megel

    Don-Megel

    Joined:
    Dec 4, 2016
    Posts:
    16
    I was thinking same character with a different texture, so different looking clothes, face, etc. This wouldn't cause too much of a performance hit?
     
  9. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    Well, in that case use separate materials with different UV maps. It will also scale with increasing number of variations. If you open up Graphics Settings menu in game and tick-untick "Units instanced shader" you can find performance difference between best and worst case scenarios. If textures are not adding additional objects but uses instead just different materials, performance should not go worse than not using "Units instanced shader".
     
  10. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    An update for selection marks and health bars is coming up:

     
  11. Don-Megel

    Don-Megel

    Joined:
    Dec 4, 2016
    Posts:
    16
    What do you recommend for poly counts for each LOD level? Also, how about texture sizes for infantry?
     
  12. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    It's a piece of art and depends on the purpose of the game. I would keep creating LODs until geometry becomes unrecognizable, i.e. several hundreds to 1000 vertices. It can be several thousands of vertices. I usually keep lower resolution textures, such as 256 and 512 pixels. But I would probably set everything in a way that I could regenerate models and textures easily for higher or lower resolutions if needed.
     
  13. Don-Megel

    Don-Megel

    Joined:
    Dec 4, 2016
    Posts:
    16
    I have purchased your code, thank you. As I read through the documentation I think you mention that animations are resource intensive. Does this mean I need to keep the animations for the units as uniform as possible? So I shouldn't have 3 or 4 idle animations for one unit?

    Forgive me if I am incorrect, I am an artist, not a coder.
     
  14. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    Well, if unit has more animations, more meshes are baked, what makes that more memory is taken to store meshes. Another thing is how many frames are baked per animation, i.e. good number can be 20-30 for simple animation cycles of 2-4 seconds. If you have longer animations, i.e. 10-20 seconds, you may want more frames. But each frame is one static mesh baked and stored in memory. So more frames you will have, more meshes are stored in memory.

    You can simply calculate if you have 4 idle, 4 walk, 4 attack and 4 death animations in total it will be 16 animations on unit. If each animation has 20 frames, there will be created 20x16=320 meshes in memory. If there are 5 different types of units in the game, then total number of meshes would be 320x5=1600.

    You can also duplicate RenderMeshModels gameObject and have multiple versions, i.e. one for units with just one animation and another for the same units but with several animations. And then you can flip between one or another to see how performance is changing (You should have only one RenderMeshModels gameObject active in the scene - another one should be disabled).
     
  15. Don-Megel

    Don-Megel

    Joined:
    Dec 4, 2016
    Posts:
    16
    When you say frames stored in memory, your talking about the 3d sprites?
     
  16. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    No, it's 3d mesh also being baked as static mesh for each frame and stored in memory.
     
  17. Don-Megel

    Don-Megel

    Joined:
    Dec 4, 2016
    Posts:
    16
    Oh my, ok, so if an infantry unit could have two different styles of rifle, and two different styles of sub machine guns, with 1 idle, fire, and reload, animation for each, that's 12 animations per unit just for weapons? Is there no way to reduce the burden animations place on the engine?
     
  18. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    At the moment it would be like that. It might be possible to set in a better way, i.e. if rifles would be as separate objects. So for example for rifle 1 and 2 could be just 1 fire animation. But if rifles are different, then humanoid animation for fire could be also slightly different, what would make 2 animations instead of 1.
     
  19. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    A new version (2017.1) of uRTS is now released. Now I changed versioning and it will continue as 2017.x. New features includes:
    - Added Journeys mode
    - Multithreaded terrain splatmaps, rivers and sea scripts
    - Added Shuriken based selection marks and health bars
    - Remade splatmap and forest biomes
     
  20. vertigostudios

    vertigostudios

    Joined:
    Oct 1, 2012
    Posts:
    66
    Hi Chanfort, has anyone used it for lets say a ww2 RTS, if so - how well does it handle vehicles with and without weaponry.
     
  21. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    That's a good question. Since now development was centred on medieval styles (i.e. swords and archery). But now I have some plans to make very basic "bullet based" weaponry system. I am not sure if others managed to get there yet.
     
  22. vertigostudios

    vertigostudios

    Joined:
    Oct 1, 2012
    Posts:
    66
    Thanks for the reply, I'll keep a close eye on its development.
     
  23. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    The system might be quite generic and it may only have very basic setup, which could get you started. It's likely that it will not fulfil your needs, so instead of just waiting, you can start doing your own implementation of it.
     
  24. HeadClot88

    HeadClot88

    Joined:
    Jul 3, 2012
    Posts:
    555
    Hey @chanfort - I just purchased your uRTS toolkit. Loving it so far.

    Got a few requests tho -

    1. Would it be possible to make an example / Tutorial showing how to use the procedural generated worlds separate from the uRTS toolkit? I am trying to make an first person RPG with RTS elements - So the players walk around the map in a first person perspective adventuring and such.

    2. Out of the box support for World Streamer would be awesome so we do not have to deal with floating point issues when we get far away from the world origin.

    I do not want to go into too much detail about our project yet. :)
     
  25. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    I am glad to hear that you like the environment. The environment is separate part from RTS already. The easiest way would be to try to put first person camera controls and redirect calls from scripts into that camera instead of RTSCamera. Alternatively you can use RTSCamera but disable "WASD" controls over the camera and use your FPS character instead.

    I am looking forward how to easier implement external environment generators like World Streamer. It's not yet in uRTS but the plan is to make scan option, which would keep regularly scanning for new terrains and putting them into reference lists so that the system could easily "talk" with terrain environment.
     
    Last edited: Feb 2, 2017
  26. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    Long awaited character setup tutorials are finally out. Try to grab some character assets and check how they work for your game:
     
    HeadClot88 likes this.
  27. patodonald

    patodonald

    Joined:
    May 4, 2015
    Posts:
    2
    Does this asset have trading system?
     
  28. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    No, trading is not there. But interesting idea for the future maybe :)
     
  29. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    456
    So I just made "Scan" option, which will allow to scan for terrains generated by external packages. It works nicely with MapMagic, here I made couple of videos:


    It should work with other terrain generators and streamers, but it may need some particular tweaks in each case.
     
    FrozenEmpire and Adrad like this.
  30. SaggitariusStudios

    SaggitariusStudios

    Joined:
    Jun 16, 2016
    Posts:
    1
    hi there i know that my question sounds stupid and yes i know that 20$ ain't that much of money

    but you considering
    a discount will be appreciated

    thanks in advance