Giter VIP home page Giter VIP logo

Comments (8)

afritz1 avatar afritz1 commented on June 16, 2024 1

Okay I made a steam-path branch. Checkout your own copy of that. Just worry about getting the path working on your preferred OS then I'll do a pass for the other OSes afterwards.

Looks like .vdf and .acf can be parsed the same so I've made a SteamKeyValueFile for that. It should check if the file is valid to parse; maybe it could count the number of open and close curly braces.

Feel free to use any std types and anything in C++17.

SteamUtils.h should eventually have some std::vector<std::string> getLibraryDirectories() so we can iterate all the places the The Elder Scrolls Arena installpath might be.

Later I think the ArenaPath behavior I want is, we use ArenaPath if it points to a valid ARENA/ARENACD directory, otherwise we try looking for the Steam install. Because we want Steam to be what most people use UNLESS they specify their own ArenaPath. Maybe don't need to change it to ArenaPaths yet.

from opentesarena.

makemeunsee avatar makemeunsee commented on June 16, 2024

Hi,

I don't know how to look up the user's Steam folder but there's probably a way to get that environment variable on Windows/Linux/macOS.

I've been looking this up, I'm not convinced there's a simple, reliable way to do it, beyond the easy cases. Steam itself can be installed anywhere, and it can manage multiple data folders. With the Steam install path, Steam config could be read and from it, the data folders extracted, but then that's code which would break whenever Steam changes anything in this regard.

Maybe having a good set of default paths, across all platforms, would work for 80+ % of the users, and then if the engine doesn't find Arena data going through all the default folders, it can point the user to the relevant config entry for manual edition.

from opentesarena.

PurityLake avatar PurityLake commented on June 16, 2024

Seems fairly doable tbh. Steam on linux tends to house a file called libraryfolders in $HOME/.local/shader/Steam/steamapps/share/Steam/steamapps/. In here there is a list of APPIDS and the folder those APPIDS are stored in. The file for that is similar to JSON but not the same.

For Steam the install location of Steam is in the Registry Keys

  • 32-bit: HKEY_LOCAL_MACHINE\SOFTWARE\Valve\Steam
  • 64-bit: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Valve\Steam

From here you can find the libraryfolders.vdf in the same way.

I'd be willing to make a solution for this if this is a way people want to do it. After this there is no real other way to find a path to ARENA outside of a defined default position or just getting the user to supply a path.

from opentesarena.

afritz1 avatar afritz1 commented on June 16, 2024

A not-quite-JSON format and registry keys don't sound appealing on the surface. I mean we can try but it's not in the spirit of this project to depend on anything more complex than like an environment variable. See my next comment

If we can cover 90% of Windows players with a Steam install by providing

ArenaPaths=C:/Program Files (x86)/Steam/steamapps/common/The Elder Scrolls Arena/ARENA;D:/SteamLibrary/steamapps/common/The Elder Scrolls Arena/ARENA

and something similar for Linux and macOS, that seems reasonable to me.

Beyond that I would probably just want a file dialog to let the player point to their custom ARENA/ARENACD folder. Not sure how to implement that, I think it's either Qt or GTK, the former which is a big dependency I don't want, and the second isn't quite Windows native. Doing an in-engine dialog could work but I'd need a couple things like an open-source font and a way to render it with SDL. I wonder how Daggerfall Unity does it.

from opentesarena.

afritz1 avatar afritz1 commented on June 16, 2024

I tried looking in the registry but it doesn't have my D drive SteamLibrary path, just the place where Steam the executable is installed on my C drive.

Oh whoops I forgot about libraryfolders, there's probably a way to find the games path.

Okay, I spent some more time thinking and I would be okay going with the more comprehensive solution to work with Steam's files and whatnot. Seems like there is enough documentation around to make it work.

from opentesarena.

afritz1 avatar afritz1 commented on June 16, 2024

Arena's app ID is 1812290 and its appmanifest_1812290.acf starts like this:

"AppState"
{
	"appid"		"1812290"
	"Universe"		"1"
	"LauncherPath"		"C:\\Program Files (x86)\\Steam\\steam.exe"
	"name"		"The Elder Scrolls: Arena"
	"StateFlags"		"4"
	"installdir"		"The Elder Scrolls Arena"

OpenTESArena would use that installdir to find ARENA.

from opentesarena.

PurityLake avatar PurityLake commented on June 16, 2024

Would you like me to work on it?

from opentesarena.

afritz1 avatar afritz1 commented on June 16, 2024

Yeah, I'm setting up some stuff on a branch, will advise in a while.

from opentesarena.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.