reeseschultz / ReeseUnityDemos

Unity packages and demos—emphasizing ECS, jobs and the Burst compiler—by Reese and others.
https://reese.codes
MIT License
515 stars 45 forks source link

Parent agents to surfaces, not bases #8

Closed reeseschultz closed 4 years ago

reeseschultz commented 4 years ago

Agents should be directly parented to surfaces so that 1) their rotation is correct, 2) inter-basis navigation is possible, and 3) navigable surfaces and bases can move independently.

This change would be a relatively large undertaking, but fortunately it shouldn't break any user-facing expectations.

I've played with this idea before, locally, but encountered issues. One problem was that, when changing parents, the built-in ParentSystem kept reporting an error that a HashMap was full, which I suspect may actually be a bug where its count query is wrong.

reeseschultz commented 4 years ago

I'm trying to reproduce the aforementioned bug strictly with tests in a different repo, but no luck so far. Will keep trying. Ideally I don't need to send Unity this entire repo with all its bells and whistles if I can help it.

reeseschultz commented 4 years ago

I'll give this another go shortly. I'm wondering if I try to implement this with the latest entities and physics (see #17) versions if some blockers have been removed by now.

reeseschultz commented 4 years ago

Finally. I have this working by adding some more matrix math, at least in the NavPointAndClickDemo, but there are bugs.

reeseschultz commented 4 years ago

I'm committing interim progress to a feature branch for this (and #17), feat/surface-parenting.

I'm also thinking I'll bump this and the other packages to v1.0.0 after this is merged (the other packages have been reliably used in the navigation demos).