AIWander getRandomIdle()

Everything about development and the OpenMW source code.
Post Reply
User avatar
EmperorArthur
Posts: 33
Joined: 17 May 2014, 07:52

AIWander getRandomIdle()

Post by EmperorArthur »

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.
getrandomidle.py.txt
Python implementation of AIWander::getRandomIdle()
(1.32 KiB) Downloaded 153 times
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.
dteviot
Posts: 144
Joined: 17 Dec 2014, 20:29

Re: AIWander getRandomIdle()

Post by dteviot »

EmperorArthur wrote:Now, this is nice and all, but the way getRandomIdle() calculates things still isn't that intuitive to
Yes, that code looked odd to me as well. (I didn't check it fully, my current focus is elsewhere.)
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.)
Post Reply