Page 1 of 1

Fireball Graphic

Posted: Sat Aug 30, 2008 5:40 am
by Paul Stevens
Zyx was using a DSA to throw
fireballs. He set the damage to
maximum and noticed that the
fireballs looked small. I investigated.
The results were not what I expected.
Here is what I wrote to him:

Prieu Benjamin wrote:

> 5) what is the maximum damage for &throw?
> with damage=255 or 2555 I obtain only small fireballs
>

The graphic seems to depend more on the range
than on the damage. But it is very complicated.
Notice that a low-level character throws maximum
fireballs that look small whereas a high-level
character throws maximum fireballs that look big!
Same spell. Different graphic.

Range and damage can be maximum 255.

Paul
I should probably have noted that there
were hints that the value 255 was special.

Posted: Sat Aug 30, 2008 3:29 pm
by Adamo
There are some investigations on missiles from Graphics.dat Item 558:
http://dmweb.free.fr/?q=node/1394
check out 0001-0264 (coordinates to display missiles), 1489-1558 (unknown data) and 1559-1642 (missile graphics definitions) parts. Don`t know if that helps.

Posted: Sat Aug 30, 2008 6:55 pm
by Sophia
The formulas as expressed in the DSB code may be easier to understand than the disassembled DM sources.

Code: Select all

	local m_power = (2*skill+4)*(power+2)
	if (m_power < 21) then
	    m_power = 21
	elseif (m_power > 255) then
	    m_power = 255
	end
So, the range (called m_power in this code) is dependent on both the caster's skill and the power level chosen, but the factor that skill contributes is doubled.

Changing the damage to a fireball has no effect at all in DM. In the DM engine, the damage of a cast fireball is set to 90, and this value is ignored in the impact calculation. (I tweaked this for DSB)

Posted: Sat Aug 30, 2008 10:43 pm
by Paul Stevens
Sophia wrote:set to 90, and this value is ignored
Very interesting. If true, this gives us eight
bits for other uses. Better not let Zyx know.
He'd probably want to insert a flag to cause
the fireball to turn around like a boomerang
or some such nonsense. Or alternate between
a fireball and a lightning bolt randomly. Or
pass through walls. Or not be affected by
teleporters. Or turn left whenever possible.
Or fall through pits. Or oscillate left/right.
Or move very slowly. Or be invisible.
Or activate a DSA at each step of its flight.
No telling what that man's imagination might
dream up.

Posted: Sun Aug 31, 2008 6:28 pm
by Sophia
Paul Stevens wrote:If true, this gives us eight
bits for other uses.
Provided we're careful, yes.

I should have said "cloud creation" and not "impact," above. These eight bits are used in the impact calculations for thrown objects and lightning bolts-- that is, things that do their damage by impact force, rather than (or in the case of lightning, in addition to) an explosive cloud. I seem to recall fireballs doing some inconsequential amount of impact damage, as well.

However, the role of "damage" didn't make a lot of sense to me. Here's the comment from DSB's source:

DM's default function was IMO broken for objects: "damagepower," which
was heavily affected by ninjaskill was used as follows:

Code: Select all

 		sub_damage = (32 - damagepower/8)
   	if (dmg/2 < dmg - sub_damage) then return (dmg - sub_damage)
This is (almost?) never true, and hardly ever matters, anyway...

Posted: Sun Aug 31, 2008 6:40 pm
by beowuuf
I think the impact damage for a mon fireball was something stupid like five health

Posted: Mon Sep 01, 2008 4:09 pm
by zoom
there had been the issue PaulH mentioned, with dragons that
just cast low level looking fireballs, just popped up in memory