Post news Report RSS Scientific Computing and Video Games

I put normal work on hold to address some long time standing issues with my game's structure. This means no new features were developed, but it makes adding new features far easier in the future.

Posted by on

Intro
I put normal work on hold to address some long time standing issues with my game's structure. This means no new features were developed, but it makes adding new features far easier in the future.

Architecture Revisiting

My original plans for this game were kind of sketchy, so I didn't plan my render-logic architecture out well. This was because of some inherent limits in both JME3 and double precision floating point numbers. So I sat down and thought of what I wanted and came up with this.


However, I also drew a diagram of what my render-logic currently looks like. It looked something like this mess.


And that is an unacceptable situation. My only choice was a total rewrite of both how my universe stores coordinates and how the rendering pipe works.

Scientific Computing

I have been trying to make this application work well with just doubles for storing coordinates, and it has caused me lots of headache. I have implemented all these cool tricks to try and make it work, but I got fed up.

Instead of continuing down this track I decided to find some arbitrary precision floating point numbers I could use to represent coordinates. This would eliminate precision issues that have been giving me headaches while writing what should be simple AI code.

After much research I decided on JScience ( Jscience.org ) for my scientific computing package because it has support for not only arbitrary precision numbers and math operations but standard/relativistic physics simulations.

I wrote a new class to represent coordinates Coordinate3D. This structure allows the transparent use of the JScience library. I was able to replace the old coordinate system based on doubles with this new structure.

It's a bit slower than doubles because it has to emulate a floating point, but think of how neat it will be to play a game that needs a scientific computing package to work properly!

Patrol Instancing
Although traders are a backbone of the dynamic economy and therefore should not be instanced my play testing has determined that patrols need to be. Simply put, space is too damn big! You're unlikely to encounter a patrol ship in a timely manner.

So, I have taken patrols and made them spawn within 10x your sensor range and despawn out of that range. This means the universe feels more populated. It is still quite dynamic since all the traders are not instanced but always alive residents of the universe.

Conclusions
Not a very exciting story, but it still works well in the long run. These architectural changes will make it much easier to build the rest of the game. I still predict a beta release before 2013.

Post comment Comments
newbie2356
newbie2356 - - 140 comments

awesome stuff.

Reply Good karma Bad karma+1 vote
247defed
247defed - - 67 comments

Well, glad to see you did some revising. It always helps:)

Reply Good karma Bad karma+1 vote
explorer13
explorer13 - - 238 comments

No matter what news comes from this, I am glad to read it. Especially this, it was quite an interesting read. Gave me a lawl at the point where you drew up a current representation of the rendering system. xD

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: