Starting to add some AI to the Duchess. Built an evasion counter, if you can increase your distance from the Duchess every frame for a predetermined interval, she'll respawn in a different location, meaning you evaded her clutches. I can already determine if she's visible, so I'll only allow a respawn if you can't see her. The thing that concerns me, is how intertwined does the AI become with the level design. If I tune the AI am I freezing the level design. Do I need different AI for interior and exterior levels..... The picture is the radio out of a Huey. |
0 Comments
Getting back to the game, I decided to add a simple feature this evening. A simple bobbing motion to the camera so that it feels like the player is walking and not just floating across the landscape.
It's pretty easy to do, especially if you use a nice convenient curve like Cos or Sin. The character controller even has a function for getting distance traveled (cc.velocity.magnitude). So we can take these and scale them to make a function that adjusts the camera offset from the character controller to get a nice bobbing effect. Which sounds like it would take about 10 minutes, but I confused myself about how character controllers work, read the documentation for the wrong method and then wasted an hour trying to figure out why my units were screwed up, when they were actually correct. Problem exists between mouse and keyboard. Bedtime!!
My model arrived and I did notice a few texture artifacts caused by the support structure. A quick email with Hero Forge suggested a swim in 409. I followed the 409 up with sandpaper and slightly thicker primer and paint than usual. The resin is very easy to work with, although I did break my mini by dropping her. Nothing that superglue couldn't fix. While the artifacts are disappointing, all miniatures in this scale need clean up and quite often a severe problem (slipped mold, damaged mold, bubbles) results in a mini that is only good for the bin. Multi-part models also require assembly and putty to make them look good, so overall I think the 3D print is of acceptable quality whilst providing a unique product. Results:I'm actually very happy with the results. She looks like she's ready to do some damage.
The characters in my game are made from a prefab that is essentially an empty game object with children that are renderable. The problem is that as this empty object doesn't have a Renderable, there is no bounding box available for frustum culling. So we need to find its children and aggregate them for visibility determination.
Finding the children is actually quite easy as shown below once you know they are accessed through Transforms. Fortunately I don't need to aggregate the children to generate the bounding box because of the way my models are designed. Basically I just need to know if the face is on screen. Plane[] planes = GeometryUtility.CalculateFrustumPlanes(localCamera); if(GeometryUtility.TestPlanesAABB(planes, souls[i].transform.Find("face").renderer.bounds)) { print ("Visible"); } |
David CoombesMaking stuff Categories
All
Archives
February 2024
|