String Safety

Discuss programming topics for the various GPL'd game engine sources.
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Post by mankrip »

Nice ideas mh, and would actually be useful for playing the game from read-only places like network folders or CD/DVD-ROMs.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

mh wrote:
Sajt wrote:It keeps changing. It's either AppData, or My Documents, or My Games, or My Documents/My Games, or Local Settings/AppData, ...

I think you are supposed to put "hidden" cache-like stuff (the same sort of thing as GLQuake's ms2 files, for example), in AppData, and put the user-config stuff (screenshots, saves, config) in My Games.
That's why you should use SHGetFolderPath - you don't need to worry about that stuff if you just do it the right way. :wink:
I wasn't talking about how to get the paths, I was talking about the stupid amount of paths that games have used, and which paths should be used for which things.

Also, I don't remember SHGetFolderPath having My Games, for example. I guess you can append "My Games", but what if Windows 8 renames it to "My Gamezz" or something?
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Post by revelator »

aye has changed a fair bit over the last few windowses.

like 7 does it seems to be the final way i think, it even stores msys and cygwin data paths in the windows user folders now.

vista did also but screwed up a fair bit sometimes i havent had any problems with that on 7.

well besides my gfx card crashing :lol: (not related)
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re:

Post by Baker »

mh wrote:That's why you should use SHGetFolderPath - you don't need to worry about that stuff if you just do it the right way. :wink:
Old thread, thread title drifted ... but really great thread.

Anyways ... I'm thinking about Windows and sweating over this.

DarkPlaces made Spirit upset by using a "single place" to store config, making Retroblazer fight DarkPlaces Quake. Which is wrong.

If I do the above or go for the registry, I'm interfering with the ability of 2 separate "installations" operating separately.

Ugh.
mh wrote:Nothing in the engine should write outside of the Quake folder, period.
Winner.

(Yeah I needed to think everything through to be certain. In a way, I don't like writing to "Program Files" and it is sort of worse that you really aren't writing to "Program Files" in Window 7/8/Vista. Still the other options suck and get away from the "Sheesh can I just copy my Quake folder and not worry about 50 other places and my registry to find all my files".

Simple > Complex)
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
Spirit
Posts: 1068
Joined: Sat Nov 20, 2004 9:00 pm
Contact:

Re: Re:

Post by Spirit »

Baker wrote:DarkPlaces made Spirit upset by using a "single place" to store config, making Retroblazer fight DarkPlaces Quake.
Iirc the problem was that the Retroblazer developer did blindly use id1 for his game directory. Not sure, I died in the maze map and never once looked back at the game.
Improve Quaddicted, send me a pull request: https://github.com/Quaddicted/quaddicted-data
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: String Safety

Post by mh »

I've a -multiuser command-line option in my current code that will use the user profile directory instead of the Quake directory (just a COM_AddGameDirectory of the relevant profile path so it also allows per-user content override). In the years since I've come to see both sides of the argument - yes, multiple Quake installs needs to be supported, but also - yes, you need to support cases where more than one person uses the same machine. I wouldn't like to get someone else's config or save games, so it's nice to have this escape hatch. The default behaviour is unchanged, of course.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: String Safety

Post by leileilol »

FYI SHGetFolderPath will kill Win9X support

but i'll mention KernelEx does an 'emulation' of it by having a My Documents folder in the C:\ root for that
i should not be here
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: String Safety

Post by mh »

I killed Win9x support a loooooooooong time ago. Happy days. :D
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: String Safety

Post by revelator »

it does have its uses to have an old dedicated PC with win9x :) sadly you will run into some hurdles nowadays if you try a fresh install of say win98 SE as there are no updates avaliable from windows update anymore (site just keeps refreshing).
so to have the fixes that came later on you should have backed up the windows updates. kernelex is neat :) allows me to run software developed for later versions of windows on 98.
Productivity is a state of mind.
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: String Safety

Post by mh »

Drivers are a big problem. Old hardware dies and new hardware doesn't get Win 9x drivers. A VM helps a lot, but they're dropping support too. Plus it was a crap OS to begin with (I usually used NT4 back in those days unless I really encountered something that just wouldn't run on it - which was rare enough but did occasionally happen. As soon as Win2k was released I threw it out and never looked back). Not working on Win9x is a pretty piss-poor excuse to not do something IMO; unless you know for an absolute fact that you're targetting and that you have to target an incredibly explicit and very small user base you're wasting your time and compromising your program on account of a 17-year-old OS that only die-hard hold-outs and nostalgia buffs still use. Neither are in my target user base.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: String Safety

Post by mankrip »

Really good points. Sometimes I think about that kind of stuff in regards to the software renderer.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: String Safety

Post by revelator »

id prefered NT4 also but there where edge cases like directx. NT4 only supported version 3 and could only be upgraded by using hacks and only to version 6, opengl worked a treat though.
and it costed an arm and a a leg back then :P.
i also changed to 2000 when it came out, but occasionally i had to use win98se for some games and programs. with XP i ditched win98se completely.
Productivity is a state of mind.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: String Safety

Post by leileilol »

I run Win9x because I have some hardware and games that don't run on NT at all and I often don't have space to dual-boot Windows 2000 on the old hardware.
I maintain 9x boxes for testing and gaming reasons (Dosbox isn't perfect), and developing Quake stuff on a ludicrously ludicrous computer isn't much of an offering for performance profiling

if you think Win95 is bad, at least it's not the psp :D
i should not be here
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: String Safety

Post by Baker »

leileilol wrote:I run Win9x because I have some hardware and games that don't run on NT at all and I often don't have space to dual-boot Windows 2000 on the old hardware.
A few times I went to Media Play (which went out of business) and bought several hundred $$$ worth of games after Christmas with the games heavily discounted. I had a Win 98 machine until about 2004. Sadly, maybe 2/3 of those games do not work on Win XP or later. Unsurprisingly, I haven't played most of those games in quite a while.
leileilol wrote:if you think Win95 is bad, at least it's not the psp :D
Didn't Win95 run on 8MB machines? The PSP has at least 32 MB. I'm just saying. I don't think there is anything inherently wrong with liking a PSP, although the demographics are far younger than any other platform. Which comes with an equally "unadjusted to reality mindset followed with unimaginative ideas and unrealistic expectations."

And I do have to say, in the age of iPhones, Android and iPads and iPod Touch ... with the mobile competition having a minimum OpenGL ES 1.1 and liberal "app store policies" versus Sony's control-freak "we have to like your idea for your game to even have a chance" makes the PSP a bit unappetizing compared to mobile platforms with far more generous specs.

Based on my understanding of history, I do not believe the Playstation Vita is going to viable.

Phones will rule this upcoming era. There will not be room for "portable" non-phones. Sony and Nintendo are going to die (in the portable market).

This is assuming that government (probably Europe) doesn't gaze with an evil eye looking at the phone market and asking the hard questions. Apple had the foresight to see way back in 2004 that the phone market was "everything" and Google seeing this came up with the Android platform that allowed big-time carriers to have a high quality OS on the cheap with the level of control they want.

But until the evils of phone market tie-in are realized by governmental entities, I do think Sony and Nintendo are going to crash and burn in the mobile market. Sony is a colossus, they'll be able to weather through 10 years of failed ambitions (it'll be less than that). Nintendo may not have that kind of luxury.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: String Safety

Post by mankrip »

Sony has the Xperia Play, which is already setting some standards for Android gaming, so they're not going to lose all of the portable market easily. If the hardcore handheld gaming market dies, they'll still survive in the mobile phone gaming market.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
Post Reply