Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

zwdavid

Is the .x format pratical in the game development?

This topic is 5905 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi, I''d like to develop a car racing game. I wonder if the .x format by Microsoft pratical and efficient in the development of this kind of game. Thanks! -Dave

Share this post


Link to post
Share on other sites
Advertisement
I never used .x because I always fancied writing my own file format and modeller which was quite fun actually.

The advantage with using a modeller and commercial modelling formats is that there''s always going to be loads of free models to use, their modelling software will always better and the management of scenes becomes far more easy with the helper functions. If you try to write it all yourself your going to have to develop your own engine which is tough.

Hope this helps.

~~tim

Share this post


Link to post
Share on other sites
x-file format was made for models. It''s not efficient to be testing all polys in the mesh when walls(using different code structure than d3d mesh) that contain polys could be checked first and quickly flagged off if not visible or not hitting, etc. For buildings that you can walk thru I would not use d3d mesh. For car racing, cars perhaps, not sure about terrain but probably not unless it consists of many small meshes that could be turned off when behind camera, etc. Drawing one huge mesh is not good. Imagine sending huge vertex buffer to video card, not sure if chip can split it into smaller pieces but I don''t think so. Experiment and come back to let us know. Also, for models the x-file is easy to work with but any higher constructs can be problematic to work out. I''ve tried to save my cell geometry structure to x-file but it''s complex and so I''ve abandoned that idea and used binary file instead. Much easier to understand and to work with then x-files.

Share this post


Link to post
Share on other sites
There''s a common misconception about .x that it''s exclusively for meshes. That is incorrect. .X is actually a very powerful storage format that is quite acceptable to use, as support for it is great (in the DX SDK).
The .x format is just like most popular formats - it represents a hierarchy of data chunks. If you want to store custom data, just create a new template. To create a template, just define it''s type, GUID, and data structure. In your program, take the parser and check for a template GUID and read the data from a memory pointer. Nothing could be easier. With .X, you even have the choice of 4 storage formats - text, binary, and compressed (2 types).
By creating your own templates, you even have the ability to ''hide'' the data, as your data needs to be understood to read it - just like any game''s data files.




Jim Adams
home.att.net/~rpgbook
Author, Programming Role-Playing Games with DirectX

Share this post


Link to post
Share on other sites
Hi zwdavid,
Almost all of game companies uses their file formats ...
But some game programmers uses of .MD3 format.
.MD3 is ID software 3d format file ...
And some of companies uses of it, too.
You can search it in google.com

Have fun.

Share this post


Link to post
Share on other sites
Well the MDL/MD2/MD3 formats are quite OpenGL specific, not in the terms that they can''t be used by DX (I''ve written code for all these formats myself) but since they were originally designed for OGL they''ll always be faster there. The .X format is created and optimized for use with DX so i.e. it is a great format for DX applications... anyway I''ve already designed my own static model format .r3d (which is faster and smaller then both 3ds and .x atleast in my app) and I''m working on two animated ones (keyframes and bones) so I''ll probably use those...

I guess that what I''m trying to say is that the .X format is more then enough for a game but you can ofcourse get better performance from building your own format better suited for your needs.

Regards Shadows

Share this post


Link to post
Share on other sites
Why are we seeing a rash of these types of questions? .x is simply a format for storing information. The method of on disk data storage makes NO DIFFERENCE to the game. Once the data is loaded, it doesn''t matter where it came from. You could use any format you wanted and once you load the data shove into a buffer, it all works the same.

Landsknecht

Share this post


Link to post
Share on other sites
Landsknecht: While it is true what you say that they way the data is stored doesn''t matter the way that data is used does matter, the reason why .X files are so good is the fact that they do support things like progressive meshes and optimized meshes without any extra coding for the developers. Things like in which order you render the vertices does matter, and it does matter alot, things like batching for texture changes matters could lower the processing time alot. All these futures are supported by the .X file format.

// Shadows

Share this post


Link to post
Share on other sites
Cool. Good pointst there, Shadows. But the types of questions like this being asked are far below the level of complexity you are describing. The last time this was asked (2 days ago, I believe), the guy wanted to know if .x files would lower his frame rates. Huh?

I think it is just a matter of people not understanding what is going on. Like the folks that say, "I can put a triangle on the screen with OGL, now I can make a game!" There is just so much more to it than this. And frankly the method of storing your vertices to disk has little to no impact on the game itself.

I mean, do you realy think that someone that asks this kind of question is gonna benefit from one format over another. Probably not. They just heard a buzzword in an article or something and started asking about. Just like all the kiddies that wanna multi-thread just cause that ability is there...

Not to rant, just explaining my position. Sorry.
Landsknecht

Share this post


Link to post
Share on other sites
The main disadvantage with x files is they are bulky, i.e. can be slow to load in mass. The binary format is basically a tokenized text format, so it isn''t that much faster.

If you don''t care about load times (like most games don''t these days), then X-files are great. There are exporters for 3DStudio, Maya and Lightwave (the lightwave one works really well since LW''s internal data structures lend themselves well to realtime work.)

However, to get any good perf for load times (like Dungeon seiges 5 seconds) ,you probally always need some kind of custom file format where data can be dumped straight into your own internal format. In this case, X-Files work great as an intermediate format, which you convert into your own format.

In general, X-File perf is dependent on the data they store. If your model is complex, with insane poly counts, your perf will be low.



Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!