FAQ Search Memberlist Usergroups
Jolt Country Forum Index
Register Profile Log in to check your private messages Log in
Log in Log in

Hugor request/improvement - for RealNC
Goto page 1, 2, 3, 4, 5  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Jolt Country Forum Index -> Hugo's House of Horrors
View previous topic :: View next topic  
Author Message
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Sun May 26, 2013 6:10 pm    Post subject: Hugor request/improvement - for RealNC Reply with quote

EDIT: Latest versions of Hugor:

http://www.joltcountry.com/downloads/hugor/hugor-windows.zip
http://www.joltcountry.com/downloads/hugor/hugor-linux.zip
http://www.joltcountry.com/downloads/hugor/hugor-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.
_________________
the dark and gritty...Ice Cream Jonsey!


Last edited by Ice Cream Jonsey on Sun May 07, 2017 4:29 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
RealNC



Joined: 07 Mar 2012
Posts: 914

PostPosted: Mon May 27, 2013 5:00 am    Post subject: Reply with quote

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:

Code:
[geometry]
startFullscreen = true
fullscreenWidth = 1000
marginSize = 8
(etc...)


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.)
Back to top
View user's profile Send private message
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Mon May 27, 2013 8:49 am    Post subject: Reply with quote

Cool. As I get closer to releasing this, I'll get Hugor's code running and if you haven't added functionality for that, I'll do it.
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
RealNC



Joined: 07 Mar 2012
Posts: 914

PostPosted: Tue May 28, 2013 12:05 pm    Post subject: Reply with quote

I've implemented initial support for this. It's here:

http://foss.aegean.gr/~realnc/hugor/testing/Hugor-w32-2013-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:
[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


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)
Back to top
View user's profile Send private message
Roody_Yogurt



Joined: 29 Apr 2002
Posts: 1993
Location: Milwaukee

PostPosted: Tue May 28, 2013 2:28 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
RealNC



Joined: 07 Mar 2012
Posts: 914

PostPosted: Tue May 28, 2013 2:54 pm    Post subject: Reply with quote

The problem is that this approach is already taken by Gargoyle, so we'd have a conflict. You're shipping a "nextday.ini" yourself in "The Next Day", for example.

A solution might be an underscore suffix. (Like "mygame_hugor.ini", but that makes even less sense than just "hugor.ini".)
Back to top
View user's profile Send private message
Roody_Yogurt



Joined: 29 Apr 2002
Posts: 1993
Location: Milwaukee

PostPosted: Tue May 28, 2013 3:09 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Tue May 28, 2013 5:17 pm    Post subject: Reply with quote

RealNC wrote:
I've implemented initial support for this. It's here:


Gonna download this right now and try it out!

Quote:
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)


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.

I can't thank you enough, Nikos, I really appreciate this.
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
RealNC



Joined: 07 Mar 2012
Posts: 914

PostPosted: Wed May 29, 2013 2:35 am    Post subject: Reply with quote

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

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".

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?
Back to top
View user's profile Send private message
Roody_Yogurt



Joined: 29 Apr 2002
Posts: 1993
Location: Milwaukee

PostPosted: Wed May 29, 2013 10:35 am    Post subject: Reply with quote

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?


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).
Back to top
View user's profile Send private message AIM Address
RealNC



Joined: 07 Mar 2012
Posts: 914

PostPosted: Wed May 29, 2013 12:51 pm    Post subject: Reply with quote

I've uploaded a new dev snapshot:

http://foss.aegean.gr/~realnc/hugor/testing/Hugor-w32-2013-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:
[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
Back to top
View user's profile Send private message
Roody_Yogurt



Joined: 29 Apr 2002
Posts: 1993
Location: Milwaukee

PostPosted: Wed May 29, 2013 2:42 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
RealNC



Joined: 07 Mar 2012
Posts: 914

PostPosted: Wed May 29, 2013 3:47 pm    Post subject: Reply with quote

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).

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.

Unless you meant something else entirely...
Back to top
View user's profile Send private message
Roody_Yogurt



Joined: 29 Apr 2002
Posts: 1993
Location: Milwaukee

PostPosted: Wed May 29, 2013 4:15 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
Roody_Yogurt



Joined: 29 Apr 2002
Posts: 1993
Location: Milwaukee

PostPosted: Wed May 29, 2013 4:22 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
Roody_Yogurt



Joined: 29 Apr 2002
Posts: 1993
Location: Milwaukee

PostPosted: Wed May 29, 2013 4:32 pm    Post subject: Reply with quote

Also, just want to say that starting a game instantly in fullscreen is so badass.
Back to top
View user's profile Send private message AIM Address
RealNC



Joined: 07 Mar 2012
Posts: 914

PostPosted: Wed May 29, 2013 4:34 pm    Post subject: Reply with quote

Yes, if appName and authorName are not defined, then the general Hugor registry settings are used. So for the game to have its own settings, appName/authorName are mandatory.
Back to top
View user's profile Send private message
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Mon Feb 02, 2015 12:24 am    Post subject: Reply with quote

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.)
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
RealNC



Joined: 07 Mar 2012
Posts: 914

PostPosted: Mon Feb 02, 2015 12:28 am    Post subject: Reply with quote

Yeah, I'm way behind on that stuff (got a programming job, so I guess you know how that works out for hobby programming projects :-P)

I'll try and put something together soon.
Back to top
View user's profile Send private message
Ice Cream Jonsey



Joined: 27 Apr 2002
Posts: 20088
Location: Colorado

PostPosted: Mon Feb 02, 2015 2:28 pm    Post subject: Reply with quote

I can attempt to make releases as I have a Mac and Mint machine. I am just worried that I'm using a different library someplace than expected and I essentially ruin everything for everyone, of all-time.
_________________
the dark and gritty...Ice Cream Jonsey!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Jolt Country Forum Index -> Hugo's House of Horrors All times are GMT - 7 Hours
Goto page 1, 2, 3, 4, 5  Next
Page 1 of 5

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001 phpBB Group

Theme by Kage Musha - RPG Garden

Copyrights and trademarks are all of the belonging company. No copyright Infringement intended