Nav Station Implementation
Hey Folks! I was able to spend some more quality time with the space prototype today, trying to bring together the orbital plotter, voxel nav console, and crew sim.
First order of business was to get a voxel model done for the console, and I decided to just get a basic captain's chair for now. It's missing the screen and some other decorations, but it's enough to get the point across. And for me to see how voxel models look in engine.
Once that was done, and exported as an OBJ file, it was off to the code editor. In the distant past, I added a LoadOBJ() function (using StarsceneSoftware's ObjReader) to the prototype for some reason, so that was handy. The trick was figuring out how to get the game object that creates and inject it into the in-game item instead of the default cube and quads everything else uses. That took almost an hour of refamiliarizing, but I eventually got there.
I also had to add some scaling and rotation changes to the defaults for the import, to make it fit with the other items on the grid. But in the end, we get the blue chair seen in the image above (bottom left corner)!
Some initial thoughts on that: On the plus side, it nicely solves the shadow-casting issues my other objects had, and is actually really easy to draw/make. On the negative, it just looks so-so. I think part of the issue is lack of normal mapping. It just has per-face normals, so everything looks a bit dull and un-lit.
Graphics are a rabbit hole, though, so I just said "good enough for now," and moved on to hooking it up to game logic. And that meant a few things.
First, I had to migrate the orbital plotter UI I've been working on out of the ship editor (where it was for testing), and into the crew sim. This wasn't a lot of work, but took some figuring out to get all the pieces moved/rewired safely.
Then, I had to create some basic data to define how AI interacts with it. Things like "IsNavStation" conditions, condition triggers to use that condition info, an interaction for raising the UI, and some additional item and UI parameters (e.g. where to stand when interacting w/this object, which UI to load, etc.).
That's about where I am now. All of that is in place, but there are bugs when it runs. At first, the AI would interact with the nav station and nothing would happen. It turns out there are a few more functions I forgot to add to the plotter to make it show on-demand in the game. And that's where I need to resume tomorrow.
Assuming that works, hopefully we'll be able to direct the AI to the nav station, have the plotter UI appear, and pretend to go places! Then, we have to figure out how to make it really go places :)