Jump to content

The Coding Thread!


The Philotic Knight
 Share

Recommended Posts

I didn't see a Coding forum, and now that we all know that the code has been publicly released, I though it might be useful to have a spot to chat about the game's code, for all of us nerds out there. I'm making this thread as a temporary holding spot until/unless the Homecoming Mods/Devs decide to make an actual Coding Forum.

 

My current pet-project that I'm working on in my spare time is a mobile Hero-Planner, a Mids-style. However, where Mids worked with a static set of data (BIG ASSUMPTION HERE), I'd like mine to work on semi-live data, to make sure that the data stays up to date. So, I went looking into the powers, and how they function, etc. I learned that the powers are not in fact just stored on the SQL server, as I think any sane programmer today would do, but rather are stored in a .BIN file on the server, that's somehow accessed by the system at-large.

 

I have no idea how to decompile a .BIN file, but it looks like someone over on the discord did that for us, at least partially. They took the .BIN file and converted it into a .DEF file. Well, that's great, now I have something human readable. It reveals that the format of powers in the game are in the form of crude C "objects" called Structs. Each Power has its own set of attributes, along with a SERIES of "AttribMod" structs that EACH contain a ton of data about all of the "abilities" that the power has.

 

The whole thing is kind of a bit of a mess, so to make more sense out of it, I made a "Translator" that converts those items into two DataTables, a Powers table to contain all of the powers' direct attributes, and an "AttribMods" table, that contains a list of all of the AttribMods associated with each power.

 

My translator, after debugging some issues, is chugging along through the 4 MILLION lines of code that make up the DEF file at a slow, but steady pace, and has about 7% done in about 20 minutes:

 

VA2FpoP.png

 

And here is a screenshot of what some of the data looks like, for reference:

 

48XMv13.png

 

CobMPZe.png

 

It's my hopes that once I have all of this data into table like this, I can then make relationships to the data and figure out how they actually work with the base stats of the characters (which I'm sure I can find in another .BIN file somewhere). Once I have all of that data, I can make a SUBSTANTIALLY more accurate Hero Planner than there was before, because the previous Hero Planners I believe (correct me if I'm wrong) were based on numbers that the dev team gave to players in the past, rather than on actual game files. I also plan to get this up into an online SQL database to make it queryable to the public, once I figure out the data relationships.

 

Then, once I have this all figured out, I can create a better tool that can be used to take a .BIN file or .DEF file, and automatically spit it out into some sort of use-able format by the players. I'm envisioning a private server, that's modified their powers/stats, can just provide their powers.bin file (along with any other files that might be necessary for the calculations) to the players publicly, and then they can take those files, run it through my future program, and get up-to-date accurate numbers for their powers outside of the game. Or I might even host a web service that can take input files, and provide a customized web interface for Hero Planning. That's my goal, eventually.

 

But tearing apart this data in this ancient, cryptic (pun not intended) form, and putting it into a more modern format is the very first step.

 

So... coders out there... what are YOU working on? What are your interests in the game code, and what are you doing with what you have? Curious minds want to know! O5khXA8.gif

  • Like 1
Link to comment
Share on other sites

And where is all this magic happening? Is it all on Discord, or is there a more permanent and static location, like a forum, where it's happening? I'd love to be in on the fun and contribute.

Link to comment
Share on other sites

What coding looks like to me....

 

6mXGt80.gif

 

if I attempted to code...

 

Crmnw63.gif

 

what it would do to me if I tried...

 

cOK3C89.gif

 

So, I will leave it up to all you clever and capable coding geniuses to work your magic. And thanks in advance for even attempting to work on this stuff!

y0Y5yFQ.png Forever grateful to be back in my city!
Link to comment
Share on other sites

Welp, I'm giving up on any more coding work with this until I can buy a better computer. Why? Because even after processing that .DEF file, it takes my computer over FOUR HOURS to just open up the Excel document, which seems kind of ridiculous and wrong. So, I think it's about time that I put my old Bessie out to pasture and invest in some new fancy hardware.

 

If someone else wants to pick up from here, here's a link to the Excel document that my custom Translator program output:

 

https://www.dropbox.com/s/8xl4t43cinfcsp1/powers.xlsx?dl=0

Link to comment
Share on other sites

If anyone with the skills is up for the challenge, I think something that could be handy would be a Server-for-Dummies program. That is, taking the code for running a server and creating a user friendly interface for making what changes you'd like for your personal server. Or even something like a "pocket server."

 

The time I have to play isn't what it was 7 years ago. You know, adulting and all that. So I don't have the time to dedicate a lot of investment in multiple characters. Something that would be nice is if I could test out certain builds on characters to whom I could grant those levels and IOs. Then I could dedicate time on the public servers with friends on building that character up.

PQAzhGk.png Make Energy Melee Great Again! Join the discussion.

 

Request hi-res icons here. fBfruXW.pngnFRzS1G.pngZOOTsRk.pngh1GKuZo.pngNG0EFBL.png8lnHKLt.png3f2lHyL.png7KPkl2C.pngHPucq9J.pngBlbsQUx.pngXdnlqXI.png9sfLlss.pngu1MqVyK.png9E28NED.pngTrwSZIP.png

Link to comment
Share on other sites

There's a reason why at the Player Summit in 2012 the Devs in attendance described working with the game code as being very much like playing Jenga with the stack of blocks ON FIRE ...

 

091876-Primary-515Wx515H?context=bWFzdGVyfGltYWdlc3w2MTI0NHxpbWFnZS9qcGVnfGltYWdlcy9oNzYvaGRkLzkxNDE4NzYzOTE5NjYuanBnfDgxN2E3MTJiNDlmZWJjZDRmN2I1ODE1YTY1NjZjOTQ3N2Y2YjJhZjMwOTRkNjBmYTA2YzAwYTMyYTA3NDg1Njc

IifneyR.gif

Verbogeny is one of many pleasurettes afforded a creatific thinkerizer.

Link to comment
Share on other sites

*pictures PK's computer*

 

SuqtwPX.jpg

 

or maybe

 

ZFmbWGV.jpg

 

#2 looks about right.  That's okay, I'm upgrading to a quad core, so that issue should hopefully be resolved in the next couple of weeks when it arrives.

Link to comment
Share on other sites

If anyone with the skills is up for the challenge, I think something that could be handy would be a Server-for-Dummies program. That is, taking the code for running a server and creating a user friendly interface for making what changes you'd like for your personal server. Or even something like a "pocket server."

 

Already done, I can use the VM on my machine no problem.

Just poke around, you will find it - not sure if I should link here. :)

Link to comment
Share on other sites

If anyone with the skills is up for the challenge, I think something that could be handy would be a Server-for-Dummies program. That is, taking the code for running a server and creating a user friendly interface for making what changes you'd like for your personal server. Or even something like a "pocket server."

 

Already done, I can use the VM on my machine no problem.

Just poke around, you will find it - not sure if I should link here. :)

VM? Yes, link it, be helpful :)

I used to play under the handle @Purple Clown, back on Live. Now I play under @Lunchmoney

 

I'm in the UK and play on Reunion.

 

Link to comment
Share on other sites

If anyone with the skills is up for the challenge, I think something that could be handy would be a Server-for-Dummies program. That is, taking the code for running a server and creating a user friendly interface for making what changes you'd like for your personal server. Or even something like a "pocket server."

 

Already done, I can use the VM on my machine no problem.

Just poke around, you will find it - not sure if I should link here. :)

VM? Yes, link it, be helpful :)

 

Right here.

Link to comment
Share on other sites

Already done, I can use the VM on my machine no problem.

Just poke around, you will find it - not sure if I should link here. :)

VM? Yes, link it, be helpful :)

 

Yes, please, and thank you!

 

YO! YO YO! CLICK ME!

Link to comment
Share on other sites

Already done, I can use the VM on my machine no problem.

Just poke around, you will find it - not sure if I should link here. :)

VM? Yes, link it, be helpful :)

 

Yes, please, and thank you!

 

YO! YO YO! CLICK ME!

 

You replied while I was replying, patience friend! And thanks! Guess I'll be spending a weekend sometime in the near future combing through that FAQ.

PQAzhGk.png Make Energy Melee Great Again! Join the discussion.

 

Request hi-res icons here. fBfruXW.pngnFRzS1G.pngZOOTsRk.pngh1GKuZo.pngNG0EFBL.png8lnHKLt.png3f2lHyL.png7KPkl2C.pngHPucq9J.pngBlbsQUx.pngXdnlqXI.png9sfLlss.pngu1MqVyK.png9E28NED.pngTrwSZIP.png

Link to comment
Share on other sites

nerds1.jpg?w=470

OG Server: Pinnacle  <||>  Current Primary Server: Torchbearer  ||  Also found on the others if desired


Installing CoX:  Windows  ||  MacOS  ||  MacOS for M1  <||>  Migrating Data from an Older Installation


Clubs: Mid's Hero Designer  ||  PC Builders  ||  HC Wiki  ||  Jerk Hackers


Old Forums  <||>  Titan Network  <||>  The City Representative (Info site for all servers)  <||>  Heroica! (by @Shenanigunner)

 

Link to comment
Share on other sites

Thanks Ogre. Speaking of nerds, if anyone wants to see some more of my nasty code, here's where you can get the code for PK's Ugly Dev Tracker, because I'm ALL about transparency, unlike SOME coders out there in the community... *grumble, grumble*

 

https://www.dropbox.com/s/jhr4n5e2c67z19y/DevTracker.zip?dl=0

Link to comment
Share on other sites

Current projects in the works (which may take a while because I have a full time job, and twin six year olds and wife that also demand my attention):

 

  • Making a new and updated Pigg Viewer/Extractor DLL - I got the source code for one of them, now I need to upgrade it from C++ to C#, could take quite a while, looks complicated
  • Make a database of all power information, ripped from the Powers.bin file, and make it publicly available for queries, so that anyone can search it or use it in their own apps
  • Make a new Hero Planner, preferably mobile, and able to export like Mids does to a code block and/or to bbCode
  • Finish scraping the old forums via the Wayback Machine and turn THAT into a queryable database for the purpose of letting users find old posts easily
  • Think of other new ideas that the community "needs", and try to fill those needs
  • ???
  • PROFIT!

 

Man, I wish I had more time, or could duplicate myself like Michael Keaton...

Link to comment
Share on other sites

Y'know, I think we'd all settle for something that runs on HTML5 and pulls from a database that only needs to be updated via automated scraping of the Powers.bin file after an update to provide the necessary database to run on.  Being able to copy/paste a URL into our build posts that takes you directly to a build on an online planner (like what World of Warcraft has been doing for over a decade now) would be extremely helpful.  You wouldn't need to make different "versions" for different devices and OS types, you'd just run everything through a web page.

 

Okay, that's a kind of idealized fantasy ... but still ...

  • Like 1

IifneyR.gif

Verbogeny is one of many pleasurettes afforded a creatific thinkerizer.

Link to comment
Share on other sites

 Share

×
×
  • Create New...