So like always start with problem description: I have some pool of command represented as enumerator. Each of command can have unique data that size can be different. I wanted to create system that allow me in easy way iterate over them and execute. After some time I created this implementation: template<ECommands::enum cmd> bool execCommandTemp(ECommands::ENUM a_cmd, void* a_data) { if (a_cmd == cmd) { SCommand<cmd>::execute((SCommand ::SData*)a_data); return false; } return execCommandTemp<(ECommands::ENUM)(cmd+1)>(a_cmd, a_data); } template<> bool execCommandTemp<ECommands::WRAP>(ECommands::ENUM a_cmd, void* a_data) { return true; } bool execCommand( ECommands::ENUM a_cmd, void* a_data ) { return execCommandTemp<(ECommands::ENUM)0>(a_cmd, a_data); } where SCommand look in example such a way: template <> st...
Can't seam to find a way to send you an e-mail so I will use the blog, sorry.
ReplyDeleteAs a quick question (to not extend on this post), what file formats you use when exporting your models from blender (map, characters, animations,etc)? Do you need a specially lib to thread those objects in OpenGL?
No problem for me this is one of purpose of this blog :]
ReplyDeleteTo meshes/animations I wrote export plugin to blender (it's python script that export data to xml and call converter that change it on my internal binary format). With map it's different with game I develop editor that I use to create locations with some simple animations of objects (moving/rotating platforms, opening doors and things like that).
Interesting, I thought you were using a common format. Is there a reason to use your own?! This also means you actually had to create the entire model draw routines in openGL?!
ReplyDeleteOn the map side, is everthing done in the editor, even the map model? Or the editor only add objects, characters, etc into to the map?
Yes you are right I developed my own rendering routines (or I should say still develop). Reason is simple I have control on it I don't need to be restricted to some library capability.
ReplyDeleteOf course somebody could say that I could use some text format like COLLADA or OBJ because they have exporters already. But they too slow to load directly to engine (additional COLLADA change to often and have to much of different modifications).
So I don't think that I done wrong decision I learned a lot developing my own mesh and animation system. Of coure this solution isn't ideal I still spending time to upgrade this system and that take time which I wouldn't need if I decided on some ready solution.
With map my pipeline looks like that: objects or it's parts are create in blender after export I can use it in editor. There I can build from it locations but this are only some static models or character. Objects like triggers, cameras, paths, terrain are created from editor directly. You can specific there propertis, create simple animations like moving of platforms or doors.
For example in prison I created some components of walls and floors that I use to create basic geometry of level then I add some other objects, characters and animations. On exterior I tried components but they weren't look to good (building in citadela Island are to unique and such a set would be to complicated) so I decided that most builingst will have separate models.