Game Engine Forum - Grit Open Source Streaming Game Engine
Site Header
It is currently Mon Feb 20, 2017 10:17 pm

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Quick and Dirty Max To Game Engine Export (mesh+tcol)
PostPosted: Wed Jul 07, 2010 10:06 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Fri Mar 26, 2010 10:06 am
Posts: 436
Note: If images do not show, reload the page.

If you need installation directions, check here:

I wanted to quickly throw together a guide for all new users to easily execute the steps for exporting and previewing works in the game engine. I have grabbed some screenshots from a simple export process and made some extras to show differences between aspects of workflow.

This won't explain how to model anything, and I could miss something perhaps, it just assumes you have your model with centered pivot and ready to export and see it in game. The aim is just to keep it simple and elaborate in replies if needed. Let me know if there is more I can do or more I should elaborate on.

First picture:
Image
Above, you can see I have a textured mesh for the game and a normal primitive Sphere with just enough geometry to make my shape. In some cases, you will want accurate geometry, and in others, it is really a non issue and better to save polygons for performance. It is named tcol_EARF for me, upon export, the tcol will need to be renamed to simple EARF.tcol. More later.

We will begin by getting the mesh out of the way UPDATE: The XML converter (shown in image below, and mentioned in following text, is now moved. The converter is now found at: "%Grit%\grit_core\media\Tools" :
Image
I am using one diffuse texture, thus I am blending only 1 texture. My earth will have a normal map, so I check this box. Since all of my UV space is unique and there are no mirrored or rotated clones to make it, I do not need the other options. Press the button, let the mesh export to the chosen place, and close the dialog. Quick note: If it is the first time you've run the exporter since installing it, you will need to define the path to the XML converter in the Grit tools folder. This will not always be required of new users.

Next, I can prepare the tcol collision mesh for export:
Image
I use a default blinn material and name it the collision surface I wish to use.
UPDATE: The above picture is outdated. A correct useful pmat can be found at:
Code:
/common/pmat/Stone

You can find a list in the wiki and at common/pmat/init.lua, so no need to add them here, as they are also subject to expand for a while. You can use more than one material per collision mesh, and you can color them in the diffuse color box to differentiate surfaces when working in the viewport. Take special note of the name of the material. The / in the beginning is important so grit can find the common folder, don't forget it!

After applying materials, we can run the tcol exporter:
Image
I want this to be a dynamic rigid body in the game, so I check dynamic. My earth is very big, so 100kg is not enough - no matter, I can make this higher in the text file when I inspect the results (tcol will not always be text, for now, it is good to check results while Grit matures). The tcol of a simple primitive should look like this, notice that I have made it heavier and how little data is in the file:

Image

It is typically ideal to use primitives, and linking them all as first generation children under a dummy, and exporting that dummy rather than exporting trimesh. The results of a trimesh is a lot more data, but sometimes it must be done (if you have errors with primitives at this time of writing, use trimesh anyway) Here is a trimesh exported, significantly more data:

Image
I'm sure the performance tradeoff isn't as bad as it looks, but it is a big deal. So, avoid a trimesh!

Now, I usually do this right before I look at the tcol and check my files in the project folder, but I had to show you that first to complete the point before those pictures, but before going any further, the first thing I always do to avoid conflicts with version control/subversion is to update my local copy of grit. Notice my tcol is not yet named EARF.tcol here:

NOTICE: Now, any mesh named tcol_ for user's keeping a clean scene will automatically remove the first 5 letters and thus no need to rename.

Image

After an update, I need to put my files into the init.lua of the project folder. There are a lot of ways to do this (see JostVice's Playground init file for a more compartmentalized, cleaner, and readable layout, Urban [and only urban] is in chaos at this time of writing)
Image
Above you can examine the easy 3 lines of text it takes to put models into Grit. The materials are defined, you can see other lines with more options exposed, the class is defined, and the object is called to place it. Easy peasy. Take note of the blue box BaseClass, this is not just for LOD that don't need collisions, other things like shrubs etc may not use collisions either.

Big ass earf to hit with a car:
Image


Top
 Profile  
 
 Post subject: Re: Quick and Dirty Max To Game Engine Export (mesh+tcol)
PostPosted: Wed Jul 07, 2010 8:22 pm 
Offline
Supreme Tyrant of All
Supreme Tyrant of All
User avatar

Joined: Sat Mar 27, 2010 1:13 pm
Posts: 758
This is a great start, very thorough. There are changes I would make all the way through it and it should become a wiki page at some point.


Top
 Profile  
 
 Post subject: Re: Quick and Dirty Max To Game Engine Export (mesh+tcol)
PostPosted: Thu Jul 08, 2010 4:42 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Fri Mar 26, 2010 10:06 am
Posts: 436
by all means, you and the rest with privs edit away or post suggestions. Feel free to add creds for contribution, and we'll eventually move it over to the wiki with perhaps more uniform imagery.

It would be more complete with an export of the map data too, but currently I use copy paste and seek a more streamlined solution for that, but if the steps were laid out I'd make use of it later when I'm doing more permanent scenes.


Top
 Profile  
 
 Post subject: Re: Quick and Dirty Max To Game Engine Export (mesh+tcol)
PostPosted: Thu Jul 08, 2010 6:33 am 
Offline
Moderator
Moderator
User avatar

Joined: Tue Apr 06, 2010 6:46 pm
Posts: 96
Location: England
Brian, you are too awesome, this is a very good guide! Will follow it for .tcol soon!

_________________
Conqueror of the polygon.


Top
 Profile  
 
 Post subject: Re: Quick and Dirty Max To Game Engine Export (mesh+tcol)
PostPosted: Thu Jul 08, 2010 8:11 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Fri Mar 26, 2010 10:06 am
Posts: 436
Also, now you don't have to rename your tcol if your tcol is named tcol_ as mine - I got Spark to update the exporter so that it will remove tcol_ from any mesh whose first 5 letters is tcol_, Awesome!!! :Aw:

Moving this to the grit technical section. Will rewrite and change it eventually, for now quick and dirty quick and dirty.


Top
 Profile  
 
 Post subject: Re: Quick and Dirty Max To Game Engine Export (mesh+tcol)
PostPosted: Thu Jul 08, 2010 10:58 am 
Offline
Site Admin
Site Admin
User avatar

Joined: Fri Mar 26, 2010 2:13 pm
Posts: 318
Location: Spain
mortalhuman wrote:
Also, now you don't have to rename your tcol if your tcol is named tcol_ as mine - I got Spark to update the exporter so that it will remove tcol_ from any mesh whose first 5 letters is tcol_, Awesome!!! :Aw:


That is awesome :yep: set up a workflow!

_________________
oh yeahh


Top
 Profile  
 
 Post subject: Re: Quick and Dirty Max To Game Engine Export (mesh+tcol)
PostPosted: Sat May 28, 2011 6:16 pm 
Offline
Newbie
User avatar

Joined: Sun Jul 04, 2010 9:42 am
Posts: 26
Location: Netherlands (holland)
My TCOL exporter doesn't work longer.. :s
After export i will get a small document (31kb normally it is 300~400kb)
Also he won't use "Common/Stone" but the normally textures. (already removed?)

Hope you will understand me! :p (dutch ;) )

Image

Uploaded with ImageShack.us

_________________
Image
Image


Top
 Profile  
 
 Post subject: Re: Quick and Dirty Max To Game Engine Export (mesh+tcol)
PostPosted: Sat May 28, 2011 6:57 pm 
Offline
Newbie
User avatar

Joined: Sun Jul 04, 2010 9:42 am
Posts: 26
Location: Netherlands (holland)
It's working again! ;) Fix: Removed some unused meshes and camera's! ;)

_________________
Image
Image


Top
 Profile  
 
 Post subject: Re: Quick and Dirty Max To Game Engine Export (mesh+tcol)
PostPosted: Sat May 28, 2011 9:14 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Fri Mar 26, 2010 10:06 am
Posts: 436
Sweet :D

What's that you're workin on there? A highway, but, whatcha makin? =)


Top
 Profile  
 
 Post subject: Re: Quick and Dirty Max To Game Engine Export (mesh+tcol)
PostPosted: Sat Dec 03, 2011 12:17 pm 
Offline
Newbie

Joined: Sat Dec 03, 2011 9:34 am
Posts: 3
I think the image domain has expired, any help?


Top
 Profile  
 
 Post subject: Re: Quick and Dirty Max To Game Engine Export (mesh+tcol)
PostPosted: Sat Dec 03, 2011 1:42 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Fri Mar 26, 2010 2:13 pm
Posts: 318
Location: Spain
I see the images fine from here!

_________________
oh yeahh


Top
 Profile  
 
 Post subject: Re: Quick and Dirty Max To Game Engine Export (mesh+tcol)
PostPosted: Fri Apr 05, 2013 5:13 pm 
Offline
Supreme Tyrant of All
Supreme Tyrant of All
User avatar

Joined: Sat Mar 27, 2010 1:13 pm
Posts: 758
I think only his sig is 404ing.


Top
 Profile  
 
 Post subject: Re: Quick and Dirty Max To Game Engine Export (mesh+tcol)
PostPosted: Sat May 24, 2014 6:35 pm 
Offline
Newbie

Joined: Sat May 24, 2014 4:56 am
Posts: 13
IT's not working anymore,,the images are indeed dead here, given the age of the post.

Can this be fixed for new users ? ;)

thx
nl


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Localized by MaĆ«l Soucaze © 2010 phpBB.fr