NEP Dev Update #12: Lots of physics updates!

by Cuchaz

I'm still trying to figure out how to balance a part time job doing heavy thinking/programming with working on my game engine (also heavy thinking/programming), but I'm getting better at it. My development pace on NEP is a bit slower than it used to be, but I'm finding ways to be more productive all the time!

Lately I've been working on completely overhauling the physics simulations in the Horde engine to be much Much better. Like, good enough that projectile trajectories match up with real ballistics equations. Meaning, the engine can now do physics accurately enough to launch a projectile that actually hits an arbitrary target. Watch the video:

Point and shoot!

I also did a ton of work on the solid object collision system to improve performance using fancy data structures called RTrees. This required making a tweak to a popular Java RTree implementation. Open-source software is such an amazing thing! I'm so happy I didn't have to implement my own RTree library from scratch.

I also implemented better collision reporting so that the various parts of game that rely on collision information can get it efficiently. Like agent behaviors.

And debug tools. #AABs4Life!

There's also lots of work I did on network sync (always network sync...) to make physical objects behave more smoothly and consistently across the client/server divide. The results look pretty good so far!

Basically, throwing rocks around feels really good now. Now I just need to give you a reason to do it. I'm working on non-solid object collision detection next, so the RIG will be able to tell when you throw rocks at it. Then exciting things will happen!

Speaking of the RIG, there's that video I promised of the stars moving behind the wormhole's event horizon.

Oooohhhh... Aaahhhhhh!

I've also been extending and improving the component system the Horde engine uses to help organize game logic. There's an old programming philosophy: prefer composition over inheritance. Games engines that use inheritance to share behaviors between objects can result in some really huge and hard-to-maintain inheritance trees. For games, sometimes composition can work a lot better. Java makes a component system a bit tricky to implement since the language seems totally geared towards inheritance, but I made a really simple component design pattern that seems to be working well so far.

Behaviors for blocks/items/agents aren't typtically inherited in the Horde engine, but rather, they come packaged in components that can be mixed and matched in whatever combinations you like. No need for deep, wide, and confusing inheritance trees! Hooray!

That's it for now. See you next time!

Yup, we have RSS. Subscribe and never miss a post.

I also announce blog posts on Twitter.