Ambrosia Garden Archive
    • Any Chance for Imported Graphics?


      I absolutely love the concept of this game. It really reminds me of some of the sketches I used to do in class back far too many years ago. Of course, that immediately made me want to dig up some of those sketches and use them to make my own version. Any chance the editor will ever support importing you own graphics?

      Just thought I'd ask.

    • officially? probably not.

      is it possible? yes, very. The method was determined by people more clever than I in beta.

      This post has been edited by Veritus Dartarion : 03 December 2006 - 11:15 PM

    • Yes, it is possible to change the game's graphics. Unfortunately, it appears that the new graphics must be the same size as whatever existing graphics you are replacing, and it is not possible to create new sprites without replacing any old sprites.

      If you open the Sketchfighter application package and go to the Contents->Resources->Data->Textures folder, you can open the "spritemapX" files to see how they're laid out. I recommend opening them in something that displays a pattern for transparent backgrounds, such as GraphicConverter or PhotoShop- not Preview. If whatever you open them in says it can't read the files, temporarily add ".tif" to the ends of their names.

      Edwards

    • Basically, you do that by modifying some data files for the game, like in, say, Apeiron X. The relevant files are inside the application package: ctrl- (or left-)click the application, and pick "Show package contents". Then go to Contents/Resource/Data/Textures/. You can find there the Spritemap# files that hold the sprites, they are in fact image files in tiff format: if you cannot open them, add a .tif extension for them to be recognised as such (but don't forget to remove it after use or the game won't find the file since you renamed it); alternatively the more tech-saavy could give them the type code TIFF, that would avoid the trouble of renaming back and forth, but doing so is more complicated.

      One thing that may surprise you is that the image is (often) all white, but more or less transparent white, so if you view it with an editor that doesn't understand transparency you'll only see white; I advise to view it with Preview, with the background set to be a rather dark grey (though an editor that displays a background made of a pattern instead of a solid color will be better). Notice it's not all or nothing transparency, you have a full alpha channel for partial transparency which allows anti-aliased edges and other such goodness (for instance, check out the eraser smudges in Spritemap6). Since the sprites are supposed to be drawn with a pen on graph paper, the interior is actually transparent and not white, so the interior is transparent as well in the Spritemaps. Now why are the actual drawn parts white? It's to allow this white to be multiplied with the actual color you specify for the sprite in the editor, thus making the sprite be of this color. Also, if you check out the color symbols in Spritemap6, you see that there are black parts, these stay black while the white parts will be whatever color you specify, you can even put grey parts which will be a darker color that the color specified in the editor, allowing you to make a transition between the color specified in the editor and the black.

      All this transparency stuff means that there aren't many image editors that are going to be able to edit these files correctly; in fact, they have been created using Photoshop CS for the Mac. Not owning Photoshop, I cannot give you precise instructions on how to turn your drawings into stuff suitable for being put there, though the basic process should go as this: first take your One Pen drawings on white paper and scan them, then you should probably do a little histogram correction to flush everything close to black to 100% black, and everything close to white to 100% white, leaving only a few edge pixels to be in between the two (don't unsharp mask or anything like that as with EV Nova sprites, though: we can keep the antialiased edges here as we have full alpha transparency in-game); also, you will need to resample your scan (probably done at a quite high resolution like 300 dpi) down to 72 dpi or the sprite will be way too big (notice you could concievably use such big sprites, and apply a scaledown factor in the editor: you would have ultra-sharp sprites, but it would be useless since the sprites are going to be shown on the screen and pixellated at 72 dpi at that point, and it would quickly eat up main memory and video memory). Once it's done, invert the image (i.e. turn white into black and black into white), then somehow specify this image to be the alpha channel of a fully white image of the same size (I have no idea on how you do it, honestly). Then copy this image, and paste it instead of the original in the relevant Spritemap file. Your image cannot be larger than the original (even if there is space in the Spritemap) or the parts outside the bounding rectangle wont be taken into account, and will be cut out (another reason for downsampling your drawing). The same way, the collision rectangle will stay the same, as well as the rotation center, so position your sprite right!

      Notice it is technically possible to modify these coordinates, but it requires hacking yet another file and I won't enter this matter. Also, if you don't want to modify the existing sprites (so that the main game stays the same) but would like to add new sprites for use in your custom level, they could concievably be added but that would require even more complicated hacking, and anyway the same hacking would need to be applied (or your hacked files would need to be put instead of the normal ones) for people to be able to play your custom level, so you can see that begins to look less and less like a good idea. So try and use the already existing sprites, by good combinations and parent-child links you can already pull off pretty impressive stuff, just check out SampleBossQuest in the sample levels.

    • @zacha-pedro, on Dec 5 2006, 01:24 PM, said in Any Chance for Imported Graphics?:

      Notice it is technically possible to modify these coordinates, but it requires hacking yet another file and I won't enter this matter. Also, if you don't want to modify the existing sprites (so that the main game stays the same) but would like to add new sprites for use in your custom level, they could concievably be added but that would require even more complicated hacking, and anyway the same hacking would need to be applied (or your hacked files would need to be put instead of the normal ones) for people to be able to play your custom level, so you can see that begins to look less and less like a good idea. So try and use the already existing sprites, by good combinations and parent-child links you can already pull off pretty impressive stuff, just check out SampleBossQuest in the sample levels.

      It should be simple to "solve" this problem with AppleScript. Just have a script that swaps out your assets for the originals, then starts the game. You could even leave the starter open and set a reasonable polling interval - say, 5 second; that shouldn't affect game performance at all - so that when the game is quit, the original assets are swapped back in. Alternately, you could just have a script that makes the swap and leave it to the user to run it before and after playing.

      I haven't looked at the files in question, but maybe adding additional sprites would be the way to go. I'll have to see what I can figure out...

    • By the way: you may notice that there is only one version of each sprite in the spritemaps, the one where it points up; there are not all the rotated frames as in (for instance) EVs, sprites are rotated in hardware. This means that you cannot use the Sketchfighter engine to have sprites with a lighting direction or a non-top rendering angle like in Nova, this engine is best suited, for, you guessed it, hand-drawn doodles or other such simple graphics (like the wireframes of Asteroids; even Maelstrom sprites have lighting and non-trivial rotation).

      cheleball: I don't really find such hacking satisfying, but it should technically work. Notice I've figured out myself some of the internal data formats, but I'm not going to document them, for various reasons.

    • @zacha-pedro, on Dec 7 2006, 10:26 AM, said in Any Chance for Imported Graphics?:

      cheleball: I don't really find such hacking satisfying, but it should technically work.

      Well, I do. 😛 I wish I had a few evenings to spend on it right now. Cursed finals.

      This post has been edited by cheleball : 09 December 2006 - 08:34 PM

    • Just stole some time from studying to make a quick mockup (y'know, test the waters, see what's what) of a replacement ship. I give to you...the King of Spades:

      Attached File Custom_Ship_Shot.jpg (61.34K)
      Number of downloads: 83

      OK, so it's kinda ugly...I was in a hurry. But it gives a glimpse of what can be done...

    • Impressive. Not bad at all.

    • what ever happened to greg's Starbridge? I think I have the kestrel I made hanging around somewhere, but that was nowhere near up to the same standard.

    • I still have it:

      For your information everyone else, this was the first such modification, early in the beta, by Insomniac.

    • Ooooooo! Neato!

    • Yes, quite. He/you ought to upload it. 🙂

    • @zacha-pedro, on Dec 10 2006, 02:22 PM, said in Any Chance for Imported Graphics?:

      I still have it:

      For your information everyone else, this was the first such modification, early in the beta, by Insomniac.

      Hey, I discovered how to do it and made the first mod (my kestrel)

      I was the first one to finish the game too, but nobody ever remembers me....

      But then I got busy, and did considerably less on the beta list.

    • Oops, sorry, insomniac even mentions you in the betalist email, but oddly enough I've never seen your Kestrel mod nor the instructions from you he mentions. Guess I never got your email.

    • Me neither. I do not remember.

    • @zacha-pedro, on Dec 6 2006, 09:24 AM, said in Any Chance for Imported Graphics?:

      You can find there the Spritemap# files that hold the sprites, they are in fact image files in tiff format: if you cannot open them, add a .tif extension for them to be recognised as such (but don't forget to remove it after use or the game won't find the file since you renamed it); alternatively the more tech-saavy could give them the type code TIFF, that would avoid the trouble of renaming back and forth, but doing so is more complicated.

      Tip: hold command while dragging a file onto an app to force it to try to open it. Graphic Converter doesn't mind though and will always try to open any file.

      @zacha-pedro, on Dec 6 2006, 09:24 AM, said in Any Chance for Imported Graphics?:

      Once it's done, invert the image (i.e. turn white into black and black into white), then somehow specify this image to be the alpha channel of a fully white image of the same size (I have no idea on how you do it, honestly).

      No, alpha channels are black for opaque and white for transparent so the image should already be in the correct format for an alpha channel.

      Here's the quick way of modifying graphics, using Graphic Converter as an example:
      1. Locate spritemap files.
      2. Make a backup of the file you want to edit.
      3. Drag the file you want to edit onto Graphic Converter.
      4. Go Picture -> Alpha Channel -> Show Alpha/Mask Channel. You will see the sprites as black drawings on a white background.
      5. Now you can modify it however you like: erase a sprite and draw in your own, paste in an image you scanned or whatever.
      6. Save 🙂

      This post has been edited by Guy : 08 January 2007 - 10:39 PM

    • Ah, thanks for the info (I thought that, since black is 0 and white 255, and since transparent is 0 and opaque is alpha 255, that it would be black->transparent white->opaque). Care to write an actual guide on how to do this, with actual experience and detailed explanations of the process?

    • @guy, on Jan 8 2007, 08:37 PM, said in Any Chance for Imported Graphics?:

      Tip: hold command while dragging a file onto an app to force it to try to open it. Graphic Converter doesn't mind though and will always try to open any file.

      Interesting; I didn't know that either. Unfortunately, Photoshop refuses to read the game's spritemaps unless a .tif extension has been added.

    • That makes sense, Photoshop does not have any idea of what kind of image file it is (PICT? JPEG? GIF? PSD? MacPaint? PNG? TGA? BMP?) without the extension (or a type code).