Hi all Space Game fanatics
this is a simple compilation of some thoughts of Space games.
With Rônin I'm working on a Space Shooter Game(other Genres are in dialogue ).
By now it does not have much features, only the basics.
And thats also what I want to talk about. The basics.
Right now, we planned to have several "Level's" for each major planet, such as Earth or Mars.
But on this weekend I was a bit confused if this is a good way, and if it is that what I want.
The thing is, in the german PC magazine "PC Games" there was the full version of "I-War 2" included, which I did not know about before. This is a game which is, in some cases, very similar to the one we are programming.
And in this game there is no Loading between Planets. You put on your HyperDrive and fly to the next system. Which I think is quite nice.
The question which taxes my brain is:
How did they did that?
Are the systems several parts of a level which are loaded dynamically when the player is near?
Is there a big Database with all planets / sations / moons / suns and are just displayed when you are near?
Are the systems ordered hierarchic, system than planets than moons?
Do they load level, even if you do not see it?
The problem I see is, among other things, the distance between the stars, which meight get quite big. The problem is the big difference between planets (or suns) and spaceships. Which is also realy big.
So you need a big scale of number you need to cover but also quite a good precision.
Well, maybe other question / brain storming later,
everyone is invited in this "discussion" !
Matthias
Space Game Coding
Space Game Coding
YASS - Yet another Space Shooter
under Devolpment, see http://yass-engine.de
under Devolpment, see http://yass-engine.de
I don't know that game, but I remember reading that the original Elite stored all of a planet's information in a seed value (8 bits or so).
Bottom line is, space is mostly empty, and if you have a hyperdrive, that means you can move the ship to a different solar system. So you can use local coordinates (even if they have to be large, they don't have to be able to store everything relative to one common origin).
If the planets have stuff on them, either that is all generated from a seed or it is loaded from disk.
If they're just spheres, it probably doesn't require any disk access other than load/save.
In order to display other stars, you only need one extra level of data: for the stars. And you can just draw white dots in a skybox texture at runtime to achieve that.
Bottom line is, space is mostly empty, and if you have a hyperdrive, that means you can move the ship to a different solar system. So you can use local coordinates (even if they have to be large, they don't have to be able to store everything relative to one common origin).
If the planets have stuff on them, either that is all generated from a seed or it is loaded from disk.
If they're just spheres, it probably doesn't require any disk access other than load/save.
In order to display other stars, you only need one extra level of data: for the stars. And you can just draw white dots in a skybox texture at runtime to achieve that.
I tried the demo of I-War 2 but it doesn't like my computer, it crashes after a few seconds of play.
Maybe it loads the planets at runtime while you are travelling in space.
The problem is that it can be too slow if it's not enough optimized.
If it's not possible to optimize enough and you haven't got a lot of meshes of planets, you can consider to load all the meshes when game loads, then , when you change level, it should be very fast to add your planets into the scene with addMeshSceneNode(preLoadedMesh).
Unfortunally this method can waste a lot of system and video ram.
I don't know if this game has got a database or if it generates the systems pseudo randomly with a fixed seed, if the universe isn't huge it's probably that it has got a database, that allows the best level of customization.
It's likely that the planets and the stations are ordered hierarchically, that's the easier way to store all the informations about planets in a file and to load them in your level.
The problem of precision is probably the biggest. By the way, are the planets reachable in I-War 2 or they are visible just from orbit?
It can be enough to store the positions of every object with vector3d<f64> and then set the sceneNodes at (nodePosition64-cameraPosition64) as you're already doing, but if you want to land on planets with a very good precision this can be not enough, since when you are, for example, on the earth's surface, actually you have to set the position of the earth's mesh at 6000Km of distance, enough to get some precision problems, not really huge (about half meter if I'm not wrong), but enough to watch the earth moving strangely, considering that imho sometimes the internal precision of the GPU can be lower than an f32.
At the moment in my game I've set the near plane of view's frustrum at a distance of 0.20 meters, and a mesh of 2 meters can walk on the earth surface without big problems, and quite strangely i don't see problems of zbuffer, but I'll see them if I just try to add the atmosphere to the planets...
Maybe it loads the planets at runtime while you are travelling in space.
The problem is that it can be too slow if it's not enough optimized.
If it's not possible to optimize enough and you haven't got a lot of meshes of planets, you can consider to load all the meshes when game loads, then , when you change level, it should be very fast to add your planets into the scene with addMeshSceneNode(preLoadedMesh).
Unfortunally this method can waste a lot of system and video ram.
I don't know if this game has got a database or if it generates the systems pseudo randomly with a fixed seed, if the universe isn't huge it's probably that it has got a database, that allows the best level of customization.
It's likely that the planets and the stations are ordered hierarchically, that's the easier way to store all the informations about planets in a file and to load them in your level.
The problem of precision is probably the biggest. By the way, are the planets reachable in I-War 2 or they are visible just from orbit?
It can be enough to store the positions of every object with vector3d<f64> and then set the sceneNodes at (nodePosition64-cameraPosition64) as you're already doing, but if you want to land on planets with a very good precision this can be not enough, since when you are, for example, on the earth's surface, actually you have to set the position of the earth's mesh at 6000Km of distance, enough to get some precision problems, not really huge (about half meter if I'm not wrong), but enough to watch the earth moving strangely, considering that imho sometimes the internal precision of the GPU can be lower than an f32.
At the moment in my game I've set the near plane of view's frustrum at a distance of 0.20 meters, and a mesh of 2 meters can walk on the earth surface without big problems, and quite strangely i don't see problems of zbuffer, but I'll see them if I just try to add the atmosphere to the planets...
why don't you store the positions of the solar systems and when you get near that position then you load the planet positions out of an other array relative to that position... i think that should make it much easier
R2D2's Irrlicht Mods
Messed up with my database so the page is not working at the moment -.-
CPU: Core 2 Quad Q6700RAM: 4096 mb Graphics: Radeon 4850 512mb Sound: on board InternetConnection: DSL
Messed up with my database so the page is not working at the moment -.-
CPU: Core 2 Quad Q6700RAM: 4096 mb Graphics: Radeon 4850 512mb Sound: on board InternetConnection: DSL