Widescreen hack and some other fixes aka AiO Patch

Discuss Drakan: Order of the Flame with fellow players and post any technical problems here where an 'unofficial' support team will try and help you. Gameplay help questions can go here too.

Moderators: Arokhs Twin, mage150

UCyborg
Dragon
Posts: 226
Joined: Sun Jul 07, 2013 7:24 pm
Location: Slovenia

Widescreen hack and some other fixes aka AiO Patch

Postby UCyborg » Sat Aug 24, 2013 8:35 pm

ALL-IN-ONE UNOFFICIAL PATCH FOR DRAKAN: OOTF
For new users: To put it briefly, this is all-in-one patch containing every known bug fix for the game and the editing tools. Please read the included Readme for the most up-to date information about the patch as it contains everything you need to know (list of fixes, installation procedure and more). The patch also increases game version number to distinguish it from vanilla Drakan. If you have any further questions, you can post them here.

Because all-in-one may sound confusing, it's meant as all-in-one when it comes to unofficial improvements to the game not made by the developers who made the game, but rather the community/fans of the game. Therefore, official patch 445 must be installed before applying AiO Patch. It would be possible to literally make All-in-One Patch including the official fixes, but would require distribution of certain patched game data files that official patches also alter.

Last update: 9/25/2017

Download:
(Final) release, Second Edition (377/447)
Arokh's Lair, Google Drive, ModDB

CRC32: 7A955A8F
MD5: 08241326D7C0731C16DB36A339DFB4B5
SHA-1: 845D99A6B0E19B17E6311E22D6F9D093DC2974F8
SHA-256: 7FE8DDC28B8036A78FC17909FF2F40D9E497395D143E52E952C27CB75AAFAF7B

Drakan Gold Pack Enhanced
Contains fully updated game with majority of player-created levels. Known mods are also included, they can be installed at user discretion.

Bonus:
Hill of Fire - HD textures (credit goes to Mauva Malhar)

DLLs' source code:
https://github.com/UCyborg/DrakanAiOPatch
https://github.com/UCyborg/LegacyD3DResolutionHack

Complete list of changes compared to vanilla Drakan:
  • Fixed black menu background bug (occurs on newer graphics hardware).
  • Fixed crash after selecting difficulty or pressing ESC while on the difficulty selection screen.
  • Fixed crash after exiting Alwarren.
  • Removed special camera rotation mode from 'left' special combo (left-forward-attack).
  • Removed special camera rotation mode from 'back' special combo (forward-backward-attack).
  • Added 2 active 'hitting intervals' for 'left' special attack.
  • Removed 'stuck in block' bug.
  • Increased amount of allocated memory for one of rendering routines (increases FPS a bit in more complex levels).
  • Removed part of problematic code that has to do with lens-flare effects, prevents the crash during gameplay when there are lots of lightning effects, but you should still disable Lens Flare Effects under Graphics options, they cause quite significant lag spikes.
  • Level of detail (LOD) value is set to zero -> fully detailed in-game objects regardless of camera distance, small performance decrease, original LOD feature wasn't exactly doing miracles neither when it comes to excessive polygon counts in certain player-created levels, also fixes crash when setting FOV to a higher value.
  • Added code that adjusts FOV based on your selected resolution's aspect ratio, so you see more things at once and actually utilize extra horizontal space if you have a wide monitor.
  • Session creation failed error will no longer occur if running server on anything newer than Windows XP or under WINE (Linux) or when setting up listen server AFTER playing a multiplayer game on someone else's server (assuming ports server intends to use aren't in use by some other program).
  • Fixed crash that occurs if Giant grabs you just after your death. Note that I only added an extra safeguard that prevents the crash, but doesn't fix the actual bug. Should the situation occur, the screen won't start fading to black like it normally would and the game won't end, but you can reload the last save and move on like nothing happened.
  • Fixed ice effect not showing up on Arokh after being frozen by an enemy and game crashing the moment he is supposed to blow into pieces. This bug only occurred when bump mapping was enabled.
  • Increased Max Fog Distance that can be set under Graphics options up to 200% (same as 'foghack' cheat), also overriding Max Fog Depth setting defined by level designer.
  • Dedicated server stores graphics settings (the ones in Windows registry) separately. Useful because dedicated server window size is defined by game resolution setting and can't be resized.
  • Minimizing the game when in fullscreen mode and connected to online game no longer causes disconnect after 30 seconds.
  • NAT fix - server has been patched so that it no longer responds back to the client using the UDP port that was used on the client side to establish connection, but rather the port visible on the server side as the originating source of the first packet sent by client. This eliminates the most notorious 30s disconnect bug.
  • Fixed crash that occurs when game contacts running machine that has no server running (no more crashing in multiplayer menu or while running server if contacting master server fails).
  • Added some common resolutions for use in windowed mode.
  • Fixed crash due to stack buffer overrun that occurs when entering Graphics menu on machines whose graphics hardware exposes a lot of available resolutions.
  • Default value of MasterServerList variable in Drakan.cfg has been changed to "master.qtracker.com:27900,gsm.qtracker.com:27900" since GameSpy is gone.
  • Game settings that get stored in registry are now stored under local user's registry key instead of system-wide key (HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE).
  • Removed all calls to RegFlushKey API.
  • Fixed some codepaths not closing registry key handle after use.
  • Fixed Texture Filtering drop-down list in Riot Engine Options not indicating Trilinear Filter was selected.
UPDATE 12/1/2015: Added proxy DLL with following features:
  • Automatically applies compatibility fixes required for the game to work properly on Windows 8+.
  • Fixes game not remembering windowed/fullscreen setting if changed in-game.
  • Populates windowed mode resolution list with the ones detected in the system.
  • Adds borderless windowed mode, when window is in that mode, it will also minimize when it looses focus.
  • Enables resizing of dedicated server window.
  • Makes the game able to get the server list from Qtracker.
UPDATE 6/15/2016:
  • Ported relevant engine fixes over to Level Editor's Engine.exe.
  • Changed borderless window settings to off by default, they're kinda hacky.
  • Borderless windowed mode code now places the window on correct monitor if you move it from the primary monitor and afterward set the correct resolution.
  • Added option to set whether borderless window minimizes when it loses focus.
  • Added option to make borderless window topmost.
  • Added Direct3D resolution limit remover, the game can now run through the old Direct3D API at resolutions above 2048 pixels, if the hardware supports it.
  • Added mini AiO Patch for the demo version.
UPDATE 6/20/2016:
  • Fixed Direct3D resolution limit remover so it doesn't crash the game anymore on some Windows versions.
  • Fixed the bug with quick-save not saving the correct music track ID to the save file under certain circumstance.
  • Restored engine's original LOD feature, crash-free, with LOD factor configurable by the user.
  • Skip FOV calculations unless the aspect ratio is actually greater than 4:3.
  • Added compatibility database with some additional fixes for the game and the Level Editor.
UPDATE 7/1/2016:
  • 2 forgotten fixes for the Level Editor 3D Viewer.
UPDATE 7/2/2016:
  • Respect Max Fog Depth property of the level, permanent 'foghack' is now optional setting, upper limit is still 60 (200%), vanilla Drakan has this at 30 (100%).
  • Min Fog Depth lower limit decreased from 12 (40%) to 5 (16%).
  • Added FOV multiplier setting.
  • Level Editor: Fixed memory leak caused by original patch that fixed 3D view crash.
UPDATE 7/8/2016:
  • Restored mipmapping feature, lost with a patch that addressed black menu bug.
  • Increased maximum texture size limit to 1024x1024 (was 256x256).
  • Made executables Large Address Aware, maybe it proves beneficial in the future.
UPDATE 7/12/2016:
  • Level Editor Texture View Options dialog updated to accept maximum view size of 1024.
  • Level Editor now releases handles to the 3D Viewer process and its thread.
  • Added registry config with correct settings for running the editor through WINE.
UPDATE 7/17/2016:
  • Level Editor: Fixed crashes and bugs that were caused by recursive calls to SendMessage API (SendNotifyMessage FTW!).
UPDATE 7/23/2016:
  • Level Editor: Fixed 2 memory leaks (messaging problem), one occured when communicating STOMP time (STOP button), the other when painting in 3D window.
  • Level Editor: Changed default Level Properties regarding fog depth to be consistent with new engine limits.
  • Level Editor: Changed default value of Fog Limit in Calculate Layer Visibility window to be consistent with new engine limits.
UPDATE 7/31/2016:
  • Added updated Modeler.
UPDATE 8/11/2016:
  • Level Editor: Fixed some stupid regression that caused 3D view to error when selecting models.
UPDATE 8/14/2016:
  • Level Editor: Minor changes to used message sending APIs where STOMP time is involved, resolves memory leak when recording key frame.
UPDATE 10/13/2016:
  • Updated most of the levels' visibility data, with exception of Ruined Village and Volcano (Max Fog Distance at 200% is effective now).
  • Tweaked ballista and dragon NPCs to detect player sooner to compensate for larger viewing distance.
UPDATE 11/13/2016:
  • Implemented technically more correct fix for players being disconnected from multiplayer server when the game is minimized in fullscreen mode.
  • Controller Sensitivity slider under Options->Controls now allows minimum value of 0.1 (previous minimum was 0.6).
UPDATE 12/21/2016:
  • If game window doesn't have the focus, it will run at 15 FPS and sleep when the limit is reached to reduce CPU usage.
  • Level Editor 3D engine will idle unless the user is interacting with it instead of hogging the CPU while not doing anything.
  • Made game and Level Editor 3D engine's message loops more conventional (PeekMessage called without message filtering).
  • Removed DisableProcessWindowsGhosting hack, not needed anymore due to above fix, game will never appear frozen unless it's actually frozen.
  • Level Editor in conjunction with 3D engine now appears to run more stable due to message loop fix.
UPDATE 12/24/2016:
  • Embedded manifest in executables that enables Visual Styles, makes editing tools look more faithful to Windows theme settings.
  • Level Editor 3D engine: Added option Timeout that specifies how much time passes with no activity before PeekMessage function is redirected to GetMessage.
UPDATE 2/2/2017:
  • Fixed the glitch with some things not being initialized on the level transition if the game was minimized and in fullscreen mode.
  • Added dedicated server launcher which automatically restarts it if it crashes.
UPDATE 2/8/2017:
  • Reverted fix from previous update due to severe stability issues.
  • Fixed text corruption when multi-sample antialiasing is forced via graphics drivers (set Text Adjustment to Shifted in Graphics menu).
  • Allow 2048x2048 textures.
  • Taken care of some stupidities in dinput.dll, including doing things in DllMain that shouldn't be there.
  • Added compatibility database install/uninstall script for easier (de)installation.
UPDATE 2/16/2017:
  • Fixed some visual anomalies caused by new texel alignment code (scrollbar blur and vertical line through the map).
UPDATE 3/4/2017:
  • Fixed some layer visibility glitches in Alwarren.
  • Minor code fixes.
UPDATE 3/8/2017:
  • Fixed another visibility glitch in Alwarren.
UPDATE 5/10/2017:
  • Fixed regression from one of previous updates that caused dedicated server window to not refresh.
  • Added option to specify refresh rate.
UPDATE 5/31/2017:
  • Fixed some layer visibility glitches in Wartok Canyons (3 were also present in original level file, last one slipped in after visibility data update).
  • 445SP1 Patch features intended for usage of special attack animations in NoWhere level are now activated only for specified levels (see 445SP1 section in Arokh.ini).
  • 445SP1 Patch code for attack intervals was previously overwriting some unrelated code, this has been reverted.
UPDATE 6/5/2017:
  • Corrected HTTP GET request to have standard compliant line endings (server browser works again!).
  • Corrected issue with HTTP GET request not containing slash if URL lacked one.
UPDATE 6/7/2017:
  • Game will no longer display "This is not the correct version of Drakan for this territory!" message and quit if system locale is set to Japanese.
UPDATE 6/18/2017:
  • Fixed critical bug in Wartok Canyons since 5/31/2017 update, the floor with pushable stone to open wall door wasn't rendered.
UPDATE 6/19/2017:
  • Added a backup copy of NPCs.odb file (Drakan\Common\NPC\NPCs.odb.bak).
UPDATE 6/24/2017:
  • Fixed the remaining layer visibility glitches in Alwarren (hopefully that's everything).
  • Level Editor 3D engine: Removed Timeout option, it's not needed anymore.
  • Level Editor 3D engine: Hopefully no more hangs caused by dinput.dll.
UPDATE 7/3/2017:
  • Layer visibility optimizations in Grotto and Wartok Canyons.
UPDATE 7/31/2017:
  • Fixed a lot of layer visibility bugs in Ruined Village.
UPDATE 8/3/2017:
  • Minor layer visibility fixes in Volcano.
UPDATE 8/4/2017:
  • Another 2 missed layer glitches in Ruined Village were fixed.
UPDATE 9/2/2017:
  • ReceiveCallback functions now handle socket errors so they won't crash the engine anymore, eg. it was possible to crash the server by sending it an oversized query packet. The crash that could occur when leaving Join Game menu may be gone as well.
  • Replaced some duplicate memory management code in server query command processing functions with a call to common routine.
  • When combining multiple query commands, responses will be broken down in multiple packets only when the size of the previous one is approaching the maximum.
  • Added small routine to determine whether to tag the current query response packet with \queryid\#.# and/or \final\, previously this was under control of each query command processing function.
  • Sending a query string that begins with \secure\ command won't crash the server anymore.
  • \echo\ query command now responds with whatever was put as the second parameter.
  • Allow specifying server region code in the Arokh.ini file.
UPDATE 9/3/2017:
  • Game server will now notify master servers when it's shutting down.
  • Added master.333networks.com as one of the default master servers.
  • Added DirectSound DLL overrides in Drakan_Wine_Settings.reg.
UPDATE 9/22/2017:
  • Server browser now uses GameSpy protocol by default to get the server list.
  • Added more detailed status messages to the server browser, the original "Master Server Contacted" was very misleading.
  • Fixed the bug when refreshing server list could randomly corrupt process' internal state, among other things causing inability to connect to any server and the game process deadlocking on exit.
  • Resolved the problem with game temporarily freezing under certain circumstances when multiplayer session ends.
UPDATE 9/25/2017:
  • Just another minor layer fix in Ruined Village.
Wishlist/known issues:
  • There should be more blood, try running the game at 20 - 30 FPS and see the gore.
  • In multiplayer, players that had their game minimized and in full screen mode during level transition will slide across the level until their game is restored.
  • Fixing in-game map to not stretch on wide monitors would be nice.
  • Support for true-color textures, we only have 16-bit now. :(
  • Texture previews in Databases window don't work properly on Windows 8+ when they have to be downscaled to fit preview square.
  • Stupid random crashes of the game and editor might still occur at times, they seem rare though.
  • After using Control menu in 3D window, user must click anywhere outside of it then click on it to be able to regain camera control.
  • If above is not done right after Control menu usage, eg. Space is pressed before clicking outside, user may find the 3D engine laggy, scenario in which user should turn off camera control, click on menu, press Space to reset state variable, then do the procedure described in previous bullet.
  • With current editor tweaks, STOMP sequence playback is a little stuttery, but we do see animated characters in their correct animation state most of the time when we move the time slider.
  • Function for limiting 3D engine CPU usage may not work properly, particularly on really old systems. First try increasing Timeout setting in Editor/Arokh.ini maximally few times by 500, this may resolve startup hang. If it still freezes or crashes, delete dinput.dll from the Editor folder.
Some information below this point aren't relevant anymore. They're here only for historical reasons.

Hi everyone!

I recently got into Drakan again. Seeing community managed to squash most annoying bugs occuring on modern PCs, game pretty much works nicely with 445++ patch. Anyway, one thing that still bugged me, game offers every possible resolution your hardware can manage, but field of view remains at 80, which is OK for 4:3 resolutions, but kinda low for wide resolutions, everything's zoomed in. Command "fov" was also a no-go, since it crashed the game plus it's not fun to manually fix FOV every time. Oh, and there is also a slight problem with hosting multiplayer server, even with 10th Anniversary Mod, but more on that later.

So I decided to fire-up OllyDbg, hoping to figure something out. Long story short, I located the function which takes FOV as the parameter and some sub-function, which, among other things, calculates model Level of Detail value using some number calculated from FOV. 0.0 is maximum detail, higer values mean less detail as the camera moves away, anything negative is catastrophic, which is exactly what happens when you try to set FOV higher than 93.

Then, knowing what's the problem, I coded a small hack DLL with the following features:
  • Alters the model LoD calculation so it always returns 0 which fixes FOV related crash and makes characters, trees,... look nicer if looked at from the distance.
    EDIT: This is now part of patched Drakan.exe.
  • Automatic FOV adjustment for wide monitors.
  • Fixes "Session creation failed!" error on Vista and newer.
  • Ability to apply any combination of unofficial game patches on startup, configurable via configuration file.
    EDIT: Realized that the whole memory patching thing was stupid so all patches are now part of patched Drakan.exe and Dragon.rfl.
About that multiplayer bug...the problem is within inet_addr function. On Windows XP and earlier, it returns INADDR_ANY if empty string is passed to it, which is what Drakan does when setting up the server. But in later versions, the behavior was changed so it returns INADDR_NONE, which sorta tells the server to not listen on any network interface. Take a look here. This is easily solved by detouring inet_addr function and returning INADDR_ANY when empty string is passed. Also, the binary patch in Drakan.exe that comes with 10th Anniversary Mod only partially solves the problem, once the server is up, anyone who joins is kicked right after 30 seconds.

Before I move on to instructions on how to use the hack, I'd like to address something about Drakan's compatibility with modern flavors of Windows. It seems that patched Drakan doesn't require any compatibility fixes applied. But Windows is actually set to apply 3 so called compatibility shims to Drakan, which are:
  • EmulateCDFS - patched Drakan doesn't use CD in any way so this one is completely redundant.
  • IgnoreAltTab - this one is meant for applications which don't handle alt-tabbing well. Drakan does it perfectly well.
  • IgnoreLoadLibrary - don't know which DLL it's trying to ignore, but it also seems unnecessary.
These can be quickly disabled using registry fix I provided within archive. Now, let's assume you want to try out the hack right away, you have fresh installation of Drakan patched to 445 and admin rights in Windows:
  1. Extract Arokh.dll, Drakan.exe and Dragon.rfl from attached archive to your Drakan directory.
  2. You'll now need something to inject the DLL into Drakan when it starts, my favorite method is to set Windows to automatically do it every time the game is started, so extract Drakan.sdb from archive to Desktop.
  3. Go to Start menu->Programs->Accessories, right click on Command Prompt and select Run as administrator.
  4. Command window should open in your user profile directory, so now you just need to navigate to Desktop by typing in following command without quotes: "cd Desktop"
  5. Now that you arrived at your Desktop, type in the following command without quotes: "sdbinst Drakan.sdb"
  6. Message "Installation of Drakan SDB complete." should appear, meaning all went well and you have successfully installed custom compatibility database for Drakan which tells Windows to load Arokh.dll everytime you want to play.
  7. You're done, start Drakan as usual and enjoy!
These steps should work out-of-the box for Windows Vista and 7. You might need to adjust them a bit for Windows XP or Windows 8. In XP, you probably won't need to worry about running as admin unless you have limited user account, as for Windows 8, can't say anything about that since I sticked with 7.

You could achieve the same thing by downloading Microsoft Application Compatibility Toolkit from here and using Compatibility Administrator to create custom compatibility database with a special shim for Drakan called InjectDll and specify Arokh.dll as a parameter. In case you're familiar with the program and are using it to fix some other problematic programs/games, you'll probably want to add this fix to your existing database. WinJect 1.7 can also be used for DLL injection.

Any kind of feedback is appreciated!

PS: I forgot about compilation requirements, nothing fancy: Microsoft Visual C++ 6.0 or newer and Microsoft Detours 1.5

Edit: updated instructions for those who have User Account Control enabled since apparently you can't open command window with admin privileges right from the Desktop. Hopefully they will work for everyone now.

IMPORTANT UPDATE: I discovered alternative possible way to implement 445++ patch, not only solving crashes, but also fixing black menu background bug. Details in 14th post.
Last edited by UCyborg on Mon Sep 25, 2017 3:12 pm, edited 182 times in total.
"Once a profound truth has been seen, it cannot be 'unseen'. There's no 'going back' to the person you were. Even if such a possibility did exist... why would you want to?" - Dave Sim

User avatar
Arokhs Twin
Site Admin
Posts: 1056
Joined: Wed Jul 18, 2001 9:36 pm
Location: United Kingdom
Contact:

Re: Widescreen hack and some other fixes

Postby Arokhs Twin » Sun Aug 25, 2013 12:14 pm

Nice one, thanks for this. I will give it a try over the next few days and let you know how it goes. It could explain why users keep getting kicked from my server.

I have installed the fix the only issue I came across was when running the command sdbinst drakan.sdb. If you shift and right click on the desktop you don't have admin rights in the command window. I went to the start menu, found cmd.exe right clicked and selected run as administrator. I then manually browsed to my desktop using cd \users\%my username%\desktop and ran the command from there.

It has fixed the session creation failed error. All I need now is to see if someone can connect and play on my server without getting disconnected. You'll have to connect directly via the in game server browser as the gamespy master server does not appear to be working now. My IP is 212.169.37.181

Ill try out the single player later this week.
By fire and by blood I join with thee in the Order of the Flame!
Webmaster of Arokh's Lair

UCyborg
Dragon
Posts: 226
Joined: Sun Jul 07, 2013 7:24 pm
Location: Slovenia

Re: Widescreen hack and some other fixes

Postby UCyborg » Sun Aug 25, 2013 6:21 pm

Glad to hear you managed to get it installed without any further complications. I updated instructions so they should work for everyone, including those with User Account Control enabled, since that seems to cause inability to simply open command window from anywhere as admin.

I added yours and the other server IP that's mentioned on the front page to my game's server list so I'll come and join sometimes. BTW, I quickly fired up my server for a few minutes just to see if master server works and it showed up here in less than a minute http://bobzent.info/gsstatusget.php?game=drakan Can't say if it would show up in game though, since LAN servers always show up, if not, well, that's slightly inconvinient. Kinda odd if it's true that the game can register with the master, but can't download the list of servers.

You can quickly test if fix for Session creation failed error is properly working by setting up a dedicated server instead of a listen server, then join it and see if it doesn't kick you after 30 seconds. It shouldn't unless you installed 10th Anniversary Mod. It can actually be used with combination of my hack, simply install the mod, then extract Drakan.exe and Dragon.rfl from my archive because installer will overwrite them with buggy ones. The only problem is that the current version is quite buggy. I noticed FPS drops in some places, Arokh is almost invisible, except part of his wings, water is almost completely transparent and alt-tabbing doesn't work properly. I hope that Shelim will manage to fix all those problems someday, because the project itself is totally awesome.

Edit: updated instructions for 10th Anniversary Mod users.
Last edited by UCyborg on Fri Sep 25, 2015 4:39 pm, edited 2 times in total.
"Once a profound truth has been seen, it cannot be 'unseen'. There's no 'going back' to the person you were. Even if such a possibility did exist... why would you want to?" - Dave Sim

User avatar
Arokhs Twin
Site Admin
Posts: 1056
Joined: Wed Jul 18, 2001 9:36 pm
Location: United Kingdom
Contact:

Re: Widescreen hack and some other fixes

Postby Arokhs Twin » Mon Aug 26, 2013 12:57 pm

I'm now testing this patch in combination with the 10th Anniversary patch as the game constantly crashed when trying to join a game. Also it wouldn't register a game server with Gamespy's master server.
By fire and by blood I join with thee in the Order of the Flame!
Webmaster of Arokh's Lair

UCyborg
Dragon
Posts: 226
Joined: Sun Jul 07, 2013 7:24 pm
Location: Slovenia

Re: Widescreen hack and some other fixes

Postby UCyborg » Mon Aug 26, 2013 1:09 pm

One problem, 10th Anniversary Mod's Drakan.exe contains a broken fix for Session creation failed error, which breaks ability to join the server even if it's running on a Windows XP system where inet_addr function natively behaves as the game expects. Dang it, I wonder what causes your game to crash. Well, it's probably not implemented in the best way, but by default my DLL copies contents of all unofficial patches into the game's memory, including Anniversary fixes, except the broken one regarding Session creation failed error. Oh, and your server is listed here: http://tools.poweredbygamespy.com/maste ... ame=drakan

I got another idea though, I can send you a copy of 10th Anniversary Drakan.exe without that broken fix then you can turn off 445SP1, 445++ and Anniversary patches in Arokh.ini. If that won't work, then i'm out of ideas. I just need few minutes to compare the original Drakan.exe with the fixed one so i can remove the offending fix.
Last edited by UCyborg on Mon Aug 26, 2013 1:22 pm, edited 1 time in total.
"Once a profound truth has been seen, it cannot be 'unseen'. There's no 'going back' to the person you were. Even if such a possibility did exist... why would you want to?" - Dave Sim

User avatar
Arokhs Twin
Site Admin
Posts: 1056
Joined: Wed Jul 18, 2001 9:36 pm
Location: United Kingdom
Contact:

Re: Widescreen hack and some other fixes

Postby Arokhs Twin » Mon Aug 26, 2013 1:21 pm

Nope still locks the system solid when trying to join a game. Mouse cursor jammed, all you can do is ctrl+alt+del and manually end task. This is with 10th anniversary patch and your patch.

EDIT: Do'h if I start the game by running Drakan.exe rather than the 10th anniversary patch it does not crash but then it kicks me after 30 seconds even when the server is running on the same machine.
By fire and by blood I join with thee in the Order of the Flame!
Webmaster of Arokh's Lair

UCyborg
Dragon
Posts: 226
Joined: Sun Jul 07, 2013 7:24 pm
Location: Slovenia

Re: Widescreen hack and some other fixes

Postby UCyborg » Mon Aug 26, 2013 1:39 pm

Ok this will take a while, a lot of differences between the files and I can't remember the offset where that fix is located. In the meanwhile, can you try joining my server with just my patch applied: 31.15.163.139 Doubt it'll work but there's no harm in trying.

Edit: Oh, didn't know you were launching with 10th Anniversary Launcher. Must be some conflict or something. I'm currently running the server so I can't try if it crashes for me too. Hm, server console says you just left, but never joined :shock:
"Once a profound truth has been seen, it cannot be 'unseen'. There's no 'going back' to the person you were. Even if such a possibility did exist... why would you want to?" - Dave Sim

User avatar
Arokhs Twin
Site Admin
Posts: 1056
Joined: Wed Jul 18, 2001 9:36 pm
Location: United Kingdom
Contact:

Re: Widescreen hack and some other fixes

Postby Arokhs Twin » Mon Aug 26, 2013 1:44 pm

Working now. I forgot to back up the original drakan.exe and dragon.rfl.

All works fine no crashes and / or drops after 30 seconds.
By fire and by blood I join with thee in the Order of the Flame!
Webmaster of Arokh's Lair

UCyborg
Dragon
Posts: 226
Joined: Sun Jul 07, 2013 7:24 pm
Location: Slovenia

Re: Widescreen hack and some other fixes

Postby UCyborg » Mon Aug 26, 2013 1:50 pm

Ok, that's because our files don't match. Do you mind uninstalling Drakan and reinstalling? But keep your savegames, Drakan.cfg and my patch. It's really frustrating since i got 3 computers at home and multiplayer between them just works without any hitches.
"Once a profound truth has been seen, it cannot be 'unseen'. There's no 'going back' to the person you were. Even if such a possibility did exist... why would you want to?" - Dave Sim

User avatar
Arokhs Twin
Site Admin
Posts: 1056
Joined: Wed Jul 18, 2001 9:36 pm
Location: United Kingdom
Contact:

Re: Widescreen hack and some other fixes

Postby Arokhs Twin » Mon Aug 26, 2013 1:51 pm

Yeah, just edited my post. I uninstalled, re-installed, installed 445 patch and 10th anniversary. Think it was because I didn't back up and restore the original game files. Going to try dedicated server now.
By fire and by blood I join with thee in the Order of the Flame!
Webmaster of Arokh's Lair

UCyborg
Dragon
Posts: 226
Joined: Sun Jul 07, 2013 7:24 pm
Location: Slovenia

Re: Widescreen hack and some other fixes

Postby UCyborg » Mon Aug 26, 2013 2:00 pm

Oh great! Glad to hear it finally worked. So I don't need to fuss around with hex editor and OllyDbg :D When Shelim starts working on 10th Anniversary Mod again, he could implement all those fixes in it so we won't need any extra DLLs lying around and just have all goodies accesible by launching through that launcher. Until then, getting Windows to load extra DLL seems most convenient.
"Once a profound truth has been seen, it cannot be 'unseen'. There's no 'going back' to the person you were. Even if such a possibility did exist... why would you want to?" - Dave Sim

User avatar
Arokhs Twin
Site Admin
Posts: 1056
Joined: Wed Jul 18, 2001 9:36 pm
Location: United Kingdom
Contact:

Re: Widescreen hack and some other fixes

Postby Arokhs Twin » Mon Aug 26, 2013 2:08 pm

Dedicated server seems to be working fine too. Just deleted some of the crappier player made levels and all seems good.

Thanks for your hard work. At last this game is working on modern operating systems. Ill put something on the front page about it.
By fire and by blood I join with thee in the Order of the Flame!
Webmaster of Arokh's Lair

UCyborg
Dragon
Posts: 226
Joined: Sun Jul 07, 2013 7:24 pm
Location: Slovenia

Re: Widescreen hack and some other fixes

Postby UCyborg » Mon Aug 26, 2013 2:42 pm

No problem! Got your PM btw and I see front page is already updated so all is well :D
"Once a profound truth has been seen, it cannot be 'unseen'. There's no 'going back' to the person you were. Even if such a possibility did exist... why would you want to?" - Dave Sim

UCyborg
Dragon
Posts: 226
Joined: Sun Jul 07, 2013 7:24 pm
Location: Slovenia

Re: Widescreen hack and some other fixes

Postby UCyborg » Thu Aug 29, 2013 10:25 am

IMPORTANT UPDATE:

So, I wanted to get to the bottom of what was causing the game to crash at the difficulty screen in the first place. It looks like every time menus are displayed, DirectX's method CreateSurface is called for the purpose of creating additional special surface where the last frame is dumped, letting the game to set the last in-game scene as the main menu background when you pause it. Obviously, the function fails in most situations as the error that comes from system ddraw.dll file says that either the width or the height of the mipmap must be the power of 2. After examining the function parameters being passed, I came to the conclusion that removing DDSCAPS_MIPMAP flag from the DDSCAPS2 structure member dwCaps results in a successful call to the function, fixing both the black menu background bug (proof) and game start crash in one shot, making original variant of 445++ patch obsolete.

As for the Alwarren exit bug, no matter how hard I try, I just can't reproduce it on my system; With or without any patches and because the original 445++ patch just places a jump on 2 codepaths (thus preventing the game from refering to a non-existent surface). The first is executed when selecting the difficulty and the second is executed if the ESC button is pressed on the difficulty screen, so I'm not sure where that bug occurs, but it should theoretically also be eradicated in cases where the game tries to refer to a non-existent surface when exiting Alwarren (if it really does that for some reason), which exists after the new patch.

To update, just download the new version from the link in the original post and extract Arokh.dll, Drakan.exe and Dragon.rfl in Drakan dir and overwrite everything. Also, delete Arokh.ini from the game dir because it's not used anymore. I figured the original hot-patching method was kinda stupid and flawed because I couldn't get it to apply the new 445++ patch variant, so all unofficial patches except the Widescreen and the Session creation failed fix are now part of Drakan.exe and Dragon.rfl and I would strongly recommend them to any Drakan player out there.

PS: The quick save feature comes with a small bug. The information about the music track that's supposed to play isn't always properly saved. To reproduce it, launch the game, wait for the cinematic to finish (disable developer mode so it won't be skipped), start the new game, skip the intro cutscene and do a quick-save then quick-load. The menu background track should start playing. The solution is to do normal save every time the track changes, then you can quick save until the track changes again.
Last edited by UCyborg on Fri Sep 25, 2015 4:39 pm, edited 1 time in total.
"Once a profound truth has been seen, it cannot be 'unseen'. There's no 'going back' to the person you were. Even if such a possibility did exist... why would you want to?" - Dave Sim

User avatar
Arokhs Twin
Site Admin
Posts: 1056
Joined: Wed Jul 18, 2001 9:36 pm
Location: United Kingdom
Contact:

Re: Widescreen hack and some other fixes

Postby Arokhs Twin » Thu Aug 29, 2013 4:01 pm

I installed the updated patch and seems to work OK. No servers online though to see if it can join without any errors however it works fine on my own server.
By fire and by blood I join with thee in the Order of the Flame!
Webmaster of Arokh's Lair


Return to “Drakan (PC) Game Discussion & Technical Support”

Who is online

Users browsing this forum: No registered users and 2 guests

cron