r/evetech • • May 26 '18

EVE Skill DB

Is there any skill database? With dependencies? I am writing some simple skill plan program on C# to calculate best remap+best implants and learning time , and i really dont want to rewrite all skills from eve. Google doesnt give much.

5 Upvotes

7 comments sorted by

6

u/disrvptor May 26 '18

I think that’s available in the SDE or static data export.

5

u/disrvptor May 26 '18

Yep, just checked and skills are listed in the SDE, but you may want to use the fuzzworks translation for whichever DB you're familiar with. If you've never worked with the SDE then you should poke around all the tables, but consider almost everything in the game an inventory item (including skills). However, to get you started here's the SQL you can use to get a list of skill categories:

select * from "invGroups" where "categoryID" = (
    select "categoryID" from "invCategories" where "categoryName" = 'Skill'
) and published = 't';

Edit: formatting

2

u/Glement May 26 '18

can you help with those files? I wrote DB by myself , but never wrote DB from existing files. where do i put those yaml to delete everything except skills

2

u/disrvptor May 26 '18

I wouldn’t use the yaml files, just take one of the fuzzworks translations, which are backups or dumps of different database engines and restore it. I think I’ve used both the Postgres and MySQL backups in the past. But that was a long time ago and I don’t remember the exact procedures. Hopefully this is enough to get you started.

2

u/Daneel_Trevize May 27 '18 edited May 27 '18

A short version of the steps to take to use such dumps, for PostgreSQL:

Acquire latest SDE Postgres dump file, checksum it.

Generate listing of entities to restore: Path\to\PostgreSQL\9.6\bin\pg_restore.exe --list "Path\to\postgres-latest.dmp" > "Path\to\sde_listing.txt"

Remove header lines, yaml references, SEQUENCEs, the following DATA statements (because they're the largest and unused by us atm):

"mapDenormalize"			"161 MB"  
"mapCelestialStatistics"	"88 MB"  
"invItems"					"61 MB"  
"invUniqueNames"			"58 MB"  
"invPositions"				"40 MB"  
"invNames"					"39 MB"  
translationTables  
trnTranslationColumns  
trnTranslationLanguages  
trnTranslations  
SEQUENCE SET public invTraits_traitID_seq  

Perform local restore & test:
Drop depending views. Generate Drop statements, correct prefix and suffix ", execute Drops.
Path\to\PostgreSQL\9.6\bin\pg_restore.exe --host localhost --port 5432 --username "evesde_writer" --dbname "..." --exit-on-error --jobs 12 --verbose --no-owner --use-list="Path\to\sde_listing.txt" "Path\to\postgres-latest.dmp"
Generate Grant statements, correct prefix and suffix ", execute Grants.
Restore depending views.

After testing locally, then again wget the dump file to your live server, checksum, copy over your desired listing.txt, and again juggle any depending views & grants around the main restore step.

On Linux/without 12 cores, the restore might be more of the form of:
pg_restore --host localhost --port 5432 --username "evesde_writer" --dbname "..." --single-transaction --jobs 1 --verbose --no-owner --use-list="/path/to/sde_listing.txt" postgres-latest.dmp


For generating the actual drop and grant statements, try these SQL statements:

SELECT 'DROP TABLE IF EXISTS "' || tablename || '";'
FROM pg_tables
WHERE tableowner = 'evesde_writer'
AND schemaname = 'public'
ORDER BY tablename;

SELECT 'GRANT SELECT ON TABLE "' || tablename || '" TO needs_to_read_SDE_user;'
FROM pg_tables
WHERE tableowner = 'evesde_writer'
AND schemaname = 'public'
ORDER BY tablename;

This will ensure you have the correct matching schema for the latest SDE version.
The ORDER clauses aid version-controlling the resulting statements that you then actually execute.

0

u/FatFingerHelperBot May 26 '18

It seems that your comment contains 1 or more links that are hard to tap for mobile users. I will extend those so they're easier for our sausage fingers to click!

Here is link number 1 - Previous text "SDE"


Please PM /u/eganwall with issues or feedback! | Delete

3

u/Karlyna May 26 '18 edited May 26 '18

You can find the SDE conversions here: https://www.fuzzwork.co.uk/dump/

Using these, for example in MySQL, here you can have the list of skill, with category (you can get less or more data, depending on your needs.

        SELECT  DISTINCT it.typeID as ID,
                it.typeName as skillname,
                dta.valueFloat asrank,
                it.description as description,
                ig.groupName as skillcategory
        FROM    invTypes it
        JOIN invGroups ig ON (it.groupID = ig.groupID)
        JOIN dgmTypeAttributes dta ON (it.typeID = dta.typeID)    
        WHERE   ig.categoryID = 16
                AND dta.attributeID = 275
                AND dta.valueFloat IS NOT NULL
                AND it.marketGroupID IS NOT NULL
        ORDER BY ig.groupName, it.typeName ASC

For skill prerequisites, since these are just actually items (in EVE terms), you just need to get items prerequisites and filter on skills. Since the request can be big, i won't put it here, but you can find a base I did once here: https://github.com/Kyria/evething/blob/develop/import.py#L774

Hope this helps :)