Save file structure

This forum is for discussions on how to edit what can not be edited through the txt files, needless to say this isn't about battle net hacking.

Moderators: Nefarius, Havvoric

1
100%
 
Total votes: 1

User avatar
ciuly
Posts: 26
Joined: Sat Jan 17, 2009 8:54 pm
Location: Romania
Contact:

Re: Save file structure

Post by ciuly » Tue Jun 15, 2010 8:38 pm

I was rounding :oops:

I'm using ATMA, but that as well might have bugs :) So I guess it will probably be best that when I find differences between atma and my output, I load the item into the game and check exact stats there.
that should eliminate possible bugs in atma/udietoo (which I'm using).

thanks in advance for that list ;)

User avatar
kingpin
Retired Admin
Cherub
Posts: 10954
Joined: Sat Jan 11, 2003 12:51 pm
Contact:
Sweden

Hand-picked

Re: Save file structure

Post by kingpin » Wed Jun 16, 2010 12:14 pm

Hans" wrote:It shows 150% since it does not show the +50%. If it stated 50% on the mace then it would do half damage to Undead.
This is not true :)

+50% is (base dmg * 50 / 100)

so in the end it do base dmg and additional 50% more damage.

Example
100 base dmg

(100 * 50) / 100 = 50 additional damage vs undead

In your example above the damage would instead be

(100 * 150) / 100 = 150 additional damage vs undead

User avatar
Hans
Dark Alliance Beta Test
Dominion
Posts: 6438
Joined: Sat Oct 02, 2004 5:14 pm
Location: Toronto, Ontario, Canada

Re: Save file structure

Post by Hans » Thu Jun 17, 2010 12:12 pm

Thanks for the clarification Kingpin
"Hi. My name is Hans, and I am addicted to a game that is not yet been made" - Card carrying member of D3 Addictions Anonymous, since June 2008.
Card carrying member of Mentaldom, since May 2006 - Zy-El Hardcore.
"German pornstar/Bee Gee lookalike" & "The Blacksmith"
Trying to picture Hans as a Dominion...nah it isn't working sorry. It's the mustache that gets me every time - Al-T.
"All men play on 127" O-H - Hans
"Okay, time out. This is Zy-El. The mod of total excess. Since when would any Zy-El lover do only what's necessary?" - Metropolis Man
Zy-El Wiki|New Zy-El Website

User avatar
ciuly
Posts: 26
Joined: Sat Jan 17, 2009 8:54 pm
Location: Romania
Contact:

Re: Save file structure

Post by ciuly » Thu Jun 17, 2010 7:32 pm

I am here to confirm that ATMA indeed does NOT correctly display some item stats.
I haven't checked all the older items, but I just found an Azure Small Charm of Shock, which ATMA shows as having stats:
- Cold Resist +4%
- Adds Lightning damage 1-4

and I decoded them in reverse order.

So I did what I thought for this situation, created a new empty char, loaded the item into it with ATMA and looked at the stats in game. The game shows what I decoded.
Indeed, this is the ultimate test, though it takes a while to complete.

I'd still like that list though :)


edit: there is another issue I raised still not cleared/discussed: weapon classes. I just bumped into another weapon that I incorrectly decode it's class as "throwing axe". So how do I get that info?

edit2: forgot to mention. regarding above discussion. I checked an item ATMA showed as 150% Damage to undead and the game shows it as +50% damage to undead (notice the plus). just to confirm everything :)

User avatar
ciuly
Posts: 26
Joined: Sat Jan 17, 2009 8:54 pm
Location: Romania
Contact:

Re: Save file structure

Post by ciuly » Tue Jun 22, 2010 9:41 pm

(been a while so I guess it's ok for a new post instead of edit)

I'll start with mentioning that I still didn't get and didn't figure out any way of finding a weapons class. If you have no ideas, I'll go with hard coding but maybe it's not necessary.

And the new issue is an item (ATMA listing):
Beryl Fanged Helm of Energy
Defense: 28
Durability: 18 of 18
(Barbarian Only)
Required Strength: 25
Required Level: 6
Item Version: 1.10+ Expansion
Item Level: 12
Fingerprint: 0x79ef2712
+3 to Energy
Poison Resist +9%
Ethereal (Cannot be Repaired)


the item code is ba2. I decode required strength as 24 instead of 25 (as game also shows). The txt says 35, to which I applied a 30% reduction, it being magical ethereal.

I've got 70 ethereal items of different types decoded correctly so far and they all decoded ok both in required reductions and damage increases (which I found to apparently be 50%, for future reference)
but even so, my percentages might need adjustments so I look forward for that promised list :)

until then, any idea why I get 24 instead of 25? and any ideas for the weapon classes? I start to pile up too many items with this issue.

Thanks.

User avatar
kingpin
Retired Admin
Cherub
Posts: 10954
Joined: Sat Jan 11, 2003 12:51 pm
Contact:
Sweden

Hand-picked

Re: Save file structure

Post by kingpin » Tue Jun 22, 2010 10:04 pm

until then, any idea why I get 24 instead of 25? and any ideas for the weapon classes? I start to pile up too many items with this issue.
It's 25. you rounding it wrong. Basically blizz never round anything. they just cut of the value.

30 percent out of 35 is 10.5 (so reduced by 10).

User avatar
ciuly
Posts: 26
Joined: Sat Jan 17, 2009 8:54 pm
Location: Romania
Contact:

Re: Save file structure

Post by ciuly » Tue Jun 22, 2010 10:30 pm

it wasn't the rounding (not directly). it was the math :lol:
I was actually doing: trunc(35*0.7) silly me.

thanks.

edit: hm, I now have 2 ethereal antlers that no longer decode right. one of them (item code dr3): it decodes required strength 15 instead of 14

<info>
<Name>Antlers</Name>
<Defense>30</Defense>
<Durability>11 of 11</Durability>
<Character>(Druid Only)</Character>
<RequiredStrength>14</RequiredStrength>
<RequiredLevel>12</RequiredLevel>
<ItemLevel>19</ItemLevel>
<Fingerprint>D6FC13C4</Fingerprint>
<Properties>
<prop>+1 to Cyclone Armor (Druid Only)</prop>
</Properties>
<Ethereal>Cannot be Repaired</Ethereal>
<Socketed>1: 0 used</Socketed>
</info>

User avatar
ciuly
Posts: 26
Joined: Sat Jan 17, 2009 8:54 pm
Location: Romania
Contact:

Re: Save file structure

Post by ciuly » Wed Jun 30, 2010 6:54 pm

I managed to figure out after comparing many items that the strength/dexterity requirements are actually diminished by 10. not percent, just 10.

And about 10 minutes ago I was re-reading some info on battle.net items to figure out what's wrong with decoding 1 hand damage for an orb and figured I'd start with the basics http://classic.battle.net/diablo2exp/items/basics.shtml and what do you know? all the info I spent days on are there. ethereal stuff, requirements, etc. damn I wish I'd pay more attention when reading stuff.

Anyway, there's the link with useful info for whomever will need it. If I find anything else, I'll post.

much later edit: it's amazing how much time and effort you can save by RTFM-ing, provided you have the right M(s) to RTF :)
Since yesterday evening until now (not calculating 8 hour sleep and about 10 hours on the job) I managed to validate over 100 items (most of them automatically based on ATMA output). Since I started this validation thing I validated almost 400 items, just to give you an idea of how huge the progress has been in the last 24 hours.
And, just to note another ATMA bug: on emeralds it incorrectly shows the poison damage as being 1 less than normal.

Kaini
Posts: 2
Joined: Sat Mar 12, 2011 7:08 pm

Re: Save file structure

Post by Kaini » Sun Mar 13, 2011 4:38 pm

Hi, I'm trying to parse items in the Plugy's sss-files. The Plugy File Format Thread states that it uses the normal JM records and I am sure that this is correct, since I've got the same parsing problem when I look into the d2s file.

Is http://home.roadrunner.com/~svr/formats/fields.htm still recent? Because I have got some trouble with parsing the items, for example:

J M 00010000 00001000 10000000 00000000 (this is an identified monarch with 4 unused sockets)
Regarding to the fields.htm this would be
  • unidentified (should be identified; 1 bit too late)
  • without sockets (should be socket; 1 bit too early)
  • an ear structure (should not be; not sure)
  • not an simple structure (correct (luck); 3 bits too late)
Another example:
J M 00010000 00000000 10100000 00000000 (this is a chipped topaz)
  • unidentified (should be identified)
  • without sockets (correct (luck))
  • an ear structure (should not be)
  • not an simple structure (should be simple)
Obviously there is a mistake somewhere. Since I am able to open the items with Udie, I guess I read the fields.htm wrong or read the bits in a wrong order or something like this.

Has anyone got an idea what my problem is?

User avatar
Freiik
Posts: 67
Joined: Sat Dec 13, 2008 5:47 am

Re: Save file structure

Post by Freiik » Sun Mar 13, 2011 5:04 pm

It looks like you're reading the bitstream from front to back (MSB to LSB) but you should be reading each byte from back to front (LSB to MSB).
Just a quick guess tho

Kaini
Posts: 2
Joined: Sat Mar 12, 2011 7:08 pm

Re: Save file structure

Post by Kaini » Sun Mar 13, 2011 11:12 pm

Thank you very much! You are right. I was reading the bits in the wrong order.

kambala
Dark Alliance Beta Test
Crusader
Posts: 77
Joined: Wed Nov 25, 2009 4:32 pm
Location: Moscow
Contact:
Russia

Re: Save file structure

Post by kambala » Thu May 27, 2021 3:56 pm

sorry for necroposting, but I have a couple of questions without exact answer.

1. The tome bits. What is the exact condition to read the 4 unknown bits that follow the "tome of identify bit"? At the moment I have the following condition: item's type1 or type2 is "book".

2. Durability. I thought that condition to skip reading durability is: "nodurability == 1 && (item is misc || durability > 0)". But that turned out wrong for throwable potions. This post says that nodurability must be checked only for misc items, but that's not true apparently, as I see a new weapon (marked as quest item) that fits the above condition and doesn't have durability saved. Following the hint about eth items I modified the condition to skip durability: "nodurability == 1 && (item is misc || item's bQuest > 0)", but I'm not sure if that's actually correct.

Does anyone know the exact parsing conditions for the above?

An excerpt from txts for the items in question:

weapons:

Code: Select all

code	name	type	type2	alternateGfx	namestr	spelldesc	spelldescstr	version	compactsave	rarity	spawnable	mindam	maxdam	1or2handed	2handed	2handmindam	2handmaxdam	minmisdam	maxmisdam		rangeadder	speed	StrBonus	DexBonus	reqstr	reqdex	durability	nodurability	level	levelreq	cost	gamble cost	magic lvl	auto prefix	OpenBetaGfx	normcode	ubercode	ultracode	wclass	2handedwclass	component	hit class	invwidth	invheight	stackable	minstack	maxstack	spawnstack	flippyfile	invfile	uniqueinvfile	setinvfile	hasinv	gemsockets	gemapplytype	special	useable	dropsound	dropsfxframe	usesound	unique	transparent	transtbl	quivered	lightradius	belt	quest	questdiffcheck	missiletype	durwarning	qntwarning	gemoffset	bitfield1	CharsiMin	CharsiMax	CharsiMagicMin	CharsiMagicMax	CharsiMagicLvl	GheedMin	GheedMax	GheedMagicMin	GheedMagicMax	GheedMagicLvl	AkaraMin	AkaraMax	AkaraMagicMin	AkaraMagicMax	AkaraMagicLvl	FaraMin	FaraMax	FaraMagicMin	FaraMagicMax	FaraMagicLvl	LysanderMin	LysanderMax	LysanderMagicMin	LysanderMagicMax	LysanderMagicLvl	DrognanMin	DrognanMax	DrognanMagicMin	DrognanMagicMax	DrognanMagicLvl	HraltiMin	HraltiMax	HraltiMagicMin	HraltiMagicMax	HratliMagicLvl	AlkorMin	AlkorMax	AlkorMagicMin	AlkorMagicMax	AlkorMagicLvl	OrmusMin	OrmusMax	OrmusMagicMin	OrmusMagicMax	OrmusMagicLvl	ElzixMin	ElzixMax	ElzixMagicMin	ElzixMagicMax	ElzixMagicLvl	AshearaMin	AshearaMax	AshearaMagicMin	AshearaMagicMax	AshearaMagicLvl	CainMin	CainMax	CainMagicMin	CainMagicMax	CainMagicLvl	HalbuMin	HalbuMax	HalbuMagicMin	HalbuMagicMax	HalbuMagicLvl	JamellaMin	JamellaMax	JamellaMagicMin	JamellaMagicMax	JamellaMagicLvl	LarzukMin	LarzukMax	LarzukMagicMin	LarzukMagicMax	LarzukMagicLvl	DrehyaMin	DrehyaMax	DrehyaMagicMin	DrehyaMagicMax	DrehyaMagicLvl	MalahMin	MalahMax	MalahMagicMin	MalahMagicMax	MalahMagicLvl	Source Art	Game Art	Transform	InvTrans	SkipName	NightmareUpgrade	HellUpgrade	Nameable	PermStoreItem
gpm	Choking Gas Potion	tpot		gps	gpm					3			1										0	0	0	0	2	1	20	16	120				gps	gpm			1ht	1ht	5	hth	1	1	1	3	25	6	flpgps	invgpm					0		0	item_potion	14	item_potion	0	0	5	0	1	0	0		48	7	3	0	0					255					255					255					255					255					255					255					255					255					255					255					255					255					255					255					255					255			0	0	0	xxx	xxx	0	1
wd02	Staff of Herding	wp02		bst	wd01					0	0				1						1		0	0	0	0	1	1	1	0					bst	wd02	wd02	wd02	stf	stf	5	club	1	3					flpsst	invsst			0	0	0		0	item_staff	12	item_staff	1	0	5	0	0	0	2		0	7	0	0	5					255					255					255					255					255					255					255					255					255					255					255					255					255					255					255					255					255			5	8	0	xxx	xxx	1	0
itemtypes:

Code: Select all

ItemType	Code	Id	*name	*order*	*status	subdivide	makepage	Equiv1	Equiv2	Repair	Body	BodyLoc1	BodyLoc2	Shoots	Quiver	Throwable	Reload	ReEquip	AutoStack	Magic	Rare	Normal	Charm	Gem	Beltable	MaxSock1	MaxSock25	MaxSock40	TreasureClass	Rarity	StaffMods	CostFormula	Class	VarInvGfx	InvGfx1	InvGfx2	InvGfx3	InvGfx4	InvGfx5	InvGfx6	StorePage	*eol
Staff of Herding	wp02	281	Staff of Herding		item design					0	1	rarm	larm			0	0	0	0		1	0	0	0	0	0	0	0	0	0		0		0							weap	0
cross-platform tools: K.A.M.B.A.L.A.: Kinetic Artificial Machine Built for Assassination and Logical Analysis

User avatar
Necrolis
Senior Admin
Throne
Posts: 9125
Joined: Sat Mar 25, 2006 1:22 pm
Location: The Land of the Dead
Contact:
South Africa

Hand-picked

Re: Save file structure

Post by Necrolis » Thu May 27, 2021 9:49 pm

A brief check of some of my old save code, which may or may not be 100% the same as vanilla, so caveat emptor:

1. This is the index from books.txt that corresponds to the book/scroll in question, requires that the item derives from the book or scroll itemtype.
2. If the item derives from the weapon or armor itemtype it has a max durability, if this is > 0, it also has a current durability.

Derived itemtypes will check the entire chain for these checks and not just the immediate itype.
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death | D2GFEx
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

kambala
Dark Alliance Beta Test
Crusader
Posts: 77
Joined: Wed Nov 25, 2009 4:32 pm
Location: Moscow
Contact:
Russia

Re: Save file structure

Post by kambala » Fri May 28, 2021 10:24 am

Necrolis wrote:
Thu May 27, 2021 9:49 pm
A brief check of some of my old save code, which may or may not be 100% the same as vanilla, so caveat emptor:

1. This is the index from books.txt that corresponds to the book/scroll in question, requires that the item derives from the book or scroll itemtype.
2. If the item derives from the weapon or armor itemtype it has a max durability, if this is > 0, it also has a current durability.
thanks!

1. If I get it right, the condition to read extra bits is: (item inherits from "book") || (item inherits from "scro") ?

2. Now this is new for me! I always thought that the bin/txt where item is present defines its type. So the condition to read max durability would be: (item inherits from "weap") || (item inherits from "armo") ? And no need to check for nodurability.
Necrolis wrote:
Thu May 27, 2021 9:49 pm
Derived itemtypes will check the entire chain for these checks and not just the immediate itype.
yes, makes complete sense.

one more thing I've just stumbled upon: reading the "normal quality" part, https://github.com/HarpyWar/d2s-charact ... em.cs#L749. It seems that I'm seeing this charm/monster thing for the first time ever. My current code that works just fine:

Code: Select all

// autoprefix

switch (quality) {
case Normal:
  break;
// other cases
}

// RW bits
// personalised name
// tome of identify bit
// tome bits
// defense
// ...
What is more correct?
cross-platform tools: K.A.M.B.A.L.A.: Kinetic Artificial Machine Built for Assassination and Logical Analysis

Post Reply

Return to “Code Editing”