SMT - Starmade Modding Tools - First Mod Made!

    Joined
    Jun 27, 2013
    Messages
    7
    Reaction score
    8
    SMT - Starmade Modding Tools
    Version 1.0 - Actually allows modding right now!​
    SMT is a small set of tools designed to help with the modding of StarMade. The toolkit is programmed in java to ensure cross platform comparability and all of the tools are designed to work in the console to allow automated scripts. I have deobfuscation and reobfuscation working quite well with some classes having minor issues which can be fixed with a little bit of work. At the moment I am yet to find a good decompiling solution which can decompile all of the code correctly (Mainly a lot of issues with Exception handling being lost and some newer java features being incorrectly decompiled) so for now it is best to just decompile only the files you want to edit and fix the incorrect decompiling issues (making sure you do not rename/remove any methods or fields) manually and then recompiling them (you will want to delete the file out of the deobf jar and then add the deobf jar as a library so you can compile without all of the source code decompiled) and then compile and replacing the file into the deobf jar and then running reobfuscation on the jar and then extracting the files you have changed. At the moment this is a lot of work however it does allow you to start making small changes quite easily... I will be making this process easier over the next few weeks and hopefully I will be able to find a good decompiler which wont require a large amount of manual fixes.

    News - 11/09/2015
    The information in this post is highly outdated. I have even managed to make a mod (see comments). I will be releasing more information soon on how to mod the game, but I can actually say now that modding is 100% possible! (Does anyone know if anyone else has managed to mod the game? As it seems to be just me)

    Toolkit Downloads
    11/08/15 - Version 2 Alpha
    - Using new SMRemapper
    - Using new .smtmap format

    Mapping Downloads
    Mappings are currently generated by me for each build of StarMade using a custom asm based program.
    StarMade Build - Version - Link
    20150802_160440 - Raw - 20150802_160440-11082015-RAW.smtmap

    Source code + Contributing
    All of the source code is kept on GitHub!
    Group - Link - This is where you will find all the repos!
    SMT - Link - This is where the main toolkit is kept
    SMRemapper - Link - This is the software that remaps the jar files to allow deobfuscation and reobfuscation
    SMT-Mappings - Link - This is where all the official mappings are stored
    Everyone is welcome to make pull requests!

    Known Issues
    - Annotations are currently broken
    An issue caused by ASM where it does not correctly remap annotations keys with method remappings​
    - No decompiler included
    - No automated changed class finder

    Contact
    You can contact me in a few ways
    Skype: chandler.newman
    Teamspeak: error22.com
    Email: [email protected]
     
    Last edited:

    Benevolent27

    Join the Dark Side
    Joined
    Aug 21, 2015
    Messages
    585
    Reaction score
    327
    • Purchased!
    So, this is a great start needed for real modding to begin on Starmade! Yay! Thank you for your work on this!

    I'm no professional coder, but I have dabbled a little in making some simple mods in MineCraft using Eclipse. I would like to continue trying to learn and perhaps make some sort of mod for StarMade, but I'm a bit lost here. I used your tool to deobfuscate the jar file and I decompiled too, but there are a lot of files here and I have no idea where to look. I think I may be in over my head here, but I thought I'd give it a shot anyhow.

    One of my end goals is to create a type of thruster block that would increase the turn speed of a ship (either by changing the ship weight or by overriding the global effect somehow). I'd also like to look at a few of the class files for things like the push-effect computer, to see how that ties itself into the ship and how it actually changes the position of the ship when activated. But alas, I am lost. Any help would be awesome.

    Thanks again,
    Phil
     
    Last edited:
    Joined
    Jun 27, 2013
    Messages
    7
    Reaction score
    8
    So, this is a great start needed for real modding to begin on Starmade! Yay! Thank you for your work on this!

    I'm no professional coder, but I have dabbled a little in making some simple mods in MineCraft using Eclipse. I would like to continue trying to learn and perhaps make some sort of mod for StarMade, but I'm a bit lost here. I used your tool to deobfuscate the jar file and I decompiled too, but there are a lot of files here and I have no idea where to look. I think I may be in over my head here, but I thought I'd give it a shot anyhow.

    One of my end goals is to create a type of thruster block that would increase the turn speed of a ship (either by changing the ship weight or by overriding the global effect somehow). I'd also like to look at a few of the class files for things like the push-effect computer, to see how that ties itself into the ship and how it actually changes the position of the ship when activated. But alas, I am lost. Any help would be awesome.

    Thanks again,
    Phil
    You may have some issues with the version of SMRemapper included in the download, I suggest that you compile the version found on github for the latest fixes such as basic annotation support.

    I have taken a short break from this project due most decompilers not being good enough however if a new version of starmade is released and you need a raw mapping file please just leave a comment on this thread as I get email notifications.

    I have not looked much into what each class is as I have been more focused with just getting the basic functionality to work however if you do know the name of a class please contact me so I can publish a community mapping file which contains real names not raw random deobf names.

    What you want to do should be more than possible once the correct names are figured out as its currently like trying to find a needle in a haystack but if you do find this 'needle' please do share.

    I am currently looking for more people to help on this project before I continue as I do not have the time to produce the mapping files with correct names. Help would also be appreciated with making the tools user friendly like basic .bat scripts however once again this requires time I do not have.

    Thanks,
    Chandler
     

    Benevolent27

    Join the Dark Side
    Joined
    Aug 21, 2015
    Messages
    585
    Reaction score
    327
    • Purchased!
    You may have some issues with the version of SMRemapper included in the download, I suggest that you compile the version found on github for the latest fixes such as basic annotation support.

    I have taken a short break from this project due most decompilers not being good enough however if a new version of starmade is released and you need a raw mapping file please just leave a comment on this thread as I get email notifications.

    I have not looked much into what each class is as I have been more focused with just getting the basic functionality to work however if you do know the name of a class please contact me so I can publish a community mapping file which contains real names not raw random deobf names.

    What you want to do should be more than possible once the correct names are figured out as its currently like trying to find a needle in a haystack but if you do find this 'needle' please do share.

    I am currently looking for more people to help on this project before I continue as I do not have the time to produce the mapping files with correct names. Help would also be appreciated with making the tools user friendly like basic .bat scripts however once again this requires time I do not have.

    Thanks,
    Chandler
    Well, after a bit of research I have figured out that the authors of Starmade are doing quite a good job at obfuscating the code. They don't feel the game is stable enough yet for mods. Frequent code rewrites and stability improvements will make keeping a mod current for the latest version difficult. It seems modding will be welcome later on. Unfortunately I am not skilled enough in Java to be able to understand the complex inner workings of the code to be able to identify which class file does what, especially with it being obfuscated to this degree. I could help with making things more streamlined with batch files though.

    Personally, I would like to see modding allowed now, with a warning to modders about upcoming stability improvements making their life difficult and to users of mods that their games could most certainly crash often and worlds become corrupted. This is what I expect and accept in the similar world of MineCraft where I ran a server that had over 180 mods on it. I think if they were to allow mods, this game would blow up in popularity. But for now, I give up. I do appreciate the work you put into this so far though. And thank you for your response as well. :)
     
    Joined
    Jun 27, 2013
    Messages
    7
    Reaction score
    8
    Well, after a bit of research I have figured out that the authors of Starmade are doing quite a good job at obfuscating the code. They don't feel the game is stable enough yet for mods. Frequent code rewrites and stability improvements will make keeping a mod current for the latest version difficult. It seems modding will be welcome later on. Unfortunately I am not skilled enough in Java to be able to understand the complex inner workings of the code to be able to identify which class file does what, especially with it being obfuscated to this degree. I could help with making things more streamlined with batch files though.

    Personally, I would like to see modding allowed now, with a warning to modders about upcoming stability improvements making their life difficult and to users of mods that their games could most certainly crash often and worlds become corrupted. This is what I expect and accept in the similar world of MineCraft where I ran a server that had over 180 mods on it. I think if they were to allow mods, this game would blow up in popularity. But for now, I give up. I do appreciate the work you put into this so far though. And thank you for your response as well. :)
    The obfuscation is only a small step back that we are mostly past, obfuscation is not the way to stop modding, it just slows it down a bit. If they wanted to stop modding correctly then should be doing multiple checksums and other hidden values.

    A good modding api wouldn't change even if the game was completely rewritten however most people can not be bothered to implement a good solution... I think the excuse about the game being unstable is not a good reason as with a good api this wouldn't make a difference!

    When I get around to writing the unofficial api, it would be more than possible to make it so it supports multiple versions (even with obfuscation!)

    I more than welcome any help!
     
    Joined
    Jun 27, 2013
    Messages
    7
    Reaction score
    8
    I would like to report that I have been successful in making a mod. It is not much of a mod however it does highlight how mod loaders will have to work with base modifications. I will probably be making a custom starmade client that allows mods to be loaded correctly.
    I am not going to release the mod I have made as it allows you to have fake players on servers (which even show up in game), I am going to contact the developers to ask them to fix this issue.
    All they need to do is make it so all players have to login in(even free accounts) and then that servers report UUIDs for each player which can be checked to see if they are really on that server and if they are a real user.