uRTS: Toolkit is allowing to simulate RTS battles with 6 phases: searching targets, approaching targets, attacking targets, damaged units self-healing, dying phase, and sinking phase.
Different phases are used only for suitable objects and full script is attached just to one object in entire game (for example, terrain). This allows the simulation to perform calculations and set parameters for all objects very quickly. Nearest neighbour search, used to find nearest targets coordinates is using kdtree.cs class (with heapsort algorithm for vectors), written by A Stark at 2009 and available here: http://forum.unity3d.com/threads/29923-Point-nearest-neighbour-search-class
WaitForSeconds used for long loops allows to increase performance even further. In general, script is optimised to run with O(n log n) time assumptions. Performance analysis (which is performed in this script too) shows that only 3 - 10 % of time is spent for calculations inside loops of all time with WaitForSeconds.
Each unit has their individual movement, set by the script, which is independent from other units and makes battles more realistic.
WebGL based armies demo will allow player to make battle between two nations and experience battles with large number of units (press “Q” to spawn multiple units; repeating will add more units): https://chanfort.github.io/armiesdemo/index.html
Less optimised old version is free as demo version:
I have just checked out the 1a demo, but I haven’t quite found out the main idea of this demo.
I have seen many units on the map, but the distance between them are too huge, and can hardly see the interaction.
Though I can control the cam movement, but I cannot figure out how to control the units.
Could you describe what interactions we can do with it and what can we see from that?
Currently units control by player is not implemented, but it is on my priority list and I will include it into next release. Battles created by this simulator demo are now more like between two AI, instead of AI-Player battles.
Scales, which were used in simulator demo are created based on more realistic idea, that units may need to go many kilometers before they reach their targets. I want to check how battles are getting distributed and evolve into such large scales. If you want to shrink scales lets say onto 4 times smaller map, you can set up initially smaller size of map, bake on it Unity navmesh and modify SpawnPoint parameters, that units would be randomly distributed on smaller scales.
I included documentation link at the first thread, please take a look for more details.
I just implemented new realistic archery and diplomacy update to have more than 2 nations in the map. YouTube announcement is available here and demo version with these changes is here. These updates will go live into the asset with next version 1.3 update.
I like this asset. I’m curious if anyone tried to add real units to it (animated soldiers). I think it would be really epic.
Btw, right now, I guess that the animations are not controlled by the system no?
Hi primus88, I am thinking to release some first games with animated models at some point with Unity 4.6 GUI, as there will be much easier to make menus and more friendly controllable games.
At the moment I tried free Spartan King model, but it works well with only few hundred models placed on the scene. I need to make some of my low poly models for this game, but I am terrible at modelling myself
No, at the moment animations would not run, but there are like 10 places in code, where I can easily put
animation.Play() instead of changing colours, so this part will be easy.
I guess that LOD levels are mandatory for a game of that size
I think you will easy manage to cram together thousands of units with a proper LOD system.
In my view, next thin you should focus on is to make it more hands-on. Meaning that I want too see that I have more control over the units. That I can identify each of the units (melee, archers, cavalry etc) and give them movement orders / interactions.
Definitely that LOD will be needed - I am thinking to create like 5-6 versions of models with different number of polys and keep switching them based on distance from camera. However at the moment I am not sure if dynamically switching models in 5-6 radii will not move down performance a lot.
Oh, yea, these controls will come up together with Unity 4.6 GUI updates applied to my game.
Well, I guess I may start with my own LOD (even not very well optimised) at the beginning, as I want to keep my package compatible with Unity Free. This will also make sure that I will know how my LOD will work (it would be not a black box for me at least). I think it is still very far away till Total War engine, but who knows
Big improvements are just made in the horizon of having large amounts animated object: 3dSprites are here. Here is the demo how the scene looks like with these sprite models. Videos, showing how this sprites system works are here.
At the moment this is for demo purposes, but if the aim is to use Facebook features then Facebook SDK integration is needed. Good news is that it is working and further steps should include Facebook SDK as well.
Hi…
I’m thinking of buying this asset …but I do not like very much 3dsprites results…I tried the demo and very many soldiers disappear from the screen for a moment
Âżwhy in the demo video / webplayer the 3Dsprites become invisible for a moment?
Hi technotdc, thanks for a message. Yes, this appearing - disappearing issue was staying for a few weeks. I just found the solution a few days ago. The issue was that sprite mesh was not updating. Current version does not have this bug fixed, which will be included in next release. These ones, who already have this asset can tick “Update Mesh” in Linked Sprite Manager attached to prefab.
Facebook demo is updated - 3dSprites are working without disappearing now.
In folder “uRTS/prefabs/spriteManager” there is “SpriteManagerPrefab” with attached “Linked Sprite Manager” script. Place a tick on “Auto Update Bounds”, save the scene and everything should work.
1- it is possible to put two or more different 3dsprites in screen ???
(one different x nation )???
2- it is possible to add atack animations 3dsprites when they are in attackPhase ???
(only with 3dsprites because in 1.3 version, with models i have already changed )
thanks
PD-I like this great asset ,because in my old PC i have a good framerate with hundreds soldiers