FAF UnitDB App

Post here if you want to help developing something for FAF.

FAF UnitDB App

Postby MfgSolid » 09 May 2017, 20:37

So, after playing Supcom for a while now I decided to contribute something to this great community project.
Out of wanting to practice and to add something to FAF I wnated to bring the UNitDB to Android to use it offline as well as on the go.

I divided the Project in 3 Parts, first the main App (unitlists as well as detailed views for single units) which is pretty much the same as the Unit DB currently at the FAForever Website. Visual progress to be seen in the attachment.

Step 1: Acquire location of relevant UnitData

Step 2: Developing Software for Processing and Serializing UnitData for Dynamic Updates

Step 3: Developing the App itself, streamlining Visualization, refactoring and Licensing

Finally I´d like to ask if in the faf-db on GitHub entrys for all the units and there stats exist and if not where to get them.

Edit: Oh and if you could tell me how things are handled with supcom icons on the legal side of things, that would be nice cause i dont want to pay for copyright thingies
Attachments
FafUnitDbPreview.JPG
Switch for Faction based Unitlists
FafUnitDbPreview.JPG (27.04 KiB) Viewed 6112 times
Last edited by MfgSolid on 07 Aug 2017, 14:03, edited 1 time in total.
User avatar
MfgSolid
 
Posts: 9
Joined: 07 May 2017, 17:38
Location: Germany
Has liked: 7 times
Been liked: 1 time
FAF User Name: MfgSolid

Re: FAF UnitDB App

Postby PhilipJFry » 09 May 2017, 21:16

If i'm not mistaken all unit stats are in the individual .bp files.
The FAF github has "only" the units that have been changed in FAF in some way the others can be found in your local .scd files in your FA install.
cats>dogs
post logs
User avatar
PhilipJFry
Supreme Commander
 
Posts: 2635
Joined: 23 Mar 2016, 21:16
Location: Austria
Has liked: 232 times
Been liked: 348 times
FAF User Name: PhilipJFry

Re: FAF UnitDB App

Postby MfgSolid » 09 May 2017, 21:35

Just to understand i, are the Units modified by FAF only in their database or are there some .scd Files as well?
And so that I dont have to ask all that much is there some sort of documentation about this?

Thx for the help btw
User avatar
MfgSolid
 
Posts: 9
Joined: 07 May 2017, 17:38
Location: Germany
Has liked: 7 times
Been liked: 1 time
FAF User Name: MfgSolid

Re: FAF UnitDB App

Postby Uveso » 09 May 2017, 23:27

Hello MfgSolid,

If i am right, your problem is to get the data from all units, right ?

I can make you an Mod that will print you all nessesary unit data to the Logfile/Logwindow if you need this.

I can provide the date in simply array format like:

Code: Select all
Info: Units={
Info:     UAB0104={
Info:         health = 10,
Info:         damage = 20,
Info:         Radar = true,
Info:     },
Info:     UAB0105={
Info:         health = 10,
Info:         damage = 20,
Info:         Radar = true,
Info:     },
Info: }



I don't see an easier way to get suitable unitdata because FAF not only change blueprints, we also hook (modify) existing blueprints.
You have to search for the original blueprint, look for the coresponding hook and then look what data is overwriten from the hook to see the real unitdata.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: FAF UnitDB App

Postby PhilipJFry » 09 May 2017, 23:35

There are no unit databases per se we "only" have a bp file for each unit.
The .scd files are simply renamed archives that can be unpacked with winrar/winzip and contain the bp, script and other files.

I recommend following Uvesos suggestion and use a mod to print out the values you need from the game and take those to feed your db.

Documentation can be found here.
Last edited by PhilipJFry on 09 May 2017, 23:37, edited 1 time in total.
cats>dogs
post logs
User avatar
PhilipJFry
Supreme Commander
 
Posts: 2635
Joined: 23 Mar 2016, 21:16
Location: Austria
Has liked: 232 times
Been liked: 348 times
FAF User Name: PhilipJFry

Re: FAF UnitDB App

Postby MfgSolid » 09 May 2017, 23:36

Perfect, thank you. It should be easy to then transfer them into a Database. Or maybe even adapt your code to later dynamically update said database on new balance patches.
User avatar
MfgSolid
 
Posts: 9
Joined: 07 May 2017, 17:38
Location: Germany
Has liked: 7 times
Been liked: 1 time
FAF User Name: MfgSolid

Re: FAF UnitDB App

Postby Uveso » 10 May 2017, 00:45

hello MfgSolid,

I implemented a smal script into my debugger to show you how it works.
Its a normal mod:
http://faforever.uveso.de/forum/UvesoDebuggerV47.zip

Run the game with the debuggermod and no other mod enabled. (You can activate other unitmods, but then the debugger will check the moded units, not the original)

Ingame; open the Debugwindow with [F9] and press [SHIFT]+[i] to run the debugger.

you will see something like this inside the log:
Code: Select all
info: xsb4302={
info:     UnitType = STRUCTURE ,
info:     Health = 3800 ,
info:     RegenRate = 0 ,
info:     ArmorType = Structure ,
info:     BuildCostMass = 7500 ,
info:     BuildCostEnergy = 105000 ,
info:     BuildTime = 5841 ,
info:     MaxSpeed = 0 ,
info:     TurnRate = 0 ,
info: },
info: uas0202={
info:     UnitType = MOBILE ,
info:     Health = 3250 ,
info:     RegenRate = 0 ,
info:     ArmorType = Normal ,
info:     BuildCostMass = 2000 ,
info:     BuildCostEnergy = 18000 ,
info:     BuildTime = 8000 ,
info:     MaxSpeed = 4.5 ,
info:     TurnRate = 40 ,
info: },


The data is generated inside the lua file in: Mods\Uveso Debugger\debug\Unit_Stats.lua

Feel free to use this and ask if you need more help.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: FAF UnitDB App

Postby keyser » 11 May 2017, 00:33

just in case you didn't know there is 2 units database and both are out-dated.
http://spooky.github.io/unitdb/#/
http://direct.faforever.com/faf/unitsDB/

this is nice to see someone working on that !
Zockyzock:
VoR is the clan of upcoming top players now
keyser
Councillor - Game
 
Posts: 1870
Joined: 17 May 2013, 14:27
Has liked: 424 times
Been liked: 540 times
FAF User Name: keyser

Re: FAF UnitDB App

Postby Uveso » 11 May 2017, 19:44

hello MfgSolid,

this is the updated debugger with Enhancement Info and Weapon Data:
http://faforever.uveso.de/forum/UvesoDebuggerV48.zip

Unit_Stats.lua:
I added a check in line 14 to also get data from ACU's (It was only getting data from units you can build, and you cant build an ACU ^^)
Added 2 functions at the end of the file to get the weapon array/data

Functions.lua:
Added a smal check for the ACU "IsACU()"
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: FAF UnitDB App

Postby MfgSolid » 02 Aug 2017, 22:35

Now that schools out, I have found enough time to continue the development of unitData conversion to JSON, but I dont seem to be able to write the data in a file, so I can automatically update the App on FAF Updates. Still, the script is almost fianalized ad I´ll continue with merging the data with the app. You can expect a finished product by the end of september. Would also appreciate a link to an supcom lua API documentation if anyone knows it.

Thx in advance, MfgSolid
Attachments
Unit_Stats.lua
(16.2 KiB) Downloaded 180 times
User avatar
MfgSolid
 
Posts: 9
Joined: 07 May 2017, 17:38
Location: Germany
Has liked: 7 times
Been liked: 1 time
FAF User Name: MfgSolid

Next

Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest