Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the GOG versions of Bethesda games #646

Closed
Infernio opened this issue Sep 30, 2022 · 9 comments
Closed

Add support for the GOG versions of Bethesda games #646

Infernio opened this issue Sep 30, 2022 · 9 comments
Assignees
Labels
A-gog Area: GOG Support (game) A-new-game Area: New Game Implementation (new subpackage in the game package) C-enhancement Category: Enhancement, a request to add or enhance a feature G-enderalse Game: Enderal: Forgotten Stories: Special Edition G-fallout3 Game: Fallout 3 G-falloutnv Game: Fallout: New Vegas G-morrowind Game: TES III: Morrowind G-nehrim Game: Nehrim: At Fate's Edge G-oblivion Game: TES IV: Oblivion G-skyrimse Game: TES V: Skyrim Special Edition M-relnotes Misc: Issue should be listed in the version history for its milestone
Milestone

Comments

@Infernio
Copy link
Member

Todd's done it again. Yet another rerelease of Skyrim on yet another platform.

Detailed information available here: loot/loot#1802

Should be really easy to support, thankfully.

@Infernio Infernio added C-enhancement Category: Enhancement, a request to add or enhance a feature G-skyrimse Game: TES V: Skyrim Special Edition A-new-game Area: New Game Implementation (new subpackage in the game package) A-gog Area: GOG Support (game) G-skyrimae Game: TES V: Skyrim Anniversary Edition labels Sep 30, 2022
@Infernio Infernio added this to the 311 milestone Sep 30, 2022
@Infernio Infernio self-assigned this Sep 30, 2022
@Infernio Infernio added the M-relnotes Misc: Issue should be listed in the version history for its milestone label Sep 30, 2022
Infernio added a commit that referenced this issue Oct 21, 2022
Did it by creating a new page specifically for TES GOG games. I hope
Beth won't rerelease all their games on GOG now, but I'm not holding my
breath.

Also some simplification and removal of obsolete code.
GameName is unused since d6f05c2,
GameTemplate has been unused since its introduction in
12c90a2.

Under #646

Mopy/bash/loot_conditions.py:
Fix LOOT path processing with trailing separators

Would cause the condition evaluation to fail with an error if you had a
game folder mapped at Y:\ and a path that resolves to
Y:\Data\Guard Dialogue Overhaul.esp, because the game folder would get
an extra separator appended (Y:\\).

Improve error message for illegal LOOT paths

To try and track down issues when it still happens.
@Infernio
Copy link
Member Author

See #648, if Beth start releasing other games on GOG as well soon I'll repurpose this issue to be about all of them.

@Infernio Infernio changed the title Add support for the GOG version of Skyrim SE/AE Add support for the GOG version of Bethesda games Mar 3, 2023
@Infernio
Copy link
Member Author

Infernio commented Mar 3, 2023

And just like that, renaming is needed since Nehrim and Enderal have been released on GOG.

@Infernio Infernio changed the title Add support for the GOG version of Bethesda games Add support for the GOG versions of Bethesda games Mar 3, 2023
Infernio added a commit that referenced this issue Mar 10, 2023
Also created an Oblivion GOG version override so it shows up nicely in
the GUI and fixed some Nehrim/Oblivion handling problems. Also dropped
patchURL and patchTip, everyone in their right mind now uses Steam, GOG
EGS, etc., all of which will automatically update games for you.

Note that we can't offer a separate installer option for these because,
unlike the GOG version of Skyrim SE, they overwrite the registry key the
Steam version uses when first launched. So we can't differentiate
between them without an inclusion/exclusion file check, which the
installer can't do for obvious reasons. So the installer simply can't
handle multiple variants of the same game being installed, but I don't
foresee that being much of a problem (how many people will actually have
both a Steam and GOG version of Enderal installed?)

Under #646
@sibir-ine
Copy link
Member

Not sure when this happened, but FO3 & FNV are on GOG, as is Morrowind, though I understand that support for it is limited at the moment. LOOT stores the GOG game IDs & registry keys here, & the IDs can be used for unique icon files of the form goggame-<GOG ID>.ico to identify GOG installs as I'm not sure if they also have a gog.ico file. I believe they have the same AppData & My Games folders as their Steam variants. IIRC, @Ortham has them, so maybe they'd be able to confirm.

@sibir-ine sibir-ine added G-fallout3 Game: Fallout 3 G-oblivion Game: TES IV: Oblivion G-falloutnv Game: Fallout: New Vegas G-morrowind Game: TES III: Morrowind G-nehrim Game: Nehrim: At Fate's Edge G-enderalse Game: Enderal: Forgotten Stories: Special Edition labels May 26, 2023
@Ortham
Copy link
Contributor

Ortham commented May 26, 2023

IIRC, @Ortham has them, so maybe they'd be able to confirm.

I've got Morrowind, Oblivion, Nehrim, Skyrim SE, Enderal, Fallout 3 and Fallout New Vegas on GOG (i.e. all the games that are currently sold on GOG). Not all the games on GOG have a gog.ico file (e.g. Morrowind doesn't), that's why I went for using the game-specific icon files to tell if an install is a GOG install.

@Utumno
Copy link
Member

Utumno commented May 26, 2023

Thanks @Ortham @sibir-ine - do you think this is easily done @Infernio ?

@Infernio
Copy link
Member Author

Infernio commented May 26, 2023

Should be straightforward, modulo some refactoring to support the different icons directly in GOGMixin. I'll take a look later today (but obviously won't be able to test it).

@Utumno
Copy link
Member

Utumno commented May 26, 2023

Thanks Inf - other than that I think from my side I have nothing else 311 related - 647 should be stable as far as loading is concerned, now that we parsed the WRLD children - in the patch API (keepRecords and co) there might be some buggy edge cases but this is (#)312 so we'll have plenty of chances to revisit. I will have some time during the weekend - anything you want help with ping me

@Infernio Infernio removed the G-skyrimae Game: TES V: Skyrim Anniversary Edition label May 26, 2023
@Infernio
Copy link
Member Author

Do the FO3/FNV games still have the different language directories in their GOG versions?

@Ortham
Copy link
Contributor

Ortham commented May 26, 2023

No, they have separate installers for each language.

Infernio added a commit that referenced this issue May 28, 2023
Can't use game_detect_includes here because that one is a logical
conjunction. For the .ico files used by GOG games we need a logical
disjunction instead, so we have to override test_game_path. Also made
the mixins inherit from GameInfo to fix some PyCharm warnings.

Unsure if we can add a separate installer option for these. Someone
would have to test if they overwrite Steam's registry key (we'll
eventually want to refactor the way we detect Steam games to stop
relying on that potentially shared key, which will fix this problem for
good).

Under #646
Infernio added a commit that referenced this issue May 28, 2023
I wanted this release to be smaller for once. 500 commits and nearly a
year later, mission failed :(

Hopefully we'll manage to keep the next one smaller.

All mentioned commits are authored by @Utumno or @Infernio unless
otherwise mentioned.

-----------------------------------------------------------------------

### Fallout 4 (#482, #525, #650)

The first major change in 311 was the beginning of the road towards
proper Fallout 4 records support and hence a fully function Bashed
Patch in FO4.

- 00c9ee8 implemented a key piece of
  the records infrastructure, NVNM. It also dropped some hacks to
  further pave the way. The first two FO4 record types were
  implemented.
- dc6311a refactored CTDA and
  implemented the next seven record types.
- 641bc73 tackled the single biggest
  challenge of the entire undertaking: VMAD. As a bonus, if you enjoy
  rants about stupid design decisions, see
  c5b5d8a. The next ten record types
  were also implemented.
- 28578a6 moved some record types
  that are identical between Skyrim and FO4 to brec and implemented
  the next eighteen records.
- This was immediately followed by
  bb7e5ae, which slightly refactored
  GameInfo.init() but mostly just implemented the next twelve record
  types.
- 3d8b23e implemented nine more
  record types.
- 9bfb6de implemented two more.

Also, @BeermotorWB began the porting process by bringing Tweak
Settings to FO4 in 57b2443.

There are about sixty FO4 record types left to implement. This will be
concluded in 312. I chose this part for the title of the release
("Fallout 4 preparation") since it's what occupied my brain during
most of 311's development.

-----------------------------------------------------------------------

### Python 3 (#618, #619, #644)

Since moving to Python 3 in 310 (see #460), we've been taking full
advantage of everything py3 offers us. Some example commits:

- 8de5f40 cleaned up one of the most
  annoying files to edit, common_subrecords.py.
- cc198c9 shaved hundreds of lines
  off by replacing verbose nested OrderedDict instantiations with
  regular, now-ordered dicts.
- fd1d4d9 took advantage of ordered
  dicts to drop duplication between the records list we used to keep
  track of records in a Mob* class and the id_records dict we used for
  fast random access by FormID. Now we only need the dict.
- In bbb8fa2, @lojack5 used Python 3's
  type annotations to refactor our flags handling.

We also upgraded to Python 3.10 in
7b3573c and to Python 3.11 in
69e7e3a. We also optimized a bunch of
central code for e.g. the BP, FName and Path to take advantage of
changes like 3.11's adaptive interpreter, which gave pretty good
speedups.

We've also been doing what we call 'fdusting' - replacing any random
pieces of code that look like

  a + '.esp'

with f-strings, i.e.

  f'{a}.esp'.

Another (made-up) example:

  'Loaded %d images' % len(images)

becomes

  f'Loaded {len(images)} images'.

This has been happening as a sort of "if you're editing in the
vicinity, fix any you touch" thing, so spread out over tons of
commits.

F-strings are one of the best things about py3 :)

-----------------------------------------------------------------------

### Records (#480, #647)

The eternal #480 rears its head again, as it does every release. First
off, every single merge mentioned in the FO4 section above also falls
under this section.

In addition to that, we are approaching setDefault. Uprooting that
will give us major speed boosts, simplify code, fix lots of random
"the BP is editing this value for some reason" bugs (all of those are
due to defaults), etc. One major blocker was FormID handling (see
section "FormIDs (#637)" below), now cleaned up. Some other commits
related to records refactoring in 311:

- 28e0734 reworked defaults handling,
  making defaults explicit where they are needed and eliminating them
  from most structures in the records code.
- fd1d4d9, already mentioned in the
  "Python 3 (#618, #619, #644)" section above, reduced duplication in
  the record_groups code by getting rid of the 'self.records' list in
  favor of just the (thanks to py3, now ordered) 'self.id_records'
  dict.
- 71520f7 massively reduced code
  duplication in the various games' init() methods and the __slots__
  definitions for all the record types for a total of nearly 1000 LOC
  removed!
- bbb8fa2 by @lojack5, already
  mentioned in the "Python 3 (#618, #619, #644)" section above, took
  advantage of Python 3's type hints to refactor our flags handling.

The biggest merge of this development cycle also falls in this
category. In a truly herculean merge
(d2152aa), @Utumno tackled
record_groups, turning it from a TODO-riddled mess that didn't really
know if it wanted to be Oblivion-only or game-agnostic into a modern
API that will serve us well for the future (e.g. for FO4, which makes
QUST a new top-level group). Seriously, this refactoring was so
complex, its merge has two sub-merges.

-----------------------------------------------------------------------

### FormIDs (#637)

One of the major refactoring goals of 311 was tackling FormIDs. We
used to repesent them as either integers (called "short FormIDs") or
tuples of strings and integers (called "long FormIDs"). Note that the
latter became tuples of FNames and integers in 310 (see section
"FName (#543)" in the 310 release commit.

This was achieved in 4964710, which
is once again an entire branch squashed down to a commit so as to not
break dev. They are now stored as a class instead (brec.FormId). This
required careful engineering and testing to make sure we don't kill BP
performance. For the full story, see the linked commit.

-----------------------------------------------------------------------

### Localization (#55, #500)

We're trying to replace all '%s' specifiers with more useful
'%(something)s' specifiers. This is still nowhere close to being
finished, but 2442285 began the
process. Once this is done, we'll want to rethink how we allow
people to contribute localizations - see #500 for more info.

-----------------------------------------------------------------------

### Epic Games Store & GOG (#646, #648)

No release is complete without adding support for new games, and 311
is no exception. Bethesda released most of their games on GOG and some
on the Epic Games Store, so we added support. See the linked issues
and the referencing commits for more information. The biggest
difficulty was adding support for yet *another* method of game
detection (for the Epic Games Store).

Still to come is refactoring the game detection on the Steam side,
since some of these rereleases will actually overwrite the registry
key used by the Steam versions, making it impossible for WB to
reliably detect the installation of both versions. This will also pave
the way for Proton-based game detection on Linux (see "Linux (#243)"
section below).

-----------------------------------------------------------------------

### Nexus integration (#459)

5e688fd prepared us for proper Nexus
integration, which will be one of the big feature goals of 312, by
merging a nexus.py file that wraps the Nexus API into the source tree
so that keeping it up to date is easier.

-----------------------------------------------------------------------

### FileInfos (#336)

Some refactoring work on FileInfos and related APIs occurred as well,
mostly on the INIs. See 22c8c5e,
2495972 and
b3e4116 for details.

-----------------------------------------------------------------------

### wx (#190)

That's right, more of this.

- 6f2bd1d finally de-wx's the mighty
  UIList (which backs all of WB's tabs) by making it inherit from our
  PanelWin instead of wx.Panel. Turns out it was that easy (I'm sure
  it had nothing to do with the metric tons of refactoring that had
  been done towards this in 310, 309, 308 and 307).
- f7dd4dc decouples us from wx with
  regards to the default, builtin art from wx we used to use. We
  instead now use SVGs (mostly from Font Awesome - don't worry, I was
  careful with the licensing), which also gives us some consistency
  across platforms.
- d1290a5 begins the fight against
  balt.ListBoxes, an absolutely horrible class that not only had a
  really weird API but also featured terrible usability. I wrote a
  mini-novel on this refactoring, see the linked commit. The second
  part arrived later, in 15444ca.
- 6659eb3 features some good old
  de-wx'ing of dialogs for opening/saving/choosing files. Also
  included is some refactoring of status bar-related classes.

-----------------------------------------------------------------------

### Usability (#625, #643, #645, #652, #656)

Back on my bullshit, aka trying to make Wrye Bash more usable.
For 311, we have:

- bfdee3e, which added a Ctrl+S
  shortcut (and matching link for discoverability) to make frequent
  saving easier.
- 47ef378, which aimed to improve the
  INI Edits tab's usability by making it more consistent with the
  other tabs (e.g. adding Alt+Click support, opening tweaks via Enter
  or double click, etc.).
- effcf83, which added links for LO
  undo/redo to improve their discoverability.
- 486a640, which restricted the red
  background color to timestamp conflicts since it kept confusing
  people. See the relevant issue (#656) for some more background info
  on this change.
- 941fb25, which was born out of me
  going "hey, I've never used the Fit Contents and Fit Header options
  before, let's try that", really liking how much easier it made
  adjusting columns for Master lists, then noticing that it applied
  *globally* and so nuked my carefully adjusted columns on the Mods
  tab. Instead, each setting now only applies to the tab/list you
  enable it on, allowing you to use it for just the lists where it
  helps you.
- d1290a5, which was already
  mentioned in "wx (#190)". ListBoxes was just no good for usability.
  They didn't remember sizes, always started out being sized wrong and
  don't even wrap text correctly when you do resize them. Replacing
  them with custom classes allowed us to massively improve the
  usability of all kinds of popups and dialogs throughout WB. The
  second part of this refactoring arrived later, in
  15444ca.

-----------------------------------------------------------------------

### Image handling (#366, #557)

As an offshoot of #190, we have the venerable #366. Image handling is
still very much a work in progress, but
f7dd4dc brings us a lot closer.
Fleshing out the image API and making it ready for SVGs, it also
replaces many of our somewhat crusty images with SVGs that can scale
to any size we need. It also further decouples us from wx (see the
second entry in the "wx (#190)" section up above).

-----------------------------------------------------------------------

### File operations (#241)

In b5bb441, @lojack5 changed our
file operations backend on Windows to use the newer IFileOperation API
instead of the old SHFileOperation API. This was no easy task, as
pywin32's support for IFileOperation is broken for some reason and so
@lojack5 had to write a wrapper from scratch.

-----------------------------------------------------------------------

### Update checking (#663)

Come 312, we want to replace our nine(!) Nexus page with a single one
in the Modding Tools section. The LOOT team recently took the same
step. The main reason is simply because updating nine pages for every
release *sucks*. Even moreso if the release gets detected as a virus.

However, the problem with moving to a single page is discoverability.
The Nexus team have indicated that they're interested in adding the
ability for pages in the Modding Tools section to indicate that they
support certain games, so that they'll show up in the search results
for searches on those games' pages, but that's not implemented yet.

To that end, we implemented an update check. Once 312 is released on
the new Nexus page, we can stop updating the other pages and direct
users to the new one via the update popup. Of course, the update check
can be disabled in the settings and a manual version of the check is
also accessible from there. You can also adjust how frequently the
update check happens (the default is once every hour).

-----------------------------------------------------------------------

### Linux (#243)

Near the end of 311's development, I bought an NVME SSD and took the
opportunity to redo my dual boot environment. After backing up and
restoring the Windows part of my dual boot, Windows promptly decided
to ruin my day by first breaking Firefox and Thunderbird, then
breaking the entire Start menu. Since I can't really get work done
when I have to use stupid workarounds like "Windows+R > explorer.exe
or wt.exe > launch the app I actually want to launch", I said "screw
it" and moved entirely to Linux.

Born out of that is the last part of 311:
- 1d6db12 fixed a smorgasbord of
  random problems when using WB on Linux.
- 1fe6d2d made BAIN wizard and
  FOMOD images work on Linux.
- 1581953 fixed the GTK webview
  refusing to load when we have a file with '&' in its filename.
- 1d07fc3 implemented sending files
  to the recycle bin on Linux.

Most of these apply to our (even more WIP) macOS support as well.

-----------------------------------------------------------------------

There were many, many, *many* other changes - again, 500 commits.
One person who hasn't been mentioned so far is @sibir-ine, who
contributed lots of minor improvements to WB's out-of-the-box
usability (e.g. default BAIN directories) and tirelessly helped with
monitoring the Discord server and recording the reported bugs on our
project board.

Massive thanks to everyone who contributed to this release, including:

@Infernio, @Utumno, @sibir-ine, @lojack5, @BeermotorWB and many more
that GitHub's contribution tracker doesn't list.
Infernio added a commit that referenced this issue Aug 19, 2023
I love how little work this now is <3
Didn't test it because I refuse to buy yet *another* version of
FO4/Skyrim/whatever.

Mopy/bash/game/oblivion/__init__.py:
Some minor aesthetic cleanups

Under #646
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-gog Area: GOG Support (game) A-new-game Area: New Game Implementation (new subpackage in the game package) C-enhancement Category: Enhancement, a request to add or enhance a feature G-enderalse Game: Enderal: Forgotten Stories: Special Edition G-fallout3 Game: Fallout 3 G-falloutnv Game: Fallout: New Vegas G-morrowind Game: TES III: Morrowind G-nehrim Game: Nehrim: At Fate's Edge G-oblivion Game: TES IV: Oblivion G-skyrimse Game: TES V: Skyrim Special Edition M-relnotes Misc: Issue should be listed in the version history for its milestone
Projects
None yet
Development

No branches or pull requests

4 participants