CSBEdit v1.0
Written by Paul Gross aka rain`

Introduction
===========================
After releasing DMExtract.exe, I tinkered around with CSB4win source code and the various .RAW files that were included in the graphics.dat files (For both DM and CSB).  Fortunately for me, Paul R Stevens did a great job commenting and explaining everything about the CSB4win source (His effort is undoubtedly the most effort put into a single "small" project i've ever seen).  I have opened up the formats of file 556, 559, and 560, whose data is included in CSBEdit v1.0.
Note: Not every aspect of DM/CSB for atari graphics.dat files are figured out, so you may find yourself lost as to what does what still.

What is it?
===========================
CSBEdit is a simple VB editor that opens .GIL files. GIL files are created with DMExtract when extracting a graphics.dat file.  Each GIL file contains information about all the files included in a graphics.dat file.  Therefor by opening a GIL file, CSBEdit then opens various other files that normally would be inside a graphics.dat.

With CSBEdit, you can edit various aspects of gameplay, with future plans of editing various GUI functions (such as moving graphics around the screen).  As of now, there may be some differences of interpretation between what I interpreted values to be and what they actually are (anotherwords, this allows you to edit every aspect, but what the values actually are may not be 100% correct)


How to use
===========================
Included with CSBEdit is two sample GIL files, which are extracted directly from the Atari CSB/DM graphics.dat files.  As you can see, they are very similar, except for a few names and graphics.  Select File-Open and choose a .GIL file (do not open raw files directly for it will not work).  Begin viewing and/or editing.  In order for your changes to take effect in DM/CSB, you must recreate the graphics.dat file using DMExtract.

If you would like to make changes to the game (a mod), you must use DMExtract (or any other utility available that can recreate graphics.dat files) to extract an Atari DM/CSB graphics.dat file.  After that you must edit the GIL file created and recreate the graphics.dat file afterwords.  This is the only way (as of now) that you can change the physics for DM/CSB!


Editing
===========================
The following is information on what the values exactly mean in CSBEdit and what changing them will do to the game.


      ************************************
      ***           Attacks            ***
      ************************************
Name:			The name associated with the attack when selecting the attack.
Skill:			The skill associated with the attack *see skills*.
Exp-gain:		The base value for how much experience you gain per attack.
Defense:		Defense modification while player is "greyed out".
Stamina:		The base stamina used when attack is made.
Hitprob:		The base chance to hit (0-75, 75 autohit).
Damage:			Damage modifier (in 1/32's), a value of 16 then would be "half 					normal damage".
Fatigue:		The amount of time before you can select another attack (1/6ths 				of a second).

      ************************************
      ***            Armor             ***
      ************************************
Name:			The Name of the armor (Direct relation to OBJECT's name)
Weight:			Weight, in 1/10th's of a unit.
Armor:			The armor value associated with the armor.
Pierced:		A 0-7 value which is used when monsters have a "piercing" 						attack.  Piercing attacks use the following format to calculate 				armor: (this / 7 * armor), so if this value is 0, and a monster 				has a piercing attack, he will ignore your armor.
Unused1:		???
Ignored:		Do not use this item when calculating armor.

      ************************************
      ***            Combos            ***
      ************************************
Difficulty:		The amount of experience (?) needed in the specified ATTACK's 					skill to be able to use the attack.
Use Charges:	The attack will use charges, and once used up, will no longer be 				available.
Attack:			The number associated with the attack (0-43).
Unused1:		???
Unused2:		???

      ************************************
      ***            Doors             ***
      ************************************
Strength:		Amount of damage required to "Break through"
Mirrored randomly:
				The door will change its graphic randomly by flipping it horizontally and/or vertically.
Non materials cannot pass:
				Prohibits non-material beings from passing underneath this door
Projectiles can pass:
				Certain weapons (such as arrows, daggers, or throwing stars) may pass through this door.

      ************************************
      ***         Food Values          ***
      ************************************
Value:			How filling the food is (in ???)

      ************************************
      ***        Monster Drops         ***
      ************************************
Item:			The item dropped by the monster when the monster dies
Sometimes dropped:
				If checked, the item will have a 50% chance of falling

More information:
	The monster drops are in a very unfriendly format.  Unfortunately, you cannot make different monsters drop different amounts of items.  It is hard-coded in CSB/DM that each monster drops so many items.  In CSBEdit, the format is a bit simplified.  Each "Monster drop" is named to define who drops it.  00 C24 Dragon #1 signifies that this object is the first object to be dropped by the 24th creature (which is the dragon).  When the dragon dies, it will start with the first object (00 C24 Dragon #1) and continue to drop objects until the dropped item is 0.  Therefor it is possible to make a dragon drop more items, but it will drop the same objects as creature #15 (worm).  This makes customizing dropped objects extremely difficult to do correctly.

      ************************************
      ***           Monsters           ***
      ************************************
Bytes
===================
Idnum:			A number which contains the ID for a monster?
Sound:			A number associated with a "Sound structure" that is uneditable 				at this point.  Editing this may result in extremely wierd 						results.  The sound is made when the monster attacks.
Speed:			The amount of time between each move a monster makes (1/6ths of 				a second).  Therefor, 0 would result in instant moving 							(teleporting?), and 255 would result in a monster never moving.
Minspeed:		This value has something to do with timing? *unknown*
Armor:			The Armor value associated with the monster.
Base HP:		This value is the Base HP which is used to calculate monster 					health ingame by monster generators and other such objects.
Hitprob:		The chance each monster's attack has of hitting your player
Poison:			The amount of poison the monster will inflict upon you when hit
Strength:		The power of the monster's attacks
Attack:			This number is used to determine what kind of attack the monster 				executes.  Changing this value will result in a different 						"protection" to be used when calculating the damage.
				The following table explains each value:
				1: Use anti-fire to determine damage
				2: Half the player's armor and do physical damage
				3: ???
				4: Deal physical piercing damage
				5: Use anti-magic to determine damage
				6: Use wisdom to determine damage
Unused1:		???
Unused2:		???

Word3
===================
Space:			The amount of space each monster takes up in the square. (0-3)
				Use the following table to determine the value
				0: 1/4th the size of a square (mummies/skeletons)
				1: 1/2 the size of the square (rats/worms)
				2: the whole square (dragon, chaos, black flames)
				3: ???
Unknown1:		???
Walks through walls:
				If checked, allows monsters to under doors (if allowed) and such. Note: Screamers have this set, possibly negating the value
Dumb:			The monster may attack a player that doesn't exist/dead on 						accident, making it miss
Levitates:		The monster will not fall down pits
Only hit by vorpal/disrupt:
				The monster is only affected by weapon #16 (vorpal blade) or attack #24 (disrupt) (physical damage).
Only hit by dispel:
				Any spell besides the dispel non material beings spell will fly right through this monster
Drops items:	If checked, the monster will drop items *see monster droppings*
Short:			If checked, the door will come down farther when on top of the 					monster
Absorbs projectiles:
				If checked, the monster may absorb projectiles like arrows, dagggers, or throwing stars until it dies.
Can see invisible:
				The monster will ignore the "invisibility" spell
Can see in darkness:
				The monster does not have sight-range reduction when there is limited light in the room.

Word5
===================
Mirror image:	The monster graphic will flip randomly horizintally.
Unknown1:		??? something to do with a graphic?
Unknown2:		??? possibly attack graphic?
Unknown3:		??? something to do with a graphic?
Unknown4:		??? something to do with a graphic?

Word15
===================
Sightrange:		Amount of squares between monster and player needed to see the 					player (note: this value is modified by the light value)
Unused1:		???
Awareness:		Amount of squares between monster and player needed to "turn" 					towards the player (perhaps to shoot a projectile?)
Spellrange:		Amount of squares between monster and player needed to execute 					an attack (casting spells and/or melee)

Word17
===================
Unused1:		???
Skill:			Base value for calculating experienced gain when attacking the 					monster or getting hit by it.
Bravery:		Resistance to warcry, brandish, blow horn or confuse.
Teleport:		??? (if < 10, monster can be teleported?)

Word19
===================
Unused1:		???
Magicres:		Resistance to magical spells like fireball (15=immune)
Poisonres:		Resistance to magical spells involving poison (15=immune)
Unused2:		???

Word21
===================
Unknown1:		???
Unknown2:		???
Unknown3:		???
Unknown4:		???

      ************************************
      ***            Objects           ***
      ************************************
Name:			The name of the object
Itemtype:		This number represents the Nth string in the object list and the 				Nth graphic in the graphic files.  See graphic 42-47.  The 						graphic information involved is the graphics when the item is in 				your inventory or selected by the mouse.
Graphic:		This number points to a structure which holds graphic 							information about what should be displayed when the object is on 				the floor and/or flying through the air.
Combo:			The number associated with what combonation of attacks this item 				uses.
Wearlocs:		This number contains bits which hold information on where the 					item can be placed in the inventory.  The following table 						describes the effect on wearlocs.

				0: cannot be held or put in inventory
				>0: can be held in hands or inventory
				Weapon: Can be held in first quiver slot
				Quiver: Can be held in any quiver spot
				Pouch: Can be held in pouch spot (below left hand)
				Hands: May only be held in hands/inventory
				Chest: May be put in chests.

				Hands should only be selected if its the only possible selection.
				

      ************************************
      ***            Runes             ***
      ************************************
Multipliers:	These values change the effect each rune has (lo to mon) on the 				power of the casted spell.
Levels 1-4:		These values are values associated with how much mana each rune 				costs to put into the spell.  This is modified by the 1st rune.

      ************************************
      ***            Spells            ***
      ************************************
Runes:			Four numbers associated with what runes make up the spell.  The 				first rune is editable, but as far as i know does nothing.  If 					you place a rune that isn't in the range, the spell most likely 				won't be possible to cast.
Word7:			Contains bits for other values.
Difficulty:		How difficult the spell is to cast. ?
Duration:		The amount of time the player is "greyed out" after casting
Skill:			The skill required to cast the spell (Yes, fighter spells are 					possible)
Type:			The type of spell which is involved.  In CSB, there are only 3 					coded options, which are included.  Each option, when combined 					with a certain Result makes the spell.

				Needs flask: This spell will take an empty flask and turn it into the result.  Keep in mind some of those results were never coded so you make experience some very wierd results.

				Missile Launcher: This spell will throw a projectile of the type specified in Result.

				Durational:  This will cast all other spells that are hard-coded in CSB/DM.

				All coded spells are accessible and editable via the CSB4win source code.
Result:			The result associated with the Type.

      ************************************
      ***           Weapons            ***
      ************************************
Damage:			The base number used to calculate how much damage your attack 					does.
Distance:		If throwing, this determines how far the projectile will go.  If 				the weapon is used to "SHOOT", this will be a part of how far 					the projectile being shot will travel.  The farther the 						projectile goes, the more damage it does (Which is decreased as 				it flies).
Word5:			A number with associated bits below (and other unused bits?)
Shootdam:		The amount of damage associated with fired projectiles.
Graphic:		A number associated with graphic information on what the weapon 				looks like when flying through the air (side view, front view, 					and back view).  If 0, it will use the OBJECT's graphic 						information for this.  The graphics used are #316-347.
Combo:			The number associated with what combonation of attacks the 						weapon uses. *Direct relation to the OBJECT's combos*
Weight:			The weight of the weapon in 1/10ths of a unit.
Byte2:			??? (some bits?)
D-energy:		??? (Delta energy lost for each room the projectile travels?)
Fired by 0x0A/0x0B:
				If this is set, this object can be used in the left hand if the right hand carries a weapon with the SHOOT option *AND* a byte2 value of exactly 0x0A or OX0B (10 or 11 respectively).

Attackname:		The name of the 1st-3rd attack used in the specified combo
Damage:			The damage of the attack used in the specified combo
Rating:			A calculated value which will give a rough rating on how well 					the weapon's attack will do.

Credits
===========================
Credits go to the following people for samples of code (copied or used as reference):

Paul Stevens:
	Excellent job in porting CSB4win to windows/linux and also for releasing the source which allows for people like me to go ahead and research ways of editing data files for a 15+ year old game.
