Model billboards - In Blender I can add an empty object and give it a name. Then, in the entity definition file, I can add a Billboard attribute and tell it to place such and such a sprite and the name defined in the model file. Thus I can add billboard sprites to models, or make a model in blender composed entirely of empty objects and easily define the placement for billboards for an entity. For example:
Adding leaves to an apple tree (billboard + model):
Or defining the leaf locations for a NiNi Shrub (just using empty positions in Blender)
But it's a pretty nifty way for me (and modders) to define the locations of billboards for entities easily.
Entity Picking - When models are read into the game, a bounding box is generated based on the bounds of the vertices read. That works great with static models, however, if the entity is animated with bones, that bounding box quickly becomes obsolete. So how to solve it? One way would be to run through the transformed vertices and calculate the bounds again. That doesn't work so well for me because the model vertices are on the graphics card from the beginning and that's where all the transformations happen. So, a slightly less accurate method. Get the bounds for each bone when the model is loaded. Then transform the bounding boxes by the animated pose.
Then we can just go through all of those bounding boxes and find the maximum and minimum bounds of those bounding boxes. Works great. The bounding boxes of the bones can over represent the model slightly, but it's pretty close. This allows me to not only select the entity with a picking ray, but it also allows me to detect the specific location of the entity that was selected. This means location based damage (useful for the dynamic dismemberment plans). Sweet.
Other - Some miscellaneous completed tasks include:
- Distant render types: When a model is far away from the camera it can either be rendered with a lower resolution model, a 2D sprite or nothing.
- GUI work: I added sub radial menus. For expanding radial menus out in a tree like fashion for easy navigation of options.
- Enemy work: I'm adding a simple entity to work on all the related systems for entities that don't like each other. That includes detecting when an enemy gets near, attacking and fleeing behaviors and plenty of other related work.
- And more stuff that's insignificant or not complete enough to share yet.
Can you tell me how did you go about importing Blender objects? This is something that I've tried doing myself (using Android's Java and OpenGL APIs) and I found it very difficult. I'm not talking just about the mesh (like vertices, faces and normals), but also (multiple) UV maps, animations, bones etc. What format do you use for exporting from Blender? Did you make your own parser for that format, or did you use an existing library for that?
ReplyDeleteI'll write up a post on exporting from Blender. Give me a bit to get it done. Thanks for your interest.
ReplyDeleteDo you think you will eventually write up a post about the planned gameplay in Age of Goblins in greater detail? From what I've read throughout your posts, it sounds like the player will start off with a small group of goblins, use them to gather resources and build some sort of structures(like shuttles), and defend them from unknown enemies. I would love to read more about specific player goals, goblin jobs, resources, structures, and enemies that you plan to have in the game.
ReplyDeleteSure thing Gigggas. I'll add it to my write queue. Probably be ready within a few weeks. Thanks for the suggestion.
Delete