Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

3.9k units battle system

Discussion in 'Works In Progress - Archive' started by chanfort, Jan 18, 2014.

  1. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    Hey guys, I created my RTS battle system, which can hold up to 3.9k units without reducing performance very dramatically. Here is demo:

    https://dl.dropboxusercontent.com/u/248943005/5_1.html

    And important scripts included as attachments. Feel free to ask and keep discussing if you are interested.
     

    Attached Files:

  2. OrbitusII

    OrbitusII

    Joined:
    Jul 4, 2011
    Posts:
    175
    Pretty neat to see how optimized it is and how smooth it runs, especially on my pitiful Pentium G2020! The only performance drop I noticed was when I was looking at as many objects as I could, which tells me that the only significant performance hog is rendering!

    One tip: I the camera aiming was a little weird. Once I got used to the inverted y-axis (I like how it feels like you're dragging the screen up and down to look up and down), I couldn't stand the non-inverted x-axis (I dislike how the y-axis has the "dragging" feel, but the x-axis doesn't). For an RTS, try to make your camera aiming style consistent- either invert both axes or neither.
     
  3. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    Oh, well, thanks for noticing about RTS camera. I forgot to attach the script, so it is here. This inversion style is because I usually like to play many games like that. But I may include optional selection, which axes player want to invert for future versions.

    Now lets keep discussing about this attacking system.
     

    Attached Files:

  4. primus88

    primus88

    Joined:
    May 14, 2013
    Posts:
    611
    Nice system. Even though they were only simple objects, it felt pretty epic seeing so many moving around and doing stuff :)
     
  5. chanfort

    chanfort

    Joined:
    Dec 15, 2013
    Posts:
    641
    well, this system seems to be functioning quite good at the moment. I have some ideas to implement tree algorithms (like binary tree), which would speed up the system more. However, if you mentioned any strange behaviour when units are fighting and you think it does not look natural, post here with as many details, as you can describe. Such help would be greatly appreciated.
     
  6. makoto_snkw

    makoto_snkw

    Joined:
    Aug 14, 2013
    Posts:
    340
    Wow, this assets is awesome.
    I put this in my wish list for now for my future project.
     
  7. Ronald_McScotland

    Ronald_McScotland

    Joined:
    Jul 30, 2014
    Posts:
    174
    That's really cool. I wonder how it would go when its thousands of animated characters though. That would be epic to see.
     
  8. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Why don't you make low poly characters with Skinned Mesh Renderers?
    Seeing cubes is just a normal thing, but the second you add Skinned Mesh Renderers after like 50 characters ur gonna start to notice performance issues and that's with Voxel based characters. Now maybe in Unity 5 these issues will be fixed.

    But if you can show me 3000+ units that I had with no issue of cubes work with Skinned Mesh Renderers then, that's really showing something fantastic.

    Right now ur just instantiating cubes and making them move to places.
     
  9. CaoMengde777

    CaoMengde777

    Joined:
    Nov 5, 2013
    Posts:
    813
    yeah skinned mesh renderers destroys it
     
  10. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Yeah that's why I stopped working on my RTS Kit, after realizing just a few voxel based characters with like 10 bones destroyed performance like wow.
     
  11. ensiferum888

    ensiferum888

    Joined:
    May 11, 2013
    Posts:
    317
    Was this for mobile? I don't seem to have this issue on desktop, I can have 100+ skinned mesh on screen (940 tris and about 20 bones each) and I'm slightly above 50FPS. (the same scene without any characters runs about 110-120FPS)
     
  12. ExDeaDguY

    ExDeaDguY

    Joined:
    Aug 25, 2009
    Posts:
    503
    Pretty neat stuff.. But this won't hold up once you are using real models instead of cubes. Also.. I have a nice system I built last year, i7 cpu 3.50ghz, 8 gigs ram, nvidia geforce gtx 760 vid card. Runs well for me up until 2500, after that if I use the drag feature (Left mouse) mass lag is created. Without doing that, it got to 4k smoothly. Nice work though. Would like to see this in action in a real rts game. Would be awesome to watch a war between thousands of soldiers. Even 1k total would be impressive.
     
  13. Imillionaire

    Imillionaire

    Joined:
    Dec 14, 2012
    Posts:
    60
    Are there any more updated tutorials on how to setup a fresh scene using this? the only part of this package i would like to really implement are the spawning, pathfinding, and combat system, and sprite manager (though this i'll worry about later). none of the other RTS devices are a huge concern for me. but when i follow the old tutorials, and setup scene. no units are spawned, or when they do spawn, they dont try to engage anything.
     
  14. x_ming_x

    x_ming_x

    Joined:
    Jan 1, 2013
    Posts:
    46
    Hi there
    Nice addon i tried the demo on my unity 4 pro project and it worked fine, i then bought a copy whilst using unity 5 demo but now i need to import it into my unity 4 project and its throwing some compile errors, should this work with unity 4 pro ? any help much appreciated
     
  15. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    My hardware is really bad, we're talking a $350 laptop but the framerate for me was around 9fps, I also had a few errors pop up in the console.

    That said, the sheer volume was pretty epic. Totally fun to watch.
     
  16. MarcopoloR

    MarcopoloR

    Joined:
    Feb 4, 2015
    Posts:
    114
    Interesting. I have always loved the Total War Series and wish there were more games out there like it. I don't have the resources to make a full blown Total War type game obviously, even though now I think I could design one (it I had about 50-100 people working for me and a game engine that is optimized for this sort of game) that is more interesting and fun to play than the latest ones in that series. Can you make a mini Total War type game with this? Basically turn based on a strategic map similar to a game like Civilization, but then for the battles zoom in and fight them in real time?