Saturday, June 8, 2019

HBV Microbe Pathfinding Script

I thought that using a way-point system would be ideal for HBV particles to navigate arteries, because at the time, it seemed to me that setting up collision volumes for the arteries would be a nightmare. I then thought that a navmesh could work, if I generated the navmesh geometry along the artery curves in Houdini. This would be ideal for a top-down game, but not any other type of 3D game, especially in VR, if the HBV particles can only move along 2D axes. So, I'm opting for a more natural method of path-finding--using ray-casts to detect the walls. I found a way to achieve 3D path-finding using ray-casts. This would be ideal for a space shooter, or microbe game where there needs to be multiple agents navigating and floating around. Some sort of simple way-point system could still be useful in conjunction with ray-cast path-finding for the viruses to navigate through the arteries. I realized that setting up collision volumes isn't going to be nearly as tricky as I originally thought, as long as the collision volumes are large enough and close enough to the arterial walls for the HBV ray-casts to detect them, and the ray-casts are long enough.

There are sections of code commented out because they are non-functional, or used for testing. The script is still under development, but it lays a foundation for a microbe path-finding system for my Master's Thesis game. It is unclear what exactly my thesis game will be, but one thing is for sure, it will concern an environment of blood vessels to be traversed by hepatitis microbes via path-finding.

This is what I have so far:


As you can see, the HBV particle avoids collision meshes in order to reach the goal, the cube. In the script, some of the commented code is for alternate raycasts that are cast on all sides of the HBV particle instead of in front. The ones in fromt are ideal for avoiding walls, but the ones on all sides may be ideal for avoiding other particles, additional testing is required to determine this.

Here are my scripts: