• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
romomo

3D file efficiency

8 posts in this topic

Hello,
So I've created a custom binary file export format for 3DS. Everything works fine, but I would now like to make it a bit more compressed. I'm considering using one or more of the following; Shared vertices (currently every face exports 3 floats, shared verts are not taken into account), converting verts to whole numbers, and exporting as a short... not sure if this will have too much impact on low poly model quality), and last but not least... exporting ONLY changed verts in each frame (though it would seem I would then need to key it by indicies, meaning it will help in SOME cases... but make things worse in most).

I'm interestes in hearing your suggestions, and if possible, an example of implementation.

Thanks!
Rob
0

Share this post


Link to post
Share on other sites
I'm sorry, typo on my part. What I meant was converting them to whole numbers in short range... eg: 26.013 becomes 26. (fixed typo)
0

Share this post


Link to post
Share on other sites
How much do you want to save?
I have seen something apparently like what you need in [url="http://openctm.sourceforge.net/"]OpenCTM[/url]. Guess what? I'm not suggesting to do that. In my case, it would save about a meg. Not worth it IMHO.
Sharing common vertex blobs is a must. This is often useful to build better batches as well. I suggest to do that only.
0

Share this post


Link to post
Share on other sites
Krohm and L. Spiro,
Thank you both, this was exactly the info I was looking for. I'm curious, as you said for mobile devices (This is precisely what I'm developing for; Android and IOS)... How are you storing animation for models with such high tri-counts?
0

Share this post


Link to post
Share on other sites
You mentioned storing only changed vertices etc. which means you are basically already off to a bad start.
Animations contain no vertex data; they are bones and joints with keyframes. Already this is about 1% the size of storing the changed vertex data. While there is a place and time to use per-vertex animation, I highly doubt this is your case.

Look into skinning.

But even joint animation with keyframes can add up, so you still need a few tricks to keep the sizes down.
One is redundant joint elimination. Firstly get all the key-frame data. Whether your are working with Maya or the FBX SDK, each provides a feature to allow you to get the joints at any time during the animation.
Run your own simulation along with the SDK’s simulation, and if your joints are not correct, add your own key-frame there. This is necessary because Maya allows rotations from 0 to 360 to 720, etc., whereas your data will consist of radians which are clamped in range. In the world of radians, 0, 360, and 720 are the exact same value, so interpolating a rotation from 0 degrees to 720 degrees, with no key-frames between, would result in no rotation in your radian-based implementation.
Then run the simulation again between every second keyframe. If, between those key-frames (interpolating between only them, excluding the middle key-frame), the joints at the time of the middle key-frame are a match, and you can eliminate the middle key-frame.

This is the most major way of reducing animation data, but can of course be further enhanced by clever compression methods. You can get inspiration for that kind of compression from my article.
And again, joints, not per-vertex animations. Research “skinning”.


L. Spiro
2

Share this post


Link to post
Share on other sites
I'm aware of skinning, I have a seperate implementation for that. The purpose of the per-vertex key-frames is to accomidate older/less powerful mobile devices. Specifically those with minimal to no GPU. Simple interpolation between vertices seems to produce much faster results (for better looking models, I might add), and as I don't intend to use this particular implementation for real-time physics/animation, I can produce much nicer deforms. This is the whole reason I'm looking into ways to minimize the size of the output file.
0

Share this post


Link to post
Share on other sites
[quote name='romomo' timestamp='1340687433' post='4952900']What I meant was converting them to whole numbers in short range... eg: 26.013 becomes 26. (fixed typo)[/quote]A much more high quality solution would be to find the middle point of the point cloud, and then the most distant point.
Normalize your data set so this most remote point has a distance from the center of exactly 1.0 -- this turns all distances into numbers between 0.0 and 1.0 (and, since the components are at most as long as the hypothenusis, the components as well).
[i]Now [/i]convert to short, by multiplying with 65535.0 and truncating, this yields 0.0 = 0 and 1.0 = 65535. You must save the scale factor (a single number) with the model for being able to to restore it. As an optimization, find the maximum squared distance rather than the distance (saving a square root per vertex), and only take the square root at the very end.

Alternatively (and computionally cheaper since there is no horizontal add, and probably even more accurate), iterate once over all vertices, calculating the maximum value of all components (as measured from the center point). Then scale using the total maximum number and proceed as above.

If you just truncate to the next integer, this works well only if your coordinates are large. It does not matter if all coordinates are in the hundreds or thousands, but it makes a big difference if they're all in the lower tens. 4 and 4.4 is a 10% error...
2

Share this post


Link to post
Share on other sites
@Samoth
This is perfect, exactly what I was thinking... I just couldn't think how to go about it.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0