Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 4 5 [6] 7 8 ... 16

Author Topic: Upright spear glitch aka "Shaft of Enlightenment"  (Read 138330 times)

Urist Da Vinci

  • Bay Watcher
  • [NATURAL_SKILL: ENGINEER:4]
    • View Profile
Re: Upright spear causes instant badassery, probable glitch
« Reply #75 on: December 23, 2013, 10:27:37 pm »

[edited reply; misread some bits of the conversation]

Best guess:

For this specific situation, it looks like garbage data from the stack is being used as experience input. The experience is awarded before the game even looks at the upright spears/spikes, being caused by the ground collision.
Out of curiosity, what happens if there are no upright spears where the creature falls down? If the experience gain only happens when upright spears are present, then it stands to reason that the game is simply printing the combat messages after the attacks are completed, and that it's those spear attacks that are using bogus "skill" levels, not the collision with the ground.

Turns out this does not work with any other kind of trap. Aka: Boulder traps (just gets crushed after landing), cage traps (captured), and I did not test weapon traps.
Boulder traps and weapon traps always derive their "skill level" from the quality of their mechanism.

When you fall on the ground, the game first runs a combat function for the ground collision as a subroutine of the falling function. This prints messages and grants XP for the ground attack. The falling function then runs a combat function seperately for each weapon in any upright spear/spike trap.

The tick after you land on the ground, the game realizes that you are on top of a cage/boulder/weapon trap and responds accordingly. This code is NOT part of the falling function.

...
It was an artifact spear, so since it doesn't derive skill from mechanisms, it takes it's 'skill' from the quality. So the spear is providing a very high skill attack which (probably due to falling or crap materials) is always blocked/parried. Since they blocked/parried such a high skill attack they gain lots of levels!
...

Does not work this way. Normally skill gain is not connected to quality or severity of things in DF, just the quantity.

There is NO actual technical verification that this has anything to do with parrying or blocking, though it is suspicious that you gain shield XP if you have a shield equipped, and weapon XP if you have a weapon equipped. There are no parry/block messages being displayed. The part about parrying the earth was mostly playing along with a joke, so it's funny that was more believable to people.

I do know that the damage of falling on spears/spikes has a velocity bug, but that has no effect on the amount of XP. Normal attacks with super-high momentum don't grant more XP.

TheDorf

  • Bay Watcher
    • View Profile
Re: Upright spear causes instant badassery, probable glitch
« Reply #76 on: December 24, 2013, 12:08:50 am »

Managed to get my adventurer killed a few times from a 2 z-level drop upon training spears. Use protection, kids! ;)

This is a quite interesting find. In case nobody mentioned it yet; wearing multiple weapons seems to give the same amount of experience in all of the weapon skills. It isn't split up or anything, so wearing multiple weapons might be nice if you want an all-around badass adventurer. I haven't tried this in fortress mode though.
« Last Edit: December 24, 2013, 12:14:59 am by TheDorf »
Logged
I love this community. Somebody asks "hay guise how do i tame shark", and then everybody is like "why don't we fling sharks at things with complex mechanical devices?".

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: Upright spear causes instant badassery, probable glitch
« Reply #77 on: December 24, 2013, 12:13:54 am »

That just makes it even stranger, because a normal fall from 2 tiles high does not convey much experience at all.

If the calculation is perfored and applied BEFORE the speartrap is detected, and computed, why does it only fire when there IS a speartrap present, and never on an ordinary ground tile?

Is there any kind of pre-calculation check first, that might be altering program flow behavior?

Eg, when the game determines that the unit is falling, it counts how far the fall will be in Z,levels, checks what kind of tile the falling actor will land on, then executes code accordingly.

There should be an unfolded loop in the disassembly indicating such a check if it exists.
If it does not exist, how does the game know to apply the bugged experience gain function, and nor the normal fall experiene gain function, BEFORE it tests for a trap? The game clearly can't be clairvoyant...
Logged

4maskwolf

  • Bay Watcher
  • 4mask always angle, do figure his!
    • View Profile
Re: Upright spear causes instant badassery, probable glitch
« Reply #78 on: December 24, 2013, 01:38:52 am »

Sweet merciful Armok...

Must... Resist... Urge... To... Make... Dwarven... Supersoldiers.

My only hypothesis is that it somehow multiplies the skill gain from the ground attack with the skill gain for the spear attack.  Mathematically, it would probably come out somewhere in the ballpark... Maybe...

Edit: has anyone tested this with unarmored soldiers.  I attempted an early-game repetition of this with no results.  dwarves had no armor to speak of.  iirc, the only unarmored creature so far to get this treatment was a goblin thief, and he did not gain the experience.
« Last Edit: December 24, 2013, 02:59:42 am by 4maskwolf »
Logged

TheDorf

  • Bay Watcher
    • View Profile
Re: Upright spear causes instant badassery, probable glitch
« Reply #79 on: December 24, 2013, 06:54:00 am »

That just makes it even stranger, because a normal fall from 2 tiles high does not convey much experience at all.

If the calculation is perfored and applied BEFORE the speartrap is detected, and computed, why does it only fire when there IS a speartrap present, and never on an ordinary ground tile?

Is there any kind of pre-calculation check first, that might be altering program flow behavior?

Eg, when the game determines that the unit is falling, it counts how far the fall will be in Z,levels, checks what kind of tile the falling actor will land on, then executes code accordingly.

There should be an unfolded loop in the disassembly indicating such a check if it exists.
If it does not exist, how does the game know to apply the bugged experience gain function, and nor the normal fall experiene gain function, BEFORE it tests for a trap? The game clearly can't be clairvoyant...

As someone mentioned earlier (I think?), my guess would be that the game checks the tile you land on for data, and notices that you're landing on a spear, which toggles xp gain on. When the attack from the ground then hits you, you get experience for that, too. Seeing as you usually get "X happens to body part Y" multiple times, I'd also think that the ground "aims attacks" against all your body parts. However, considering the enormous amount of experience, the ground has to aim a lot of attacks at you. Or there might be an entirely different explanation. :)
Logged
I love this community. Somebody asks "hay guise how do i tame shark", and then everybody is like "why don't we fling sharks at things with complex mechanical devices?".

Fallenworldful

  • Bay Watcher
  • The Expert !!Newb!!
    • View Profile
Re: Upright spear causes instant badassery, probable glitch
« Reply #80 on: December 24, 2013, 11:28:04 am »

Soo...

Falling is the earth attacking you. Then the spear provides something to parry, so the Dwarf attempts to parry the planet's attacks indirectly and gains the experience?
Logged
The Vile Force of Darkness strikes Fallenworldful's Fortress, jamming the skull through the brain!

Fallenworldful's Fortress has been knocked unconscious!

Fallenworldful's Fortress has been struck down.

Enemy post

  • Bay Watcher
  • Modder/GM
    • View Profile
Re: Upright spear causes instant badassery, probable glitch
« Reply #81 on: December 24, 2013, 12:27:20 pm »


Must... Resist... Urge... To... Make... Dwarven... Supersoldiers.

Resist? Why would you do something like that?
Logged
My mods and forum games.
Enemy post has claimed the title of Dragonsong the Harmonic of Melodious Exaltion!

4maskwolf

  • Bay Watcher
  • 4mask always angle, do figure his!
    • View Profile
Re: Upright spear causes instant badassery, probable glitch
« Reply #82 on: December 24, 2013, 06:09:30 pm »

Okay, I did a bit of !!SCIENCE!! on this glitch and found that you do, in fact, have to be wearing metal armor for it to trigger, as both unarmored and leather armored dwarves did not trigger it.

At least, those are my findings.  Expect more !!SCIENCE!! to come.

Edit: With copper breastplate and axe, jumped 52 levels in fighter and axedwarf.
« Last Edit: December 24, 2013, 06:11:21 pm by 4maskwolf »
Logged

PDF urist master

  • Bay Watcher
  • Born from cold iron
    • View Profile
Re: Upright spear causes instant badassery, probable glitch
« Reply #83 on: December 24, 2013, 10:28:28 pm »

it also doesn't trigger if anything interrupts you fall. ie a spinning pig tail robe that somehow got in my new training room.
Logged
We are not evil by choice, but evil by necessity.

4maskwolf

  • Bay Watcher
  • 4mask always angle, do figure his!
    • View Profile
Re: Upright spear causes instant badassery, probable glitch
« Reply #84 on: December 24, 2013, 10:43:37 pm »

it also doesn't trigger if anything interrupts you fall. ie a spinning pig tail robe that somehow got in my new training room.

Interesting.  I noticed this phenomenon as well.  But on an entirely unrelated note, somebody said they did it to a miner and it worked.  Was the miner on active duty with an assigned pick at the time?

AnotherDwarvernDeath

  • Bay Watcher
    • View Profile
Re: Upright spear causes instant badassery, probable glitch
« Reply #85 on: December 24, 2013, 11:26:19 pm »

Interesting.  I noticed this phenomenon as well.  But on an entirely unrelated note, somebody said they did it to a miner and it worked.  Was the miner on active duty with an assigned pick at the time?

It appears to only train combat skills, and if I'm not mistaken Miner used for combat. Would explain how someone holding an ax didn't instantly become a legendary+ woodcutter.

Okay, I did a bit of !!SCIENCE!! on this glitch and found that you do, in fact, have to be wearing metal armor for it to trigger, as both unarmored and leather armored dwarves did not trigger it.

Metal armor is unnecessary (tested with a leather-armored dwarf), but it IS necessary to have at least a dabbling experience in the weapon you're training.

I'm guessing that these two things together explain why Urist Da Vinci's miner became legendary, while the woodcutter remained ordinary. If his woodcutter had had at least dabbling experience in Axedwarf and was also holding an ax, he would have become a legendary Axedwarf.
Logged

4maskwolf

  • Bay Watcher
  • 4mask always angle, do figure his!
    • View Profile
Re: Upright spear glitch aka "Shaft of Enlightenment"
« Reply #86 on: December 24, 2013, 11:48:31 pm »

THAT may have been the problem with my results.  I ran the unarmored test first, then the metal one.  With the same dwarf.

misko27

  • Bay Watcher
  • Lawful Neutral; Prophet of Pestilence
    • View Profile
Re: Upright spear causes instant badassery, probable glitch
« Reply #87 on: December 25, 2013, 12:20:06 am »


Must... Resist... Urge... To... Make... Dwarven... Supersoldiers.

Resist? Why would you do something like that?
Well, the reason is probably that it crosses a line that for some is crossed with regular danger rooms, and for some can't be crossed at all: It becomes too easy/exploity. It's well-known that you can, for example, basically seal off your fort with cage traps; given enough time and not caring about caravans, you can, without using a bug or anything, completely doom an prospective siege or wild-life attack without even a remote chance of their winning. Megabeasts can be dealt with by only slightly more complex traps and are limited in number, forgotten beasts can be left in the caverns. With little effort on your part per battle, you can defeat everything, but there's no, investment.

This goes too far on the "exploity" scale for many. I mean at some point, you might as well mod dwarves to be 10000x size and win all battles. There's no challenge, no glory to it. Dwarven Childcare gives you child bad-asses, but with significant casualties and a low rate of success; danger rooms take time, traps require ingenuity. magma requires investment and is dangerous (and firey), This is just, bleh. It's not dwarven to become a god after surviving a small fall onto a single spike while wearing armor.
Logged
The Age of Man is over. It is the Fire's turn now

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: Upright spear glitch aka "Shaft of Enlightenment"
« Reply #88 on: December 25, 2013, 12:31:23 am »

There's only three things I an consider happening here.  Either one or the other is occurring, or some combination...
1: The damage dealt by an upright spear/spike depends on the distance dropped, as it effectively takes your falling damage and applies that as the power of the weapon's attack.  Falling from higher up increases the damage the spear does, which alters the way experience and skillgain is handled.  I'm aware that skillgain doesn't depend on difficulty of task, so...
2: Toady may have slipped a variable somewhere, and accidentally referenced the wrong item.  It may not be a fluke of design, but rather an outright misplaced value, where it's trying to assign the damage as experience.  Because of the weird way combat is handled, dealing damage in the tens of thousands might only translate into bruises, but if those tends of thousands are accidentally put in the 'experience' column, you get supersoliders.
3: Weird conversions are happening.  It's possible that falling damage is figured differently from weapon damage, because normal weapons are made of metal and wielded, while the ground is made of relatively soft 'floor' and thus needs highly exaggerated damage values - an axedwarf with a copper axe might deal 30 strength through 10 hardness, for 300 damage, but a floor tile only has a hardness of .1 so it needs to hit with a strength of 3,000 to deal any reasonable damage.  That 3,000 strength strike is only a gentle pap, but it's somehow applied to the upright spear as well, and from there somehow works its way into the experience given...

Whichever way you look at it, this is a very deep coding issue, not something that can be explained via any in-game means.

In any case, I think it'd tag quite nicely on the Children of Armok project...

4maskwolf

  • Bay Watcher
  • 4mask always angle, do figure his!
    • View Profile
Re: Upright spear glitch aka "Shaft of Enlightenment"
« Reply #89 on: December 25, 2013, 12:54:28 am »

Huh.  The second one is one of the best ideas I've heard so far.  But then why must they have weapon skill already?
Pages: 1 ... 4 5 [6] 7 8 ... 16