I've had an embarrassing problem for some tim...

September 25, 2007 by Adam in NWN2

I've had an embarrassing problem for some time now. I'm theoretically quite good at math, but when it came time to code the ship combat AI so that the enemy would turn and head towards you, I have been failing miserably. I was breaking out the trig, scribbling angles on paper, and watching ships either go in a straight line or sail in circles.

Yesterday I decided to try something different. There's a built in function that makes a creature turn to face a point. The catch with boats is that they don't turn on a dime, so I turned it, found the ideal direction, and then turned it back. It worked like a charm and there weren't any weird flipping animations that I was afraid of.

I'm adding some additional polish in the ship combat scenes. I want to add in more sound effects, an indicator to wind direction, and make sure the whole thing is fun. For example, ships no longer try to sink you (based on your hull damage) if they're trying to capture your ship. Being repeatedly sunk was no fun.

I'm also hoping to at least get started on the Daniel dialog. My wife is back in the country after her Italy trip, so hopefully things will be less crazy at home and I can start moving towards a final QA run before a public beta.

permalink| comment

Older Posts

Links

Dragon Age
Dragon Age Central

Interviews, etc.

Why We Fight

About Me

I've won multiple awards for my Neverwinter Nights modules, which I've been working on since the year 2000. In the real world, I'm a web developer for a healthcare organization. If you have any questions, feel free to contact me.