Level Viewer for KEEN VORTICONS and GALAXY (and more...)

Here is where to post about the latest Commander Keen fangame or modification you've finished, a new website you've made, or another Keen-related creation.
User avatar
Fleexy
Tool Smith
Posts: 1354
Joined: Fri Dec 12, 2008 1:21
Location: Abiathar C&C
Contact:

Re: Level Viewer for KEEN VORTICONS and GALAXY (and more...)

Post by Fleexy » Mon Feb 20, 2017 1:12

Here's a PowerShell script that clips the 32-pixel-wide borders off all PNG files in the current folder:

Code: Select all

Add-Type -AssemblyName System.Drawing
gci *.png | % {
 $img = [System.Drawing.Bitmap]::FromFile($_.FullName)
 $clipped = [System.Drawing.Bitmap]::new($img.Width - 64, $img.Height - 64)
 $g = [System.Drawing.Graphics]::FromImage($clipped)
 $srcrect = [System.Drawing.Rectangle]::new(32, 32, $clipped.Width, $clipped.Height)
 $g.DrawImage($img, 0, 0, $srcrect, 'Pixel')
 $g.Dispose()
 $clipped.Save($_.FullName.Replace('.png', '-clip.png'), 'Png')
}
You can paste all of that right into the PowerShell console. For purposes of getting to the right folder, the "cd" command works exactly as you'd expect.

User avatar
Nisaba
Vorticon Elite
Posts: 791
Joined: Fri Jan 01, 2016 23:34
Location: The Outpost
Contact:

Re: Level Viewer for KEEN VORTICONS and GALAXY (and more...)

Post by Nisaba » Mon Feb 20, 2017 1:37

@Fleexy splendid! gonna batch it for the ease of use.
"We have come to conquer you all and bring you lots of candy!" | about me | my current project: play Keen mods on a GameBoy |

User avatar
K1n9_Duk3
Vorticon Elite
Posts: 467
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Re: Level Viewer for KEEN VORTICONS and GALAXY (and more...)

Post by K1n9_Duk3 » Tue Feb 21, 2017 21:48

Nisaba wrote:
Sun Feb 19, 2017 23:19
it seems to me that the VorticonsViewer v.1.3 stopped displaying the level title in the window-manager header...
Yeah, the BlitzMax libraries won't let me change the title of the main window after it is created, so I wouldn't be able to change the title (without having to close the window each time). Version 1.0 was able to display the level file name because you couldn't change the level while the program was running.
Quinton wrote:
Mon Feb 20, 2017 0:35
The only thing I think it could need is a way to remove the borders when exporting them (so people wouldn't have to do it manually), but that's just a minor thing.
It would have been possible to do that, but since the viewer has to support multiple games, I decided against it. Some games (Shadow Knights and maybe Dave 2) use "holes" in the border to indicate where the player can leave the level. In Rescue Rover, the border is only 1 tile (but still 32 pixels), and DDICI, Slordax and Hovertank don't even have a border.
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net

User avatar
Quillax
Vortininja
Posts: 102
Joined: Sat Mar 14, 2015 14:41
Contact:

Re: Level Viewer for KEEN VORTICONS and GALAXY (and more...)

Post by Quillax » Wed Jun 07, 2017 19:25

I used this for many other mods, and it's still working pretty great, although I did come across a few issues. Here's a list of them (along with a couple suggestions):
  • Some Vorticons levels don't seem to really like VorticonView. When I open those, the program says the level is in an unknown format, and then closes. This includes most levels from The Fastest Gun in the Universe, some levels from IceKeen, some levels from the Keen 1 Level Competition Level Pack, and some levels from the Keen 2 Level Competition Level Pack.
  • A few Vorticons levels seem to be missing some sprites when viewed with VorticonView. This includes the secret level (level 14) of Tom Bailey's 1st Levelpack (Keen and many Gargs are missing) and the level in Airefresco's Keen 2 Levelpack (the bottom-left corner of the map is missing Keen and many enemies).
  • I tried to open Keen 59 with GalaxyView, but while the levels loaded quite well, the graphics loaded as gibberish. I'm assuming that this might have to do with the file size of the EGA files of the mod.
  • It'd be nice if transparent graphics were viewed like how they are in-game, rather than just not being seen. For an example, the Slops from Keen 58 are just seen as a black outline in GalaxyView, although they are seen with green on their inside in-game.
  • Since the palette in Vorticons and Galaxy mods can be changed, it'd be great to at least have the ability to make the level viewers display different color palettes.

User avatar
K1n9_Duk3
Vorticon Elite
Posts: 467
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Re: Level Viewer for KEEN VORTICONS and GALAXY (and more...)

Post by K1n9_Duk3 » Wed Jun 07, 2017 22:12

Thanks for the kind word. It's good to hear that I wasn't just wasting my time when I wrote these programs.

I'm not too much into Keen mods (especially not Keen 1-3 mods) myself, so that's probably why there are some issues regarding mod support. Just keep in mind that mods using CKPATCH or hacked executables could change pretty much every aspect of the game. This means making sure that my tools support every mod ever made would be a huge amount of work, so that's most definitely not going to happen.

It would have been nice if you had included a few screenshots to show the actual issue (not error messages, but for things like "missing" sprites, it would be nice to have a screenshot of the level viewer and another screenshot directly from the game for comparison). And it would also be nice if you could include download links for the mods you mentioned. I was able to find the mods on the Keenwiki, but I'm not sure if they are identical to the files you were using.
  • I'll look into the "unknown format" issues. I'll be use the "Fastest Gun in the Universe" mod for testing, but I noticed the mod uses some low-level patches. I don't know if the patches change the way the game reads the level files, but if they do, there probably won't be any support for this in the viewer.
  • I had a look at Airefresco's Keen 2 Levelpack and the viewer seems to be displaying the sprites at the same position as the number icons (when sprites are disabled), so this issue might be related to the level fomat itself, like the previous one.
  • The automatic chunk type detection appears to fail for Episode 59's EGAGRAPH file. This is the first time I've seen this happening. Passing the correct values via a GFXINFOE.CK4 file or a modified GalaxyView.ini might fix this.
  • The "fake transparency" effect only works properly with the EGA tile drawing routines used by the game. Since the level viewers draw the tiles using the OpenGL or Direct3D API, it is pretty much impossible to draw the tiles exactly like they would appear in the game. But it would be possible to make the "transparent" parts visible in the viewer by using other features of the API such as alpha blending.
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net

User avatar
KeenRush
Android Dummy
Posts: 2524
Joined: Sat Oct 27, 2007 20:57
Location: KEEN1.EXE
Contact:

Re: Level Viewer for KEEN VORTICONS and GALAXY (and more...)

Post by KeenRush » Thu Jun 08, 2017 7:36

Hi, just noticed this convo by accident. Due to a bug in akeen 0.1 (the first version), levels saved in that editor aren't supported by most - if any - other Keen editors (akeen 0.1 was used to make The Fastest Gun In The Universe). Except for the old KeenEdit for DOS, if I remember correctly. The game, however, reads the levels perfectly. Any bugs went unnoticed for a while because despite using and testing the level editor extensively (I made at least two level packs and one full mod before noticing it), the actual game never had any problems with my levels, everything was always in game just as displayed in my editor, so I never encountered the problem. I can't remember what the bug was; I simply wrote the entire level-write operation again while perusing the level format more carefully, and then other editors began making sense of my levels.

However, I'm not the only one to have made some mistake. I've encountered at least one level that wasn't made in my editor but would not open correctly in my editor but would show up correctly in Keen. :p I think they did the same mistake I did with akeen 0.1 -- whatever that mistake was.
My newest mod - Planet Of Agony: https://pckf.com/viewtopic.php?t=4165 | codename H.Y.E.N.A.

User avatar
K1n9_Duk3
Vorticon Elite
Posts: 467
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Re: Level Viewer for KEEN VORTICONS and GALAXY (and more...)

Post by K1n9_Duk3 » Fri Jun 09, 2017 0:47

Update:
galaxyview_17.zip
vorticonview_14.zip
KeenRush wrote:
Thu Jun 08, 2017 7:36
However, I'm not the only one to have made some mistake.
Yeah, I have to admit that my RLEW routines had a bug. It didn't handle run lengths of 0 correcty (which are completely useless and shouldn't be in the level data to begin with IMHO). This RLEW bug was responsible for the missing sprites and icons.

The "unknown format" issue was caused by either too few or too many bytes in the RLEW encoded level data. This prevented the level viewer from detecting the compression type correctly (Dangerous Dave in Copyright Infringement uses the uncompressed version of the level format, all the other games use RLEW compression). I have improved my compression detection code and also added an option to open the level anyway when the detection fails.

The garbage graphics in Episode 59 were caused by the EGADICT.CK4 file that comes with the mod. The mod doesn't use this file, it uses the one in KEEN4E.EXE instead. Simply remove or rename the file and the level viewer works perfectly fine.

The new version of the Keen: Galaxy level viewer adds support for semi-transparent tiles and sprites. In the editor, they are displayed using alpha blending, which means the graphics will not look like they would in the game. But in the images exported with F3 (or CTRL+F3), the graphics should look exactly like they would in the game.

I missed Quillax's point about palettes earlier. At least in the Keen: Galaxy viewer, you can change the palette by modifying the settings in the INI file. Just have a look at the Rescue Rover 2 settings to see how this is done in the INI. In Keen: Vorticons, the palettes are hard coded. Maybe later versions will allow you to change the palette via the INI file as well.
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net

User avatar
Levellass
S-Triazine
Posts: 5261
Joined: Tue Sep 23, 2008 6:40

Re: Level Viewer for KEEN VORTICONS and GALAXY (and more...)

Post by Levellass » Sat Jul 08, 2017 22:31

K1n9_Duk3 wrote:
Fri Jun 09, 2017 0:47
Yeah, I have to admit that my RLEW routines had a bug. It didn't handle run lengths of 0 correcty (which are completely useless and shouldn't be in the level data to begin with IMHO). This RLEW bug was responsible for the missing sprites and icons.
If it's useless, pointless, should never, EVER be stumbled across... but is still possible in any way, you WILL have to deal with it, it's an iron law of programming.
What you really need, not what you think you ought to want.

Post Reply