Discussion in 'Assets and Asset Store' started by chanfort, Jun 6, 2014.
So finally mobile support takes first steps in uRTS:
My first madewithunity story just got published:
This is how well served SpriteManager passes into history, allowing more modern Unity's Shuriken Particle system to take over:
There are also several more detailed tutorial videos afterwards with some links to demos.
Sorry for my English, I use google translator
First congratulations for this great asset.
After several days testing the scenes, I think I understand all its functions, and it seems an incredible system, but there is a point in the game that I would like to change but do not know if I can:
For the construction of buildings, the castle is used(i hate this point jeje). But, Its possible that workers could do this?
My intention is to make a game where workers build the buildings, and buildings spawn units (workers, archers, soldiers...). Like "Age of Empires".
A second point that I would like to know how it would be possible to change, it is time to place the buildings. Could change the green brush for a preview of the building itself?
Thanks for everything,
Interesting ideas. It would need a bit of coding for both things, but it's not very difficult. Would probably work the approach to put "build" button not in the castle menu, but on workers menu and when building is set, move the worker close to the location and start building. It may look a bit more realistic to do with workers, but I found that player can set things faster (especially at the beginnings) when just setting up from the castle. Another point - I can put it as optional, i.e. workers help could speed up setting up buildings or make it cheaper to set from worker, or just give a better choice for developer which way is better appreciated
To change a brush to lets say "half-transparent" building looks interesting. At the moment it's just projector "shining" into the terrain, but would probably work nicely to create prefab for the pre-build building with half-transparent materials.
thanks for having these ideas in mind. I wish I could help, but I do not know code
There is always possible to learn how to code step by step. It's the main way to create a unique and rich game, and realise your long-standing ideas...
Awesome asset. I'm working on a zombie game where I'm looking to have thousands on zombies on screen at once. Is there anyway to use the 3d sprites in a more simple way. I'm sure you could sell this as an asset by itself. I need more of a drag and drop script onto a game object to handle 3d sprites that could work with my own scripts with mecanim support. That would be a killer asset that I'm sure would sell like crazy.
Yes, 3dSprites are coming as a separate asset and should come to asset store soon. There are also some-level documentation how to set up models to go through 3dSprites. However, I am thinking to make quick step by step guide to ease and make more clear the way how you set any kind of model. I didn't looked yet for mecanim animations, but I guess it should be relatively simple to get them working.
Thanks for the RTS framework, I was afraid that my project was dead in its tracks on seeing that unity couldnt handle more then a few thousand gameobjects at once. Im glad you were able to share your framework with us.
Ive spent the past day or so trying to figure out how all of this code works and its a bit overwhelming, I am a decent coder so I can understand it, there is just so much! I feel like I have only scratched the surface.
What I am trying to do is to remove pretty much every aspect except for the units, Im making a Total War like minigame where you have an army at the beginning and you fight the opponent until your units or enemy units retreat. First thing I am trying to do is to make everything division wide (movement, attacking, exhaustion/moral) instead of by individual unit. First problem I am coming across is that im jumping between like 5 scripts just to figure out how to instantiate a unit properly. If you have the time avaliable, any chance you could do a short guide on how to properly do this? If not, any tips to making some things division wide instead of by individual unit?
Hi, and thanks for reply. If you are trying to spawn not an individual unit but a group instead, you can use several approaches:
1. spawn units in a regular way and put on the formation
2. if you dont need to move units relative to each other and if you have flat terrain you can use a model, which has not just one unit, but multiple units instead (i.e. model of 4 units squad). In that case there would be just one navmesh agent for each squad.
3. you may want to experiment for a bit with this problem to find out what you really need.
As for performance - I doubt at the moment if groups would bring big advantage without loosing some naturally looking nature when you use at individual unit level. What could be potential points to investigate would be:
1. Avoidance tests - to move out from Unity "automatic" agents and move them manually. Then you will be able to see which loops are most expensive, if you may want to call them less frequently. In a large cluster there are probably many units in the middle which could not reach their targets and only at the edges of cluster action is happening - you can reduce calculations in the middle of clusters for these units which show no sign of big movements or actions.
2. New 3dSprites system shown that rendering is no longer a problem. If navmesh and avoidance calculations would come closer to rendering at some point, you can remove GameObjects and use Graphics.DrawMesh to get around that you wouldn't need to use Transform anymore.
3. You can use multithreading for more heavy avoidance calculations, but that would limit you from platforms like WebGL at the moment.
I guess quite a lot of things are quite experimental here as the question about how to bring more objects to Unity remains open.
Hi i was wonder what the current ability of the system is to have lods of the models and switching them based on distance. Is it using unitys culling groups maybe ? And is there any difference to your stand alone 3d sprite system in thos reguard. Im not planning on a rts game but i want as many characters on screen as possible. If possible 100+ on mobile. With in a fairly high poly count city (100k triangles). Thanks- josh.
Hi, if you are interested in 3dSprites only, there has been released separate asset (https://www.assetstore.unity3d.com/en/#!/content/50386). uRTS Toolkit uses this system as well. As for 3dSprites, make sure to check my new thread (http://forum.unity3d.com/threads/3dsprites.374454/), where are some examples given.
3dSprites are not using LOD meshes at the moment, it only switches to sprites at specific distance. If you need to use LOD models, you may want to define all LOD levels to be switched at smaller distances than 3dSprites, i.e. lets say you have your model which would have 5 LODs. Then you can render different LOD levels at distances of 1,2,3,4,5 and finally switch to sprites at distance 6. As long as LOD distances are smaller, any LOD system should not contradict with 3dSprites.
I didn't checked yet what are Unity's culling groups and what they are doing. I suspect they are responsible for units, which are not visible to camera (to hide units). 3dSprites are dealing with units, which are in a view of camera, so if you adopt culling groups you may push performance even further.
It's kind of an art to find best possible distances where to switch to sprites. However, for your meshes you may want to do tests to see what is actually draining performance - are there meshes, colliders, navigation, movement calculations or something else.
As for sprites - think more like about Shrunken particles and how many particles your device could handle.
Ok thanks for the quick reply. So there isnt any difference between uRTS and 3d sprites as far as how the 3d sprites are handled. So if i want to buy uRTS i could pull the 3d sprite portion out with any issues ?
uRTS only uses 3dSprites, what means that there are no baking scene and comparison scene there, so you won't be able to create your own 3dSprites. uRTS main goal from 3dSprites is to handle large scale battles. If you are developing not RTS game, but something like city simulation game with lots of characters, I would definitely go with just 3dSprites, as it's very unlikely that you will need any of RTS AIs or something else...
Hi @chanfort, just by reading through 5 pages, I have some questions:
1) any plans to implement Multi-Threads support for KD Tree search or 3D-Sprites systems? I'm not aiming for WebGL platform, and looking for less frame rate hits.
2) How easy can I add extra behaviors to my Battle-AI type? Can I override myself, without hacking into uRTS code base?
3) How easy can I use my own Camera system, again, without hacking too much uRTS code base, which is a headache later, like your upgrade, conflicting my changes.
4) any plans to implement LOD support? Because it's weird to have 2 LOD systems.
5) from what I know, 3D-Sprites using Particles now instead of Sprites. So I wonder the performance between Particles Physics collisions vs. Sprite Physics collisions? Because I want to add some forces to units, when they are in Particles 3D Sprites form.
6) Can you explain a bit about your Hit Detection system?
Hi ikemen, welcome back and thanks for questions
1) I had a plan to start putting multithreading for KDTrees until I noticed that it's not the main performance eater. If you run a battle with several thousand units and open up Profiler, you would notice that on the top of the list there is almost always NavMesh Agent functions. It means that the most of computing power is consumed by local avoidance calculations and the right thing to do first would be to control manually local avoidance calculations. I started to implement manual system a bit earlier, but at the moment it only moves units along their path with no avoidance at all. The performance is significantly better, but units can go through each other...
2) At the moment BattleAI is almost like "baked AI", which runs AI on specific units, which follows some conditions. I am curious what behaviours you may want to see here? It looks like quite interesting area and could improve AI "intelligence" further
3) Umm, at the moment RTSCamera got updated last time with mobile support. The old camera, was checking when specific keys are pressed, to move camera. The new system adds additional check on the top - if it's mobile or not. If it's mobile, the old part of code is not even considered and only the new part runs there. So the first question I would wonder is if you getting conflicts on desktop or mobile device? In fact, if you have everything controlled by your own script, you can just lock up everything what runs in RTSCamera Update function - then nothing should be conflicting with your own camera script.
4) I thought Unity has some kind of LOD system, so if you just have your model imported with LODs, everything should work independently from 3dSprites as long as all LOD distances are being smaller than 3dSprite switch distance.
5) There was never such thing as Sprites with their Physics in uRTS. The system, which was before was using SpriteManager scripts, which was not a part of Unity. These scripts were just defining mesh system of billboards to handle at which locations in space to put billboard square and what image to show that it would represent a visible unit in that location. If you want to use forces, you can use GameObjects and attach your forces or colliders components onto these GameObjects. However, you shouldn't use forces of particles in the 3dSprites, as there is no callback from particle scripts to adjust GameObjects to follow particles. If you implement those callbacks, I'm afraid, you probably would lose at least half of performance just from callbacks to update GameObject positions.
6) Umm, damage on units is applied through AttackPhase coroutine in BattleSystem.cs . There are multiple checks from which units damage is made. If attacker is archer, it is launching an arrow. The arrow flies through space based on gravity law (ArrowPars is responsible for these). If arrow reaches it's target through specific distance, damage is applied onto target and nullified on arrow, that it would not cause any more damage. Later arrow is being destroyed. If damage is being caused by knight, random damage number is being applied onto target in specific time intervals. Attackers can enter AttackPhase only from ApproachPhase when they get close enough to their targets. If they become more far away, it comes back to approach phase again and continues approaching till the distance becomes small enough again.
I am thinking about setting up version control for uRTS on Bitbucket for those of you who want to follow more recent changes and features, and see if things are working for your own scripts.
Recently I was spending most of time for bringing up multiplayer support. Results looks promising, but it comes with a cost that scripts getting complicated even more. The point, which I want to achieve with that is that multiplayer wouldn't be a completely separate game and that player would be able to switch between single player and multiplayer with all their towns, economies and other set-ups. This will bring easy possibilities to train and set up towns in a single player and finally when players agree that they are ready to challenge each other with what they have created, then it's time to clash and see who wins. At the moment it's still in its early phase, where movement and hit detection across the network seems to be working. However, lots of optimisations will be needed to bring so many units to be correctly transmitted through the network. So this is my top priority probably for upcoming month to bring multiplayer alive and running.
@chanfort Hi thanks for all the answers. In fact, I haven't read any code of your uRTS system yet. I'm just playing around with demos, and reading posts and following this thread. 3D Sprites system truly amazes me, because I'm planning of using 3D Sprites only for my massive AIs, and forget about Animations, which could be a performance bottleneck. Your Nearest Neighbor Search, using KD Tree data structure is another feature that I like. But, the AI system, Steering, overall and behaviors to me not quite friendly enough and easy to extend, like you said, almost like "baked AI". Your Damage system looks like a quick fake hit detection system, so no real hit detection taking place, just a distance check between the Arrow final position with its target, is close enough to apply any damage. My game is shoot them up genre, so real bullet requires real damage check. Anyway, I'm going to buy 3D Sprite, and starts with it first. Your system is powerful, but I wish there is a way to separate its modular systems.
I'm glad you are planning to support Multiplayer. I can't wait for any new updates.
Yes, AI systems are a bit tricky at the moment, because usually you don't know which behaviour fits the best. Eventually they should get better once I will try to look at more procedural decisions system at the town level. I was also quite interested in visual programming, as it could bring nodes, which would be much easier to understand for other developers, who uses uRTS. However, Unity itself does not come with visual programming at the moment and 3rd party plugins would be needed, what could make development even more complicated and confusing. For damage detection, yes it's a quick trick, but in fact, what is actually damage detection? In real life it would be when arrow / bullet reaches the target. The difference is that in my system the target is assumed as a sphere. It can be reasonable up to the point, while arrow is outside the sphere. What I was thinking next could be that when arrow enters the sphere, more precise detection, which would be looking if arrow doesn't cross the mesh, could be turned on. I got a bit stuck with this is how to detect when arrow is crossing unit mesh. If this would be implemented, it would allow to have nice (but a bit brutal) effect - when arrows hits targets, they can could get stuck into dead soldiers at the points where they firstly started to intersect with unit mesh. P.S. Damage is applied not on final arrow position but at the point when arrow is reaching enclosed sphere of the target. As for bullets it can be different - bullets are flying at much larger velocities and they could just pass through the target between two update calls if it would be implemented that way. So maybe it could work better to use straight lines for bullet paths and pre-calculate if lines are crossing any of meshes. In arrow case projectile is not a straight line so both approaches are a bit different. If you go with many thousands or tens of thousands bullets crossing your field, calculations can become heavier, but I guess with straight lines and vectors you should be able to get quite good approaches. The only unknown is how to actually detect if your bullet path line is crossing the mesh of the target.
hehe I want that effect it would be fun to look at.
I'm aiming for around 100-200 units vs. 100-200 units for mobile devices, plus a bit smarter AIs, like evading to get hit, retreating if too many, using shield if have it, etc. not like the old style Age of Empires, AI so grave, not afraid to be dead, fighting until his last HP drops (which is cool anyway). I will study your package soon, lots of questions may come up later
Great, let me know if any other questions will come along it
Any tutorial about setup uRTS to mobile ???
Hi, welcome back! Did you checked this one:
I Have 2 questions
1- how do you show ( i can so? ) new buttons for mobile input?
2- it work for Android ?..(i saw the video is for iOS platform)
1. These movement buttons should appear in runtime mode when you run the game. Firstly you need to switch platform to Android or iOS and finally you can press run in Editor and these buttons should appear. If they are still missing, let me know.
2. Yes, it works for Android as well. Just choose in platforms list Android instead of iOS and wait till Unity reconfigures everything (it might be good to make separate copy for Android as this configuring takes about 20 minutes and if you keep switching between Android and PC, it might be good to have two copies for quick work). In the video I didn't shown Android because Chromecast didn't worked with my Nexus device and I was unable to show Nexus screen on my laptop...
yes....still missing.....(I changed platform to android , play run in unity and buttons do not appear
I just checked and for me buttons appears as they should be. Which version of Unity are you using? It looks to me like it would be imported one of older uRTS versions (this FPS counter is also hidden in newest version by default), where mobile buttons are not yet implemented. So check if you have:
1. Unity 5.2.3
2. Re-import uRTS from Asset Store
3. Open up documentation.pdf to check that v4.0 is written just bellow "uRTS toolkit" and that the date is 21/11/2015.
I noticed that by default Unity imports corresponding version of asset, which was used when asset is being uploaded to Asset Store. This leads that if you are using previous Unity versions, like 5.1.0, 5.2.0, etc., the previous versions of uRTS will be automatically imported. You can also see the list of Unity versions in Asset Store: https://www.assetstore.unity3d.com/en/#!/content/17660
which were used to submit the package.
Let me know if the problem still remains.
ok....I will try downloading new version of unity....(im Using Unity 5.1.2)
Great news: development of uRTS multiplayer mode has been a success! However, implementing multiplayer mode required to rewrite and review almost all currently existing features and some of them are still needed to be tested more properly. Multiplayer is UNET based, what means that there is no need of any other networking packages in order to be able to run multiplayer mode. Currently multiplayer has been tested only on LAN. It works well with host-client standard configuration. More than one client still may throw some errors, but it will be soon tested and supported.
- Spawning and destroying building and units
- Health sync
- Damage transmission
- Nation spawning
- Players and AIs nations on the same map
- Units movement sync
-- Players: on their own devices - makes instant action when controlling your own units (no latencies)
-- AIs: on server
- Diplomacy and relations between players and AIs nations
- Baking via RTSCompiler on empty scenes
- Multiplayer medieval style HUD inside Options menu
- "Nice" disconnection of client via HUD button
- "Nice" disconnection of host via HUD when there are no other clients connected to the network
- Full support for many clients
- Handling "crash" and other types of disconnections
- Network data flow optimisations for large number of units
- MatchMaker support
Just started some modelling in Blender, so soon horses should come into uRTS
It´s a great asset ! I amazed it have 72 scripts!
Im a beginner in unity and in c#. It is possible to change the building prefabs and units?
I see under RTS Compiler the options. I choised one prefab but no result. I see , i can change the mesh filter. But how make i this really ? I hope to hear from you.
Hi, if you like to change just geometry and overlook of buildings and units the best idea would be to overwrite existing geometries. I suspect that mesh filters should work. Try to use different mesh filter lets say on castle prefab to see if it looks different.
Some wild life starts to appear in woodlands - wild horses... They are wandering around these lands based on a new script, which will provide random movements
Now I guess it's time to find out how to make riders
I was always thinking that sometime LOD will make its way in uRTS. I guess this time is now:
A new look into multiplayer mode:
Today hits 2 new videos about multiplayer structure, new models and LODs:
The last 2 videos from recent weeks development comes about RTS Compiler updates and a launch of a new website!
Something procedurally sweet is coming into uRTS:
Just saw 3d sprites from unity asset store facebook link. I've always wanted to remake a duke nukem 3d / doom style sprite FPS. Can 3d sprites work at any distance, id like to have it on at all distances even very close. How does it take snapshots, is it automatic, manual or both, I'd like to take snapshots and do dismemberment animations on the sprites. Also since it is geared towards RTS, can you do any angle or is it currently only top view snapshots? Thanks in advance.
Hi, check out demos firstly for WebGL and WebPlayer:
to get the idea how it works approximately.
Sprites are pre-baked before you run them on your main game. Textures are saved into PNG and when you launch your game they are being imported. It works at any distance, however, at a very close distance sprites does not look very good as there is a miss-match due to curvature effects between perspective view and baked sprite image. Animations has to be made on models, as sprites are taking snapshots from these models. Sprites on their own only reproduce these animations to make illusion of 3d models. As you can see from demo, it's used for multiple angles.
Can those png textures be modified outside like with photoshop then brought back in and used by 3d Sprite?
Sure they can, you can do whatever you like, it's regular PNG files. Just copy PNG file like usual, do stuff in Photoshop and then copy back by overwriting the original file with your modified one. If something won't work, check if in TextureImporter (within Editor) everything is the same for modified textures as for original ones.
Just made some exciting implementation for time of the day, which brings golden sunsets and sunrises as well:
The time of day videos are in:
Big performance improvements were just made by using DrawMesh() instead of having child GameObjects with skinned mesh renderers attached on them:
Fires are coming up into uRTS :
So here is the video for procedural fires; there are more vids about more advanced stuff for fires in my channel as well.
The new procedural terrain update now allows to generate terrain on runtime where camera goes:
This weekend has been a very good start for usage of A* Pathfinding Project for navigation in uRTS. The sneak peak arise with "Riding to West" trailer as A* starts to get working with procedural terrains:
This weekend "blindness by night darkness" problem is solved as buildings will now have point light sources, which will turn on at night: