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.
User avatar
Arokhs Twin
Site Admin
Posts: 1295
Joined: Wed Jul 18, 2001 9:36 pm
Location: United Kingdom
Contact:

Re: Widescreen hack and some other fixes aka AiO Patch

Post by Arokhs Twin »

OK great. Ill update it when you are done
By fire and by blood I join with thee in the Order of the Flame!
Webmaster of Arokh's Lair

Tarnum
Hatchling
Posts: 4
Joined: Tue Mar 18, 2014 7:03 am

Re: Widescreen hack and some other fixes aka AiO Patch

Post by Tarnum »

A new version 2.94 has been released! Thanks very much for the support, UCyborg! :)

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

Re: Widescreen hack and some other fixes aka AiO Patch

Post by UCyborg »

I was just polishing layer visibility in Ruined Village level (parts of terrain popping up in the distance, parts of it being invisible from certain points, that sort of thing), not finished with everything I wanted to do, there's still one spot to take care of, hence no announcement yet, just put it on Google Drive for the peace of mind. The going's slow.

Relatively minor details, Drakan is the only game I know that has this sort of bugs. I fix what I can, no matter how big or small.

Finally encountered this one, the game generated corrupted save at one point, so crash-bang on load. Would be nice to have answers regarding what causes these random issues. Well, given how computers work, they're not really random. :?
"When a human being takes his life in depression, this is a natural death of spiritual causes. The modern barbarity of 'saving' the suicidal is based on a hair-raising misapprehension of the nature of existence." - Peter Wessel Zapffe

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

Re: Widescreen hack and some other fixes aka AiO Patch

Post by Arokhs Twin »

Cool, thanks for letting me know. I think it's best not to update it on this site just yet; has the corrupted save being caused by one of the latest versions?
By fire and by blood I join with thee in the Order of the Flame!
Webmaster of Arokh's Lair

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

Re: Widescreen hack and some other fixes aka AiO Patch

Post by UCyborg »

The save problem is one of those random bugs, haven't been able to reproduce it since. I've triple-checked my code for deficiencies, the only issue that remained in from the time I was looking for more optimal solution for multiplayer player-disconnect bug is the crashing during cutscenes, it happened when the game transitioned to the next STOMP sequence and only if the game was in fullscreen mode and minimized at the time. This one is already taken care of.

Ideally, one would have to figure out exactly what needs to be executed to prevent the player from sliding around the level after (s)he spawns, which is the only remaining side effect that I'm aware of when it comes to the player-disconnect fix. There is a ton of code executed under the normal circumstances (so when the game isn't minimized), so you'd have to find which bits exactly affect player spawning. Executing that whole big function just makes game more crashy in the long run, which is the last thing we want.

The rest of the code fixes affect things on smaller scale, no problems with them whatsoever. I've been keeping backups of the old versions for trickier cases mentioned previously, it seems I won't need them anymore. Now, I just play around with the editor, so no more binary hacking. I've kept visibility distance in Ruined Village at default, that level is problematic enough as it is. I've lost count of on how many spots the visibility glitches can be observed. Most of them are gone now, I just didn't bother with those that can only be seen when flying through the level with 'floy' cheat at higher altitude. Perhaps this is meant to be optimization since we don't have the dragon yet. There is a value in the editor called Flight Ceiling.

Then I'd also like to check and see if I'm able to do anything about the blueish river issue at the end of Wartok Canyons. If it's just the problem of water layers being set as invisible from certain points, then it should be fixable.
"When a human being takes his life in depression, this is a natural death of spiritual causes. The modern barbarity of 'saving' the suicidal is based on a hair-raising misapprehension of the nature of existence." - Peter Wessel Zapffe

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

Re: Widescreen hack and some other fixes aka AiO Patch

Post by UCyborg »

Done with what I've wanted to do. The issue with blueish river in Wartok Canyons is actually bump mapping feature bugging out. I have no idea what's special about those parts, but it's not layer visibility problem.
"When a human being takes his life in depression, this is a natural death of spiritual causes. The modern barbarity of 'saving' the suicidal is based on a hair-raising misapprehension of the nature of existence." - Peter Wessel Zapffe

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

Re: Widescreen hack and some other fixes aka AiO Patch

Post by Arokhs Twin »

OK Ill update it
By fire and by blood I join with thee in the Order of the Flame!
Webmaster of Arokh's Lair

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

Re: Widescreen hack and some other fixes aka AiO Patch

Post by UCyborg »

Uploaded it again, just did some quick small layer visibility fixes in Volcano. These small details just won't give me peace.
"When a human being takes his life in depression, this is a natural death of spiritual causes. The modern barbarity of 'saving' the suicidal is based on a hair-raising misapprehension of the nature of existence." - Peter Wessel Zapffe

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

Re: Widescreen hack and some other fixes aka AiO Patch

Post by UCyborg »

Back with another update, I added some error handling code in ReceiveCallback functions, it was assumed recvfrom will never return -1, which could easily happen if someone sent oversized query string to the server, crashing it. Maybe it even solves the crash that sometimes occurs when leaving Join Game menu, although I'm not sure about this one, haven't seen that crash in a while and I don't remember from the last time where in the code it occurs.

I also tweaked the code which processes query strings a bit, originally it was assumed only certain combinations of commands will be sent to the server in certain order, so among other things there was a bug that would result in a crash if the query string began with /secure/ command.

Drakan was one of the earliest games that used GameSpy server query protocol for getting information about the game server itself, when GameSpy predecessor MPlayer also existed. I guess that thing with retrieving the server list from servers.txt file on the master server using plain HTTP protocol was MPlayer thing (also remember MPlayer's master server was the primary followed by the GameSpy), before the special protocol was implemented by GameSpy, which involves connecting to the master server's port 28900 and sending the command to retrieve the list there. I saw in the code that the query command \secure-mp\ is also recognized (assuming mp stands for MPlayer), similar to Gamespy's \secure\ command, used for verifying the server sending the heartbeat packet is real. It uses different encryption key and probably different encryption algorithm.

Today, I also made the server notify the master server when it shut downs after reading that the Gamespy protocol supports that too. Since last two updates, it's now also possible to get Drakan's server to register itself with the master servers run by 333networks. All of these seem to work and can be added to Drakan.cfg:

master.333networks.com:27900
master.errorist.tk:27900
master.oldunreal.com:27900

The last two share the same server database I think. Just the in-game server browser would have to be reworked to support retrieving the server list the proper way. I might look into this again at a later point. There is also the easy way, modifying Luigi Auriemma's gslist utility to output the server list in the text file in the proper format (haven't figured out how to modify the game itself to accept the colons as IP:port separators instead of damn spaces) which the game can read. So you can have a bat file that invokes the utility to get the server list, saves it to servers.txt and starts the game afterwards, achieving similar effect like with that old Drakstart app.
"When a human being takes his life in depression, this is a natural death of spiritual causes. The modern barbarity of 'saving' the suicidal is based on a hair-raising misapprehension of the nature of existence." - Peter Wessel Zapffe

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

Re: Widescreen hack and some other fixes aka AiO Patch

Post by Arokhs Twin »

Great to see you are still working on improvements to the game. I've updated it on the website.
By fire and by blood I join with thee in the Order of the Flame!
Webmaster of Arokh's Lair

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

Re: Widescreen hack and some other fixes aka AiO Patch

Post by UCyborg »

Agreed! I also like to see bugfixes and improvements to my favorite software/games. Messing with assembly code can be interesting, at least until the point where it gets too complicated. Can't believe this started as just a small FOV fix. Haven't seen all the other improvements coming TBH. Now if only we had Drakan's source code and programming wasn't such a pain in the ass! :mrgreen:

The recent update was prompted by the fact that Qtracker may be going offline soon (they're still online ATM, same shutdown announcement message on the forums, complications?) and by little searching I stumbled upon 333networks and got curious how their master server works.

Just a good minute after setting the game up to register with their master server revealed some fatal, it crashed not too long after starting the server. Took some smaller alterations to the existing routines and one or two extra ones so it handles queries better. Haven't put this update out right away so I don't have to upload it again the same day because I've missed something. ;)

Hopefully the next update will have in-game server browser working like it should have from the beginning. Already pinpointed the function in the engine that has to be called to add game server to the list in Join Game menu, now just have to integrate code that will process the response from master server and get server addresses out of it. Looks like source code of gslist utility will come in handy for this task.
"When a human being takes his life in depression, this is a natural death of spiritual causes. The modern barbarity of 'saving' the suicidal is based on a hair-raising misapprehension of the nature of existence." - Peter Wessel Zapffe

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

Re: Widescreen hack and some other fixes aka AiO Patch

Post by UCyborg »

Done with server browser enhancements! It can now talk to the master server using GameSpy protocol. Some status messages were added that display in that little black rectangle under Multiplayer->Join Game so it's clear what's happening in the background. The message that says to wait max 10 seconds that briefly remains on the screen after initial "Contacting Master Server" can be ignored as it's unintentional. "Contacting Master Server" only stays on the screen for up-to 30 seconds if there are no servers on LAN and there's no master server on the remote side or it doesn't accept the connection. When everything is OK, the message sequence goes like this:

"Contacting Master Server"->"Connection Established"->"Authenticating..."->"Receiving..."->"Querying Servers..."

After the first message, it takes about 5 seconds before the code initiating connection is actually executed. Some strange design decision I guess. The last message will read "No Servers Listed" instead if there aren't any servers listed on the master server.

Additionally discovered and fixed some synchronization bugs between the main thread and the secondary thread that is created to handle some multiplayer related tasks. The strangest issue that occurred randomly was refreshing server list would sometimes corrupt process' internal state, among other things causing inability to connect to servers and the process deadlocking on exit. The problem with game temporarily freezing when exiting multiplayer is also gone. It was most apparent on the server-side when leaving the game created with Host Game option in Multiplayer menu when nobody was connected and on the client side if the server was shut down mid game.
"When a human being takes his life in depression, this is a natural death of spiritual causes. The modern barbarity of 'saving' the suicidal is based on a hair-raising misapprehension of the nature of existence." - Peter Wessel Zapffe

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

Re: Widescreen hack and some other fixes aka AiO Patch

Post by Arokhs Twin »

Awesome. Updating the website now.
By fire and by blood I join with thee in the Order of the Flame!
Webmaster of Arokh's Lair

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

Re: Widescreen hack and some other fixes aka AiO Patch

Post by UCyborg »

Here's the new update:

  • Implemented per-user settings; config, saves and other data will be saved to user's Documents folder, in "My Games\Drakan".
  • Added option to turn on/off redirection of user data to user's Documents folder.
  • Screenshots will go to Screenshots subfolder and the old screenshots won't be overwritten.
  • Added option to disable the usage of performance counter for timing.
  • Game will no longer force-create registry key with A3D settings for old Aureal sound cards.
  • Reverted change from previous update that caused "No Servers Listed" message in server browser remain on screen permanently.
  • Deleting last user defined server from server browser will now delete servers.txt file from disk, previously the file remained on disk with 1 server entry, which showed up on the list again after refreshing server list.
  • Replaced PeekMessage call with GetMessage in a message loop for Riot Engine Options dialog, taking care of excessive CPU utilization.
  • Changed main loop to process all pending window messages before running a frame instead of just one per frame.
  • Increased default limit of concurrent playing sounds from 20 to 64 (no more sound cutoffs without a DirectSound wrapper).
  • Added missing trigger that turns off EAX Cave sound effect when leaving the cave in Ruined Village where 2 Scavengers attack an Orc.
  • Game will now use the audio device selected in Riot Engine Options dialog instead of always using default device.
  • It's now possible to select which monitor to use for fullscreen mode in Riot Engine Options dialog.
  • Added FPS limiter.
  • Restored compatibility with Windows 9x family of operating systems.
  • Removed now redundant compatibility database from the archive, you may remove "Drakan SDB" entry from programs list or using Compatibility Administrator if you've installed it.
  • Empty DebugLog.txt will no longer be created when opening 3D view in Level Editor.
  • Sounds played in Level Editor 3D view will no longer be muted when window loses focus.
One oddity about the saved games. Apparently the information on whether EAX is available is cached. If you save the game with EAX disabled then reload it after restarting with EAX enabled, there are still no EAX effects on that level and probably on previous levels as well if you backtrack. They work on newly visited levels.
"When a human being takes his life in depression, this is a natural death of spiritual causes. The modern barbarity of 'saving' the suicidal is based on a hair-raising misapprehension of the nature of existence." - Peter Wessel Zapffe

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

Re: Widescreen hack and some other fixes aka AiO Patch

Post by UCyborg »

One change from the last update exposed another bug in the code that caused dedicated server to get stuck in infinite loop if its window is minimized during level transition. I didn't test it at the time, but it's all good now.

Dege, the author of dgVoodoo, also contributed a small patch, taking care of the black screenshot bug. So game's own screenshot function should now always work correctly.

I took a quick look at the game's Lens Flares Effects option. It seems this function is broken with today's legacy Direct3D drivers. On my NVIDIA GeForce GTX 750 Ti with driver version 368.81, those round shaped lights don't appear when Arokh takes rune with new breath weapon. On Radeon R2, there are graphical glitches.

Effects are rendered correctly with dgVoodoo2 wrapper, but frame-rate dips into 10s. I did tell Dege about it, though he didn't have any comment about the issue. I might poke him about it again later. He's gotta test crapload of games with his wrapper every time he releases new version. If there's a person who could resolve this mystery, it's him.

There was a "fix" by Shelim in my patch that could prevent a crash under the certain circumstances when Lens Flare Effects option was enabled, I've realized that all it did was prevent those round shaped lights from appearing. Since it doesn't do anything to resolve the core problem, I've decided to remove it.

It's the best to keep the said option off unless someone figures out proper fix sometime. I remember having problems with it even on the ancient GeForce4 MX 440. The game would sometimes crash during the cutscene where Rynn and Arokh bond. The biggest problem would be getting past the scene where Arokh gets Rune of Poison. Not sure how I got past the other such scenes with lightning, might have been luck. I only realized much later that the lens flare effect rendering is causing problems.

Works correctly, but slowly on emulated Voodoo 2 card.
"When a human being takes his life in depression, this is a natural death of spiritual causes. The modern barbarity of 'saving' the suicidal is based on a hair-raising misapprehension of the nature of existence." - Peter Wessel Zapffe

Post Reply