Author Topic: Modding RA3  (Read 13907 times)

Offline CodeMoose

  • Antweight
  • Posts: 8
  • Rep: 1
    • View Profile
    • Awards
Modding RA3
« on: June 19, 2016, 03:48:40 PM »
Since RA3 is built on Unity and I'm pretty familiar with how that works (sort of), I thought I would take a look at how difficult it would be to mod the game. Also considering the second Q&A post by the developers contained the following:

 > I'd also like to ask if any modding tools will be supplied by Octopus Tree
Not at initial release. Between us, Unity games are HIGHLY MODDABLE without any support required on the Dev side. Clever folks can actually hook right into the C# mono code.

I thought they wouldn't mind if I took a look.

So I spent a few days investigating and coming up with a way to modify the C# IL (similar to how other Unity game mods do it - with Mono.Cecil). Then I coded up a few examples of how you could alter the code, by adding a couple of export buttons and a new component.

The code isn't much more than a proof of concept (so expect issues if you try to use it) but I'm hoping it might serve as a useful resource for other people to start modding RA3, or even for fixing issues. I put it up on GitHub over at: https://github.com/CodeMooseUS/ra3-tweaks.

Here is a picture of the example weapon I added to my bot (I call him 'ChopSalad'):


Offline Badger

  • Permanent Artifact
  • Giga Heavyweight
  • Posts: 6318
  • Rep: 3
  • I wish to be with my people
  • Awards BOTM Winner Donated money for site hosting 2019
    • View Profile
    • Awards
Re: Modding RA3
« Reply #1 on: June 19, 2016, 03:52:29 PM »
looks sweet, wonder how this will interact with online play. I highly doubt that the devs bothered to check that all the components on a bot are stock, or that both players have a modded component installed.
also lol at most toxic guy around calling others out on this sh**
Google Drive with my newer bots

Offline CodeMoose

  • Antweight
  • Posts: 8
  • Rep: 1
    • View Profile
    • Awards
Re: Modding RA3
« Reply #2 on: June 19, 2016, 04:03:19 PM »
Good question. I imagine if only one person has the component it might crash. If both have the same modded code running though it would probably work. But you are right in that there are no checks (at least as far as I know).

Offline Silverfish

  • The Hardest Part of Ending is Starting Again
  • Super Heavyweight
  • Posts: 843
  • Rep: 3
  • Welcome to the quiet before the storm hits...
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: Modding RA3
« Reply #3 on: June 19, 2016, 04:40:45 PM »
Looks nice, man! I can see you going places.
Please have mercy on me when you get admin.
Tourney stuffs:

"We need a new way to defeat them... Something they haven't seen. Something... no one... has ever seen..."
-Gelorum, Acceleracers: Ignition

Youtube(cuz I can't use the normal link): https://www.youtube.com/channel/UCZ8zJZecbrpqiZK2eLnKLAA

Offline RedSawn

  • aka RedlineM203
  • *
  • Posts: 1922
  • Rep: 4
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: Modding RA3
« Reply #4 on: June 19, 2016, 05:47:36 PM »
I was just wondering if when we'd see something. Excellent.




Offline Scrap Daddy

Re: Modding RA3
« Reply #5 on: June 19, 2016, 05:51:03 PM »
lmao dev team, hire this man.

Offline FOTEPX

  • Your dad
  • Giga Heavyweight
  • Posts: 6797
  • Rep: 5
  • Thank you, meow.
    • Bamzookiman130
    • View Profile
    • Awards
  • Skype: f0tepx
  • Discord: Shima33 #9110
Re: Modding RA3
« Reply #6 on: June 19, 2016, 06:47:09 PM »
Now the race is on - will the GTM community patch the game before the actual designers, or will the designers pull their thumbs out of their ass?


Currently listening to: Marblehead Johnson - The Bluetones

Offline SharkyPRS

  • Antweight
  • Posts: 3
  • Rep: 0
    • View Profile
    • Awards
Re: Modding RA3
« Reply #7 on: June 19, 2016, 07:02:04 PM »
Did you make physics tweaks?  I see the bot bouncing around a bit a doing a bit of wheelie when it moves.  Looks sweet so far.

Offline J

  • I don’t give a dimmadamn
  • *
  • Posts: 3152
  • Rep: 4
  • I sexually identify as a tall hat
    • I don’t care
    • I don’t care
    • View Profile
    • Awards
  • See profile for gamer tags: Yes
  • Skype: I don’t care
  • Discord: I don’t care
Re: Modding RA3
« Reply #8 on: June 19, 2016, 07:44:27 PM »
So.....

.......

How long until RA3 has a Steam Workshop?

Offline Tashic

Re: Modding RA3
« Reply #9 on: June 19, 2016, 08:22:03 PM »
Very interesting! How did you made that component and how did you import it into the game?
Once I finish these BS exams I might help with this.

Offline CodeMoose

  • Antweight
  • Posts: 8
  • Rep: 1
    • View Profile
    • Awards
Re: Modding RA3
« Reply #10 on: June 19, 2016, 11:34:10 PM »
My original idea was to design a system where you can just add small tweaks to methods in the original game to fix issues. For instance I just updated the GitHub repo with a small tweak that now draws a line between the last vertex and the mouse cursor when building the chassis baseplate (just like RA2 used to have).



That being said, I also added code to tweak the methods that load up components like seen in the first post. Essentially there are 2 that I changed. The first loads up the list of all components in the game (from a JSON file). I hooked into this function and made it append a second set of json to the end that describes the new components I want to add (just the dagger shown in the first post). That json file has an entry that says what Unity prefab to load when you add the component. So the second method I hooked is the one that loads the prefabs. I check to see if the prefab it is looking for is one I've added and if it is, I load it up from a Unity asset bundle I created (if not I just let it load as normal).

So to create the new components, you have to use Unity (free personal version works fine - its what I have) to create a new gameObject and pack it into an asset bundle.

To do that you basically create a new Unity gameobject that has a child gameobject containing the model mesh, and the physics collider (if you've ever used Unity you'd know this is just a normal sort of thing you would do). You also add a child gameobject called 'AttachPoint' that gets converted into an object where RA3 should attach the component when you add it. Then you put it into an asset bundle using the Unity asset bundle option, and then build the bundle (I included an editor script in the GitHub Unity project that will build it for you from the Assets menu). The components.json file is also included in that asset bundle. That probably all sounds like nonsense, but its actually pretty straight forward once you see it in action.

The system could be improved to use multiple asset bundles or something, and there is no way to specify the type of attach point right now (fixed, motor, wheel, swing, socket, plug, etc). But it is just a proof of concept right now.

Online WeN

  • #1 Malaysian Idiot
  • Ultra Heavyweight
  • Posts: 1938
  • Rep: 8
  • totsugeki!!!
    • View Profile
    • Awards
  • Discord: thatwenguy
Re: Modding RA3
« Reply #11 on: June 20, 2016, 01:57:43 AM »
interesting. I can create papyrus on RA3.

Offline Serge

  • *
  • Posts: 1530
  • Rep: 13
    • View Profile
    • http://www.q3k.org/
    • Awards
Re: Modding RA3
« Reply #12 on: June 20, 2016, 09:15:03 AM »
Great job!
As the game actually works under mono/wine on Linux, I might join in on the fun later on - once I actually learn some more Unity and C# :/. However, doing some RA2/RA3 component conversion might be right up my alley.

I assume the game assembly .dll is not obfuscated, right?
home | twitter | yt | gmf de/compiler | component freedom | xmpp: q3k@q3k.org | email: q3k@q3k.org

Offline CodeMoose

  • Antweight
  • Posts: 8
  • Rep: 1
    • View Profile
    • Awards
Re: Modding RA3
« Reply #13 on: June 20, 2016, 12:30:02 PM »
It is not obfuscated, which I am very thankful for. You would need to flesh out the rough component importing system somewhat before attempting to convert any RA2 modded components. Static weapons like blades and spikes might be easy, but it can't do wheels or motors... yet(?)

As an interesting side note, the components.json format that the RA3 game uses, contains entries for RA2 model names, and they have code to convert the metadata from the old format (though I don't see it getting called anywhere). I think they must have manually converted the model meshes though, since I don't see code to read in gmf formats.

Offline RedSawn

  • aka RedlineM203
  • *
  • Posts: 1922
  • Rep: 4
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: Modding RA3
« Reply #14 on: June 20, 2016, 12:39:35 PM »
I can't think of a component that looks like the model has been ripped straight from RA2. Maybe the Power Steering Unit comes close. Curious they even have it, though.




Offline CodeMoose

  • Antweight
  • Posts: 8
  • Rep: 1
    • View Profile
    • Awards
Re: Modding RA3
« Reply #15 on: June 20, 2016, 12:42:36 PM »
Perhaps it was used for testing before they had new models and left the code in there?

Offline toAst

  • *
  • Posts: 928
  • Rep: 5
  • this one goes out to all of my babies mamas
    • View Profile
    • Awards
  • Skype: besttoaster
Re: Modding RA3
« Reply #16 on: June 25, 2016, 05:11:58 PM »
oh this just made my day  :redface: god speed to you all
-------------------------------
who love to party

Offline R01

  • Heavyweight
  • Posts: 769
  • Rep: 1
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: Modding RA3
« Reply #17 on: July 16, 2016, 03:19:34 PM »
Perhaps it was used for testing before they had new models and left the code in there?
Code to convert the RA2 components? Now that's something I'd definitely like to have(but I guess that part was already removed?)
Tournament History:
Showcases:
https://gametechmods.com/forums/index.php?topic=18882.0
https://gametechmods.com/forums/index.php?topic=19197.0

Offline Sage

  • *
  • Posts: 6182
  • Rep: 11
  • RA2 Wizard & GTM's Favorite Stock Builder 2015
  • Awards Sage's Favorite BOTM Winner
    • View Profile
    • Awards
Re: Modding RA3
« Reply #18 on: July 16, 2016, 05:47:54 PM »
Perhaps it was used for testing before they had new models and left the code in there?
Code to convert the RA2 components? Now that's something I'd definitely like to have(but I guess that part was already removed?)

Why would you need to convert RA2 components? RA3 already has them all

/s
You got my vote for RA2 Wizard. Always and forever.

Offline R01

  • Heavyweight
  • Posts: 769
  • Rep: 1
  • Awards BOTM Winner
    • View Profile
    • Awards
Re: Modding RA3
« Reply #19 on: July 16, 2016, 06:32:46 PM »
Perhaps it was used for testing before they had new models and left the code in there?
Code to convert the RA2 components? Now that's something I'd definitely like to have(but I guess that part was already removed?)

Why would you need to convert RA2 components? RA3 already has them all

/s
Saw the /s. I'm more interested in exporting RA2's components into a format that can be used by 3d model editors so we can go forwards and backwards between the file formats/because I'd like to do a mod for balanced stock and would really love to have the original components as a reference.
Tournament History:
Showcases:
https://gametechmods.com/forums/index.php?topic=18882.0
https://gametechmods.com/forums/index.php?topic=19197.0