Technical reason for the name of "Game.agf"?

Started by monkey0506, Sun 27/03/2011 18:55:52

Previous topic - Next topic

monkey0506

Hey, I was wondering, along with Ryan Timothy, why the Game.agf file is always named "Game" instead of, for example, using the name of the project folder (as is done with the EXE). I actually managed to write some changes to the editor that allowed it to do this, and it apparently was working fine.

To do so, I did have to change some const static fields into readonly static properties, so I'm unclear what the underlying consequences of that might be, but as I said I was able to get this working, even with templates or existing projects that had the "Game.agf" file.

The reason behind this change would be to take advantage of the Windows "Recent Documents", which, alongside a file association for AGF files, can be useful if you're working on several projects at once (especially like I do for various modules and such).

Also, if CJ reads this, could I maybe get check-in rights to the repository? Thanks ahead of time. :=

Gilbert

Why not use a unified name? This can prevent problems (such as creating lots of useless "temp" files in the folder) when you make a copy of or rename the whole folder.

TBH, craps such as "My Documents" and "Recent Documents" shouldn't even exist at all...

monkey0506

It wouldn't matter if you renamed or copied the the project folder, the AGF file would just be updated whenever the project was next saved. The only time any copying of the AGF file would be done at all is when starting a new project, and then the template's AGF would simply be copied to the new AGF. That would represent the only case of a temporary file being created, and it would be deleted as soon as it was copied.

Just because you don't personally find automatically generated/updated shortcuts to recently used documents to be a useful feature does not mean no one else would. That, and from what I can tell there's not a technical reason for using a unified file name. Ultimately this type of change would benefit those who use shortcuts, like the Recent Documents, without any real negative impact to those who don't. In fact, it could even be made a customizable preference. Why would That be bad?

Gilbert

Actually I have checked, you can rename Game.agf to whatever names you want and open it in the editor, but once you save the game again it will save it as Game.agf, making a copy of the original file in the folder.
Based on this, if the AGF file would following the name of the folder, say if you name your game "Monkey" at first the file will be saved as Monkey.agf, and if for whatever reasons you rename the folder to say, "Ape" you can open Monkey.agf from the editor, but when you save it again, it will create Ape.agf, leaving the original Monkey.agf in the folder, which is quite annoying.

Personally, I hope that association of the game files to the editor (and thus includes Recent Documents) should be prohibited, as there isn't anything wrong with launching the editor directly and then load a project from it. This is especially true when you need to keep multiple versions of the editor at the same time.

monkey0506

#4
The installer already makes the AGF file association optional anyway, and if you use the RAR archive then you avoid it altogether. However, not everyone shares your personal preferences for using the editor or Windows. I, for example, find it easier to navigate to the project folder and use a file association to open the AGF file. As for you, there is absolutely nothing forcing you to have the association set.

And regarding your test, I was already aware of the scenario you described. That is precisely why I wrote the modifications to the editor that I already mentioned that I made in my own tests. (Edit: Just in case this wasn't clear, I wrote modifications to prevent the duplication of the AGF file by ensuring that only the correct one would remain in the project folder when you save.)

You're not saying anything more, from what I can tell, than that you would not personally find such an option useful. As I already said it could very easily be made entirely optional, so it wouldn't affect you in any way, but would be useful for some people. I don't see why you're so apparently against that.. :-/

TomatoesInTheHead

I would much appreciate if the .agf filename would be the one used for the generated .exe (or even better, the executable's filename could be customized in a general setting) and instead the folder name could be anything.

Pumaman

There's no technical reason for "Game.agf", it's just that at the time there was no particular reason to have a game-specific name either.

However now that the Recent Documents list has become more obvious in Windows 7 due to the way it's displayed, it probably is worth changing this. Note that any change would need to take account of characters like \ and / in the game name which are not legal filename characters. Also the old .AGF file would need to be deleted when the one with the new name was created.

This would go hand-in-hand with an option to specify the game EXE name in the Global Settings, this could then control the name of both the AGF and the EXE.

QuoteAlso, if CJ reads this, could I maybe get check-in rights to the repository?

Yes, though first we need to agree a process whereby changes can be proposed and accepted/rejected before people start randomly checking things in when they feel like it.

monkey0506

It probably wouldn't be reasonable or desirable to have a slew of different branches, so I was thinking that perhaps we could create a newer (new and improved!) version of what the bug/feature tracker was designed to be. Users with check-in rights for the repository would be able to add new entries to the list (or edit their own). People would be able to use forum logins to rate entries to get an idea of what type of priority the community as a whole would give them, and they could comment on and discuss the entry there as well.

That obviously wouldn't be a small task to create this type of system, but it seems to me like it could prove fruitful..maybe? :=

I'll take another look at the modifications I made regarding the AGF file, but I think it works pretty well with the scenario you described CJ.

SMF spam blocked by CleanTalk