Author Topic: repair/remove settings  (Read 2340 times)

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
repair/remove settings
« on: 30 December 2012, 23:04:34 »
I wasn't sure if this is more a bug or a feature request, but here we go:

The last days I often changed the monitor because I was on a LAN Party I have new hardware and so on ... All those monitors had different screen resolutions and I ended up on a small monitor with a huge resolution which I was not able to change from MG because the "ok" button was unreachable.

Another problem we had with last release was a broken language file and so on.

All those problems are very easy to fix for me by editing the ini files manually, but for computer noobs this might be hard to do. Even just removing the glestuser.ini is hard for them and makes MG unplayable for them. Maybe its a good idea to add a "program" that just removes all settings or just sets the default which is installed with MG and reachable via start menues.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
Re: repair/remove settings
« Reply #1 on: 1 January 2013, 01:26:03 »
What if the restore defaults option deleted glestuser.ini and automatically and created a new one instead of rewriteing the current one?
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: repair/remove settings
« Reply #2 on: 1 January 2013, 03:08:36 »
What if the restore defaults option deleted glestuser.ini and automatically and created a new one instead of rewriteing the current one?
As long as it stores still valid settings and applies them to the new one. Would suck to have to apply changes to the settings every time you update the program, though.
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: repair/remove settings
« Reply #3 on: 1 January 2013, 14:50:27 »
@Ishmaru: What should rewriting the glestuser.ini be good for ? I would just remove the whole file.

@Omega: This has nothing to do with updating the program. Usually we pay attention that new versions are compatible in the settings. It's just meant as a last help which results in a clear default state.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: repair/remove settings
« Reply #4 on: 1 January 2013, 19:26:27 »
FYI in svn, changing screen resolution or toggling fullscreen will happen right away in game when clicking OK. Then it asks to confirm with ok cancel to save the change.

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: repair/remove settings
« Reply #5 on: 13 January 2013, 21:01:24 »
Maybe when the game starts up it could check whether the configured screen resolution is actually onewhich SDL reports as supported, and falls back to one SDL reports as supported if not so? However, this change of behaviour would also require introducing a new INI option which forces overriding SDL resolutions (diables this check at startup) for people who really know what they're doing.

This only solves half of the problem discussed here, though. There is the other problem where any kind of no longer supported and now problematic INI options may cause the game to fail to start / provide grpahical output (and thus be unable to provide visual feedback in error situations for the largest group of  Windows users who don't know what cmd.exe is). And I don't have any real idea on how to solve this, other than to always run the game from a cmd.exe window and to pause (press a key) in case of a non-zero exit code of the megaglest.exe process, keeping the cmd.exe window open so the user can actually read the error message.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: repair/remove settings
« Reply #6 on: 14 January 2013, 18:28:15 »
Yes for this special problem this is a solution but for all the other currently unknown problems one can rise with an defective ini file it will not help.
The idea is to have a way to reset all user settings to make the game work again in case it doesn't start up anymore caused by the ini file.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: repair/remove settings
« Reply #7 on: 15 January 2013, 00:59:40 »
How exactly should it work. I have no desire to create another program to maintain. A command line option is easy but maybe too hard for windows users.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: repair/remove settings
« Reply #8 on: 16 January 2013, 13:01:05 »
Its not exactly a "program", its for example a script that removes the glestuser.ini file. If possible with a warning.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: repair/remove settings
« Reply #9 on: 16 January 2013, 13:38:50 »
You could just ship a shortcut that runs with the command line parameter?.
(for windows at least).
WiP Game developer.
I do danish translations.
"i break stuff"

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
Re: repair/remove settings
« Reply #10 on: 16 January 2013, 13:42:04 »
I think that to reset the game we should ship, with installers (only, since only there we know the exact setup), a POSIX and a Windows batch script which is accessible from the window managers' menu. Once run, these would prompt the user, then delete either all of $UserDataRoot, or, alternatively, both glestuser.ini and glestuserkeys.ini (which one is the better option?).

I don't think adding an option to the "megaglest(.exe)" binary to remove its very configuration files would be the right approach.

NB: I think this thread should go to "feature requests" since we're now discussing new code/an added feature (to overcome a possible issue).
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: repair/remove settings
« Reply #11 on: 17 January 2013, 05:33:55 »
I think that to reset the game we should ship, with installers (only, since only there we know the exact setup), a POSIX and a Windows batch script which is accessible from the window managers' menu. Once run, these would prompt the user, then delete either all of $UserDataRoot, or, alternatively, both glestuser.ini and glestuserkeys.ini (which one is the better option?).
Am I correct in assuming that "$userDataRoot" is the MegaGlest user folder containing the INI files along with downloaded mods? If so, I think that it'd be better to delete just the INI files, if that alone is enough to solve the problem. That way there's no need to redownload mods (or back them up before running a script).

Also, here's a batch script for deleting just the two INI files:
Code: [Select]
cd %APPDATA%/megaglest/
DEL /P *.ini

Should work for all versions of Windows NT. Note, however, that the windows command line is a bit buggy about drives. The CD command to change folders disregards the drive. As a result, if you're running the command line on drive F and want to change folders to appdata (which will be in drive C always, unless you manually moved it and make a symbolic link; Windows isn't very friendly with multiple drives), the cd command will fail since you're changing to a different drive. The only way to change drives is to manually type the drive letter followed by a colon (and interestingly, a prior cd command will be applied after changing drives). As far as I can tell, there's no way to derive the drive letter from the path of %appdata%. What does all this mean? The batch script must be on the same drive as appdata to work. So ideally, it would be in appdata and linked to (and if it's in appdata, only the second line is necessary).

Also, the /P flag after the DEL command will prompt the user Y/N to delete.

Oh, and we should also note that the folder containing the user data can be moved. Not sure how to deal with that, but presumably anyone with the experience to move the folder would be able to delete two files easily.
« Last Edit: 17 January 2013, 05:53:27 by Omega »
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
Re: repair/remove settings
« Reply #12 on: 17 January 2013, 09:26:08 »
For sure we will NOT remove the entire directory, only the  glestuser.ini file and maybe the glestuserkeys.ini too ( but I think this can be reset in game right ? )

If we delete the directoy people can loose a lot, like all their mods and so on !
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

 

anything