True Length of Fire Wall

Post here about all aspects of D2 mod making whether it's information, problems or whatever. Please specify whether your post is relating to Classic D2 or the Expansion.

Moderator: Nizari

Post Reply
User avatar
mmpx222
Junior Member
Paladin
Posts: 139
Joined: Sat Apr 26, 2014 9:19 am
Korea South

True Length of Fire Wall

Post by mmpx222 » Sun Jan 06, 2019 8:05 pm

Help! What should be a simple math problem has been driving me up a (fire) wall for several hours. I will state each piece of information as a Fact (undisputable truth), Proposition (believed to be generally true), or Lemma (intermediate statements derived from other statements). Bear with me:
  • Fact 1: Fire Wall uses the firewallmaker missile to spawn the fire patches.
  • Fact 1A: When you cast Fire Wall, two firewallmaker missiles are spawned. These travel in opposite directions, leaving two trails of fire in their path.
  • Lemma 1B: The length of a Fire Wall is the combined distance traveled by two firewallmaker missiles.
  • Lemma 1C: For each skill level, Fire Wall length increases by 2×(firewallmaker move distance increase)
  • Proposition 3: In Missiles txt, Range and LevRange determine the duration of the missile. Range is the base duration at skill level 1, and LevRange is the additional duration per each skill level. These values are measured in frames (25 frame = 1 second).
  • Fact 3A: In Missiles.txt, firewallmaker has LevRange=2.
  • Lemma 3B: From Prop 3 and Fact 3A, firewallmaker gains 2 frames of duration per each skill level. Let's call this frame/slvl for short.
  • Lemma 3C: From Lemma 2B and Lemma 3B, firewallmaker travels an additional 12 px/frame × 2 frame/slvl = 24 px/slvl.
  • Lemma 3D: From Lemma 1C and Lemma 3C, the length of Fire Wall increases by 24 px/slvl × 2 = 48 px/slvl, or 48 pixels per each skill level.
Conclusion: From Lemma 3D and Prop 4, Fire Wall gains 48px × (1 yard / 48px) = 1 yard per skill level.
  • Observation: Fire Wall length increases by 1 + 1/3 ≒ 1.33 yards per skill level. This contradicts the Conclusion above.
My face: ???

So....which part of my logic is wrong?
Last edited by mmpx222 on Fri Jan 11, 2019 8:17 pm, edited 1 time in total.
D2TXT / D2INI - Python scripts for editing TXT files, or converting between TXT ↔ INI files

User avatar
JDS
Junior Member
Paladin
Posts: 197
Joined: Wed Jun 05, 2013 8:31 pm

Re: True Length of Fire Wall

Post by JDS » Sun Jan 06, 2019 10:19 pm

I don't know what the answer is, but I found a (possibly known) client-side bug. I can change the duration of the firewall by increasing Levrange of the firewall missile. But only the first (center) missiles stay visible. The damage is still dealt correctly.

EDIT: I played around with it a bit and haven't found anything very useful, but definitely the length of the wall is proportional to the product of Vel and Range/LevRange.
EDIT: But it's definitely not what you believe in terms of pixel distance. Putting range=3 and vel=200, it covers the whole screen horizontally, which is a distance of 800. With your pixel movement, it should be 600. 600 * 4 / 3 = 800, so maybe that's all there is to it.

User avatar
mmpx222
Junior Member
Paladin
Posts: 139
Joined: Sat Apr 26, 2014 9:19 am
Korea South

Re: True Length of Fire Wall

Post by mmpx222 » Mon Jan 07, 2019 2:15 pm

More observations:

Distance in Skill Desc

Fire Wall uses skill descfunc 29 in SkillDesc.txt to display "X Yards". The function uses descmissile1 for the missile. As expected, the number of yards shown is completely incorrect; it displays floor((Range + LevRange × (slvl - 1)) × 2 ÷ 3). It does NOT use Vel and MaxVel to calculate actual distance!

Actual Missile Range

Actual missile range (duration) used by the game seems to be (Range + LevRange × slvl), NOT (Range + LevRange × (slvl - 1)).

Invisible Pyres

firewallmaker seems to spawn a submissile on each frame of its existence, NOT along every subtile along the path it travels. When I set Vel and MaxVel to a high value (120), large gaps were created between each fire patch (pyre).
JDS wrote:
Sun Jan 06, 2019 10:19 pm
I don't know what the answer is, but I found a (possibly known) client-side bug. I can change the duration of the firewall by increasing Levrange of the firewall missile. But only the first (center) missiles stay visible. The damage is still dealt correctly.
Thank you. I also noticed that the two pyres nearest to the center pyre were invisible; this resulted in double-width gaps next to the center pyre.

Image
The pic shows level 3 Fire Wall with Vel=120, MaxVel=120, Range=0, LevRange=1. The green circle indicates where the skill was cast, and the yellow line is the direction of the wall. 5 pyres are spawned, 2 of which are invisible (blue circles). Notice the dead Fallen in the left blue circle, which was killed by an invisible pyre.

The pyres became visible only when Fire Wall was cast by clicking directly on a monster. See:

Image
Same config as previous pic, except the Fire Wall is cast directly on a monster. The two pyres nearest to the center pyre is now visible.

Image
Occasionally, only 1 pyre would remain invisible. The pic shows 4 visible and 1 invisible pyres.

Edit: For Fire Walls cast horizontally, the invisible submissile bug seems to occur if Vel and MaxVel are set to 16 or greater. I replaced the CelFile of firewall with a 32×16 rhombus to determine exactly where the missiles spawn. Compare: Vel = 15 and Vel = 16 (on ground).

Image

I also noticed that even the vanilla Fire Wall has the invisible submissile bug. Check out pics of Fire Wall, levels 1-10.

Number of Submissiles Spawned

I set Range=0, LevRange=1 so that firewallmaker would have a range equal to skill level. I also set Vel=60 and MaxVel=60 to easily count the pyres. Then I counted the number of pyres spawned by each skill level of Fire Wall.

See results:

Code: Select all

Range	# pyres shown   # pyres shown
(slvl)	(on ground)     (cast on monster)
------------------------------------------------
0       1               1
1       1               1
2       1               3
3       3               5
4       5               7
5       7               9
6       9               11
7       11              13
8       13              15
9       15              17
10      17              19
Taking the Invisible Pyres bug into account, I concluded that (# of pyres) = 1 + 2 × ((range of firewallmaker) - 1).

Duration of Client Submissiles

For firewallmaker, the Range/LevRange of cltsubmissile2 and cltsubmissile3 are ignored; both missiles use the same range as cltsubmissile1. This is why firewall submissiles on the client expire at the same time, even though they have different Range/LevRange values in Missiles.txt.
D2TXT / D2INI - Python scripts for editing TXT files, or converting between TXT ↔ INI files

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

Hand-picked

Re: True Length of Fire Wall

Post by Necrolis » Mon Jan 07, 2019 8:16 pm

Just a small thing on the distance calcs: never use pixels, as a pixel is (technically) square, however D2 is isometric, so all distances should be in calculated subtiles (see this image from dzik on discord). The alternative is that you use isometically adjusted pixel widths for a yard (24x48px).

Formula wise, you can convert using: Subtiles = Yards * 2 / 3. However, you need to keep in mind that on the server, all the math is truncated, decimals don't exist at any point. On the client its slightly different as the drawing code can interpolate between subtiles (which means on the client a missile of size 1x1 subtile can straddle two or more subtiles; but on the server will only be in one of those subtiles).
Image
Netiquette, Do you USE it?!?! | Nefarius' Fixed TXT Files | Terms Of Service
Blackened | Day of Death
"What was yours is mine. Your land, your people, and now your life." - Lim-Dul, the Necromancer
Judgement is Final, Death is Eternal

User avatar
mmpx222
Junior Member
Paladin
Posts: 139
Joined: Sat Apr 26, 2014 9:19 am
Korea South

Re: True Length of Fire Wall

Post by mmpx222 » Fri Jan 11, 2019 8:26 pm

Necrolis wrote:
Mon Jan 07, 2019 8:16 pm
Just a small thing on the distance calcs: never use pixels, as a pixel is (technically) square, however D2 is isometric, so all distances should be in calculated subtiles (see this image from dzik on discord). The alternative is that you use isometically adjusted pixel widths for a yard (24x48px).
Thank you. But the game eventually translates isometric coordinates to square pixels on the screen, so I feel there still is some merit in using pixels. I just have to be careful.

I did quite some testing and some theorycrafting over at Amazon Basin, and would like to report the results:

For the layman, (fire wall length) = ( 7 + 2 × {9 × slvl ÷ 8} ) × (2 ÷ 3) (yards)

For great justice and accuracy:
  • Length of diagonal Fire Wall: ( 1 + { (9 × (R - 1) - 8) ÷ 16 } + { (1 + 9 × (R - 1) - 8) ÷ 16 } ) × (2 ÷ 3) (yards)
  • Length of horizontal Fire Wall: 1 + 2 × { (2 + (38 ÷ 3) × (R - 1) - 16) ÷ 32} (yards)
Where R = Range + LevRange × slvl in Missiles.txt
D2TXT / D2INI - Python scripts for editing TXT files, or converting between TXT ↔ INI files

Post Reply

Return to “General Mod Making”