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

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

Re: Widescreen hack and some other fixes aka AiO Patch

Postby Arokhs Twin » Tue Jul 04, 2017 5:38 pm

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: 3
Joined: Tue Mar 18, 2014 7:03 am

Re: Widescreen hack and some other fixes aka AiO Patch

Postby Tarnum » Wed Jul 26, 2017 6:44 pm

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

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

Re: Widescreen hack and some other fixes aka AiO Patch

Postby UCyborg » Sat Jul 29, 2017 11:11 pm

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. :?
"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: 1062
Joined: Wed Jul 18, 2001 9:36 pm
Location: United Kingdom
Contact:

Re: Widescreen hack and some other fixes aka AiO Patch

Postby Arokhs Twin » Sun Jul 30, 2017 11:38 am

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: 226
Joined: Sun Jul 07, 2013 7:24 pm
Location: Slovenia

Re: Widescreen hack and some other fixes aka AiO Patch

Postby UCyborg » Sun Jul 30, 2017 2:04 pm

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.
"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 aka AiO Patch

Postby UCyborg » Mon Jul 31, 2017 10:38 pm

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.
"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: 1062
Joined: Wed Jul 18, 2001 9:36 pm
Location: United Kingdom
Contact:

Re: Widescreen hack and some other fixes aka AiO Patch

Postby Arokhs Twin » Tue Aug 01, 2017 5:36 pm

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: 226
Joined: Sun Jul 07, 2013 7:24 pm
Location: Slovenia

Re: Widescreen hack and some other fixes aka AiO Patch

Postby UCyborg » Tue Aug 01, 2017 11:27 pm

Uploaded it again, just did some quick small layer visibility fixes in Volcano. These small details just won't give me peace.
"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 aka AiO Patch

Postby UCyborg » Sun Sep 03, 2017 11:05 pm

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.
"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: 1062
Joined: Wed Jul 18, 2001 9:36 pm
Location: United Kingdom
Contact:

Re: Widescreen hack and some other fixes aka AiO Patch

Postby Arokhs Twin » Mon Sep 04, 2017 5:45 pm

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: 226
Joined: Sun Jul 07, 2013 7:24 pm
Location: Slovenia

Re: Widescreen hack and some other fixes aka AiO Patch

Postby UCyborg » Tue Sep 05, 2017 6:50 pm

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.
"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 aka AiO Patch

Postby UCyborg » Fri Sep 22, 2017 2:05 pm

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.
"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: 1062
Joined: Wed Jul 18, 2001 9:36 pm
Location: United Kingdom
Contact:

Re: Widescreen hack and some other fixes aka AiO Patch

Postby Arokhs Twin » Mon Sep 25, 2017 6:11 pm

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


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

Who is online

Users browsing this forum: No registered users and 9 guests

cron