Worklog for Vilu

Ananta

Return to Worklogs

Big changes in the making(Posted 2009-05-27)
Update priorities

... for the lack of a better term.

By that I mean varying levels of detail for physics and AI update timing.

The basic idea is that the player ship will have a fixed priority of 1 (updates every frame). AI ships nearby will have a high priority too, but ships further out will have lower update priorities. Space objects very far away will have a priority of, say, 16 or so. And objects that only move but do not think (asteroids, planets etc.) should probably update at a fixed lower priority rate. That way I could increase the amount of physics entities dramatically without adverse effects to the game performace.


How this integrates to the current collision detection engine, I have no idea. The current engine requires that both colliding objects have updated before collision respose can be calculated properly. So I might have some trouble in implementing this one. Oh well, life without challenges wouldn't be that exciting, right?

The technical way to implement this is still a bit obscure. Maybe I should have 3 or 4 lists with fixed priority values, and dynamically move the objects between the lists as they move closer to or futher from the player. Also, I need an elegant way to make sure that the objects in a 16-frame priority list are not all updated during the same frame, but smooth them out to span all 16 frames.

All of this makes me think of...


Timing

Now there's a beast that requires a total rewrite. But why?

Having played around with fixed time step and fathomed out the pros and cons of fixed and variable time steps, I'm slowly coming to the conclusion that it's definitely worth trying.

First off, I believe implementing those priority lists I talked about above is possible only using a fixed dt, without the need to save the last update time with every object.
Secondly, there's a fair chance that my struggles with degrading planetary orbits are over after this decision. I knew from the beginning that variable physics step is a big no-no for the inaccuracies it causes.

Unfortunately it will be a hell of a job at this point of the project. There's a lot of logic in the game relying on the current delta timer, so it might require some hacking and shaky duct tape fixing to get everything in working order.

Or then again it might be better for me to abandon Ananta and join the Vega Strike team... ;)

--------------------------------
2d space sim in progress: Ananta
Worklog here
Code updates

Fly-by-wire(Posted 2009-04-26)
Remember Independence War 2 and Terminus? They were space sims that had beautiful Newtonian physics and still managed to be a lot of fun. They can easily be mutually exclusive if not done right.

Let's face it: Elite Frontier was innovative and extremely realistic, but as a result, space flight and combat were dead boring. Those games that do it right have some kind of an artificial velocity limiter that bend some laws of nature but manage to get away with it as space sims.

Ananta's latest SVN incarnation features a fly-by-wire computer that controls velocity in a very subtle manner, without actually breaking any laws of physics. I came up with a hull-specific top velocity after which the hull starts to gradually take damage. Speeding is controlled by the ship's computer, which controls directional thrusters to keep the ship's velocity under the hull's speed limit. The limiter can be momentarily switched off for those quick escapes, trading some of the ship's integrity for the pilot's life.

In a technical side, it took a lot of thinking and trigonometry to pull it off in an elegant manner, but the results look quite good. The directional thrusters do their best to bring a speeding ship below the speed limit without crippling the pilot's control over his ship.

Those fly-by-wire functions should help tremendously with coding in some advanced AI routines as well.

--------------------------------
2d space sim in progress: Ananta
Worklog here
Code updates

Wingmen!(Posted 2009-03-28)
It's really not a simple task to code AI logic for Newtonian space flight. After hours of pouring through physics books and sites in search for useful equations, and failing countless times trying totally different approaches to tackle the problem, I finally bumped into a forum thread that presented a simple yet surprisingly effective idea for AI chase logic.

To put it simply: predict the coordinates of your ship and the target at some time in the future, draw an imaginary vector between those two predicted points in space and accelerate in parallel to the vector. The trick is knowing how to calculate the prediction time interval for it to work at all speeds and distances.

The result is far from optimal control, but in a game like this it comes close enough. If it looks good enough, use it. After all, we're not JPL engineers coding an autopilot logic for Mars landers.

So, the current SVN revision (140) now features a wingman who does his best to follow your ship.

Next up: combat flight AI.

--------------------------------
2d space sim in progress: Ananta
Worklog here
Code updates

Solar system(Posted 2009-03-20)
By the way, here's a sneak peek at what the solar system generator is producing right now.



In case you're wondering, that view kicks in if the galaxy map zoomed in enough. :)

--------------------------------
2d space sim in progress: Ananta
Worklog here
Code updates

Trigonometry(Posted 2009-03-19)
I knew I should've not skipped those lessons.

--------------------------------
2d space sim in progress: Ananta
Worklog here
Code updates

Progress(Posted 2009-03-14)
Ok, it's been a while.

The project has not progressed much since the last worklog entry. And to make it even more embarrasing, most of the credit for the progress goes to Matt, a helping hand who volunteered to give the project a little push.

He coded in a well-working procedural planet generator that is fired on entrance to the solar system and populates the system with stellar bodies.

So yes, now it's quite possible to jump around the vast galaxy and travel through the generated space environment to your heart's content.

Right now I'm putting together some primitive AI routines, and I expect to see some combat action soon. Also, the plan is to make the static planets orbit their suns. After preliminary testing I still have trouble keeping the moons' orbits stable enough for the simulation. Maybe delta timer wasn't the proper choice for a timing method after all :P

I'm quite thrilled about the latest great advance in BlitzMax: threading. A project of this scale can surely benefit from it as soon as I get my head around it.

--------------------------------
2d space sim in progress: Ananta
Worklog here
Code updates

Why not 3d?(Posted 2008-05-18)
I've had numerous ravings from disappointed Elite fans about this game done in 2d, so I thought to clear it up a bit.

With the help of free 3rd party modules, BlitzMax is very capable of doing fast and visually appealing 3d. Still, I chose 2d. Why?

Yes, it's 2d, yet I have the nerve to compare it to Elite. So go ahead and sue me. Visual appearance aside, keeping the game in 2d has many benefits over 3d.

Ananta started out as a one-man-project and will probably stay that way for some time, at least until I get the game on tracks to let it evolve by itself. 3d would mean that I'd be dependent on a scarce resource of 3d modellers. Unfortunately I have neither the skill, talent, will nor time to learn it by myself.

On top of that, there really are no modellers out there willing to participate in a casual on/off project which occasionally might not show any progress for a long time. For free, might I add. Even getting a talented 2d pixel artist or two to take part in this could prove to be difficult.

Most importantly, 2d allows more freedom in game design. The intention is to focus on the immersion of a huge, dynamic and living universe, instead of polishing the glossy visual aspects of 1st person action. Keeping it simple allows me to concentrate on things I feel are most important. I will need every CPU cycle I can squeeze off to simulate the physics and economy of the underlying universe, and in spite of what modern computers are capable of, doing everything in 3d would consume more CPU time and memory.

To sum it all up, as a man with a day-job (and a life, mind you ;), I feel Ananta development already consumes more than enough of my spare time. I barely have the time to commit to a project of this scale, let alone to a full-blown 3d space sim.

--------------------------------
2d space sim in progress: Ananta
Worklog here
Code updates

Procedurally generated galaxy teaser(Posted 2008-05-08)
Starmap zoomed up on a "star sector":



The star names are generated by randomly combining three syllables together.

A bit zoomed out...:





"My God, it's full of stars!":




Galaxy image kicking in when zoomed out far enough:






The sector in the middle is one of 67,108,864 others in the universe. They're all procedurally generated on-the-fly when the map is scrolled or zoomed out. The star generation algorithm actually loads and parses a grayscale image of a real galaxy, and star distribution and densities are based on the brightness of a pixel associated with the specific sector. A sector can have any number of stars between 0 (black pixel) and 42 (white pixel).



--------------------------------
2d space sim in progress: Ananta
Worklog here
Code updates

What the game is all about?(Posted 2008-05-08)
Ananta is a 2d, single-player Elite-like trading/combat/exploring space adventure game. I'm taking influences from the best of the space trading games, but still try to create something unique. It will combine the best features from Elite II Frontier, Flatspace, X-series, Terminus, Hardwar and Starshatter, to name a few. Each of those games excel in one or two categories, but none of them doesn't fit my idea of a perfect game of this genre. Well, Ananta will not be perfect either. Not without a huge budget and a team of hired developers, or a motivated group of talented open-source coders. It is still a one-man project and might stay that way till the end.

Trying to squeeze my development goals into a nutshell, here are some things I'm trying to achieve (or already have):
* A procedurally generated nearly endless universe
* Semi-realistic Newtonian and Keplerian physics and orbital mechanics
* Modular ship design with ship upgrades
* Dynamic supply/demand -based economy
* Player-owned space stations with the ability to run manufacturing or retail businesses
* Hired AI wingmen and cargo-runners
* Real-time strategic space battles with the ability to issue commands to AI ships
* Factions with dynamic relations towards each other
* Missions from factions or private employers

For those willing to read a more detailed description, head over here

--------------------------------
2d space sim in progress: Ananta
Worklog here
Code updates

The beginning... not!(Posted 2008-05-08)
Now that the project has been under development on and off for almost two years now (mostly "off" during the first year), a real game is slowly starting to rise from the loose heaps of random code. So, I finally decided to start a worklog as the game has progressed beyond the infamous point of no return, where the amount of invested time and effort is getting too huge for me to chicken out anymore.

Actually the project started some three years ago, but not originally with BlitzMax but another game-oriented marginal language. Some two years ago I decided to port the little code I had to BlitzMax. It's been a really, really slow project, mainly because the damned Real Life ™ getting on my way. You know, the day job, spouse, drinking with buddies, etc. Now I've picked up the pace, and I believe this worklog might actually make me push even harder, now that I know there might be people out there expecting to see some results. :) Right now, the codebase has almost 4000 lines or 130000 characters of self-written code, not counting comments or empty lines. Everything critical to the game, including the physics engine, is 100% homemade. A small helping hand from Brucey in the form of the XML file parser wrapper and Cairo vector graphics module has been needed, though ;)

The game is free and open-source, and will remain that way. The source code repository and some ideas about the game development can be found at the Google Code site.

The repository commit log acts as a really detailed "worklog" for the game (not that I expect anyone to actually browse through it!), so this worklog will be mainly my channel to shamelessly promote my development milestones.

While I'm pondering what parts of the game to shamelessly promote, go ahead and see what the Google Code site has to offer. The Subversion repository is free for anyone to checkout, compile and run. The game doesn't use any commercial 3rd party modules, so it should be a breeze. Also it should compile on Linux and Mac as well, although it's been a while since I tried compiling it on Ubuntu. Throw me a message if it doesn't.

--------------------------------
2d space sim in progress: Ananta
Worklog here
Code updates