genesisfr / ds2troubleshootingguide Goto Github PK
View Code? Open in Web Editor NEWA document listing all technical issues for Dungeon Siege 2 along with solutions.
License: MIT License
A document listing all technical issues for Dungeon Siege 2 along with solutions.
License: MIT License
So I stumbled across those problems already in 2017 but was not able to fix them. Retrying 6 years later I finally have progress.
Remarks:
This solution does not only apply for VPN but also for clients which have interfaces in multiple networks (e.g. HyperV).
Goal:
Playing with friends over VPN without relying on external services.
Prerequisite: A working VPN connection on all clients. We assume a VPN nework with 10.0.8.0/24 (subnet, not p2p!) and the lowest metric possible.
Details: Plain simple VPN without any routing neccessary but it MUST be a layer 2 interface (TAP interface for OpenVPN) so global UDP broadcasts (255.255.255.255), which the game uses to advertise a game lobby, go through.
The main issue here is that the game does not support multiple network interfaces properly. Windows 11 does make it also very difficult if you use virtual networking like HyperV for wsl or other tasks. The game will always prefer those!
Problem:
VPN working but nobody sees games in the lobby and can't join them. On some systems the error "name already in use" appears and they can't even enter the lobby.
Details: If we use wireshark to sniff the UDP packets of the VPN tunnel, then we see on both cases that they go through. The interesting part is the content:
If we look at the UDP stream a part of it provides the hostname and the ipaddress. But inside is the ip address of the wrong interface (e.g. of wsl or wifi) which are send over 10.0.8.0. That is the reason why the game decides to ignore those.
I pulled out a debugger and could see that the game uses wsock32.dll to create a socket to send/receive upd streams. This library is also used to get the hostname and the ipaddress of the system.
The functions it uses are:
GetHostName() to get the hostname
GetHostByName(hostname) to get a hostent struct with exactly 1 ip address.
So the game gets the hostname and passes it over to GetHostByName(). This function returns often a not desireable IP Address, if multiple network adapters are in use. This information is used to generate the UDP stream inside the socket.
Sadly I could not find out how the function GetHostByName determines the primary ip address out of many. But I can say for sure it neither considers the metric of the routing table nor the metric of the interfaces. However, I stumbled across the winsocks documention with an interesting tidbid mentioning the environment variable CLUSTER_NETWORK_NAME to override the hostname used.
After many, many hours:
Solution:
create a bat file with following content and put it to the directory with the dungeonsiege2.exe:
@echo off
_CLUSTER_NETWORK_NAME_=host1.local
start "" .\DungeonSiege2.exe fullscreen=false
Every VPN Client needs his own entry!
Now this host1.local needs a corresponding IP-Address. Either create DNS entries (if you have one) or create for every VPN client a new hosts entry in %windir%\system32\drivers\etc\hosts:
host1.local 10.0.8.1
host2.local 10.0.8.2
host3.local 10.0.8.3
Run the game through the .bat file you created earlier.
After this the function GetHostName() will look for the environment variable and passes the value 'host1.local' to GetHostByName() which consults the DNS/Hosts-File for resolving the ip-address.
The game will now use the correct IP-Adress inside the UDP streams it creates and finally the clients are able to enter the lobby and host games.
I am really sure that nobody has ever digged that deep to get the game going on multiplayer but I hope this guide helps to make it happen.
EDIT: If somebody knows what kind of order gethostbyname() follows, it would help to develop a much better fix!
anzz1/openspy-client#9
It seems that redirecting to the openspy server can allow you to play over the network, but need open ports.
Have you tested this method ? It definitely works for broken world, but the original required a cdkey.
Hi again,
shameless crossposting from there:
https://steamcommunity.com/app/39200/discussions/0/3809531933812050831/
Problem:
The game (Dungeon Siege 2 : Broken World) runs with low fps. It often drops below 20 frames per second.
Systems not affected reach easily 90+fps with the same settings. Affected systems don't have any performance problems with the vanilla version of the game.
Cause:
Unknown.
I can not rule out BIOS settings since there are plenty of options to check against.
It seem maybe a CPU issue. If I downclock the CPU on an affected system from 5.8Ghz to 3.4Ghz the frames go down proportional.
My test laptop -which is not affected by this bug- clocks max. at 3.4Ghz and reaches 90fps.
Thesis:
The game .exe wastes CPU cycles on specific hardware configurations and thus dropping the frames. Since it is not bound to a specific CPU model (e.g. Intel i13th gen is both affected and not affected) I would point to either a lowlevel BIOS/UEFI-Implementation problem (UEFI & CMS both affected) or it is a mainboard problem. I have 2 affected MSI boards. KVM is affected, too.
This is an edge-case which does not affect other real world performance. Modern Applications work as fast as advertised.
Dead ends:
-Debugging the application does not help. Between non-/affected systems there doesn't seem to be more/less errors pointing to the problem. Also the API call durations do not provide useful data. Since there are many calls/second and the root cause is unknown the debugging is not trivial.
This also is...
...not GPU related (issue appears at least on Nvidia/Intel GPUs), the GPU is even on not affected systems barely utilized.
...not bound to a specific CPU model.
...not caused by OS settings. Even Windows XP with original .exe and disc can be affected.
...not caused by game settings. The performance is barely improved (1-4fps) between min and max settings and resolutions.
...not caused by game modifications. Unmodified DS2:BW is equally affected.
...not caused by virtualization settings.
...not caused by CPU affinity.
If requested I can provide many more details on how I approached this problem.
I am trying to solve this but I struggle hard to find anything helpful.
Current tasks to tackle:
-Need a debug executable of DS2:BW like that one from the main game bundled with SiegeEditor2 (DungeonSiege2Mod.exe). If not available, any information in how to hack one is welcomed (debug console may provide performance problems).
-Need knowledge how to analyse performance issues in Direct3D Applications (what frame waits on which ressources etc). Maybe injecting debug builds of d3d9.dll?
-Looking for a discord group or forum etc. with more knowledgable people which are interested in that kind of problem
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.