First off, thanks for replying Mike - I appreiciate this assistance
Some screenshots of Iro can be found in the puzzle competition thread. Primarilly I am looking for techniques to speed it up, but I hope to apply it to other projects in the future.
The entire world is made up using the dbMakeObjectBox() primitive. Some use different size parameters to make thin platforms. Slopes and ramps are made by creating a box and then altering the vertex data like thus:
void MakeObjectRamp(int id, float width, float height, float depth) {
if (dbObjectExist(id))
dbDeleteObject(id);
dbMakeObjectBox(id, width, height, depth);
LockVertex(id);
SetVertex(0, vpx(0), vpy(3), vpz(0));
SetVertex(10, vpx(10), vpy(3), vpz(0));
SetVertex(20, vpx(20), vpy(3), vpz(20));
SetVertex(1, vpx(1), vpy(2), vpz(1));
SetVertex(11, vpx(11), vpy(2), vpz(11));
SetVertex(16, vpx(16), vpy(2), vpz(16));
UnlockVertex();
dbMakeMeshFromObject(1, id);
dbMakeObject(id, 1, 0);
}
void MakeObjectParallelogram(int id, float width, float height, float depth) {
if (dbObjectExist(id))
dbDeleteObject(id);
dbMakeObjectBox(id, width, height, depth);
LockVertex(id);
SetVertex(0, vpx(0), vpy(0) + height, vpz(0));
SetVertex(10, vpx(10), vpy(10) + height, vpz(10));
SetVertex(20, vpx(20), vpy(20) + height, vpz(20));
SetVertex(1, vpx(1), vpy(1) + height, vpz(1));
SetVertex(11, vpx(11), vpy(11) + height, vpz(11));
SetVertex(16, vpx(16), vpy(16) + height, vpz(16));
SetVertex(2, vpx(2), vpy(2) + height, vpz(2));
SetVertex(3, vpx(3), vpy(3) + height, vpz(3));
SetVertex(19, vpx(19), vpy(19) + height, vpz(19));
SetVertex(21, vpx(21), vpy(21) + height, vpz(21));
SetVertex(13, vpx(13), vpy(13) + height, vpz(13));
SetVertex(14, vpx(14), vpy(14) + height, vpz(14));
UnlockVertex();
dbMakeMeshFromObject(1, id);
dbMakeObject(id, 1, 0);
}
(vpx etc are all #define macros for vertex position x etc - uses all the normal vertex commands but using short hand macros)
and thats pretty much it except for entities, but those can naturally be handled as normal objects.
Yes, I understood about doing more polygons at once being a better idea - thats why I figured creating all these objects as limbs would be a good idea? Wouldnt that leave you with just one object made out of limbs at the end of the loading process which would be processed all at once? Or does the renderer process limbs seperatly as if they were seperate object?
Those functions look interesting! I just had a quick whip through the help file and couldnt find them by doing a search in the basic3d section so I didnt know they existed x_X What is the downside to sharing a vertex buffer? IE - why WOULDNT I do it? Should only objects with exactally the same vertex data share the same buffer? ie all ramps, all boxes, all paralellograms etc? in which case is there a way to set which buffer they use or is this all handled automatically?
ExcludeObject im guessing removes it completly from the rendering pipeline? Does this not happen when you hide an object? There is already a function I wrote which hides and disables collision for all objects that are not on screen during play - would also calling an exclude on them do something that hide/disable collision doesnt do?
Thanks again for all this assistance
Any more ideas will be greatly appreiciated - the faster the better
If its any further help, the level is stored in a kind of node tree - its a custom typed struct which I can use to access any nodes object ID, know its position and its type (is it a normal box, a ramp, a thin box, etc) and also what entity is attached to it.
Thanks again!