KeenGraph questions, also Lemm

KeenGraph is a ModKeen alternative with extra features for Keen:Vorticons.
Post Reply

How should I handle patch filesz/

Create automatically
0
No votes
Create if absent, ad patches if present
2
25%
Use a switch option
5
63%
Don't create patch files at all
1
13%
 
Total votes: 8

levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

KeenGraph questions, also Lemm

Post by levellass »

Ok everyone, moving into Galaxy modding now, an issue that has emerged is patch file generation.

(Lemm, please skip to last issue.)


In modkeen a patch and bat file is created whenever graphics are imported. This seems pretty useless to me since you can't put patches in it, it's rewritten each time, so you have to copy stuff from it, and also know enough to open the .pat file in notepad (Or equivalent, shush, I'm windows based!)

The first question I must thus ask the modding community is: How should I handle patch file creation? The first option is how modkeen does it, except it will not be rewritten every time, meaning that a modder may create the file and use it for patching. A second option would be the same, except patchfiles already there would also be scanned and graphics patches added to them if they are not there, so a patch file made by the modder or another program can be used (The modder would of course need to name the patch file if it is not the default name.) The third option is to have an option, much like I have done with transparency, -patchfile="blahblahblah" would make the program create a patch file, otherwise it wouldn't. (In this option not creating patch files would be the default.) The final option is not to create patch files at all, and just include them in the 'extras' folder, if the modder wants them they can just copy them.

These options are not exclusive, it is possible for example to use the on/off option which also scans for existing patch files and creates/adds patches as appropriate. I value your comments on this.


The next issue is patch file extension. .PAT is traditional, but can be hard for new modders to work with. I prefer .TXT myself since this is a common file type most programs will know.


Final issue is for Lemm, KG needs to scan for things that may/will crash the game. For this I need to know how large the graphics can be before they exceed the game's memory limits, any and all restrictions (For example it already scans for sprites being too big and for more exotic games, patched files that will overwrite other data.) You were going to inform me, however you have yet to do so. I would like this information.
User avatar
Tulip
Posts: 394
Joined: Mon Jun 16, 2008 2:40 pm
Location: Heidelberg, Germany
Contact:

Post by Tulip »

I'd rather create my patchfile myself, but an option (-patchfile=blahblah) would be okay, if it's omission means no patchfile is created.
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

I don't know about galaxy, since stuff is cached so it depends on how you design your level. I don't know what the maximum chunk size is, if there is any (although there is a string that says "CA_FarRead doesn't support 64K reads yet.... so maybe that's the limit?) Pretty sure you can draw any size sprite. They can be any height, because there is vertical clipping at the edge of tehs creen, but I don't know about horizontal clipping.



For vorticons:

Screen buffer ends at A700, so that gives you $9000 bytes per plane of egalatch graphics, or $24000 altogether.

For sprites, these are stored in main memory along with sounds (and story/preview/gameend/helptexts for keen 1), so what I would recommend you do is add up the size of all of these files, then keep increasing the size of one of these files by 100Kb intervals until the game runs out of memory. Then do 10kb intervals, and 1kb inteverals until you find the exact size of extra data that one episode can handle.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

I don't know about galaxy, since stuff is cached so it depends on how you design your level. I don't know what the maximum chunk size is, if there is any (although there is a string that says "CA_FarRead doesn't support 64K reads yet.... so maybe that's the limit?) Pretty sure you can draw any size sprite. They can be any height, because there is vertical clipping at the edge of tehs creen, but I don't know about horizontal clipping
Maximum chunk size is indeed 64Kb, including 4 byte huffman dword at the chunk start. I am curious as to whether it's possible to remove the huffman code from the Keen games entirely (No need for the DCT files.) and what this would involve since it would speed up loading times in-game and with KG.

Sprite width again must divide by 8 (ALL EGA graphics must, remember) so that's a limit, no max width or height, I know the Galaxy limits pretty well, they're mostly with level design.

For sprites, these are stored in main memory along with sounds (and story/preview/gameend/helptexts for keen 1), so what I would recommend you do is add up the size of all of these files, then keep increasing the size of one of these files by 100Kb intervals until the game runs out of memory. Then do 10kb intervals, and 1kb inteverals until you find the exact size of extra data that one episode can handle.
This complicates things since a limit is only worth checking for if I can accurately predict when it is crossed. Since it depends on so many other files here, it's probably not worth checking for. I could check for text files and sounds (Wait, for Keen 2-3 are the internal files in memory or not? That would make this workable.) but that could be complex.
lemm
Posts: 554
Joined: Sun Jul 05, 2009 12:32 pm

Post by lemm »

This complicates things since a limit is only worth checking for if I can accurately predict when it is crossed.
Just find the maximum size of the egasprite+text before the game refuses to load. What's hard about that?
unntofas
Posts: 1
Joined: Tue Jan 08, 2019 6:40 am

Re:

Post by unntofas »

Tulip wrote: Thu Dec 02, 2010 10:29 pm I'd rather create my patchfile myself, but an option (-patchfile=blahblah) would be okay, if it's omission means no patchfile is created.
I think the answer is very relevant.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: KeenGraph questions, also Lemm

Post by levellass »

And one day I may even revisit KeenGraph.
Post Reply