Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2   Go Down

Author Topic: Spells  (Read 497 times)

MrFlay

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
  • Generic Amiga User
Spells
« on: July 25, 2019, 09:20:53 AM »

I use these pages very often. Many thanks to all contributing persons here. :D

Since I continue my code, I have some unanswered questions.
Each spell has its own level of difficulty. For example, Vivify is too complex at the beginning. But with each level up, the exercise improves more and more.
Then there is the possibility to practice each spell individually.
Spells that succeed with bad chance are practiced faster.
It should also be dependent on the intelligence of the champion?

In summary, the exercise with a spell depends on the level and the individual exercise.

My question: Have you already decrypted the exact mechanism. How does this work in detail in the game? Where is this stored in memory?
I want to understand that from the point of view of a programmer.
« Last Edit: July 25, 2019, 02:58:52 PM by MrFlay »
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 306
  • Offline Offline
  • Posts: 3,319
  • Don't forget... Ameboid's need love too!
    • Amiga Online
Re: Spells
« Reply #1 on: July 25, 2019, 04:03:48 PM »

I will confess I don’t know the mechanism, but if I have a chance I will dig through the uncommented 68000 code and at least work out the relevant area, and perhaps collectively we can get it worked through/commented
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace's Artwork Available
Buy my work

http://twitter.com/horaceandspider

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 306
  • Offline Offline
  • Posts: 3,319
  • Don't forget... Ameboid's need love too!
    • Amiga Online
Re: Spells
« Reply #2 on: July 25, 2019, 04:45:52 PM »

My only problem with this, is that I have been very productive on another project recently and any activity on Bloodwych with others always has the end result of distracting me!

I think it’s time the source code ended up on GitHub so that we can all work on it collectively ... even it’s just for comments.

I just need to be sure we have a compiled version being produced from the source. I did manage it the once!!


I wonder if BruceUncle is around to help clean up a couple of things....
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace's Artwork Available
Buy my work

http://twitter.com/horaceandspider

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 306
  • Offline Offline
  • Posts: 3,319
  • Don't forget... Ameboid's need love too!
    • Amiga Online
Re: Spells
« Reply #3 on: July 25, 2019, 06:48:23 PM »

Code: [Select]
Click_LaunchSpellFromBook:
bsr.s adrCd004E8E ;6112
bne.s adrCd004E86 ;6608
bsr adrCd006698 ;61001818
bsr adrCd00C85E ;610079DA
adrCd004E86:
move.w #$0002,$0014(a5) ;3B7C00020014
adrCd004E8C:
rts ;4E75

adrCd004E8E:
bsr adrCd00665C ;610017CC
clr.w adrW_00505A.l ;42790000505A
move.b $0007(a5),adrB_00EE3E.l ;13ED00070000EE3E
adrCd004EA0:
move.b $0013(a4),d0 ;102C0013
bmi.s adrCd004E8C ;6BE6
subq.b #$03,d0 ;5700
beq.s adrCd004EBE ;6714
cmp.w #$0008,$0042(a5) ;0C6D00080042
bne.s adrCd004EBE ;660C
movem.l d0-d7/a0-a6,-(sp) ;48E7FFFE
bsr adrCd00332A ;6100E472
movem.l (sp)+,d0-d7/a0-a6 ;4CDF7FFF
adrCd004EBE:
subq.b #$04,$0007(a4) ;592C0007
bcc.s adrCd004EC8 ;6404
clr.b $0007(a4) ;422C0007
adrCd004EC8:
move.b #$0F,$001B(a4) ;197C000F001B
clr.b $0011(a4) ;422C0011
bsr adrCd00688C ;610019B8
move.b $0009(a4),d1 ;122C0009
sub.b d0,d1 ;9200
bcs adrCd004FD6 ;650000F8
move.b d1,$0009(a4) ;19410009
tst.b d0 ;4A00
bne.s adrCd004EFA ;6612
move.b $0013(a4),d0 ;102C0013
bsr adrCd006900 ;61001A12
lea RingUses.l,a0 ;41F90000EE32
subq.b #$01,$00(a0,d0.w) ;53300000
adrCd004EFA:
bsr adrCd0080CA ;610031CE
bsr adrCd006778 ;61001878
moveq #$00,d0 ;7000
move.b $0013(a4),d0 ;102C0013
lea adrEA00685E.l,a6 ;4DF90000685E
move.b $00(a6,d0.w),d1 ;12360000
addq.b #$05,d1 ;5A01
add.b $0015(a4),d1 ;D22C0015
cmp.b #$64,d1 ;0C010064
bcs.s adrCd004F20 ;6502
moveq #$64,d1 ;7264
adrCd004F20:
move.b d1,$0015(a4) ;19410015
add.w d0,d0 ;D040
lea Spells_01_Armour.l,a0 ;41F90000505C
lea Spells_LookupTable.l,a6 ;4DF90000500C
add.w $00(a6,d0.w),a0 ;D0F60000
bsr adrCd005546 ;6100060E
add.b d0,d7 ;DE00
bmi.s adrCd004FB0 ;6B72
move.w d7,-(sp) ;3F07
bsr adrCd008498 ;61003556
move.w (sp)+,d7 ;3E1F
move.w $00(a6,d0.w),d1 ;32360000
and.w #$0007,d1 ;02410007
subq.w #$06,d1 ;5D41
bne.s adrCd004F5E ;660C
move.b $00(a6,d0.w),d1 ;12360000
and.w #$0003,d1 ;02410003
beq adrCd004FEE ;67000092
adrCd004F5E:
move.l a4,-(sp) ;2F0C
jsr (a0) ;4E90
moveq #$00,d0 ;7000
move.b adrB_00EE3E.l,d0 ;10390000EE3E
bsr adrCd004078 ;6100F10C
tst.w d1 ;4A41
bmi.s adrCd004F8E ;6B1C
beq.s adrCd004F86 ;6712
move.w d1,d7 ;3E01
tst.w $0042(a5) ;4A6D0042
bpl.s adrCd004F8E ;6A12
bsr adrCd007EF0 ;61002F72
bsr adrCd007ED2 ;61002F50
bra.s adrCd004F8E ;6008

adrCd004F86:
move.w $0006(a5),d7 ;3E2D0006
bsr adrCd00CCD8 ;61007D4C
adrCd004F8E:
move.l (sp)+,a4 ;285F
move.l #adrL_007E22,a0 ;207C00007E22
add.l a4,a0 ;D1CC
moveq #$00,d0 ;7000
move.b $0013(a4),d0 ;102C0013
addq.b #$01,$00(a0,d0.w) ;52300000
bcc.s adrCd004FA8 ;6404
subq.b #$01,$00(a0,d0.w) ;53300000
adrCd004FA8:
lea NullString.l,a6 ;4DF90000CAE9
bra.s adrCd004FBE ; 600E

adrCd004FB0:
lea SpellFailedMsg.l,a6 ;4DF90000504C
move.w #$0004,adrW_00D92A.l ;33FC00040000D92A
adrCd004FBE:
move.b #$FF,$0013(a4) ;197C00FF0013
tst.b adrB_00505B.l ;4A390000505B
bne.s adrCd004FD4 ;6608
jsr LowerText.l ;4EB90000CFB8
moveq #$00,d0 ;7000

adrCd004FD4:
rts ;4E75

adrCd004FD6:
tst.b adrB_00505B.l ;4A390000505B
bne.s adrCd004FD4 ;66F6
lea adrEA00EA62.l,a6 ;4DF90000EA62
jsr LowerText.l ;4EB90000CFB8
moveq #$01,d0 ;7001
rts ;4E75

adrCd004FEE:
lea SpellFizzledMsg.l,a6 ;4DF900004FFE
move.w #$0008,adrW_00D92A.l ;33FC00080000D92A
bra.s adrCd004FBE ;60C0

SpellFizzledMsg:
dc.b 'SPELL FIZZLED' ;5350454C4C2046495A5A4C4544
dc.b $FF ;FF

Spells_LookupTable:
dc.w Spells_01_Armour-Spells_01_Armour ;0000
dc.w Spells_02_Terror-Spells_01_Armour ;0022
dc.w Spells_03_Vitalise-Spells_01_Armour ;002A
dc.w Spells_04_Biguile-Spells_01_Armour ;0032
dc.w Spells_05_Deflect-Spells_01_Armour ;0062
dc.w Spells_06_Magelock-Spells_01_Armour ;0066
dc.w Spells_07_Conceal-Spells_01_Armour ;00DA
dc.w Spells_08_Warpower-Spells_01_Armour ;00F6
dc.w Spells_09_Missle-Spells_01_Armour ;00FC
dc.w Spells_10_Vanish-Spells_01_Armour ;0106
dc.w Spells_11_Paralyze-Spells_01_Armour ;010C
dc.w Spells_12_Alchemy-Spells_01_Armour ;0114
dc.w Spells_13_Confuse-Spells_01_Armour ;0174
dc.w Spells_14_Levitate-Spells_01_Armour ;017C
dc.w Spells_15_Antimage-Spells_01_Armour ;0182
dc.w Spells_16_Recharge-Spells_01_Armour ;0188
dc.w Spells_17_Trueview-Spells_01_Armour ;01CA
dc.w Spells_18_Renew-Spells_01_Armour ;01D0
dc.w Spells_19_Vivify-Spells_01_Armour ;0222
dc.w Spells_20_Dispell-Spells_01_Armour ;0258
dc.w Spells_21_Firepath-Spells_01_Armour ;0298
dc.w Spells_22_Illusion-Spells_01_Armour ;02A0
dc.w Spells_23_Compass-Spells_01_Armour ;02A6
dc.w Spells_24_Spelltap-Spells_01_Armour ;02AC
dc.w Spells_25_Disrupt-Spells_01_Armour ;02B2
dc.w Spells_26_Fireball-Spells_01_Armour ;02C0
dc.w Spells_27_Wychwind-Spells_01_Armour ;03C0
dc.w Spells_28_ArcBolt-Spells_01_Armour ;0412
dc.w Spells_29_Formwall-Spells_01_Armour ;041A
dc.w Spells_30_Summon-Spells_01_Armour ;048A
dc.w Spells_31_Blaze-Spells_01_Armour ;0490
dc.w Spells_32_Mindrock-Spells_01_Armour ;049E
SpellFailedMsg:
dc.b 'SPELL FAILED' ;5350454C4C204641494C4544
dc.b $FF ;FF
dc.b $00 ;00
adrW_00505A:
dc.b $00 ;00
adrB_00505B:
dc.b $00 ;00

Spells_01_Armour:
...
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace's Artwork Available
Buy my work

http://twitter.com/horaceandspider

MrFlay

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
  • Generic Amiga User
Re: Spells
« Reply #4 on: July 26, 2019, 08:30:27 AM »

Thank you for your honest answer.

I know the assembler code of Bloodwych, it is very complex.
When I saw the code for the first time, I did not understand anything.
Also after some time I think I understand 68k assembler just too bad to master that.
So how can I help with that?  :-[

Are you still working directly on Amiga hardware? I use Linux with a PC.
Is an Amiga bloodwych version still useful?
Would you like to bring Bloodwych to other operating systems?
What is your goal?

My approach is to have a C++ version of Bloodwych, which is tested against the behavior of the Amiga version.
If the correct behavior can't be found then it has to be simulated as well as possible (as Bloodwych HTML did).

Therefore, it would help me a lot to collect all the information about the magic system of Bloodwych.
Logged

adrazar

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 54
  • Generic Amiga User
Re: Spells
« Reply #5 on: July 26, 2019, 01:20:55 PM »

I had a look at the code dump, it would appear the interesting things happen in the two subroutines adrCd005546 and adrCd008498. I could check out those too if you'd post them next :D
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 306
  • Offline Offline
  • Posts: 3,319
  • Don't forget... Ameboid's need love too!
    • Amiga Online
Re: Spells
« Reply #6 on: July 26, 2019, 03:04:15 PM »

My goal is to have a perfect recompile of Bloodwych for the Amiga, which I can the insert edited data (maps, graphics, etc) into and /or include the option for some enhancements, which again, are informed by data blocks (ie something you can export from an editor)

I’ve already done a lot of this, with my Book of Skulls modification... for example many of the monsters have names - not just Zendick! - but my 68k code hacks are not clever enough to say, allow a machine which shoots arrows instead of arc bolts. Or create a new type of armour with “deflects” arrows (like the “deflect” spell)... or even show a different monster on screen when you walk onto the completion square!


On the Zx Spectrum there have been similar projects such as “Jet Set Willy 64” an enhanced version of the classic game which can still be run on the original machine.

A fully commented set of code would allow these type of enhanced mods which overall still work with the original game mechanics, and also allow others to port it onto other newer hardware.


I still love to use original Amiga hardware, but I also emulate., so i do most of my investigations on there!
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace's Artwork Available
Buy my work

http://twitter.com/horaceandspider

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 306
  • Offline Offline
  • Posts: 3,319
  • Don't forget... Ameboid's need love too!
    • Amiga Online
Re: Spells
« Reply #7 on: July 26, 2019, 03:05:20 PM »

I had a look at the code dump, it would appear the interesting things happen in the two subroutines adrCd005546 and adrCd008498. I could check out those too if you'd post them next :D


I will grab those tonight for you ;)
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace's Artwork Available
Buy my work

http://twitter.com/horaceandspider

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 306
  • Offline Offline
  • Posts: 3,319
  • Don't forget... Ameboid's need love too!
    • Amiga Online
Re: Spells
« Reply #8 on: July 28, 2019, 09:51:25 PM »

There’s a random number generator after his routine so I stopped there (and shortly after “view spell” which I assume is more of a gfx routine.


Code: [Select]
adrCd005546:
moveq #$03,d6 ;7C03
moveq #$02,d5 ;7A02
adrLp00554A:
bsr.s adrCd005556 ;610A
add.w d0,d6 ;DC40
dbra d5,adrLp00554A ;51CDFFFA
move.w d6,d0 ;3006
rts ;4E75

adrCd005556:
move.w adrW_0055AA.l,d0 ;3039000055AA
addq.w #$01,d0 ;5240
mulu #$B640,d0 ;C0FCB640
move.l d0,d1 ;2200
asl.l #$04,d0 ;E980
add.l d1,d0 ;D081
move.w #$0511,d1 ;323C0511
moveq #$00,d3 ;7600
adrCd00556E:
divu d1,d0 ;80C1
bvc.s adrCd005580 ;680E
move.w d0,d2 ;3400
clr.w d0 ;4240
swap d0 ;4840
divu d1,d0 ;80C1
move.w d0,d3 ;3600
move.w d2,d0 ;3002
bra.s adrCd00556E ;60EE

adrCd005580:
subq.w #$01,d1 ;5341
swap d0 ;4840
move.w d3,d0 ;3003
swap d0 ;4840
divu d1,d0 ;80C1
clr.w d0 ;4240
swap d0 ;4840
move.w d0,adrW_0055AA.l ;33C0000055AA
moveq #$06,d1 ;7206
adrCd005596:
divu d1,d0 ;80C1
bvc.s adrCd0055A6 ;680C
move.w d0,d2 ;3400
clr.w d0 ;4240
swap d0 ;4840
divu d1,d0 ;80C1
move.w d2,d0 ;3002
bra.s adrCd005596 ;60F0

adrCd0055A6:
swap d0 ;4840
rts ;4E75

adrW_0055AA:
dc.b $03 ;03
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace's Artwork Available
Buy my work

http://twitter.com/horaceandspider

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 306
  • Offline Offline
  • Posts: 3,319
  • Don't forget... Ameboid's need love too!
    • Amiga Online
Re: Spells
« Reply #9 on: July 28, 2019, 09:55:24 PM »

This one seems like a more generic bit of code and includes the “coord to map” routine, so probably it is used to make the spell have an effect on areas around it.

Code: [Select]
adrCd008498:
move.l $001C(a5),d7 ;2E2D001C
CoordToMap:
move.l adrL_00EE78.l,a6 ;2C790000EE78
adrCd0084A2:
move.w d7,d0 ;3007
mulu adrW_00EE70.l,d0 ;C0F90000EE70
swap d7 ;4847
add.w d7,d0 ;D047
swap d7 ;4847
add.w d0,d0 ;D040
add.w adrW_00EE76.l,d0 ;D0790000EE76
rts ;4E75
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace's Artwork Available
Buy my work

http://twitter.com/horaceandspider

MrFlay

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
  • Generic Amiga User
Re: Spells
« Reply #10 on: July 29, 2019, 08:13:03 AM »

Regardless of the posted assembler code (thanks for posting), I would like to to summarize:
A spell can refer to a single champion (armour, warpower ...), to the whole party (vitalise), to the field in front of the party or it's a projectile spell. A spell has a magic class or form (green=serpent, blue=moon ...), a value of difficulty, an experience value and a learned flag (a name, four runes and a description of course).
Did I forget something?

The remaining values (cool down timer, intelligence, vitalize ...) should be derived from the champion values.
The game behavior should be derived completely from these values.
Please correct me if I'm wrong.
I hope the assembler code brings a better clarification.
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 306
  • Offline Offline
  • Posts: 3,319
  • Don't forget... Ameboid's need love too!
    • Amiga Online
Re: Spells
« Reply #11 on: July 29, 2019, 08:51:27 AM »

The only thing I think you missed , should be the most obvious!

That the characters class determines difficulty, eg wizards, adventures, cutpurses then warriors. (Possibly the last two are equal)


I believe the intelligence of a character may also determine the maximum number of spell points made available to them (increased on each level gain) . Certainly they are not all equal.
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace's Artwork Available
Buy my work

http://twitter.com/horaceandspider

adrazar

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 54
  • Generic Amiga User
Re: Spells
« Reply #12 on: July 29, 2019, 01:54:07 PM »

Ok, the first subroutine generates 2D6 + 3 :P
The other indicates that spells fizzle depending map content.. (did I just make it obvious that I've never played this game? :o)

This was a bit clarifying but didn't get me a lot closer to completing the picture, unfortunately :/. And there are still at least six subroutines that could be affecting the casting abilities in some way. Maybe the easiest way to proceed would be to simply attach the entire file and have me go through each them?

One more thing: a4 (and maybe a5) seems to point to a "struct" which I guess must have something to do with the character stats. Any already known details about this struct would be great to have. :)
Logged

MrFlay

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 6
  • Generic Amiga User
Re: Spells
« Reply #13 on: July 29, 2019, 03:40:52 PM »

This can be found here in the forum under "Hacking: A Guide to the Data-Structure of Bloodwych" at "Champion Data Structure".
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 306
  • Offline Offline
  • Posts: 3,319
  • Don't forget... Ameboid's need love too!
    • Amiga Online
Re: Spells
« Reply #14 on: July 29, 2019, 04:33:19 PM »

I will also have a look at getting the source on GitHub , plus the data blocks etc.

Perhaps it is time I moved all of the hacking guide stuff on there as well.
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace's Artwork Available
Buy my work

http://twitter.com/horaceandspider
Pages: [1] 2   Go Up
 

TinyPortal 1.6.3 © 2005-2019