Ultimate Amiga

Please login or register.

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

Author Topic: Spells  (Read 8707 times)

0 Members and 1 Guest are viewing this topic.

adrazar

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 67
  • Generic Amiga User
Re: Spells
« Reply #15 on: July 29, 2019, 05:23:17 PM »

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

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Spells
« Reply #16 on: July 29, 2019, 08:49:44 PM »

Right, i've set up the GitHub, it is here:

https://github.com/HoraceAndTheSpider/Bloodwych-68k

I've managed to compile it, and the final code does work, but it's not identical to the original. I am testing it with WHDLoad which bypasses the copy-protection.

It could be my DevPac settings which are stopping this being the same. I am not familiar enough with Devpac to tell.

A resource (.rs) file, as provided by BruceUncle, is also included.

I would really like to get this producing an identical file first, then perhaps contributor can either comment-up what is happening and/or at least get us some 'human' labels in there!
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

MrFlay

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 11
  • Generic Amiga User
Re: Spells
« Reply #17 on: July 30, 2019, 08:08:07 AM »

A big thank you for the great work!  8)
There was already a lot of work going on, as I see.

A ReadMe.txt in each folder might be quite handy, which explains the file structure of all contained files.

for example:
 bw-sfx/ReadMe.txt
  Interchange File Format (IFF) 8SVX audio files

In this way, information from this forum would be included there.
('kill two birds with one stone')  ;)
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Spells
« Reply #18 on: July 30, 2019, 10:43:07 PM »

I've started working on my Excel labelling sheet macros again.

This has a list of resourced labels and will find/replace accordingly.

I am working on a function to add in data blocks / files as well, although i want some validation checking on that (that the data file and declared data in the code are the same, or at least the same size!!)

i will also look at a system for adding code comments that are in the spreadsheet as well. This way it is all recovered if reverting back to a previous ReSourced code

There's quite a few 'offset labels' (e.g. label+2 ) which are created as unique labels that will need fixing, as sometimes they jump into the data blocks. (Like ChampionData+2) which is a cheap way of arriving at the worn armour
« Last Edit: July 30, 2019, 10:57:12 PM by Hungry Horace »
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

adrazar

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 67
  • Generic Amiga User
Re: Spells
« Reply #19 on: July 31, 2019, 08:49:13 PM »

I've figured out the rules for determining spell casting success/failure, but the presentation here will have to wait till tomorrow. However, I could mention one thing right away; I found that all spells are practiced equally fast regardless of difficulty, contrary to what was said in the first post. If that is clearly a wrong conclusion then I should probably look further into some of the later subroutines.
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Spells
« Reply #20 on: July 31, 2019, 11:34:59 PM »

Ffs.... tapatalk crashed mid reply....  and it’s a long one! Here I go again....

Firstly thank you for even looking at this! It is appreciated!!!


Are you saying that becoming more proficient at spells is simply dependent on the character becoming better at magic overall, and does not directly link to learning the individual spell being cast?

This I could believe.

The spell definitely has a difficulty - it is called “cast” in game and is shown as a small bar. The fuller the bar the more likely a spell will be cast successfully, and the easier a spell is to cast, the more powerful some are.

Some spells with power include FirePath which will last longer and damage more with a better cast, and Summon, which brings a wandering monster into being (his strength and hitpoints are determined by his level, which also affects what colour he is so you get a good visual indicator immediately)



As well as “learning”, I believe cast can be improved by:

- Being a wizard (instead of a warrior for example!)
- Casting a spell of the same colour/class as the character
- choosing to spend more spell points on the cast (if your character has them available)
- holding a wand of the same colour/class in your hand
- presumably depending on the characters intelligence


However, for each spell to have a “learnt” value, (which would need at minimum 4 values, but 8 seems more likely, and with 32 spells to choose from, across 16 characters this would require a data block of (I think) at least 64 bytes.... I am hopeful I would have noticed such a block being referred to when cutting up the data of that was the case.


Now if you tell me that every character has a single byte which is used for “spell ability learnt” I would not be at all surprised as there are 1 or 2 bytes of character data (one of which I am sure relates to spells and is changed when the game starts) which I have never managed to work out.
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

adrazar

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 67
  • Generic Amiga User
Re: Spells
« Reply #21 on: August 01, 2019, 03:32:21 PM »

In the context of Click_LaunchSpellFromBook, the two unknown bytes in the champion data structure are used this way:
Byte 13 (hex) is the number of the spell that the player attempts to cast.
Byte 14 (hex) is the spell power boost gained by spending additional mana.

Well, what I meant about practicing a spell will be clear in a moment.. ("spoiler": each spell is practiced individually by counting the number of times it has succeeded (all champions contribute to the same count). A high number of successes increase the chances of further successes for that particular spell.)

In the following I will say that champions, wands, rings and spells matches if their colour matches.



Mana Cost

(Attempting to cast a spell always reduces vitality (Byte 07) by 4 to a minimum of 0, and sets the attack cooldown timer (Byte 1B) to 15, but neither of these two stats have any effect on the spell success chance.)

Each spell has a base mana cost that is derived from the first row of this table:

+----------------------------------------------------------------------------------------------------------------------------------------------+
|               1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23  24  25  26  27  28  29  30  31  32  |
|              ------------------------------------------------------------------------------------------------------------------------------  |
| Spellcost     1   2   2   1   1   2   2   3   1   3   2   5   2   2   4   5   3   3   7   3   4   4   2   5   8   3   7   4   5   6   6   4  |
| Difficulty   14  15  14  14  13  14  14  15  14  15  14  18  15  15  17  16  15  16  36  16  17  19  14  18  24  16  22  16  17  19  18  16  |
+----------------------------------------------------------------------------------------------------------------------------------------------+
                                                               Table 1: Spells


The base mana cost is

     2 * (Spellcost + 1)

e.g. spell 10 has base cost 8.
If an attack bonus/penalty is applied to the spell (Byte 14), the base value is adjusted according to the next table.

+--------------------------------------------------------------------------------------------------+
| Attack modifier   ..  -3  -2  -1   0   +1   +2   +3   +4   +5   +6   +7   +8   +9  +10  +11  +12 |
|                   ------------------------------------------------------------------------------ |
| Additional mana   ..  -3  -2  -1   0    3    6   10   15   21   28   36   45   55   66   78   91 |
+--------------------------------------------------------------------------------------------------+
                                   Table 2: Attack modifiers

Mana used on a single spell can't exceed 99.

If the champion wears a ring matching the spell, a charge from that will be spent instead of using mana.
Such spells are always cast unmodified (no attack bonus/penalty).



Casting success

If a champion matches the spell or is wielding a wand matching the spell, the base attack is given in Table 3A.
Otherwise the base attack is given in Table 3B.

+---------------------------------------+     +---------------------------------------+
|   #Successes         Base attack      |     |   #Successes         Base attack      |
|   ----------       ----------------   |     |   ----------       ----------------   |
|     0 - 4           0 + (X - 0)/1     |     |     0 - 9           0 + (X - 0)/2     |
|     5 - 14          5 + (X - 5)/2     |     |    10 - 29          5 + (X - 10)/4    |
|    15 - 34         10 + (X - 15)/4    |     |    30 - 69         10 + (X - 30)/8    |
|    35 - 74         15 + (X - 35)/8    |     |    70 - 127        15 + (X - 70)/16   |
|    75 - 127        20 + (X - 75)/16   |     +---------------------------------------+
+---------------------------------------+           Table 3B: Non-matching spell
         Table 3A: Matching spell

Here #Successes is the accumulated number of times the spell has succeeded. (The count stops increasing after 127 successes)


The base attack is adjusted by caster class:

+---------------------------------------------------+
|  Class:       Matching bonus       Level bonus    |
|  -------      --------------      -------------   |
|  Warrior            +3            +2 / 4 levels   |
|  Wizard             +5            +2 / 1 level    |
|  Adventurer         +4            +2 / 2 levels   |
|  Cutpurse           +4            +2 / 4 levels   |
+---------------------------------------------------+
               Table 4: Class bonuses


The matching bonus of Table 4 applies when the champion matches the spell. If the champion does not match but is wielding a wand that matches the spell, a matching bonus of +3 is used instead.
The level bonus is based on the level of the champion (Byte 0).

Next the attack bonus/penalty from mana adjustment (Byte 14) is added to the result.
A further +5 is added if a PowerStaff is equipped.

Now subtract the spell difficulty found in Table 1.
Finally the Spell Cool Down Timer (Byte 15), is subtracted from the result. Only half the Spell Cool Down Timer is subtracted if spell, equipped wand and champion are all matching.
Spell Cool Down Timer then increases by Spellcost+5 (ref. Table 1) to a maximum of 100.


If the final attack value plus 3D6 is less than 0 the spell fails, otherwise the spell succeeds. :)

EDIT:
The roll was of course the more natural 3D6 (three dice of value 0-5 plus 3)
« Last Edit: August 01, 2019, 07:24:18 PM by adrazar »
Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Spells
« Reply #22 on: August 01, 2019, 07:47:40 PM »

wow, that is a lot of information, and very detailed, thank you!

You might need to give me a little time to take all this in before i comment too far. I will have a look at how to get this into the game-data/resourced code and labels.... plus getting this into the wiki / hacking guide!


quick - someone give him another bit of code to work through ;)
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: Spells
« Reply #23 on: August 01, 2019, 09:57:26 PM »

For references:

Label adrEA00685E = Spell  Cost table
Label adrB_00683E = Spell Difficulty table

Just getting my head around how i'm going to go through the section to get this understood in the code.
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

MrFlay

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 11
  • Generic Amiga User
Re: Spells
« Reply #24 on: August 06, 2019, 05:27:11 PM »

I'm back from vacation and very happy about the great news.
Soon will take a closer look at this. Thank you all!  8)
Logged
Pages: 1 [2]   Go Up
 

TinyPortal 2.2.2 © 2005-2022