Fireball Graphic

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Fireball Graphic

Post 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.
User avatar
Adamo
Italodance spammer
Posts: 1534
Joined: Fri Apr 22, 2005 11:59 am
Location: Poland
Contact:

Post 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.
Spoiler
(\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/) (\__/)
Spoiler
(@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@) (@.@)
Spoiler
(>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<) (>s<)
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post 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)
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post 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.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post 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...
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

I think the impact damage for a mon fireball was something stupid like five health
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

there had been the issue PaulH mentioned, with dragons that
just cast low level looking fireballs, just popped up in memory
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”