• 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
Anddos

Writing model 3D Model data to a new file as a new format

12 posts in this topic

I am just wondering if its possible to write 3d model data to a file,instead of directly working with md5 files i would like to convert to my own format,the information i want to write to the file are vertices,normals,vertex weights,texture coords,so far i have written the model data to a text file but now i would like to write it to my own file format using fopen,fwrite as binary data, or should i stick to just md5 files in the game directory?

1

Share this post


Link to post
Share on other sites

It is possible and a lot of games, including my own, do it this way. Thought I wouldn't recommend md5 as basic format (it has its restrictions), but either FBX or Collada from which you should create your own files.

2

Share this post


Link to post
Share on other sites

It is possible and a lot of games, including my own, do it this way. Thought I wouldn't recommend md5 as basic format (it has its restrictions), but either FBX or Collada from which you should create your own files.

 

 

What are the restrictions?

0

Share this post


Link to post
Share on other sites

This is probably obvious, but the md5 format itself doesn't have restrictions, but the model that is in md5 format may have restrictions.  For example:  You can't just grab a doom model, write it out to your new format and use it in your game that you are making money on (I doubt they'd care if it was just some open source game), and even someone's custom model may have some rights attached (though I'm a bit murky on that one)

Edited by ferrous
0

Share this post


Link to post
Share on other sites

If you want a file format for 3D models that lets you store some custom information try with PLY. You can define the name and the type of a property of the vertex in the header and then for each vertex you store the values for each property in one line. Here's an example of one file with only vertex position (x, y and z) and faces, and other example with vertex position AND colors, faces and "edges" (you can add new elements if you need too): http://www.mathworks.com/matlabcentral/fx_files/5459/1/content/ply.htm

0

Share this post


Link to post
Share on other sites

i would like to write it to my own file format using fopen,fwrite as binary data, or should i stick to just md5 files in the game directory?

I'd suggest using your own binary format. The first step is to determine an efficient way to load the model data which supports how your app creates the model internally, in what order you want position, normal, texcoord, blend indices, blend weights, etc., to write into your buffer or structure. Then design the file format to support that process.

 

Only as an example, if you have  a vertex comprised of position, normal, diffuse color, 2 tex coords - read in your md5 file, setup your model with that vertex structure, open an output binary file, write a header describing the number of vertices and the format/stride, etc., and write the binary data out in vertex order. You can then read in that file by reading the header, creating a buffer of appropriate size and load data directly into the buffer. You may want to consider extras like texture names, etc.

Edited by Buckeye
2

Share this post


Link to post
Share on other sites

There is also the new OpenGEX format:

 

http://www.opengex.org/

Hmmm. looks really interesting, thought a few month too late for me (refactored my converter from the over-engineered collada to the proprietary FBX format), thought there is one question:

What I really miss from all this exchange formats, especially when using them to export stuff for a game engine, is the lacking support of custom attributes. You can add custom attributes in modelling tools, but you never got them exported to Collada/FBX. It is possible with OpenGex ?

Edited by Ashaman73
0

Share this post


Link to post
Share on other sites


What I really miss from all this exchange formats, especially when using them to export stuff for a game engine, is the lacking support of custom attributes. You can add custom attributes in modelling tools, but you never got them exported to Collada/FBX. It is possible with OpenGex ?

 

It depends on exactly what kind of custom attributes you're talking about. OpenGEX supports custom per-vertex data and custom material attributes, but intentionally does not allow for general custom data all over the place. The reason for this is to avoid the creation of software-specific standards like you see in the Collada format through the use of the <technique> elements, making it necessary for importers to understand information whose format is specified over multiple poorly-maintained documents. Now if you're just talking about custom user-defined key-value properties like those supported in 3DS Max, then I can tell you that support for these is being considered for the next version of OpenGEX, and it's something that can easily be added to the existing exporters.

1

Share this post


Link to post
Share on other sites


This is probably obvious, but the md5 format itself doesn't have restrictions, but the model that is in md5 format may have restrictions.

You're talking about a different type of restriction than the above posts; you're talking about legal restrictions in how you can use a particular model, whilst Ashaman73 was talking about the fact that some data isn't stored in the md5 format.  If you don't need that data anyway this restriction doesn't matter to you, but if you do need that data it's probably worth investigating other formats. smile.png

0

Share this post


Link to post
Share on other sites


Now if you're just talking about custom user-defined key-value properties like those supported in 3DS Max, then I can tell you that support for these is being considered for the next version of OpenGEX, and it's something that can easily be added to the existing exporters.

Yes, I'm talking about this kind of additional information. There's is always some kind of game (engine) specific information I like to export properly which can't be mapped to Collada/FBX (animation specific sampling rate, if a bone is a item link etc). Either you need to write your own exporter or you use some hacky name-convention information hidding.

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