These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

invTypeMaterials question

Author
Cryten Jones
Advantage Inc
#1 - 2013-12-16 00:10:45 UTC
Hi techies,

I am building a manufacturing DB, I know there are others out there but I want to learn SQL etc so having something I know well as a project helps.

I have got off to a good start and already have systems to lookup the requirements for building items including ME and PRod Eff skills in the calcs.

I have hit a bit of a wall though on the Tech 2 items in that the listed BASE REQUIREMENTS in the invTypeMaterials table does not in any way match up with what is showing in game.

Tech1 example to show I am not mad:

Tristan: ME 20 Prod Eff 5 (TypeID 593)

Base Trit = 21000
Skill waste = 0
ME waste = 100
Total Required = 21100

In game Required (on manufacturing job submission) = 21100 Cool


Tech2 Example to show my issue:

Adaptive Nano Plating II: ME -4 Prod Eff 5 (TypeID 1306)

Base Trit = 1116
Skill waste = 0
ME waste = 558
Total Required = 1674

In game Required (on manufacturing job submission) = 465 Shocked



WTF! why is the amount of Trit listed in invTypeMaterials over double that listed on the job sheet in game ??

I am sure this is just one of those missing bits of knowledge but I would really appreciate it if someone could shed some light for me!

Thanks

Cryten Jones
Advantage Inc
#2 - 2013-12-16 00:20:22 UTC
I think I just cracked it....

the requirements listed in the invTypeMaterials for T2 items INCLUDES the same requirement from the T1 variant


Using the calcs in my last post the ME waste on the ANP II = 0.5 or 50%

(ANP II Trit - ANP I Trit) * 0.5 = T2 Requirement

so 1116 - 806 = 310

50% of 310 = 155

155 + 310 = 465

In game need = 465..


My god ... WHY?


Can anyone confirm this is how it works?

Thanks

Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#3 - 2013-12-16 05:07:40 UTC
https://www.fuzzwork.co.uk/2012/10/24/eve-sde-sql-blueprint-details/ should cover what you're wanting.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Cryten Jones
Advantage Inc
#4 - 2013-12-16 09:52:10 UTC
Steve Ronuken wrote:
https://www.fuzzwork.co.uk/2012/10/24/eve-sde-sql-blueprint-details/ should cover what you're wanting.



Thanks Steve, love your work!

I dint see how that helps my issue, I already used your formulas for my calculations and as I say it works... My issues is / was that a tech 2 items' base materials in the db seems to also include the base requirement from the t1 version of that same item.

My first post explains, but at that point I was confused by the numbers .. Now I am confused as to why ccp would have this behaviour at all :-)

Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#5 - 2013-12-16 10:12:44 UTC
invTypeMaterials is the table containing the materials that you get back when you recycle the item. It used to be there were only base materials (a long time ago). They then added extra materials, for a few reasons. Doing it this way means they only had to touch manufacturing, rather than touching manufacturing and recycling, with a bunch of data duplication.

if something in ramTypeRequirements is marked as recyclable, you have to remove its materials from the materials in invTypeMaterials (to a minimum of 0)

Hence:
select typeid,name,greatest(0,sum(quantity)) quantity from (
select invTypes.typeid typeid,invTypes.typeName name,quantity
from invTypes,invTypeMaterials
where invTypeMaterials.materialTypeID=invTypes.typeID
and invTypeMaterials.TypeID=?
union
select invTypes.typeid typeid,invTypes.typeName name,
invTypeMaterials.quantity*r.quantity*-1 quantity
from invTypes,invTypeMaterials,ramTypeRequirements r,invBlueprintTypes bt
where invTypeMaterials.materialTypeID=invTypes.typeID
and invTypeMaterials.TypeID =r.requiredTypeID
and r.typeID = bt.blueprintTypeID
and r.activityID = 1 and bt.productTypeID=? and r.recycle=1
) t group by typeid,name

for the base materials.


Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Cryten Jones
Advantage Inc
#6 - 2013-12-16 12:34:52 UTC
Ah..

Great thanks !