Author Topic: Editing Wheel .gmfs  (Read 3441 times)

Offline Gazea2

  • Ultra Heavyweight
  • Posts: 3075
  • Reputation: 8
  • the one and only
    • View Profile
  • Skype: gazea2
Editing Wheel .gmfs
« on: June 27, 2010, 02:44:52 PM »
In this tutorial, you will learn how to edit wheels and how to make multiple skins for them.

First of all, you will need to download Serge's Compilers and De-compilers. These are the only things that can compile and de-compile wheels successfully.

Next you need to choose your wheel. This first tutorial will be about shiny wheels.

Part 1 - Shiny Wheels

First of all, open up the folder containing the shiny wheels files. You should find a maps folder, the shiny wheel .gmf and the preview image.



Ignore the preview image and .gmf for now and go into the maps folder. Make a copy of both maps and re-name them. This is vital. Edit them and save them.

Now copy the .gmf and paste it somewhere. Run the de-compiler and choose the copied .gmf. Now re-name it as something else and put a .gmf at the end of it.

E.g - wheel.gmf

Now open up the de-compiled .gmf. You should see a bunch of writing and numbers. Scroll down a bit and you should see a name of a map. Change this name to the name of your edited map.



Before you compile it, you must change something. Press Ctrl+F to find something. Type in

MESH_TVERT 15

You need to find this and change it. It should say -1#QNO or something like that. Delete the letters and the #. Now compile it, drag the .gmf into the shiny wheel folder and copy the shinywheel.txt in the main components folder. Open it up and change the .gmf to the name of the edited .gmf. Now run your game and enjoy your new wheel!

(Pictures and more tutorials to be added soon!)
« Last Edit: June 29, 2010, 01:23:14 PM by Gazea2 »


Offline G.K.

  • *
  • Posts: 11514
  • Reputation: 10
  • Striving for a good personal text since 1994.
    • View Profile
Re: Editing Wheel .gmfs
« Reply #1 on: June 27, 2010, 02:47:21 PM »
Nice tuto Gazea.


Why does one have to delete the letters and the #?
My above post explains everything about everything.

Host of: Wheely Tag, Back To The Beginnings, BTTB 2, BTTB 3, BTTB 4, & BTTB V. Signups open for The RA2 League.
Heavy Metal: Champion (Mockery of the Whole Concept)
Robotic International Wars Series 1: Champion (Minifridge 6)
RA2 Team Championships 1 & 2: Champion (High Speed Train & Upthrust - as part of Naryar's Not Quite Evil Council of Doom)

Runner Up in: The Amazing Rage (Team Fedex), R0B0NOVA (Zaphod Stock), Steel Warzone (Inception of Instability), Box of Nightmares (Gicquel), Wheely Tag (Minifridge the Second)

Clash Cubes IV: 5th place (Fretless)
BBEANS 6: Rumble Winner & 6th Place (Minifridge 4)

Offline Sparkey98

  • Giga Heavyweight
  • Posts: 5133
  • Reputation: -20
    • View Profile
Re: Editing Wheel .gmfs
« Reply #2 on: June 27, 2010, 02:47:54 PM »
I think G2 needs to be an AU

Offline Gazea2

  • Ultra Heavyweight
  • Posts: 3075
  • Reputation: 8
  • the one and only
    • View Profile
  • Skype: gazea2
Re: Editing Wheel .gmfs
« Reply #3 on: June 27, 2010, 02:51:34 PM »
@G.K. - Because Serge's Compiler won't compile it when they are there. Stock wheels are weird like that. :P

@Sparkey98 - I'm flattered but lots of other people deserve to have that title instead of me.


Offline Serge

  • *
  • Posts: 1483
  • Reputation: 13
    • View Profile
    • http://www.q3k.org/
Re: Editing Wheel .gmfs
« Reply #4 on: June 27, 2010, 06:54:03 PM »
It should say -1#QNO or something like that.

Whoops.
home | twitter | yt | gmf de/compiler | component freedom | xmpp: q3k@q3k.org | email: q3k@q3k.org

Offline Gazea2

  • Ultra Heavyweight
  • Posts: 3075
  • Reputation: 8
  • the one and only
    • View Profile
  • Skype: gazea2
Re: Editing Wheel .gmfs
« Reply #5 on: June 28, 2010, 09:32:15 AM »
LOL. Don't worry, Serge. This tutorial will fix everything. :)

Coming soon  - Granny Wheels.


Offline Gazea2

  • Ultra Heavyweight
  • Posts: 3075
  • Reputation: 8
  • the one and only
    • View Profile
  • Skype: gazea2
Re: Editing Wheel .gmfs
« Reply #6 on: June 10, 2012, 07:27:56 AM »
Eh, may as well finish this off.

SO, granny wheels don't actually need anything to be done to them. When you compile them you'll get a message saying: "Expected = but found 0 instead! Continue?" Press YES. This won't affect the wheel at all.
More wheels coming soon.


Offline Clickbeetle

  • *
  • Posts: 3323
  • Reputation: 21
  • In Soviet Russia, bugs stomp YOU!
    • View Profile
    • Beetle Bros site
Re: Editing Wheel .gmfs
« Reply #7 on: July 11, 2015, 11:48:22 PM »
Okay, Knight was asking me about how to make wheels for the Robot Wars mod, so I'm going to bump this thread and provide a little more information.

Gazea got the most important bit, which is use Serge's compiler and decompiler.  Dummy's doesn't know how to handle node parents and will break any wheels you try to edit.

After you do that, editing wheels is pretty much the same as any other component.  The format is a bit different, however, so I'm just going to go over how wheels are set up so you know what you're doing.

If you press F12 in the bot lab, you'll notice that all the wheels have a wonky collision box around them.  This is something unique to wheels and is called the traction zone.  It's invisible and doesn't collide with anything, but the game uses it to determine if a wheel is getting traction or not.



This zone needs to be slightly bigger than the wheel's actual collision mesh.  If it's too small, the wheel won't get traction when it's supposed to and the bot won't move.  If it's too big, funny things will happen when the bot gets close to walls.

In the bot lab, you'll also notice that all the wheels are aligned to rotate on the Z axis.  This is not a coincidence.  Because RA2 is finicky, wheels will ONLY work if they spin on the Z axis.  Keep that in mind if you're making a custom wheel model.

Now let's look inside the gmf file, using the rubber wheel as an example.  Wheels are funny because they have two separate objects in one file, the wheel itself and the traction zone.  The thing about having two objects is, you can only use one attach point to put it on a bot, meaning that the other object is going to be hanging loose.  Normally, the loose object will fall into the eternal gray abyss at the bottom of the bot lab, never to be seen again.

To solve this problem, you need to link the two objects together.  Motors do this with an axle constraint.  Wheels do it with something called a node parent.  Here's the relevant part in the gmf file.



The node parent is a blank "dummy" object that the other objects are linked to.  It's usually called wheel_rbodies.  To link the objects, you need to put a NODE_PARENT line right under the NODE_NAME, and specify the name of the node parent.  This line does not appear in any other components, and is the reason why you can't use Dummy's compiler to work with wheels.

The rest of the wheel gmf is like any other component until you get to the RB Collection at the bottom.



Here there are two rigidbody lists, where normally there is just one.  The first one contains wheel_rbodies, the node parent.  See that NUMBER_OF_CHILDREN line?  That tells the game how many objects are linked to the node parent.  In this case, it's 2.

The second rigidbody list is like what you would find in any other component.  There's one very important line here that you don't ever need to worry about with other components, however, and that is the DISABLE_COLLISIONS line for the traction zone.  THIS NEEDS TO BE SET TO 1 or the wheel will turn red when you try to attach it in-game and tell you that components must not overlap other components.  I think.  It's been a while since I forgot to set that to 1.

The .txt file

The .txt file is pretty simple.  There are just a couple of new lines that you won't see in other components.  Here is what they do.

contact = tells the game which object to use as the traction zone.

grip = Think of grip as a speed multiplier.  Bot speed is determined by motor power x wheel grip.  "Normal" grip is around 1.  Fast is 1.2, and "whooooa I can move my SHW with 2WD angle motors" is 2.

resistance = Resistance is kind of hard to explain.  It has to do with turning.  The best way to figure it out is to mess with it and see how it affects your driving.  Low resistance seems to result in more skidding and sliding, while high resistance seems to make sharper, tighter turns.  All the stock wheels use resistance = 0.2, except the shiny hub wheel which has 0.12 because somebody at Gabriel made a typo, I guess.  The maximum seems to be 1.

To lack feeling is to be dead, but to act on every feeling is to be a child.
-Brandon Sanderson, The Way of Kings

Offline jaydee99

  • randomspam memer
  • Ultra Heavyweight
  • Posts: 1341
  • Reputation: -5
  • I've left (searching for my hero Sami Callihan)
    • https://www.facebook.com/
    • Jaydee (Jdixon)
    • View Profile
  • See profile for gamer tags: 1
Re: Editing Wheel .gmfs
« Reply #8 on: July 12, 2015, 04:13:45 AM »
thank you
Download my AI guide: https://gametechmods.com/uploads/files/7203FIXEDJaydee's AI guide.zip
It's a game. I'll play it how I want.
https://gametechmods.com/uploads/images/787141lVITw_JGr_yFr-meOD6MJGneTmi-W4U-Em_iSvXQzM.jpg