unitsDB

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

Re: unitsDB

Postby Raging_Squirrel » 16 Nov 2013, 00:38

I'm on a business trip and don't have any access to the source code, so you guys have to wait until I'm back.
It's expected to happen in February, maybe sooner but chances it will not.

aaaaand that code is total mess, complete trash and hard to understand. I feel really ashamed for it when sharing :roll:
Never argue with an idiot. He will bring you down to his level and beat with experience.
User avatar
Raging_Squirrel
Priest
 
Posts: 494
Joined: 26 Aug 2011, 16:53
Location: Russia
Has liked: 1 time
Been liked: 4 times
FAF User Name: Raging_Squirrel

Re: unitsDB

Postby spooky9 » 19 Nov 2013, 12:11

What's the back-end technology and how do you get the data for unit details? From a db or directly from the .bp files?
Oh and how can I get the images for each unit? (apart from stealing them from your page :) )
spooky9
Avatar-of-War
 
Posts: 67
Joined: 07 Nov 2013, 19:03
Has liked: 1 time
Been liked: 5 times
FAF User Name: spooky9

Re: unitsDB

Postby spooky9 » 19 Nov 2013, 12:16

First look http://imgur.com/zADsvXB
This is just the list screen, and as you can see, there's a 'few' images missing, but that's not the most important thing at the moment.

Anyway - feedback appreciated.
spooky9
Avatar-of-War
 
Posts: 67
Joined: 07 Nov 2013, 19:03
Has liked: 1 time
Been liked: 5 times
FAF User Name: spooky9

Re: unitsDB

Postby Szakalot » 19 Nov 2013, 16:27

I like the idea so far, as long as the lists are easily expandable/contractable so you can choose what information you want to focus on.

Personally, I'd love to see more focus being put on comparing units in the database, not just side by side; but also as ratios; especially ones that take the mass/energy/buildtime costs into account (dps/mass, etc.)

It would also be good to keep track of how up to date the database is with the current FAF version : )
Szakalot
Avatar-of-War
 
Posts: 134
Joined: 23 Oct 2013, 14:45
Has liked: 8 times
Been liked: 12 times
FAF User Name: Szakalot

Re: unitsDB

Postby spooky9 » 19 Nov 2013, 17:48

The buttons on the right allow filtering content, as well as the text input.

As for the unit comparison - haven't gotten to that part yet. The plan is to have all the functionality from the existing site (including the FAT query I guess) but what else will be there - depends on the time I can spare on it ;)

I'll try to set up an online version for everyone interested to click through - that should allow for fast feedback

The unit list is generated from the faf file, so as soon as a new version comes out, I'll be able to make an update within minutes
spooky9
Avatar-of-War
 
Posts: 67
Joined: 07 Nov 2013, 19:03
Has liked: 1 time
Been liked: 5 times
FAF User Name: spooky9

Re: unitsDB

Postby Raging_Squirrel » 20 Nov 2013, 21:15

spooky9 wrote:What's the back-end technology and how do you get the data for unit details? From a db or directly from the .bp files?
Oh and how can I get the images for each unit? (apart from stealing them from your page :) )

I wrote lua parser for the .bp files (which eventually got transferred to python and greatly improved) and stored the parsed data in the db. They are serialized arrays in there.
backend is pure php + mysql

At some point there was official supcom db, I took all the images from there.
The hardest part of recreating the db will be properly calculating dps based on the blueprints.
It was really painful for me, 3 days of hardcore reverse-engineering and still didn't go without some bugs left :(
My only advice for now will be this: don't leave unnoticed the part about projectiles. This info is not in the units' bp themselves, there is another file for them and you're going to need it for calculating all the splitting stuff dps.
Never argue with an idiot. He will bring you down to his level and beat with experience.
User avatar
Raging_Squirrel
Priest
 
Posts: 494
Joined: 26 Aug 2011, 16:53
Location: Russia
Has liked: 1 time
Been liked: 4 times
FAF User Name: Raging_Squirrel

Re: unitsDB

Postby spooky9 » 21 Nov 2013, 11:47

Raging_Squirrel wrote:...which eventually got transferred to python and greatly improved...


Any chance I can get my hands on that? Cause I'm actually trying to dodge writing this thing myself :>
spooky9
Avatar-of-War
 
Posts: 67
Joined: 07 Nov 2013, 19:03
Has liked: 1 time
Been liked: 5 times
FAF User Name: spooky9

Re: unitsDB

Postby Raging_Squirrel » 21 Nov 2013, 20:53

you can find it in faf repository, which is open source
the link should be somewhere around in the forums
Never argue with an idiot. He will bring you down to his level and beat with experience.
User avatar
Raging_Squirrel
Priest
 
Posts: 494
Joined: 26 Aug 2011, 16:53
Location: Russia
Has liked: 1 time
Been liked: 4 times
FAF User Name: Raging_Squirrel

Re: unitsDB

Postby Retnut » 23 Nov 2013, 15:06

Found it: https://bitbucket.org/thepilot/modular- ... aparser.py

And here's an example of Zep using it to parse zipped mods: https://bitbucket.org/thepilot/modular- ... 4acdf816c3

And there's also this: https://bitbucket.org/thepilot/modular- ... il/slpp.py

Which appears to be a fork of: https://github.com/SirAnthony/slpp

There's several FAF usage examples if you look through the diffs: https://bitbucket.org/thepilot/modular- ... il/slpp.py
Retnut
Crusader
 
Posts: 45
Joined: 03 Jun 2013, 07:55
Has liked: 3 times
Been liked: 4 times

Re: unitsDB

Postby spooky9 » 25 Nov 2013, 12:07

Thanks, that will come in quite handy :)
spooky9
Avatar-of-War
 
Posts: 67
Joined: 07 Nov 2013, 19:03
Has liked: 1 time
Been liked: 5 times
FAF User Name: spooky9

PreviousNext

Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest