gametechmods

Robot Arena => Tutorials and Tips => Other Tutorials => Topic started by: Madiaba on August 08, 2009, 03:33:21 PM

Title: GMF ('How-to' mods and notes)
Post by: Madiaba on August 08, 2009, 03:33:21 PM
(https://gametechmods.com/uploads/images/78544GMF.jpg)[/color]
Title: GMF ('How-to' mods and notes)
Post by: Clickbeetle on August 09, 2009, 06:38:54 PM
Excellent tutorial.  I wish this was around a couple years ago; it would have saved me a lot of grief.  It was a while before I finally understood those dang TM rows.

Two things I have to add.  One, a helpful tip:  Attach points always face in the positive Z direction.  So whatever way you want stuff to attach, make the Z axis face that way.

Two, a more in depth explanation of rotating TM_ROWs.

Say you need to rotate, say, an attach point 30 degrees, or even something really weird like 271.2 degrees.  How do you do that?

Well, it's pretty simple with a little math, and once you realize that the length of any one of the TM_ROWs always equals 1.

The examples Mad gave full of 0.7071's will rotate the attach point 45 degrees.  Why all the long decimal numbers?  Well, since the length of any axis always equals 1, you can't just do

Code: [Select]
*TM_ROW1  1  0  -1
*TM_ROW2  0  1  0
*TM_ROW3  1  0  1

in order to rotate the attach point 45 degrees, halfway between the X and Z axes.  That won't work.

In order to get the correct numbers, you need to imagine a circle with radius 1, and rotate the axes inside that.  It will help here if you've had some basic trigonometry because you'll be using sine and cosine functions.  Basically, the cosine of the angle you want gives you the X coordinate on the circle, and the sine of the angle you want gives you the Y coordinate.  Plug in cos(45) to a calculator and you'll get about 0.7071.  That is the terminal X coordinate of a line with length of 1 at 45 degrees.  You'll get the same number for sin(45).

So the correct numbers for a 45 degree rotation are

Code: [Select]
*TM_ROW1  0.7071   0  -0.7071
*TM_ROW2  0          1   0
*TM_ROW3  0.7071  0  0.7071

***IMPORTANT NOTE***  If you're doing sine and cosine on a calculator, MAKE SURE YOU'RE IN DEGREE MODE AND NOT RADIANS.  Radians are multiples of pi with 180 degrees = pi and 360 degrees = 2pi.  Obviously, 45 will be a much different number in Radians mode than in Degree mode, and you'll get bogus numbers.

Now let's get back to doing weirder rotations like 30 and 271.2 degrees.  Once you understand 45 degrees (or any other angle), it's pretty simple.  Just plug in cos(30) and sin(30) as the x,y coordinates of the X and Z axes.

Code: [Select]
*TM_ROW1  0.866  0  -0.5
*TM_ROW2  0        1   0
*TM_ROW3  0.5     0   0.866

Sketching it out on a piece of paper helps to understand where to put the numbers, and whether they should be positive or negative.  The key thing to remember is that the angles between axes are always 90 degrees, so if you rotate one axis, you will have to rotate another one to compensate for it.

If you get the numbers wrong, you'll end up with something like the Distortion Field in Firebeetle's Component Pack :mrgreen:

I think that just about covers it.  Basically, you just need to "get it" with one angle, and then you'll understand them all.
Title: GMF ('How-to' mods and notes)
Post by: Madiaba on August 09, 2009, 07:55:28 PM
*Cricket noise, cricket noise, cricket noise,.......*
..
Thanks, CB, for the added help. Greatly appreciated.
Sorry, I've been sitting on the info for a while, since few dive in here. And I'm often accused of 'over-doing' it in my explanations, which I already thought I had done from the response of utter silence...
..
Several arena and component makers(nice-:-D) were inquiring how to turn things in the gmf. I was told by a couple that they didn't understand my first chart too well. So I made it more user-friendly here. Didn't want to 'over-do' it so I stayed with the 4 cardinal point and 45 degree increments, to save from confusion. I left the 'place values' long because that's what they will encounter in a stock gmf, again for the same reason.
..
BTW: I really DO like helping modders and tweakers, but I'm sorta run-down from helping so many through the week, continuously. Do you think that you or Serge or Apanx (maybe Trov) could help out during the week sometimes? Let me know (PM) please...
 
.
Title: GMF ('How-to' mods and notes)
Post by: Clickbeetle on August 09, 2009, 08:47:13 PM
I try to help when I see someone asking about Python or GMF's, but you usually get to them first :mrgreen:
Title: GMF ('How-to' mods and notes)
Post by: Trovaner on August 10, 2009, 10:33:49 AM
I made this (https://gametechmods.com/uploads/files/GMF STUFF.rar) excel file a while back that simplifies rotating things. You guys are doing things a little differently than what is being done in the excel file but for the most part, the end results are the same... Feel free to change it all you want. It currently has a converter for degrees to radians, a TM_ROW rotator (which probably could be made more user friendly), and a mesh resizer.

I'm willing to help anyone that asks.  Although I'm still open to helping people with other things, I know the most about Python and GIB files.
Title: GMF ('How-to' mods and notes)
Post by: Serge on August 12, 2009, 03:30:32 PM
I am willing to help anyone with GMF files. I daresay I know everything about them (including PointToPoint and AngularDashPot constraints, and some other weird sh**.)
Title: GMF ('How-to' mods and notes)
Post by: Madiaba on August 12, 2009, 05:47:53 PM
^^Hehe^^, Wouldn't doubt that at all, Serge.
BTW: I did get your IM-ed Python inquiry. Check the py docs I gave you already; don't remember the exact question, but I think it's already in there. I'll get back with you soon. Just that work is never-ending this month...
 
If you desire to and can, Serge, you can hack away at explaining some of the other GMF topics listed above (or add some more topics)... :)
 
'Dziekuje', Serge. *hope it's spelled right and didn't say something nasty*
Title: Re: GMF ('How-to' mods and notes)
Post by: Avalanche on January 30, 2010, 03:29:51 PM
Can you make the text bigger?
Title: Re: GMF ('How-to' mods and notes)
Post by: Naryar on January 30, 2010, 03:32:44 PM
 :eek: i never saw this thread

 
Title: Re: GMF ('How-to' mods and notes)
Post by: JoeBlo on January 30, 2010, 07:27:21 PM
there is my thread that you said you weren't going to read  :frown:

@Avalanche: if you mean font size hold down Ctrl while in your internet program and scroll with the mouse to zoom
Title: Re: GMF ('How-to' mods and notes)
Post by: Naryar on February 11, 2010, 06:31:54 AM
Nice tutorial, will read it soon.

Anyways,

(http://www.slashfilm.com/wp/wp-content/images/ragetoon.jpg)

After a few tries, I am still absolutely unable to get a second opposite attachment point on the sawblades (like that was done on the chewblades) because i want them to be chain-able for NAR AI v2.2 so you can make sawblade drums (i will also change the replica discs's APs in a similar way)

Here is part of the the modified sawblade1.GMF that when compiled back either crashes my game, either changes the sawblade to a huge-ass flat thing that does not look at all like a sawblade...

________________

(start of the GMF)
{
   *OBJECT_COUNT   6
   *GEOMOBJECT
   {
(Unchanged mesh info)
   }
   *GMID_ATTACHMENTPT
   {
      *NODE_NAME   Point01
      *NODE_TM
      {
         *NODE_NAME   Point01
         *TM_ROW0 1   0   0
         *TM_ROW1 0   1   0
         *TM_ROW2 0   0   1
         *TM_ROW3 0   0   2
      }
      USER DATA   type = attach
      
id = 1

attach = axle_F, axle_M
   }
   *GMID_ATTACHMENTPT
   {
      *NODE_NAME   Point02
      *NODE_TM
      {
         *NODE_NAME   Point02
         *TM_ROW0 1   0   0
         *TM_ROW1 0   -1   0
         *TM_ROW2 0   0   -1
         *TM_ROW3 0   0   2
      }
      USER DATA   type = attach
      
id = 2

attach = axle_F, axle_M
   }

   *GMID_HAVOK_SIMOBJECT

(end of the GMF)

______________________________________

Changes are bolded.

I changed the OBJECT_COUNT to 6 since there is one more AP (when it is kept at 5 it crashes my game) but it still doesn't seems to work :(

Any help ?
Title: Re: GMF ('How-to' mods and notes)
Post by: JoeBlo on February 11, 2010, 08:39:22 AM
gah mental blank

I will do a bit of quick refreshers....I think I may know your issue
Title: Re: GMF ('How-to' mods and notes)
Post by: Serge on February 11, 2010, 06:17:38 PM
Care to upload the file somewhere? I'll take a look at it.
Use http://www.drop.io/ .
Title: Re: GMF ('How-to' mods and notes)
Post by: Clickbeetle on February 12, 2010, 10:28:00 PM
changes the sawblade to a huge-ass flat thing that does not look at all like a sawblade...


This sounds like a skin problem, rather than an attach point problem.  The saw blade (presumably to cut down on polys) has square faces on the top and bottom, and a .tga skin with alpha channel is applied to make it appear circular.  If the skin is changed, it could appear as a big flat square.
Title: Re: GMF ('How-to' mods and notes)
Post by: Serge on February 13, 2010, 08:38:37 AM
Actually, both of the meshes are circular. The display mesh is 22-sided, and the collision mesh is 8-sided.
Title: Re: GMF ('How-to' mods and notes)
Post by: JoeBlo on February 13, 2010, 09:00:06 AM
the "rim" of the sawblade is made out of a 3D object

the 2 faces just use a square tga image
Title: Re: GMF ('How-to' mods and notes)
Post by: Madiaba on February 13, 2010, 11:04:09 AM
So, are one of you guys on top of this and got it figured out?
Title: Re: GMF ('How-to' mods and notes)
Post by: Serge on February 13, 2010, 12:05:41 PM
Not yet, since Nary hasn't posted his GMF file.
Title: Re: GMF ('How-to' mods and notes)
Post by: Badnik96 on February 13, 2010, 03:37:07 PM
umm guys, I have a problem. I'm making a Psychosprout shell for my *unannounced* replica pack using the Frosty the Snowbot wheel, but it won't attach.(it says it can't intersect with the chassis) I want to edit the collision mesh but I don't know how. Can you teach me???
Title: Re: GMF ('How-to' mods and notes)
Post by: G.K. on February 13, 2010, 03:39:01 PM
You could always BFE it on.
Title: Re: GMF ('How-to' mods and notes)
Post by: JoeBlo on February 14, 2010, 04:49:50 AM
umm guys, I have a problem. I'm making a Psychosprout shell for my *unannounced* replica pack using the Frosty the Snowbot wheel, but it won't attach.(it says it can't intersect with the chassis) I want to edit the collision mesh but I don't know how. Can you teach me???


its not the collision mesh you want to play with (otherwise everything will pass through it)


you want to edit the passthrough within the text file matching it to the same as the collision should allow chassis passing.
Title: Re: GMF ('How-to' mods and notes)
Post by: Badnik96 on February 14, 2010, 06:41:55 AM
How do I do that?
Title: Re: GMF ('How-to' mods and notes)
Post by: JoeBlo on February 14, 2010, 06:51:37 AM
make a copy of the GMF if it doesnt already have a text version of it


if not then decompile the copy and go right down to the bottom ridgedbody and find the node name for the collision


copy and paste it


jump into the text file for the component and add it to the passthrough section, if one doesnt exist add it


 :mrgreen:
Title: Re: GMF ('How-to' mods and notes)
Post by: Badnik96 on February 14, 2010, 07:52:06 AM
thanks! It works now!
Title: Re: GMF ('How-to' mods and notes)
Post by: JoeBlo on February 14, 2010, 08:02:36 AM
good to hear


pasthrough can be rather useful/ powerful tool for components
Title: Re: GMF ('How-to' mods and notes)
Post by: Naryar on February 14, 2010, 01:22:09 PM
https://gametechmods.com/uploads/files/sawblademod.rar (https://gametechmods.com/uploads/files/sawblademod.rar)

My modded sawblade that doesn't works
Title: Re: GMF ('How-to' mods and notes)
Post by: Naryar on May 19, 2010, 03:16:18 AM
Well... these are supposed to be two new components for v2.3

Introducing, the 90 kg hammer !

I just edited the gmf vertices and after compiling it gave that particularly successful result:

(https://gametechmods.com/uploads/images/77242failhammer.PNG)

And another, the NAR AI blade - just a modded ramplate. Modded vertices, added Axle_F to the AP, did txt, new component folder and everything... and yet again...

(https://gametechmods.com/uploads/images/83984failaiblade.PNG)

Really i am wondering if i am using the right gmf compiler and decompiler. What do you guys use and think which one is better ?

If someone wants to take a look at the gmfs here they are.

https://gametechmods.com/uploads/files/naraiblade.rar (https://gametechmods.com/uploads/files/naraiblade.rar)

https://gametechmods.com/uploads/files/sledgehammer3.rar (https://gametechmods.com/uploads/files/sledgehammer3.rar)

Title: Re: GMF ('How-to' mods and notes)
Post by: Serge on May 19, 2010, 03:24:12 AM
I am using the toolset that's in my sig :D.

Anyway, I'll take a look at those files later today.
Title: Re: GMF ('How-to' mods and notes)
Post by: Naryar on May 19, 2010, 03:28:44 AM
Does it works for all components ? I've heard some compiler did not worked for some motors or wheels...
Title: Re: GMF ('How-to' mods and notes)
Post by: Madiaba on May 19, 2010, 07:55:33 AM
Nar, the Sledgehammer vertice parameters you entered are what you see in game,.. they're huge:
Code: [Select]
    *MESH_VERTEX 0 0 1 -6
    *MESH_VERTEX 1 0 10 0
    *MESH_VERTEX 2 0 0 -6
    *MESH_VERTEX 3 0 10 0
    *MESH_VERTEX 4 0 -10 0
    *MESH_VERTEX 5 0 0 -6
    *MESH_VERTEX 6 0 -10 0
    *MESH_VERTEX 7 0 10 0
    *MESH_VERTEX 8 0 0 -6
    *MESH_VERTEX 9 0 10 0
    *MESH_VERTEX 10 0 -10 0
    *MESH_VERTEX 11 0 0 -6
    *MESH_VERTEX 12 0 -10 0
    *MESH_VERTEX 13 0 1 -6
...which is why the geomobject is so huge in-game...  The X-axes are at '0' so the object is flat.
 
 

And on the Ramplate mod, the vertices are all '0':
Code: [Select]

    *MESH_VERTEX 0 0 0 0
    *MESH_VERTEX 1 0 0 0
    *MESH_VERTEX 2 0 0 0
    *MESH_VERTEX 3 0 0 0
    *MESH_VERTEX 4 0 0 0
    *MESH_VERTEX 5 0 0 0
    *MESH_VERTEX 6 0 0 0
    *MESH_VERTEX 7 0 0 0

...which is why there's nothing in-game...
 

I would suggest changing the original gmf vertice parameters one at a time, and only slightly. Then compile and try it in-game to see what effect your tweek has made.
 
(BTW: Serge's gmf previewer is handy for quick checking tweeks...)
 
 
Title: Re: GMF ('How-to' mods and notes)
Post by: JoeBlo on May 19, 2010, 09:02:06 AM
sounds like Naryar didn't read the tutorial :P

also remember if the value has an e in the decimal its actually smaller then 1  ;)
Title: Re: GMF ('How-to' mods and notes)
Post by: Madiaba on May 19, 2010, 10:10:05 AM
Well the geometry of the vertices is a bit conceptual when translating it from numbers to 3d object, and takes practice. I think Nar will be right on top of it, NP.
Title: Re: GMF ('How-to' mods and notes)
Post by: JoeBlo on May 19, 2010, 10:16:03 AM
NP I was just teasing as when I posted a GMF tutorial he said he wouldn't read it but attempt to figure it out himself :P