Just saw this thread! I was asking about just this previously. I’ll see if I can get the RTS Demo to work.
UPDATE: Sadly that requires a pro license, So I will check it out after I complete my project. I’m pretty sure I’m not allowed to use paid assets for a course project. If I’m wrong about that, expect to see lots of questions about how to get it to work.
I have tried to replicate the native collection has not been disposed errors, but I have not been able to.
What I have tried to do is to just use the RTS scene and use a script to reload the scene several times, but it doesn’t seem to trigger it. Do you have some steps I could follow to be able to reproduce it?
I’ve been debugging the difference in behavior when the agents are stopping and it seems like it’s due to some bad constants I had in my code. From the point where the agents noticed that the destination was crowded they would wait for more than a second before actually starting to slow down.
Try editing a script, let it recompile and then reload the scene. It didn’t work for me, even in your example scene. I don’t see why it wouldn’t work as when you reload the scene everything should get destroyed?
Anyways, I think these things make big difference once you get to the polish stage of the game, because you want to be able to iterate on things fast.
Ah. That did indeed trigger a bug. Every movement script would get their Update method called one more time per frame every time you recompiled and reloaded the scene that way. So the unit would move faster and use more CPU. I did not see any native array leaks though.
I have fixed this in my dev version now.
Yeah, that’s what I’ve been working on for the last week
I’ve been trying to get a good and stable behavior when moving groups of units and I’m pretty happy with the result right now. I still need to fix a few bugs before I can push out the beta, but it will likely go up within a week.
Good to hear.
By the way what kind of collider setup the RichAI supports?
I’ve been using a capsule collider attached to the same gameobject up until now, but I’ve had this issue where bigger creatures can climb on smaller creatures because I’m still using physics. I was thinking a interesting fix to this problem would be using a cylinder shaped mesh collider parented to the RichAI/rigidbody.
I tried this and it seemed to work mostly fine, but the AI never seemed to reach it’s destination.
The new beta (4.3.6) is now up. Sorry for taking such a long time to release it. I have been plagued by soo many last minute bugs. I switched some components to use a custom gizmo system and it turns out that gizmo drawing has a ridiculous number of edge cases that one has to get right. I also switched local avoidance algorithm from RVO to ORCA and I had to fine tune it to get a more similar behavior.
The new version has some improved formation code for the RTS demo and the agents stop more reliably. The exception may be when you only have two agents that want to reach the same point in which case one of them sometimes sometimes fails to stop. I know how to fix that case though, I just thought I should push the beta out sooner rather than later.
Performance for local avoidance has also been increased.
The RichAI script supports:
No collider/rigidbody (recommended for highest performance)
Using a CharacterController
Using a rigidbody + Collider
Using a rigidbody2D + 2D collider
That would be really bad for performance. Mesh colliders are really slow. A better solution is to rely on local avoidance for collisions and change your project’s physics settings so that agents do not collide with each other (and/or change your agent’s ground raycast mask to exclude the agent layer).
You can definitely do that, but it depends on what kind of rts you want. RTS games have wildly different requirements. Some RTS games work very well with the features that this package has and some would require a lot more features.
This particular demo is only in the pro version (or the beta). However you can try out the free version of the package which should allow you to test most things.
I figured the solution to this was to delete the one that wasn’t static, and that seemed to fix it.
However that wasn’t the end of it. After that I got a bunch of errors like this that I couldn’t figure out
Ah. Crap. UnityPackage annoyances again.
So UnityPackages do not support deleting files. In this case I have deleted the original Draw.cs script and made a new one with the same name in another place. However when upgrading unity will keep the original Draw.cs script that I deleted. The correct solution is to delete it in your project. I will publish an update that fixes this.
The second group of errors seem to be because you have a too old version of Unity. The API that I use is pretty recent.