So, I've been spending time on the AIWander code, and realized that there are some improvements that could be made.
Most of those improvements are here.
https://github.com/OpenMW/openmw/pull/701
Now, this is nice and all, but the way getRandomIdle() calculates things still isn't that intuitive to me.
With that in mind, I've written a little python program to model the distribution.
I Haven't gone too far yet, but am looking for other's opinion before going further.
Edit: No need to include details of the PR in this post when people can just follow a link.
AIWander getRandomIdle()
Re: AIWander getRandomIdle()
Yes, that code looked odd to me as well. (I didn't check it fully, my current focus is elsewhere.)EmperorArthur wrote:Now, this is nice and all, but the way getRandomIdle() calculates things still isn't that intuitive to
That said, you should probably search for AiWander on the Wiki to see exactly what the distribution is supposed to be like. Then build a test case to confirm that getRandomIdle() is producing the desired distribution. (And if it's not, you should be able to prove that any modified version of the code IS producing the wanted distribution.)