Hugor request/improvement - for RealNC
Moderators: Ice Cream Jonsey, joltcountry
- Ice Cream Jonsey
- Posts: 30175
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
Hugor request/improvement - for RealNC
EDIT: Latest versions of Hugor:
http://www.joltcountry.com/downloads/hu ... indows.zip
http://www.joltcountry.com/downloads/hu ... -linux.zip
http://www.joltcountry.com/downloads/hu ... or-mac.zip
___
Hey Nikos --
Question for you. I copied my work in progress (Cyberganked) to a new laptop. I did not "install" Hugor, I just used the copy that I rename cyberganked.exe.
When I started it up, it did not start in full screen. It started in a window that was a square. I hate to guess what it started out as. 800x800 maybe?
The problem is that Cyberganked is not really designed for a window that small. I could (and should!) recognize a small window and tell the user to make it bigger. I will do that, now that I think about it. But is there any way for:
1) Hugor to default in full screen mode the first time it opens
2) Hugor to default to full windowed mode the first time it opens
3) Hugor to read a text file with what length and width it should open to?
I'm curious as to your take on it. I forsee a lot of people buying this game when it's done and I would hate for their first experience to have a screwed-up picture.
http://www.joltcountry.com/downloads/hu ... indows.zip
http://www.joltcountry.com/downloads/hu ... -linux.zip
http://www.joltcountry.com/downloads/hu ... or-mac.zip
___
Hey Nikos --
Question for you. I copied my work in progress (Cyberganked) to a new laptop. I did not "install" Hugor, I just used the copy that I rename cyberganked.exe.
When I started it up, it did not start in full screen. It started in a window that was a square. I hate to guess what it started out as. 800x800 maybe?
The problem is that Cyberganked is not really designed for a window that small. I could (and should!) recognize a small window and tell the user to make it bigger. I will do that, now that I think about it. But is there any way for:
1) Hugor to default in full screen mode the first time it opens
2) Hugor to default to full windowed mode the first time it opens
3) Hugor to read a text file with what length and width it should open to?
I'm curious as to your take on it. I forsee a lot of people buying this game when it's done and I would hate for their first experience to have a screwed-up picture.
Last edited by Ice Cream Jonsey on Sun May 07, 2017 4:29 pm, edited 2 times in total.
the dark and gritty...Ice Cream Jonsey!
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
That's a "no" to all three questions. The introduction of an *.ini file where the game can override default settings is actually in my TODO list. Something like:
It should probably also keep these settings separate from the generic ones (changing a setting in a game that comes with an ini file should not affect other games, and vice versa.)
Code: Select all
[geometry]
startFullscreen = true
fullscreenWidth = 1000
marginSize = 8
(etc...)
- Ice Cream Jonsey
- Posts: 30175
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
I've implemented initial support for this. It's here:
http://foss.aegean.gr/~realnc/hugor/tes ... -05-28.zip
The ini file has to be named "hugor.ini" and it's case sensitive (important for Linux.) It currently has the following format:
The key names are not case sensitive. One thing to watch out for is that appName and authorName are used for saving preferences (that's the registry on Windows). This makes any changes the user makes to the various configuration dialog settings exclusive to this game. So if you change those keys, you will be creating new Windows registry entries each time. Also note that both of those keys must be either set or not set (because both are needed for constructing a valid registry key.) You can also use double-quotes for those string values.
More keys can be added to hugor.ini. Maybe font sizes? What else? We can go crazy here with ideas (unless they're too much work to implement :-P)
http://foss.aegean.gr/~realnc/hugor/tes ... -05-28.zip
The ini file has to be named "hugor.ini" and it's case sensitive (important for Linux.) It currently has the following format:
Code: Select all
[Display]
; Application name.
; If this is set, authorName must also be set.
appName = My Game
; Author/organization name.
; If this is set, appName must also be set.
authorName = My Name
; Start in fullscreen mode.
fullscreen = true
; Maximum display width in fullscreen mode.
; The value is in pixels.
fullscreenWidth = 900
; Hide the menu bar.
hideMenuBar = true
More keys can be added to hugor.ini. Maybe font sizes? What else? We can go crazy here with ideas (unless they're too much work to implement :-P)
-
- Posts: 2255
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
I haven't looked at it yet, and I'm sure it works great. I just wanted to note, though, that when I was envisioning this, I thought the *.ini file that Hugor looks for would share the name of the game file, especially since I figured this kind of game-optimization would be used a lot when hugor.exe is also named after the game file.
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
-
- Posts: 2255
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
Ah, yes, that is a good point. On one hand, I think Hugor's configuration file system is more important than Gargoyle's; in the past, I have used Gargoyle's .ini system to weakly enforce color schemes for some of Robb's games or, as in the case of The Next Day, to make sure the screen was wide enough (in retrospect, I should have just made the game complain if the screen isn't wide enough... and I'll probably do that in a future release now). Given what Hugor can do for the presentation of a game, I would say it's a bigger priority.
Still, I can understand the hesitance towards overlapping .ini usage. Maybe Hugor's current approach will be fine.
Still, I can understand the hesitance towards overlapping .ini usage. Maybe Hugor's current approach will be fine.
- Ice Cream Jonsey
- Posts: 30175
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
Gonna download this right now and try it out!RealNC wrote:I've implemented initial support for this. It's here:
Ah yes, could we please! Font sizes for proportional and fixed is pretty important for me as the graphics in my games require the fonts to be of certain sizes so that they would look correct.More keys can be added to hugor.ini. Maybe font sizes? What else? We can go crazy here with ideas (unless they're too much work to implement :-P)
I can't thank you enough, Nikos, I really appreciate this.
the dark and gritty...Ice Cream Jonsey!
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
The worst part is that we can't have a combined ini file. For example adding a "[Hugor]" section to a Gargoyle *.ini. That won't work because Gargoyle's "ini" files aren't actually ini files. They use a custom format that's incompatible with standard ini-file parsers. It would have been more appropriate for them to have a ".cfg" suffix rather than ".ini".Roody_Yogurt wrote:Ah, yes, that is a good point. On one hand, I think Hugor's configuration file system is more important than Gargoyle's
Also, we can't really ignore Gargoyle and try to claim "gamename.ini" for ourselves, because that would leave authors with no way to provide both Hugor and Gargoyle configuration files at the same time (many people do prefer Gargoyle, especially for text-only games.) And it would confuse Gargoyle anyway if it tries to load a "gamename.ini" that's actually intended for Hugor.
However, one way around the issue would be to drop the ".ini" suffix and go for something else. Maybe *we* could pick the ".cfg" suffix instead?
-
- Posts: 2255
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
Yeah, that'd be reasonable. Another alternative would be to use an extension like ".hugor" or something. I also looked up ".hgr" but that is used by some Apple II graphics format (while I'm not really worried about Hugor clashing with Apple II, "hgr" seems reasonably generic enough that other stuff out there probably uses it, too).RealNC wrote:However, one way around the issue would be to drop the ".ini" suffix and go for something else. Maybe *we* could pick the ".cfg" suffix instead?
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
I've uploaded a new dev snapshot:
http://foss.aegean.gr/~realnc/hugor/tes ... -05-29.zip
Instead of "hugor.ini", it now looks for "<basename>.cfg". The defaults specified in the cfg file only have an effect if the user didn't already run the game at least once. So if any changes to the standard preferences dialog are made, those will be kept. This only applies to cfg entries that are configurable in the preferences dialog.
Another change is the use of the appName string instead of "Hugor" in the title bars of the preferences and quit confirmation dialogs.
Oh, and "hideMenuBar" is now working correctly.
I've also added more options to the cfg. The new format is:
http://foss.aegean.gr/~realnc/hugor/tes ... -05-29.zip
Instead of "hugor.ini", it now looks for "<basename>.cfg". The defaults specified in the cfg file only have an effect if the user didn't already run the game at least once. So if any changes to the standard preferences dialog are made, those will be kept. This only applies to cfg entries that are configurable in the preferences dialog.
Another change is the use of the appName string instead of "Hugor" in the title bars of the preferences and quit confirmation dialogs.
Oh, and "hideMenuBar" is now working correctly.
I've also added more options to the cfg. The new format is:
Code: Select all
[Identity]
; Application name.
; If this is set, authorName must also be set.
appName = My Game
; Author/organization name.
; If this is set, appName must also be set.
authorName = My Name
[Display]
; Start in fullscreen mode.
; true or false.
fullscreen = false
; Maximum display width in fullscreen mode.
; The value is in pixels.
fullscreenWidth = 900
; Hide the menu bar.
; true or false.
hideMenuBar = true
; Left/right margin in pixels.
marginSize = 40
; Size of proportional-width font.
; The value specifies a point size, not pixels.
propFontSize = 13
; Size of fixed-width font.
; The value specifies a point size, not pixels.
fixedFontSize = 4
; Use a bilinear filter when scaling images.
; true or false.
imageSmoothing = true
[Media]
; Pause audio when application loses desktop focus.
; true or false.
backgroundPauseAudio = true
-
- Posts: 2255
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
I gave it a try. It's looking good. Under Windows 7, though, I'm finding that changes to the .cfg file aren't being recognized unless you alter the appName/authorName fields (creating a new registry entry). Hmm, that gives me an idea...
(goes and runs Hugor as administrator, just to make sure that isn't affecting the registry-writing)
Hmmm, no, the problem is still there.
(goes and runs Hugor as administrator, just to make sure that isn't affecting the registry-writing)
Hmmm, no, the problem is still there.
- RealNC
- Posts: 2301
- Joined: Wed Mar 07, 2012 4:32 am
As mentioned in the post, settings already present in the registry will override those from the cfg. Otherwise the user's preferences would get lost between restarts.Roody_Yogurt wrote:I gave it a try. It's looking good. Under Windows 7, though, I'm finding that changes to the .cfg file aren't being recognized unless you alter the appName/authorName fields (creating a new registry entry).
Unless you meant something else entirely...
-
- Posts: 2255
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
Ok, I missed where you said that was the intended behavior, but I disagree with it being the best behavior. I think it'd be better if the player could continue to tweak the .cfg file until the environment is exactly like how he or she wants.
Ok, I guess I get what you're saying, that even though that, having run it once, I can't change the settings from the .cfg, changes made within Hugor after the fact are kept in that game's registry setting.
Hmm, no, that doesn't seem to be the case, having tested it now, so yeah, I think it'd be better if .cfg info overrode the registry settings.
Ok, I guess I get what you're saying, that even though that, having run it once, I can't change the settings from the .cfg, changes made within Hugor after the fact are kept in that game's registry setting.
Hmm, no, that doesn't seem to be the case, having tested it now, so yeah, I think it'd be better if .cfg info overrode the registry settings.
-
- Posts: 2255
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
Ok, the problem was that both when I used the default .cfg template (where appName was MyGame) and my edited one where I just commented out that and authorName, my changes were recognized once and then were ignored from then on.
Having edited appName and authorName to use quoted strings like recommended earlier in the thread has fixed the problem. Now changes between versions of my .cfg file are being recognized.
Having edited appName and authorName to use quoted strings like recommended earlier in the thread has fixed the problem. Now changes between versions of my .cfg file are being recognized.
-
- Posts: 2255
- Joined: Mon Apr 29, 2002 6:23 pm
- Location: Milwaukee
- Ice Cream Jonsey
- Posts: 30175
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact:
So it looks like there's been 33 commits since the last release on Github for version 1.0.
Nikos, would it be possible to create a new release with all the changes since then? 1.01 perhaps?
I'm going to try to make one-click download solutions for my games for Mac, Linux and Windows, but it looks like IF Wiki is pointing people to a version which doesn't have .cfg support among other things.
(I think 2015 is the year I try to get absolutely everything updated for Hugo. It's killing me that I don't have the latest compilers for Linux and Mac on the IF Archive, but I'll deal with that ASAP.)
Nikos, would it be possible to create a new release with all the changes since then? 1.01 perhaps?
I'm going to try to make one-click download solutions for my games for Mac, Linux and Windows, but it looks like IF Wiki is pointing people to a version which doesn't have .cfg support among other things.
(I think 2015 is the year I try to get absolutely everything updated for Hugo. It's killing me that I don't have the latest compilers for Linux and Mac on the IF Archive, but I'll deal with that ASAP.)
the dark and gritty...Ice Cream Jonsey!
- Ice Cream Jonsey
- Posts: 30175
- Joined: Sat Apr 27, 2002 2:44 pm
- Location: Colorado
- Contact: