Register Register

Author Topic: Coding custom equipment  (Read 522 times)

ErikModi

  • Master Sergeant
  • *
  • Posts: 334
Coding custom equipment
« on: 04 June 2022, 14:13:56 »
So, I asked about this awhile ago on the MegaMek boards when those were still a thing, was directed to the development chat, and I despite some great advice, could not make any headway.  Thought I'd ask again, see if anyone could dumb it down for me.

How can you make your own gear to use in MegaMek, MekHQ, and MekLab?  Like, if you want to alter the number of connections a C3 system has, or mess with the weights/slots of C3 systems?

Anyone able to give me pointers on this?
Best Served Cold (Clan Wolverine AU)

House Northman (Partial, Abandoned)

rjhancock

  • Master Sergeant
  • *
  • Posts: 378
  • MegaMek Server Guy and Mac Enthusist
Re: Coding custom equipment
« Reply #1 on: 04 June 2022, 14:17:23 »
Need coding knowledge and to edit the code base for it. They are pretty much all hard coded inside MegaMek.

ErikModi

  • Master Sergeant
  • *
  • Posts: 334
Re: Coding custom equipment
« Reply #2 on: 05 June 2022, 07:55:03 »
In my previous attempt, I'd gotten the program I need to look at the stats for weapons and equipment, pretty sure I found the values I wanted to change, relatively sure I got them changed correctly, but couldn't get the new equipment to show up in the game.

My knowledge of any kind of coding is functionally nonexistent (most I've done is change a few values in xml files, modding mods for other games), but I get good instructions, they just didn't work for me for whatever reason.
Best Served Cold (Clan Wolverine AU)

House Northman (Partial, Abandoned)

rjhancock

  • Master Sergeant
  • *
  • Posts: 378
  • MegaMek Server Guy and Mac Enthusist
Re: Coding custom equipment
« Reply #3 on: 05 June 2022, 08:09:12 »
My knowledge of any kind of coding is functionally nonexistent

Sadly this will be a hamper as I believe the steps needed to add custom equipment not only include adding the weapon files but also weapon loader code and probably a few other things.

Unfortunately, this is the extent of what I know as I haven't really dove into that part of the code yet.

Maingunnery

  • Lieutenant Colonel
  • *
  • Posts: 6456
  • Pirates and C3 masters are on the hitlist
Re: Coding custom equipment
« Reply #4 on: 05 June 2022, 08:16:32 »
I have tried it myself, but also completely failed.

The solution I arrived at was to edit the record sheets. (this does mean that the BV had to be recalculated and edited in).
Herb: "Well, now I guess we'll HAVE to print it. Sounds almost like the apocalypse I've been working for...."

Fan XTRO: The Society
Nebula Confederation Ships

BATTLEMASTER

  • Captain
  • *
  • Posts: 1723
  • Lightning From Another Zip Code
Re: Coding custom equipment
« Reply #5 on: 05 June 2022, 08:23:47 »
In my experience it's a lot easier to add or edit weapons or equipment than to alter functionality.  That goes way over my head and I don't have time to learn it :(
BATTLEMASTER
Trombone Player, Lego Enthusiast, Engineer
Clan Smoke Jaguar, Delta Galaxy ("The Cloud Rangers"), 4th Jaguar Dragoons
"You better stand back, I'm not sure how loud this thing can get!"
If you like Lego, you'll like my Lego battlemech projects!

ErikModi

  • Master Sergeant
  • *
  • Posts: 334
Re: Coding custom equipment
« Reply #6 on: 05 June 2022, 08:48:54 »
So, if you wanted to add a C3I that had ten connections instead of six. . . there's no relatively easy way to do that?  I don't expect it to be "click, click, boom, done," but a way that doesn't require spending two months learning coding?
Best Served Cold (Clan Wolverine AU)

House Northman (Partial, Abandoned)

rjhancock

  • Master Sergeant
  • *
  • Posts: 378
  • MegaMek Server Guy and Mac Enthusist
Re: Coding custom equipment
« Reply #7 on: 05 June 2022, 10:26:37 »
Probably not without 6 months of coding in Java, an unhealthy supply of Advil, and 4 pallets of caffeine of choice to wade through hundreds of thousands of lines of code to fine the 400 places you'll need to edit to adjust.

dgorsman

  • Captain
  • *
  • Posts: 1779
Re: Coding custom equipment
« Reply #8 on: 05 June 2022, 10:57:48 »
Probably not without 6 months of coding in Java, an unhealthy supply of Advil, and 4 pallets of caffeine of choice to wade through hundreds of thousands of lines of code to fine the 400 places you'll need to edit to adjust.

Maybe not quite that much.  A couple of months of learning the basics of coding, and about two- to three- person weeks to start with assuming full time attention.  Most of it would be searching through code for mentions of C3/C3I and either replacing it with the custom equipment (easy, there should be only a few cases which limit the number of links, but removes the original) or adding (gets a bit more complicated weaving that in).  That's assuming there aren't any major bugs to work out.  The code is much better structured than when I was making changes to TestBot, and it took me a few weeks to get a handle on things like ammo selection and target computer use.

Keeping up the changes with the releases would require more work, as a person would also need to pick up the skills to use source control.
Think about it.  It's what we do.
- The Society

Thunder LRMs: the gift that keeps on giving.  They're the glitter of the BattleTech universe.

ErikModi

  • Master Sergeant
  • *
  • Posts: 334
Re: Coding custom equipment
« Reply #9 on: 05 June 2022, 12:31:15 »
Well, darn.

Thanks for the help.
Best Served Cold (Clan Wolverine AU)

House Northman (Partial, Abandoned)

Hammer

  • Numerorum Malleo
  • Global Moderator
  • Major
  • *
  • Posts: 3581
    • MegaMek Website
Re: Coding custom equipment
« Reply #10 on: 05 June 2022, 15:14:56 »
Anything C3 is complex and the code is everywhere.

I've been with the projects almost 10 years, am not a Java coder (have tried to learn) and you really need to know your stuff before adding more than simple weapons.
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker
New Units and RAT's aren't added until after the 2 month release moratorium is passed.


BATTLEMASTER

  • Captain
  • *
  • Posts: 1723
  • Lightning From Another Zip Code
Re: Coding custom equipment
« Reply #11 on: 05 June 2022, 15:19:06 »
I've been with the projects almost 10 years, am not a Java coder (have tried to learn) and you really need to know your stuff before adding more than simple weapons.

I thought you were a coder!  So what do you do?   :))
BATTLEMASTER
Trombone Player, Lego Enthusiast, Engineer
Clan Smoke Jaguar, Delta Galaxy ("The Cloud Rangers"), 4th Jaguar Dragoons
"You better stand back, I'm not sure how loud this thing can get!"
If you like Lego, you'll like my Lego battlemech projects!

dgorsman

  • Captain
  • *
  • Posts: 1779
Re: Coding custom equipment
« Reply #12 on: 05 June 2022, 16:09:11 »
I thought you were a coder!  So what do you do?   :))

That's not a half-bad question.  Any chance of a 'major contributors thread' where they can do a quick run-down of what they've worked on?
Think about it.  It's what we do.
- The Society

Thunder LRMs: the gift that keeps on giving.  They're the glitter of the BattleTech universe.

BATTLEMASTER

  • Captain
  • *
  • Posts: 1723
  • Lightning From Another Zip Code
Re: Coding custom equipment
« Reply #13 on: 05 June 2022, 19:08:39 »
That's not a half-bad question.  Any chance of a 'major contributors thread' where they can do a quick run-down of what they've worked on?

In the docs folder of my MekHQ installation, there is a contributors.txt document that lists Hammer as the Data Lead, so thanks for that  :thumbsup:  Everyone else who was involved in the project development at some point of the program's lifetime is there too.  You're actually listed above me in that document  ;D
« Last Edit: 05 June 2022, 19:10:37 by BATTLEMASTER »
BATTLEMASTER
Trombone Player, Lego Enthusiast, Engineer
Clan Smoke Jaguar, Delta Galaxy ("The Cloud Rangers"), 4th Jaguar Dragoons
"You better stand back, I'm not sure how loud this thing can get!"
If you like Lego, you'll like my Lego battlemech projects!

Hammer

  • Numerorum Malleo
  • Global Moderator
  • Major
  • *
  • Posts: 3581
    • MegaMek Website
Re: Coding custom equipment
« Reply #14 on: 05 June 2022, 19:46:52 »
I thought you were a coder!  So what do you do?   :))

Most of my role is data. But I've done light simple coding (Caseless ammo, Hyper-laser, and Spinal mounts were me). Mostly I serve as the old man of the project handle social media, and general administration and liaison duties.  Basically none of the fun glory stuff. 

Current coders we have:
Windchild - he's been handling MekHQ and helping modernize the code base in all three programs. The company generator and personnel improvements in MekHQ are all him.
Nickargua - Master of Princess, creator of Stratcon, implementor of Errata, and lots of other stuff. When I joke about Blackjack and Princess all her improvements over the last few years has been him.
Juliez - The master of the UI, the list of graphical improvements over the years and player tools is too long to list. Lately he's been improving MML.

Honorable Mention
rjhancock (Not that Tex) - While not a full dev, without his work on figuring out Macs, dedicated servers, and keeping websites safe we'd still be in the stone ages. Check out megamek.games for his tutorials on servers.

Part-Time  :rockon:
Taharqa - The really old man of the projects he's also implemented Aerospace into MegaMek, the original creator of MekHQ (as we know it today), and biennial projects guy. Currently working on Story Arcs for MekHQ. Oh..forgot to mention he did all the system work and mapping in MekHQ

Sabbatical  :wheelchair:
Neoancient - He coded AtB into MekHQ, implemented LAMs, most new unit types in the last 4 years are his, and and pretty much every Record sheet improvement. RAT Generator and Force Generators were his.

Retired  :beer:
Watford - Lots of MekHQ bug fixes, implemented lots of our deployment tools on Github, dark mode and lots of work on refits.
Arlith - He did it all. Him and I started at the same time - implemented BA and ASF in MML, but most importantly worked in the 34.x to 40.x versions to get MM and MML less buggy.
and numerous others

We also have countless players and contributors who have made the programs what they are.

I consider myself lucky to have been around for this long, and worked with and continue work with amazing coders who are passionate about the BattleTech.

 
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker
New Units and RAT's aren't added until after the 2 month release moratorium is passed.


rjhancock

  • Master Sergeant
  • *
  • Posts: 378
  • MegaMek Server Guy and Mac Enthusist
Re: Coding custom equipment
« Reply #15 on: 05 June 2022, 19:50:05 »
I appreciate the honorable mention. I'm honored.

pheonixstorm

  • Major
  • *
  • Posts: 5394
Re: Coding custom equipment
« Reply #16 on: 06 June 2022, 03:02:02 »
I don't get a mention? How sad... :P ;D

You can blame me for...
The original marriage work
Force Techs
Updated construction rules for DS/JS/WS (somewhat)
CamOps
Some weather stuff.
Some SPAs and Quirks (I think).
Add/Remove pregnancy (original code)
Time in Service
Not sure what else...

Now that I have free time I can get back to playing MM and HQ and maybe get back to finishing what I started oh so long ago with other SPAs and weather code. Provided I can find anything anymore... Four years is a long time and a lot has changed :'(
« Last Edit: 06 June 2022, 03:46:05 by pheonixstorm »

Windchild

  • Master Sergeant
  • *
  • Posts: 291
Re: Coding custom equipment
« Reply #17 on: 06 June 2022, 06:50:47 »
I don't get a mention? How sad... :P ;D

You can blame me for...
The original marriage work
Force Techs
Updated construction rules for DS/JS/WS (somewhat)
CamOps
Some weather stuff.
Some SPAs and Quirks (I think).
Add/Remove pregnancy (original code)
Time in Service
Not sure what else...

Now that I have free time I can get back to playing MM and HQ and maybe get back to finishing what I started oh so long ago with other SPAs and weather code. Provided I can find anything anymore... Four years is a long time and a lot has changed :'(

The core code for both SPAs and weather has largely gone untouched at this time.

I'd also highly recommend joining the Discord, as that's the primary location for the devs and contributors to discuss.
MegaMek Developer - MekHQ, Personnel, and Internal Focus
MegaMek Discord
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker

pheonixstorm

  • Major
  • *
  • Posts: 5394
Re: Coding custom equipment
« Reply #18 on: 06 June 2022, 07:19:06 »
Much has changed... But, since the kids are gone for now I have more time for hobbies again :thumbsup:

Though... what's a dishboard?? xp Just need the decoder ring to find the link.

Windchild

  • Master Sergeant
  • *
  • Posts: 291
Re: Coding custom equipment
« Reply #19 on: 06 June 2022, 08:03:20 »
Much has changed... But, since the kids are gone for now I have more time for hobbies again :thumbsup:

Though... what's a dishboard?? xp Just need the decoder ring to find the link.
I've added an invite link to Discord to my signature. Just click on it to join  :)
MegaMek Developer - MekHQ, Personnel, and Internal Focus
MegaMek Discord
MegaMek Projects Wiki
Bug Trackers
MegaMek Tracker
MekHQ Tracker
MegaMekLab Tracker

 

Register