Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - 8bitKittyKat

Pages: [1]
1
Of course, but ScummVM also adds their own internal patches to SCI script bugs so you won't have to manually patch your game.

You can take a look at one such fix: https://github.com/scummvm/scummvm/commit/87afecfe1394398c18324ec06dc628eb2e923e9d

It's a bit involved to fix it in ScummVM but you can try seek the devs (especially SluiceBox) on discord for help.
Ah, I didn't know they had their own patches in the engine.  Personally I use DOSbox 99% of the time.  I'm not sure I want to add additional work by writing a patch for ScummVM too, especially since I'm not done yet and this bug is proving to be stranger than I first thought, but my github repo is public and if when I'm finished someone wants to port my work, that's fine by me.

2
Just did some quick testing and it's looking like the bug isn't in v1.000 of Hero's Quest.  I don't have a decompilation of that version aside from what I can get through SCI Companion's tools unfortunately.

That's a very interesting bug!

Have you considered writing a patch for ScummVM as well?
ScummVM works with SCI patch files, which is what's I've included in the zip, so it should just work if you put the files in the game folder.

3
When I started working on my bug fix I did a search for any scripts with "if (CastSpell spell)" outside of a switch and restructured those bits of code, so yeah, I probably didn't need to every instance.  I'll go through and see what rooms were unnecessary.  Also I did see the redundant spells in some rooms.. I had a bit of an itch to tidy it up when I saw it, but I had to remember I'm trying to patch a bug and not needlessly rewrite a whole bunch of code!  That would be.. a whole other beast.

Thanks for the thorough explanation.  I'm very new to SCI and still a novice programmer so it's appreciated. I'll be fixing up the EGA patch soon and doing more testing on it.  Then on to the VGA patch.

4
That is really awesome!

I hope to be able to take the time and really see what’s going on. If I had to guess I’d say for the EGA one, the room-specific code isn’t claiming the Said event as finished, so it runs the room specific code first, then runs the generic code, thus double-casting the spell.

Amazing find, and fix! Great work.
Cool find. Here's what I see in the buggy QfG1EGA code.

When "(if (CastSpell spell)" is used before "(switch spell", it's always casting the spell, even if there isn't a switch case for the spell the player typed. So it gets cast twice in these rooms, once by the (CastSpell spell) procedure and then again in Main's default spell handling. Any spell that does have a switch case in the buggy rooms, like (DETMAGIC in bearCave, *should* only consume mana once. This is because the event gets claimed, not sent back to Main for handling like spells that aren't matching a switch case do.
I was looking at the code again earlier because apparently I missed a couple rooms, and was beginning to think it might be something like that.  Thanks for confirming it!

5
Also, if anyone wants to see the bug themselves before patching the EGA version, the best place I found to test was at the waterfall.  Check your mana, cast fetch, and then check it again.

6
So, the other day I was playing QFG1, the VGA version, for the first time in a few years, and ran into a bug I'd never noticed before.  I was in the kobold's cave, a bit low on mana, but still had enough to cast a spell.  Except the game told me I didn't have enough mana for the spell when I tried to cast it.  What the heck?  So I gave up and left, restored my mana and continued on playing.  But I never forgot about that odd bug.  I completed the game, but came back to it after I was done to poke around a bit, and see if I could figure out what had happened.

My first discovery was that a couple of my spells cast in the kobold's cave cost twice the normal amount of mana.  Out of curiosity, I decided to see if the EGA version had a similar quirk.  This is where things got interesting.  Not only did it have the same bug, but it happened with more spells.  So I dug into the SCI Decompilation of QFG1EGA with SCI Companion and (after wayyy too much time looking at the code and trying to figure out exactly where the bug was occurring) eventually discovered that there were 11 separate room scripts that had this bug.  Best I could gather from comparing code between rooms where spells do something unique came down to the unique spell code being nested within a block of code that checked if the spell could be cast.  The rooms where this bug didn't occur put the code that checked if the spell could be cast inside each of the spells coded for the room.  I'm admittedly just a novice programmer, so I'm not exactly sure why this distinction made all the difference, but I found my solution and fixed up the scripts for the 11 rooms this bug occurred in.  The VGA version is a bit of a different beast with a similar bug, but it seems to occur less frequently.  I admittedly haven't fully figured out the bug for the VGA version yet, but I'm working on it.

I've posted my work (forked from ErikOakford's SCI Decompilation) up on Github if anyone wants to take a look.  It hasn't been fully tested yet but with the limited testing I did on my own, everything seems to be working fine with spells now.  You can also download a zip of patch files for the room scripts there, but I'll attach it here as well.  Also, I was working with v1.200 of QFG1EGA so I'm not sure how compatible it would be with any other version, or the original Hero's Quest release.

If anyone more knowledgeable with SCI than me has any insight into the bug, I'd love to hear it.  The original code in theory looks like it should work, and it does look cleaner, but it just doesn't work the same.

Link to the Github repo!

Pages: [1]

SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.024 seconds with 21 queries.