HG(X) on linux Sept 20, 2018 11:51:02 GMT
Post by tritone on Sept 20, 2018 11:51:02 GMT
Tritone (ingame account: maltelau) here
I primarily have some questions about getting hgx (or another log parser) to run on linux, but I thought I'd share my experience getting nwn+hg to run in the first place.
NWN on linux
Neverwinter nights runs ~ok through wine, and in my ignorance, that's what I've been using for a few years when revisiting some of the great single player modules on the vault.
However, when I tried to use the quickbar-swapping (!qb) commands that are so helpful as a mage on hg, I found that every time I toggled the quickbar switch, the switch would get slower and slower to the point where after 1/2 an hour on a run, my game would freeze for 2+ seconds whenever I swapped quickbar slots.
Luckily, google quickly told me there are actually native binaries available for nwn for some years. Why didn't I know this!
I read this post on gog (https://www.gog.com/forum/neverwinter_nights_series/guidelinux_install_neverwinter_nights_on_any_linux_distribution), which recommended this guide (wiki.dotslashplay.it/en/games/neverwinter-nights) which worked really well for me.
The process is basically that someone wrote a script that uses the gog installer to create a .deb which means you can install neverwinter in a "standard ubuntu way" without angering your local sysadmin. Bonus!
So what I did: made sure the necessary packages were installed (fakeroot icoutils imagemagick unar), and the right files downloaded:
and ran the script:
Which left me with a .deb I could install. Now I had neverwinter-nights in my path and could start it with my standard launcher. Yay!
To disable the intro movies I went into /usr/local/games/neverwinter-nights and commented out the line: LD_PRELOAD=nwmovies/nwmovies.so
Next are some hg-specific changes. The install page on the wiki ( wiki.hgweb.org/wiki/Installation_Guide ) had a lot of info, but for my case after reading through it, I realized I needed two things: the right CEP version, and the higher ground enhanced haks and overrides.
To install these, there's was a small hiccup: which folder to put these files in? The script to start the game is /usr/local/games/neverwinter-nights, but it starts a different script: /usr/local/share/games/neverwinter-nights/nwn, which again starts /usr/local/share/games/neverwinter-nights/nwmain, which is the main executable. So where does the game look for hak files etc? Answer: a third folder, namely $XDG_DATA_HOME/play.it/prefixes/neverwinter-nights
So don't get lost in /usr/local/games or /usr/local/share/games or ~/.config/neverwinter-nights
What I found is that the config files you need to edit and the place you need to place your haks is in:
~/.local/share/play.it/prefixes/neverwinter-nightsGreat. So, download the right CEP version, download the version og hge you want (I picked the version which included aena gui, no problems there)
The last thing I will touch on is config in the .ini files.
In nwn.ini (so ~/.local/share/play.it/prefixes/neverwinter-nights/nwn.ini ) I had to change two lines to get window mode (just add them if you can't find them):
In nwnplayer.ini, under [Game Options], I changed these settings:
Max Memory Usage=128The first two based on performance recommendations I received: 1. let it use more video memory than default, and 2. don't try to use multiple cores (apparently it causes some crashes)
Client CPU Affinity=-2
And the last setting to make nwn write your chat windows to a file log-readers could use (more on this in the second half of this post). Yes it writes everything, even if you right click->exclude combat info
All of this is of course old news to all you veterans, but I still thought it would be nice to have a guide if any newcomers are on linux like me.
I still have a few crashes / disconnects, but I'm still working out whether it's due to my wifi only, or there's something else I could do to my nwn install.
If anyone has more recommendations for running nwn on linux, feel free to share.
HGX on linux?
After playing for bit and reaching legendary levels pretty quickly (thanks everyone who grouped with / helped me / wrote the wiki), it gets increasingly obvious that the game is giving us a lot of information that can be hard to digest.
Especially as a mage, but probably also for other classes that I didn't play yet: when a lot of combat is going on; are you making your SP vs SR checks, are you beating the monsters saves, and are they even vulnerable to the effect/damage type you're using? The first two (SR and saves) can be clear enough if you fiddle with the !filter commands to get this info to get sent as a "system message" and then right click->exclude combat info to filter out the spam. But vulnerabilities ..
Yadda yadda enough talk. I need a log reader. I encountered a lot of dead links in the forum until I realized I had to delete the "3" from the domain of the urls, and even then I encountered a lot of dead links when I tried to download various log readers, before someone pointed me to Higher Ground Extender (hgx).
Did anyone succeed in running hgx or another useful log reader on a (somewhat recent) linux install? How?
HGX: What I tried.
Using PlayonLinux, I made a fresh wineprefix and installed dotnet (I think I picked the most recent: dotnet45).
I placed the hgx folder inside my neverwinter nights folder ( ~/.local/share/play.it/prefixes/neverwinter-nights/hgx ) and ran Hgx.exe with wine inside my shiny new wineprefix.
It pops up with a config window, and puts a launcher in my tray: so far so good. But, nothing more. I don't get any gui overlay in game or anywhere else. There are a few things I think might clue you in to what's going wrong:
- First, here's the (whole) hgx log file:
2018-09-20 12:46:54.534 - INFO - [Hgx.App.Program]: HGX 188.8.131.52 'Limbo Edition'
2018-09-20 12:46:55.518 - INFO - [Hgx.Services.SettingsBase]: Trying to find NWN installationIt can't find my game. This is the primary problem I guess, but who knows. I wonder if it's specifically looking for nwmain.exe or something and therefore doesn't think it has the right directory.
I tried putting (in the config window) both the folder and the executable, but no luck.
- In the preferences window, under the "colours" tab, there is a lot of blank space under "timer overlay" and "statistics overlay". This makes me think I'm missing some dependency. Maybe a font? img: www.dropbox.com/s/i2dfvusawqn0qtd/hgx-1.png?dl=0
- Wine spits out a bunch of warnings as usual, but this one might mean something to someone. idk:
0009:fixme:ntdll:NtLockFile I/O completion on lock not implemented yetOther warnings wine spams that might not mean anything:
0009:fixme:gdiplus:GdipGetLineSpacing ignoring style- When I click "Show log with Notepad" it somehow can't find the log file. Notepad opens with a dialog box: "The file Z:/path/to/hgx/logfile does not exist. Do you want to create a new file?" even though I can open the log file fine manually in notepad or any other text editor. I can't see anything wrong with the path (linux is case-sensitive, but it seems to have the correct case for the path here). img: www.dropbox.com/s/v3kgtebn93n8ge4/hgx-2.png?dl=0
0009:fixme:exec:SHELL_execute flags ignored: 0x00004100
I also tried to run it with native mono, but it seems to be using some windows-specific gui bindings, so that's probably not the way forward.
HGX 184.108.40.206 "limbo edition"
Alternative (older?) log parsers
According to this thread there used to be a bunch of different projects parsing logs. Maybe one of them would be enough to get to run on linux. (http://highergroundpoa.proboards.com/thread/10939/reader-programs-help-hone-play)
This is where I encountered a lot of dead links.
One of them, the mageparser seemed promising since java is usually pretty cross-platform. I couldn't find a working download link however.
Similarly, there were one written in ruby, and one in perl, and one in python - all should be easy enough to get to run if they're not using windows-specific GUI bindings. The ruby one had only dead links afaik. The python one had dead links.
Of the two from that thread I managed to find still working download links:
This one actually has a github. Yay: github.com/separ/hg-yal
And it's a perl script. It was reading my logs, showing a window, showing some stats even. Until something in the log file was bugging it or SOMEthing, I don't know, but all it does is spam the terminal with
seek() on closed filehandle LOGFILE at yal.pl line 282.
readline() on closed filehandle LOGFILE at yal.pl line 283.
OK tbh when I tried it first it didn't show anything but now that I'm writing this thread, I tried it on part of the log from last night's tia run, it actually produces some output. Still only after-the-fact and doesn't show me concisely which vulnerabilities the monsters I'm fighting have, but it is the only one I got to work at all so far.
Log parser by Ill (http://highergroundpoa.proboards.com/thread/10944)
This one I was able to download and run through wine (wine dotnet installed), but I think the way it parses the chat looking for player names is outdated. It does however have a way to customize that, you can
edit the config file which lets me 1. disable trying to update it every time it starts up (lol), and 2. change the pattern matching it uses to parse the log file. Hope! But alas, I couldn't get it to work. In particular, it can't find my own player name. It used to look for the text "[Server] You are XYZ", which I guess is how HG used to welcome you. I tried to change the pattern to "Welcome to Higher Ground, XYZ!" but I couldn't get it to use the exclamation mark as the end of the pattern. If anyone has a hunch on what kind of pattern matching is used, if there might be some sanitizing going on, and how to work around that to match the "!", this might be an option, but if not, it seems this one is out too.
- Anything I missed for general nwn performance on linux? Hints on how to debug the crashes?
- Can you help me getting hgx running? Have you managed to get it to run yourself? Did you fiddle with the code and have an idea of what's going wrong based on the above report? Please help
- Or, are there any other useful options that work on linux?