Ok without giving away the major selling point of our game idea, lets just say that we the developers are generating these massive worlds on a server, likely with a lot of detail. then pushing the new worlds periodically to players including updates to assets and the generation system...
yeah still gave away a fair bit really.
If i just needed to generate random levels on the fly that would be fine however i do not need this for the sheer complexity of the game world needs to be generated by our servers.
I am aware that GDK has position object and rotate object commands however i do not if there is a way to save everything currently in the 3d environment as a single file to simply load latter. and if i do find this i am then not sure what other things i have to do that may be special ways to position objects so that it works with this save system and what not.
Then i would only really need to be able to detect the collision of objects in a negative way (ie object is floating in air not on ground, object is intersecting another object etc.) and i would be able to take it from there with those functions and i believe make i can make an ai that uses those functions as a level editor, saving the detailed newly constructed area and then... shipping it for distribution to players.
Although if i did not use this distribution system then i would still need ways to check if the position is valid and not colliding with other stuff it shouldnt be as i say in the previous paragraph.
EDIT:
I am looking through the GDK documentation (puregdk) for things that may help and i spotted this.
void dbSetObjectCollisionToPolygons ( int objectID )
Now this is definitely a step in the right direction on detecting if the current object needs to be moved as its position is invalid, however i see this:
Quote: "When a polygon collision is carried out, the secondary object being tested will be treated as a sphere for collision purposes, where the bounds of the object define the radius."
However as speed is not at all an issue in my generator, is there anyway to evaluate collision with the second object more accuratly?
i see this command:
int dbObjectCollision ( int objectIDa, int objectIDb )
Although this can test collision against two objects the second objects hitbox being a sphere, i can see instances where this will not work for my code.
While this may work for a normal game where you may test collision of objects of the same size, i will be evaluating many different sizes. For example; take a barrel i want to place as object 1 and a large box for building as object 2, the barrel being much shorter then the building whose hitbox is a sphere approximate to the structures dimensions, there will be a radius around the bottom of the structure, where the structure meets the ground (just so happens to be the height the barrel needs to be) where the barrel could be positioned partially (or fully if the building is large enough) within the bottom edge/wall of a building and not register as a collision... and this would be bad.
EDIT2:
I am looking through documentation on 3d objects and limbs, could i not create an object primate plane (maybe add perlin noise to it for slight slopes) and then using this as a main object, for all other assets i place on the level just use:
void dbAddLimb ( int objectID, int limbID, int meshID )
void dbTextureLimb ( int objectID, int limbID, int imageID [, int stageNumber] )
this would load the current object i am using in the scene. Then i would have to place the object, i need some way to tell what the "face" of the object is... im not sure on how to do this but this would determine its rotation to the path/road that a building is placed on so that it is facing the right way (not everything will use faces there is no need for a barrel to have a face, although maybe a top and or bottom for use in placement).
Im not sure that this function works on limbs?
void dbSetObjectCollisionToPolygons ( int objectID )
cause i would need that once i can figure the answer to my previous edit on this function.
Then i would use something like:
int dbLimbCollision ( int objectIDa, int limbIDa, int objectIDb, int limbIDb )
using some kind of for loop to check the collision of this limb against all other limbs aswell as the main limb/object (the ground)
and then if a collision is detected move the new limb 1 unit away from the direction that limb is in from the new limb and do the collision loop again until the new object does not collide with any other.
Then presumably once i finish the above steps i can get the main object, that is based on the ground with everything else as limbs, and use this function on it to save it as a single file including textures and can later be loaded into the game simply using the next function:
void dbSaveObject ( string fileName, int objectID )
int dbLoadObject ( string fileName [, int textureReduce [, int textureMode [, int objectID]]] )
By this point in my tangent i feel i have likely gotten this all wrong. Also i do not know how i would define spawn locations for the player/npc's/enemies or how i would define entry and exit points? I just thought i might be able to generate these in the generation phase but instead of saving them to the object and thus the file i can maybe make a second level information file that has a list of special objects and where they are placed. This i can understand but i am not sure how to define their position from this second file, Assuming the ground plane is a large square (regardless of its heightmap) then could i maybe use some kind of function to get one corner of the plane (and thus the level) as a reference and have the positions for these special objects defined in relation to that, that way no matter where the entire level object is placed in a 3d environment the special objects file can place the objects correctly cause they are saved in relation to the corner as say:
Spawn:
X = 10
Y = 20
Z = 0
thus when the level is loaded then all the level loading function has to do is find the x, y, z of the designated corner of the levels and then add that x, y, z value to the one from the second file for the special object?
EDIT3: short one, how come the documentation for:
void dbSaveObject ( string fileName, int objectID )
says that is saves as a dbo format however the docs for:
int dbLoadObject ( string fileName [, int textureReduce [, int textureMode [, int objectID]]] )
say this:
Quote: "This command loads a 3D model into the specified object number from any of the supported file formats: .x, .3ds, .mdl, .md2 or .md3."
presumably this means that although GDK can save an object it does not have the support to load that same object? that cannot be right? or is there a different load for dbo formats?
WOW /endwalloftext
I will keep pouring over documentation and asking questions about things i find (sorry if i am getting annoying) as i have now slept and have the cognitive skill required to at least read over a bunch of documentation.
I swear to the programmers bible that I shall not harm the FPS.