Zanzarah Steam release: HiRes/Language fix available here.

Benutzeravatar
modder
Fahrer(in) des Doktors
Beiträge: 7
Registriert: So 23. Aug 2015, 23:08

Zanzarah Steam release: HiRes/Language fix available here.

Beitragvon modder » Mo 24. Aug 2015, 00:07

UPDATED: 08/29/2015 Language packs available: DE/EN/FR/RU

UPDATED: 08/28/2015 New version of the patch fixes remaining ratio and interface bugs


Hello,
I've been a fan of Zanzarah for almost 15years and was very pleased to see it offered a new life through Steam,

many thanks for that.

Unfortunately the provided game files are from the original 1.010 build that dates back to 2002/2003. It was left

unchanged by Daedalic who probably don't even have the source code available to attempt modifications on the

program.

It means the game is limited to a maximum resolution of 1024x768x32b and that's very annoying.

So in hopes of making the play-through more enjoyable for people backing off the game because of the low res I

made a set of patched binaries that allow for arbitrary screen sizes.

Here's a simple python script that will patch the "zanthp.exe" provided by Steam to the desired resolution:

Code: Alles auswählen

#!/usr/bin/python
from struct import pack

RES_X,RES_Y = 1920,1080
resX = pack("<L", RES_X).encode("hex")
resY = pack("<L", RES_Y).encode("hex")

p1 = [0x001078, "9090"]
p2 = [0x006762, "c7442410"+resX+"c7442414"+resY+"90909090909090909090909090909090909090909090909090"]
p3 = [0x01128c, "e90e2c1900"]
p4 = [0x0f5c43, "59595968"+resY+"68"+resX+"5233c99090"]
p5 = [0x1a3e9f, "8d732c8bcec7442408"+resX+"c744240c"+resY+"e9d8d3e6ff"]

with open("zanthp.exe", "rb") as f: blob = f.read()
for p in [p1, p2, p3, p4, p5]: blob = blob[:p[0]] + p[1].decode("hex") + blob[p[0]+len(p[1].decode("hex")):]
with open("zanthp."+str(RES_X)+"x"+str(RES_Y)+".exe", "wb") as f: f.write(blob)


And here are some links to download already patched binaries for various setups:

http://www.multiupfile.com/f/372c936e
http://multiupload.biz/m238ooea6aaf

Includes:
1920x1200
1920x1080
1600x1200
1600x1024
1600x900
1400x1050
1366x768
1280x1024
1280x960
1280x800
1280x720

My advice would be to run the script on your own installation of the game instead of using the provided binaries,

malware could be hidden in there, who knows... ;-)

To run the script yourself just:
- install python's 2.7 branch: https://www.python.org/downloads/
- put the file "patch.py" inside your installation folder (Zanzarah/System) where "zanthp.exe" is located.
- Edit patch.py using any text editor and replace "1920,1080" at the top with the desired value.
- Run patch.py by double-clicking.

It will create a new copy of the program "zanthp.exe" named after the chosen resolution like

"zanthp.1920x1080.exe".

When it's done just double click on this new "zanthp.1920x1080.exe" to run the game.

After that, the "zanzarah.exe" launcher has no use anymore, you could just delete it and replace the desktop

shortcut to run the game by a shortcut to your new ""zanthp.1920x1080.exe".

note: when using the patched version of the game the drop-down startup options menu "Video/Mode" is disabled.

Resolution won't change anymore when modifying that option. Only the selected color depth mode is relevant, just

select any mode with either 16 or 32bits depth and your game will run using that depth at the fixed resolution as

per the patch.

Finally here's a screenshot from the result, running at 1920x1080x32, enjoy this wonderful game in all its glory:

Bild
Zuletzt geändert von modder am Sa 29. Aug 2015, 12:08, insgesamt 4-mal geändert.

Benutzeravatar
Galdring
Forenmoderator
Beiträge: 1089
Registriert: Di 28. Aug 2012, 09:48

Re: Zanzarah Steam release: Widescreen/HiRes fix available h

Beitragvon Galdring » Mo 24. Aug 2015, 18:47

Hello,

first of all: Many thanks for the effort you have put into this! You are actually right, we are just re-publishing the game, without the actual source code afaik.

Apart from that, there is one thing I have to say: We, Daedalic, cannot give support for your game if crashes occur when applying these changes and can not be held responsible for any possible damage to your game and/or PC.

Kind regards,
Galdring
Community Moderator
Daedalic Entertainment

Vielleicht habe ich deinen Schlüssel gefunden, Schnutzipu...

Benutzeravatar
modder
Fahrer(in) des Doktors
Beiträge: 7
Registriert: So 23. Aug 2015, 23:08

Re: Zanzarah Steam release: Widescreen/HiRes fix available h

Beitragvon modder » Fr 28. Aug 2015, 06:31

Hello again,

reading through comments scattered across the Interwebs pointing at the obvious flaws in the previous patch I decided to dive somewhat deeper into the game's binary and managed to fix the only three, but still game breaking, concerns:

- Bottom half of the combat HUD not showing in "widescreen" modes.
- Camera ratio fixed for 4:3 making Amy look fat in "widescreen" modes.
- People using 16bits color modes causing rendering artifacts

The new patch is the following, it is used the same way as the previous one and it will adjust screen ratio and interface position as well as fixing colors to 32bits for any selected screen resolution:

Code: Alles auswählen

#!/usr/bin/python
from struct import pack, unpack

RES_X,RES_Y = 1920,1080
resX = pack("<L", RES_X).encode("hex")
resY = pack("<L", RES_Y).encode("hex")
ratios,offsets = [round(640/480.0, 2), round(1920/1080.0, 2), round(1920/1200.0, 2)],[0, 0.25, 0.17]
r = offsets[ratios.index(round(RES_X/float(RES_Y), 2))]

p1 = [0x001078, "9090"]
p2 = [0x01128c, "e90e2c1900"]
p3 = [0x0f5c43, "59595968"+resY+"68"+resX+"5233c9894c2414894c2410b820000000"]
p4 = [0x1a3e9f, "8d732c8bcec7442408"+resX+"c744240c"+resY+"e9d8d3e6ff"]
p5 = [0x1a5fcc, pack("<f", RES_Y/float(RES_X)).encode("hex")]
p6 = [0x1a6508, pack("<f", RES_Y/float(RES_X)).encode("hex")]
p7 = [0x019430, "e987aa1800" + "90"*26]
p8 = [0x1a3ebc, "c74108"+resX+"c7410c"+resY+"c7411020000000c74114000000005ec20400"]
skills,icon,gauge,bars = [0x1a60ac],[0x1a7278, 0x1a727c],[0x1a7290, 0x1a7294],[0x1a6e6c, 0x1a72ac]

with open("zanthp.exe", "rb") as f: blob = f.read()
for p in [p1, p2, p3, p4, p5, p6, p7, p8]: blob = blob[:p[0]] + p[1].decode("hex") + blob[p[0]+len(p[1].decode("hex")):]
for i in (skills+icon+gauge+bars):
    t = unpack("<f", blob[i:i+4])[0]
    blob = blob[:i] + pack("<f", t-t*r) + blob[i+4:]
with open("zanthp."+str(RES_X)+"x"+str(RES_Y)+".exe", "wb") as f: f.write(blob)


I'm fairly confident this makes the HD experience of the game identical to the original while not introducing any side effects but as always: use at your own risk.

Screenshots for fixed ratio and fixed combat hud, 1080p:

Bild

Bild

Patched binaries:

http://multiupload.biz/xgwf0l9dl9qa
http://www.multiupfile.com/f/2317c99a

Includes:
1920x1200
1920x1080
1680x1050
1600x1200
1600x900
1400x1050
1366x768
1280x960
1280x800
1280x720

It might be better for everyone if Daedalic published an updated replacement "Zanzarah.exe" launcher that polls the available screen modes, displays a selection menu and "hot" patches the game in RAM using that setting before running it without ever modifying the file stored on disk nor making steam complain about file integrity. You are welcome to reuse the provided code guys, it's free.
This should not take long to make and would greatly improve the value of the edition just released to steam.

Anyways, thanks for reading, have fun everyone!

Benutzeravatar
ShardofTruth
Clown(in) der Traurigkeit
Beiträge: 1
Registriert: Fr 28. Aug 2015, 08:38

Re: Zanzarah Steam release: Widescreen/HiRes fix available h

Beitragvon ShardofTruth » Fr 28. Aug 2015, 08:46

I just had to make an account to personally thank your for the updated patch. Zanzarah was one of my most favorite games back then (and kind of still is) and you did what Daedalic wasn't able/willing to do: showing it in all its glory.

Thanks you very much.

Benutzeravatar
rotator
Clown(in) der Traurigkeit
Beiträge: 1
Registriert: Fr 28. Aug 2015, 09:06

Re: Zanzarah Steam release: Widescreen/HiRes fix available h

Beitragvon rotator » Fr 28. Aug 2015, 09:16

Dear modder,

Just like ShardofTruth I've registered here only to thank you for your excellent work. Daedalic should hire you and pay you to make an updated, fully Steam-compatible version of this magnificent game. Zanzarah deserves greater care than just releasing an untouched ancient binary. Shame on Daedalic and thanks again for your fix!

Benutzeravatar
modder
Fahrer(in) des Doktors
Beiträge: 7
Registriert: So 23. Aug 2015, 23:08

Re: Zanzarah Steam release: HiRes/Language fix available her

Beitragvon modder » Sa 29. Aug 2015, 10:56

Hello again,

(thanks for the supporting comments :-) )

Only the English/US language pack is provided in the steam release.

So I gathered a few of the missing localizations for Zanzarah 1.010.

Those weren't made by myself but they are the original language files from the old Zanzarah releases:

http://www.multiupfile.com/f/17fd3197
http://multiupload.biz/up4r2cq8i2i2/

How to use it:
- The archive contains 4 different "Data" folders. One for each available language.
- Overwrite the files in your "Zanzarah/Data" folder with the content of the chosen "Data (XX)" folder for your language.
- Play!

Included localizations:
- DE (German)
- EN (English)
- FR (French)
- RU (Russian)

What it does:
- All text items are translated. (Dialogs/Interface)

What it does not:
- Text embedded inside graphic items is not translated. (negligible)

There might have been other versions but unfortunately I wasn't able to find them. Hopefully those ones cover most of wishlist.

Enjoy!

Example"DE":

Bild


Example "FR":

Bild

Benutzeravatar
Ozangel
Clown(in) der Traurigkeit
Beiträge: 3
Registriert: Fr 11. Sep 2015, 13:17

Re: Zanzarah Steam release: HiRes/Language fix available her

Beitragvon Ozangel » Fr 11. Sep 2015, 13:26

thanks for the patch b ut I am having problems with it. I downloaded all the binaries and placed them in the right foler. each one plays well but I am unable to use any of them a second time. When I double click on them I get the initial screen with the grey out serial but when I click OK, the game fails to launch and exits back to the desktop. I am running windows 10 with a Nividia GeForce 750 and 4 GB , 32 bit Intel 760 2.66 GHz would love to know how to fix this.

Benutzeravatar
ghost_zero
Clown(in) der Traurigkeit
Beiträge: 1
Registriert: Fr 11. Sep 2015, 18:07

Re: Zanzarah Steam release: HiRes/Language fix available her

Beitragvon ghost_zero » Fr 11. Sep 2015, 18:09

Just wondering but is there a way to increase the font size slightly after applying the Python patch?

Benutzeravatar
modder
Fahrer(in) des Doktors
Beiträge: 7
Registriert: So 23. Aug 2015, 23:08

Re: Zanzarah Steam release: HiRes/Language fix available her

Beitragvon modder » So 13. Sep 2015, 16:36

ghost_zero hat geschrieben:Just wondering but is there a way to increase the font size slightly after applying the Python patch?

The font size itself can be increased through some multiplier constant somewhere yes.

But changing these values will in turn break the whole game's interface as the text will be too big to fit in the various boxes and buttons when applied on the background images for inventory and menus. The fairies' stats won't be snapped next to the correct pictures &c.
To make a proper text size patch you then have to resize those images too.

Unfortunately I'd rather not attempt this modification.

In case you or anyone else wants to go down that path here's another piece of code I wrote while investigating the screen ratio issues to extract the game assets from the packaging format used in "Resources\\DATA_0.PAK":

Code: Alles auswählen

#!/usr/bin/python
from struct import pack,unpack
import os

datasize = os.path.getsize("DATA_0.PAK")
f = open("DATA_0.PAK", "rb")
f.seek(0x4)


while f.tell() < 0x7876c:
    filelen = unpack("<L", f.read(4))[0]
    namelen = unpack("<L", f.read(4))[0]
    name = f.read(namelen).lstrip("..")
    pos = unpack("<L", f.read(4))[0] + 0x7876c + 8
    fpos = f.tell()
    f.seek(pos)
    print name
    if not os.path.exists(os.path.dirname("unpacked"+name)):
        os.makedirs(os.path.dirname("unpacked"+name))
    with open("unpacked"+name, "wb") as g:
        buf = ""
        while "0202000001010000".decode("hex") not in buf:
            if f.tell() + 16384 >= datasize:
                buf += f.read(datasize - f.tell())
                buf += "0202000001010000".decode("hex")
                break
            buf += f.read(16384)
        g.write(buf[:buf.index("0202000001010000".decode("hex"))])
    f.seek(fpos)
f.close()


This code cannot repack the files as I didn't have a need for that feature at the time but it's quite simple to code the same operation backwards.
It creates an "unpacked_data" folder with the whole tree of resources. (images/textures/sounds...)

Then you can edit any file and make a Pikachu textured fairy as well as resizing backgrounds for the interface.

Finally, the constants used for the position/scaling of the various elements of the UI are all in the ".rdata" section of the binary starting around "0x5A5B48" in memory. Those are noticeably 32bits floats and the rest are just pointers you can ignore.
By changing them one at a time and eliminating bad candidates you can find the ones related to text manipulations pretty quickly.

The only problem with this game is that it crashes every time the window is minimized so it makes the thing difficult to debug in real time, going to the debugger window just crashes the program and you need to patch/restart it to view the result of a modification.

Using a kernel mode debugger on a virtual machine running the game would workaround that problem but it's an overkill answer to the matter at hand and I'm not going to dive into antique DirectX7 pipeline madness to fix the crashes themselves.

Good luck! :-)

Benutzeravatar
modder
Fahrer(in) des Doktors
Beiträge: 7
Registriert: So 23. Aug 2015, 23:08

Re: Zanzarah Steam release: HiRes/Language fix available her

Beitragvon modder » So 13. Sep 2015, 17:11

Ozangel hat geschrieben:thanks for the patch b ut I am having problems with it. I downloaded all the binaries and placed them in the right foler. each one plays well but I am unable to use any of them a second time. When I double click on them I get the initial screen with the grey out serial but when I click OK, the game fails to launch and exits back to the desktop. I am running windows 10 with a Nividia GeForce 750 and 4 GB , 32 bit Intel 760 2.66 GHz would love to know how to fix this.

This is a strange problem which could have a wide range of causes.

By "I am unable to use any of them a second time" do you mean that the game works correctly the first time you run it and never after that?
Do the patched binaries work again "only once" after you reboot your computer?
Does the original/unpatched game, run multiple times as expected using the "zanzarah.exe" launcher ?
Does the original/unpatched game, run only once, just like the patched one when you run the original "zanthp.exe" through a desktop shortcut with the option "-zanzarah" at the end?

If all of this stands then I suspect the following is happening:

You can only run one copy of the game at a time.
When using the patched game you're not using the "zanzarah.exe" launcher anymore.
"zanthp.exe" crashes when returning to desktop/exiting. The "zanthp.exe" process stays stuck as a ghost in the windows process manager and doesn't get cleaned by the parent "zanzarah.exe" process.

Two ways to fix this:

- Backup your original "zanthp.exe" and rename the patched program from "zanthp1920x1080.exe" to "zanthp.exe". Finally replace the original with it. Now you can run the patched game through "zanzarah.exe" and this will probably fix the problem.

alternatively:

- When the game exits and it refuses to start again, open the windows task manager (ctrl+shift+esc), then in the "processes" tab listing all open programs you will find one that is called "zanthp1920x1080.exe*32", kill it.

The first solution is permanent, the second solution has to be repeated each time, so you might want to try the first one and see if it works.

Other causes for the problem may include steam file integrity verification kicking in and reversing the patch or maybe and AV product doing the same. But that's unlikely.


Zurück zu „Technische Unterstützung / Technical Support“

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast