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

$prefix per-user directory support on Windows #165

Closed
jdolan opened this issue May 17, 2013 · 13 comments
Closed

$prefix per-user directory support on Windows #165

jdolan opened this issue May 17, 2013 · 13 comments

Comments

@jdolan
Copy link
Collaborator

jdolan commented May 17, 2013

Many game engine ports now support a per-user directory on Windows (similar to ~/.$engine on Unix). The standard path for this appears to be My Documents\My Games\${game}.

GtkRadiant should support adding such a path path to the VFS subsystem at startup. NetRadiant uses a variable called $prefix for this. Since $prefix is specified in the game configuration in Unix notation (e.g. .q3a), it is required to either skip over the . at the beginning of $prefix, or simply use a Windows-specific variable to accomplish this (e.g. $prefix_win32.

Adding support for this per-user directory will allow mappers to keep their custom assets in their local directories, away from the official game data. For games which update via rsync (e.g. Quake2World), this is a blocker for using GtkRadiant.

@TTimo
Copy link
Owner

TTimo commented Jun 15, 2013

I would like to better define and understand the problem we are trying to fix before picking out what the best solution is.

My understanding, is that the main problem we are trying to work around, is that q2w removes any foreign files from it's main assets path when an update is executed (by doing a rsync with some --delete options).

So all support files and custom content would need to be placed somewhere else, where both GtkRadiant and q2w can find it. I ran the windows version of q2w for a bit, looking for fs_* cvars and such, but I haven't found any signs of where else the engine looks for content.

I've started to include the Q2WPack from GitHub into the GtkRadiant setup. In 1.6, games need to be configured before they can be used by GtkR. It's an essential part of the workflow, e.g. the install logic has moved into GtkR itself instead of being in platform specific, hard to maintain installers.

Right now when configuring Q2WPack, when prompted for 'engine directory', the most intuitive thing to do is to select the top folder 'quake2world'. That will put content in quake2world/default/script/.

It won't get squashed by the updater, but neither q2w or GtkRadiant will find the content at that point. It would be reasonable to modify GtkRadiant so it finds that content, I'm not sure about q2w.

If one picks 'quake2world/share' as the engine directory, then GtkR will start fine and find the right stuff. But then every update run will squash the content.

That was the situation on Windows. On Linux/Mac it sounds like the engine is already searching in ~/.quake2world - when configuring the game, GtkR still prompts for the 'main engine path' to copy stuff over to though.

So there are a few possible directions:

  • make q2w update stop trashing unknown content from the main assets folder?

We would still have a problem with the GtkR setup phase though. The path tree in the gamepack could be easily modified to it goes to 'share/default/script' instead of 'default/script', and then users can intuitively pick the top level folder 'quake2world' to install into and it'll be fine.

  • make GtkR add a search path for 'quake2world/default', in addition to 'quake2world/share/default'

On GtkR side this would be relatively easy. The q2w engine would need to support this as well.
On Linux/Mac that would be a third path coming in addition to 'quake2world/share' and '~/.quake2world'

  • make GtkR install content to My Documents\My Games${game}

That's more work. Would have to customize that game configuration dialog, just to go out and copy the content there. Then would still have to modify GtkR to look for assets in that location. From what you wrote I suppose the q2w engine already knows to look in that location.

On Linux and Mac we would be doing the same, but copying the content to ~/.quake2world instead.

I don't think Windows should be splitting content for q2w into two separate locations. It's a very unixy thing and tbh windows guys don't think that way. Plus that option is the most work.

Another thing I have completely ignored, because I don't know anything about it, is the toolchain. I don't know what map compiling stages there are, if the tools would need to be modified and customized as well to include those search paths etc.

@jdolan
Copy link
Collaborator Author

jdolan commented Jun 17, 2013

Thanks for looking into this one and for the thoughtful response.

The quake2world/share directory is new on the Windows side. It's something @maci0 decided to go with when he redid our Windows build system just last month. I was actually unaware of it until now. It used to be just the directory of the executable (e.g. Program Files/Quake2World) and My Documents/My Games/Quake2World. The default directory, in any context, is the game (mod) name.

I will look into the extent of the changes required to the game setup dialog, to see if there is a clean / reusable way to add this functionality. I'm thinking a checkbox that, if $prefix_win32 is set, says "Install for this user only" or something. The rest of the functionality required (i.e. making Radiant look in this location) is already addressed by my patch, I think.

Failing that, I can just start including everything Radiant needs directly in our game data. That, in combination with the current patch in this pull request, would get us rolling.

As for the toolchain, we provide our own BSP compiler (q2wmap). It's not critical, from our perspective, that it's accessible via the compile menu -- at least not right away. Is that acceptable for Radiant tho?

Thanks again for considering all of this.

@TTimo
Copy link
Owner

TTimo commented Jun 29, 2013

Now that the content is managed by q2w directly, and that patch has been merged in, I don't think there is any work remaining on that issue? If so, we can close it.

@jdolan
Copy link
Collaborator Author

jdolan commented Jun 29, 2013

I believe that's correct. I don't have access to Windows to test it, tho. It'd be great if someone could confirm that $prefix_win32 is working; i.e. Radiant will find textures and maps in My Documents\My Games\Quake2World\default.

@TTimo
Copy link
Owner

TTimo commented Jun 29, 2013

I'll give it a spin before closing

On Sat, Jun 29, 2013 at 1:24 PM, Jay Dolan notifications@github.com wrote:

I believe that's correct. I don't have access to Windows to test it, tho.
It'd be great if someone could confirm that $prefix_win32 is working; i.e.
Radiant will find textures and maps in My Documents\My
Games\Quake2World\default.


Reply to this email directly or view it on GitHubhttps://github.com//issues/165#issuecomment-20234622
.

@jdolan
Copy link
Collaborator Author

jdolan commented Jun 29, 2013

Thank you thank you thank you!

@TTimo
Copy link
Owner

TTimo commented Jul 5, 2013

Doesn't seem to work no:

  • I updated to the latest quake2world content, which grabbed the GtkR support files
    btw it is still doing that bug where the file permissions are completely borked after the rsync and have to be reset manually
  • I renamed C:\quake2world\share\default\map-wake.pk3 to C:\quake2world\share\default\map-wake.pk3.off
  • Expanded the content of map-wake.pk3 to C:\Users\ttimo_000\My Games\Quake2World\default
  • Started GtkR, load map etc. .. none of the map textures load (except the stuff that's in common)

WARNING: Activate shader failed for textures/trak5/pipez1a
WARNING: Activate shader failed for textures/trak5/pits1a
WARNING: Activate shader failed for textures/trak5/trim9e
WARNING: Activate shader failed for textures/trak5/wall4b
WARNING: Activate shader failed for textures/trak5/trim1a
WARNING: Activate shader failed for textures/trak5-2/vert1
WARNING: Activate shader failed for textures/trak5/trim1b
WARNING: Activate shader failed for textures/trak5/base1b
etc.

@jdolan
Copy link
Collaborator Author

jdolan commented Jul 5, 2013

I think the path it wants is My Documents\My Games\Quake2World\default

@TTimo
Copy link
Owner

TTimo commented Jul 6, 2013

C:\Users\ttimo_000\My Games\Quake2World\ has config files created by quake2world, so that's definitely where the engine is looking. Sounds like the project file template isn't setting up the right path (which is user dependent etc.).

@TTimo
Copy link
Owner

TTimo commented Jul 7, 2013

@jdolan says this works, and I'm seeing things.

@TTimo TTimo closed this as completed Jul 7, 2013
@IZaRTaX
Copy link

IZaRTaX commented Jul 31, 2013

Hi, can you make a surface inspector and "fluid" camera view like gtk radiant 1.5 ?

fixe the rotation "model" does not work in gtk 1.6..

and for 3d views texture can you do as cod4 radiant, that is to say textured face SEVERAL remaining press ctrl + shift right click of the mouse, it will be genial.

Sorry for my bad english im french.

-if you do not understand please let me know.

Have a nice day! :)

@Mateos81
Copy link
Contributor

You commented a closed ticket and totally out of topic ^^'

The Surface Inspector ticket is here: #195

The 3D view performances was often discussed, I don't know the state atm...

You may create a new ticket for your request or join the IRC channel and discuss it (#radiant at QuakeNet) :)

@IZaRTaX
Copy link

IZaRTaX commented Jul 31, 2013

Ok, thanks you for the information and sorry for the off topic ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants