Did you just spend 5 turns buffing a unit or 30+ turns leveling it up to max level? Well, it instantly dies to a max strength psionic blast/lightning bolt/magical focused fire in the first turn of combat before you can even do anything. It has elemental armor + iron skin + holy armor + true sight + bless? Doombolt instantly kills most ultra-elite priests/magicians.
And the AI doesn't even do the -4 spell save items + death spell combo.
Is there some trick i'm missing? i'm getting really annoyed trying to keep support units and low level heroes alive because the AI just one shots them with a high power spell before i can do anything, and getting the magic immunity spell forces me to go sorcery heavy (and its not alive till late game).
I cant even resurrect heroes unless i have a substantial amount of life spell books.
I've noticed a weird spot on the map at the top edge.
This also happens to be the first time I get random overland crashes, like once every 100 or so turns played.
By random I mean that if I reload the game it will not crash in the same turn again, so there isn't any consistent flaw anywhere that would trigger a crash.
So I started wondering, as you can see there have been a lot of Armageddon spells flying around. And lots of volcanoes reverting. Could those cause some memory corruption if they happen at the edge of the map? Or is the tundra generation flawed?
Did anyone encounter a similar problem? Was it with or without Armageddon? Did your game crash at end of turn at unpredictable times?
According to wiki, Spell Ward has no effect on town curses at all. I haven't changed this myself, and nothing in insecticide mentions this either.
Despite that, this happened :
Was this actually fixed? Was it never a bug? Or could it be that it only counters this one spell? Or specific spells only?
another Spell Ward problem, I had a unit moving towards a city but it got warded. The dialog saying I can't enter pops up but no matter how many times I click it keeps coming back. I assume units don't lose their movement point and keep trying to enter
It seems that most fantastic units are much more expensive and weaker compared to normal units...
You can easily get end tier normal units like paladins, elven lords, etc much much earlier before you get mid tier summons like stone giants. The normal units are much more powerful and will keep getting more powerful as they get experience, access to mithril/admantinium and most unit enchantments are limited to normal units (flame blade, holy weapon, etc).
Only when you start hitting stuff like sky drakes, etc are they noticeably more powerful than normal units, but why waste 500 mana summoning a unit that struggles to kill trash units that the AI throws at you, when you could spend some gold to rush buy paladins or whatever? Gold is much easier to get and if you have even a couple of cities linked with roads, your gold income just sky rockets.
I usually end up allocating no power into mana and just putting most into research/casting skill because there's only one way to increase casting skill, while you can just convert gold to mana. You don't even need alchemy to afford the exchange rate.
I tried using a stack of storm giants once and the AI's unbuffed, veteran slingers, with only magical weapons, managed to kill one of them while the giants took forever to kill anything. Great mana investment right there.
Most of the dangerous summons seem to be multi-figure units like gorgons or have very high stats for a single figure unit. Otherwise, they feel like a joke.
When summons that cost hundreds of mana and have a mana upkeep of 10+ mana per turn are getting slaughtered by the AI's unbuffed veteran level normal units, why bother using the summons? Upkeep of 4 gold + 1 food vs 10+ mana is really hard to justify. It's not like the summon is anywhere close to being twice as good.
I noticed a wizard who is not in the game anymore is shown in the astrologer.
I vaguely remember this happening in the original game too.
Anyone encountered this bug?
The fortress is still marked inactive and the wizard is not casting spell of return.
Could it be a display only problem with F4 and F5 or is it some deeper problem?
(October 26th, 2015, 06:31)MrBiscuits Wrote: I have to say these changes sound absolutely amazing, thanks for putting the massive amount of work in.
I have to ask how you are able to understand the code and mod the changes, could you give a very brief outline of how you do it? Also I am wondering whether you would consider making a repository for your code so others can see each change and where it occurs in the code.
Basically it's 6 steps
1. Disassemble the code with a disassembler (IDA is recommended)
2. Figure out what the referenced data structures contain (This one is hard but you only need to do it once per data structure)
3. You need to be able to read and understand 8086 assembly code and write new code for some of the more advanced tasks
4. You need to find where the code you want to change is within the exe and what is the problem with it in case of fixing a bug.
5. If the change needed isn't something as simple as replacing "add 3" with "subtract 2" you need to find useless parts of the code that do nothing and remove them, then rearrange code so that the empty space is where new code is to be inserted, all of this using just the hex editor. Including recalculating all offsets for all jumps pointing to the moved code.
6. After step 5 is done, you use an assembler to compile the code you want to insert and add it into the space you made.
Then you run the game and see if it works, and use the disassembler to make sure all offsets and code was properly inserted. Miscalculating the offset even by 1 makes the code unstable and do totally random things.
It usually takes many times of doing step 5 and 6 until the result works as intended, as it's quite easy to overlook some detail.
I'm not going to make a repository because it would increase the amount of work many many times.
Instead, after the mod is complete (or at least reaches 1.0), I will make a differential file of this and 1.40n and split up the changes into individual files addressing various fixes, then gather the general purpose ones and apply them to 1.40n and release it as a "Raid 1.50" bugfix release. The individual files will also be available for public.
Unfortunately a lot of the AI logic won't be compatible because some changes depend on others.
For example the change of Lionheart uses the space gained through the removal of Black Channels. The new AI logic for battle spell choices is inserted to where the choice for Word of Recall was, as that spell is now gone. A lot of AI changes are related to spells having new effect, and it would be a huge work trying to separate all of these from changes involving the unchanged spells. However, where it's obvious which change the code belongs to, will all be separated, eventually. I want to make sure everything works perfectly before I start doing that, there is no point separating individual changes when there still is a chance they need to be further altered.
Also, although I name the identified variables and such to make the disassembled code readable, those names are only saved for the original wizards.exe. The changed exe will not have the names inserted because it is a different, just similar exe file that has to be disassembler from zero every time I open it after a change. I don't think the disassembler has the function to export names from one exe to another, changed copy of the same file, although it would be nice if it could do that.
For reference, the two hardest things to do so far were
-Making the AI use the "grant gold for killing enemies" event which was completely unused. This required the making of over 160 bytes of space, and writing new code of that size (roughly 50 lines). Doesn't sound that much but the truth is 160 bytes are a lot when a single instruction is 2-6 bytes and you have to remove existing code to make the space. Fortunately compiled code such as wizards.exe often contains redundant calculations, but not always and not everywhere.
-Making Spell Ward counter combat spells of the same realm. This needed about 80 new bytes in a much tighter area than the previous, and it had to use data I wasn't yet familiar with, the "combat copy of city enchantments" one. I found that out the hard way, after seeing the normal city data is swapped out during combat from the memory.
Compared to this, changing alliance to ignore your units near towns was a single byte change, had to make the jump related to it go to the "end of procedure" instead of the "give the warning" and that's it. Of course, figuring out all the diplomacy variables to the point that I was able to recognize this code is giving the warning took weeks of reading the code and identifying parts and effects.
Below is the code I inserted for the gift gold event, and it had to be separated to 2 parts because that's how I was able to get enough free space.
cmp byte ptr [bp+0Ch],8
jnz skipall ; Action type=killed units in combat
cmp di,0
jnz skipall ; Performed by the player
mov cx,1
allwizardsloop:
cmp cx,si
jz nextwizard ; Skip the wizard being hurt
mov ax,cx
mov dx, 4C8h
imul dx
add ax, si
mov bx, ax
cmp byte ptr [bx-5FDEh], 3 ; 'üE
jnz nextwizard ; Skip if they aren't at war with the victim
mov ax,[bp-2] ;Use base diplamatic value not charismatic one
neg ax ; as a positive value
sar ax,1 ; Effect/8
cmp ax,1
jl nextwizard ; No effect if it's too weak
mov bx,cx
cmp byte ptr[bx-5FCCh],0 ; Skip if wizard already wanting to talk about something else
jnz nextwizard
mov byte ptr[bx-5FCCh],6 ; Event type 6 thanks for attack
mov bx,cx
add [bx-5FE4h],ax ; add the points
shl bx,1
mov [bx-5FD8h],20 ; counts as though it was a +20 effect to avoid overwriting with trivial things
mov [bx-5FC6h],si ; set victim as referred wizard
push ax
mov ax,cx
mov dx, 4C8h
imul dx
mov bx, ax
pop ax
add [bx-5FE4h],ax ; add the points to other side too
cmp byte prt [bx-5FDEh],2
jnz nextwizard ; done if no alliance, otherwise
mov dx, [bx-5DE0h] ; wizard's gold
sar dx,1 ; halve it, not giving more than half owned
cmp dx,0
jz nextwizard ; can't give gold if not having any
call alliance
alliance:
push bx
mov bl,64h ; Multiply effect strength by 100
mul bl
pop bx
cmp ax,dx
jle ok
mov ax,dx ; max gold given is what we have/2
ok:
sub [bx-5DE0h],ax ; deduce spent gold
mov bx,cx
mov byte ptr[bx-5FCCh],2 ; Event type 2 pay gold instead of just saying thanks
shl bx, 1
mov [bx-5EFAh], ax ; Offer this much gold*100
add [-5DE0h],ax ; player gain the gold
mov [bx-5FA2h],si ; set victim as referred wizard
retn
As you can see, the code tells nothing about where it goes or how the space is made for inserting, so it's not really useful for the public.
Thanks for your swift and comprehensive reply. It's more complicated than I originally thought!
I downloaded IDA and got it to dissemble the Wizard.exe, but I'm struggling to navigate to even start looking at the code. I have a tab called "Hex view A" that just contains lines like these and none of the sort of machine code that you wrote above:
seg038:0CC0 82 00 74 13 83 3E AA 82 00 7E 0C 0E E8 10 FF C7 é.tâ>¬é.~Þ Ã
How for example would I look at the machine code for where the program "starts" ? And then how would you follow the code from that point?
I don't understand why you need to create space before adding new code. What would happen if you added code without freeing up the space first? Is there no way of adding things without removing other things first and just change the reference to point at the new space?
Point 5 in your list looks the most difficult to me, I hadn't quite realised how restricted you were when making changes. I wonder if some custom tools could be written to make this stage much easier and less painstaking. Or somehow find an alternative solution to stage 5 in your list.
Sorry for all the question, I've done a fair bit of coding but never anything quite like this before. I'm going from "maybe I could help out" to "how on earth is that even possible". If this is cluttering up your mod thread too much maybe we could move this discussion to a new topic instead.
Also I am curious, do you think it would be possible to rewrite the code from scratch using the disassembled code? Not that I think it would be a good idea and it is obviously a huge amount of work, it's just something that I'm wondering about. It might be easier in the long run than messing around with hex code for each tiny change.
And I'm glad that you are going to split up the changes and add them as a bugfix release. I had visions of you arriving in a whirlwind, make this amazing mod and then disappearing without anyone knowing how you managed to do any of it.
In case one of the other opponents clicks my thread.
By accident or "accident"
I actually clicked Old Harrys thread and read first post, before realizing that this was that lurker-ranking-start thing and that I was actually playing
So not really accident, more "accident" due to extreme Molachian idiocy.