🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles

Tilengine

2D retro grapics engine with true raster effects for creating 8/16 bit style games · By megamarc

images need 256 colours?

A topic by soulblaze created 69 days ago Views: 65 Replies: 4
Viewing posts 1 to 5

This is a great engine, I tried some test images with the mario example though and I got a black screen.

It seems on Gimp, it can palletize images with 8 colours - these are fine in Tiled - then Tilengine won't use them. So a workaround on Gimp seems to be - use a large jpeg with lots of colours, dragdrop your pixel art onto it, put it in the top left, merge down, then change the image mode, then save.

I just checked and resaving/resizing the image with Gimp afterwards works.

Amazing engine, thank you.

(Edited 2 times)

I also can't get transparency to work. The documentation says nothing about this?

I tried setting the top left pixel to the transparent colour, and I tried setting it in Tiled (done via the xml), can't figure out what I have to do though.

Edit: I looked at the source code, I also tried using pngcs to attempt to generate a .act file, but it's way too complex. Would be nice if I could just manually set the transparency colour and have this reflected through the C# API too.

Developer

Tanks for your feedback!

Tilengine works exclusively with indexed color graphics with 8-bit palettes (up to 256 colors). It uses color indexes inside a palette, not actual RGB values. Transparent color for sprites and tiled backgrounds is always index 0, this is how actual 2D graphics chips used to work and cannot be changed.

It seems that you're exporting 32-bit RGB images from Gimp, not the indexed ones required by Tilengine. They will show ok in Tiled editor, but not in Tilengine. The transparent color attribute in Tiled is only ised by Tiled itself to composite the image, but it has no meaning for Tilengine. Please take a look at this link from the Gimp documentation:
https://docs.gimp.org/en/gimp-image-convert-indexed.html

As a working reference I also recommend you to open the assets provided in tilengine samples (/samples/assets folder) in Gimp, because they have the expected format.

Let me know if you have success!

(Edited 1 time)

Hi Marc,

Yes, I have definitely been using indexed colour. Gimp shows it in the image info. I have modified and resaved the other assets so I know it's not Gimp's export problem.. maybe it is.

This is what I created using indexed colours in Gimp (256 color pallette, the top-left pixel is transparent colour), and it doesn't have transparency once in Tilengine: https://files.fm/u/a8zxk8wj

I didn't realize it but C#/OpenTK is much easier to use than I thought. So I will probably go with that now. Other than sprite batching, there's not much I wanted but OpenTK seems good enough.

I also found a bug with Tilengine, using the Super Mario sample - there is sometimes randomly a viewport within a viewport, a little smaller, where the actual game runs. All I did was create new maps with my new tilesheet, then load them in as a foreground and background.

Good luck with Tilengine :) It's a very neat little engine.

Developer

I've checked your asset. It's 256 colors, but the transparent color you want (I guess it's pink sky) is not located at palette index 0, but in the middle of the palette, that's why Tilengine doesn't show transparency. Transparency is based in palette index, not in RGB color value.

OpenTK is a C# binding for OpenGL, that is a low-level graphics API for 3D hardware. It doesn't provide the abstractions for tiled backgrounds, layers, sprites and so that Tilengine offers, so you'll have to build them yourself on top of OpenTK to get a similar functionality. But if this is easy to implement for your project, go for it!

You say you've found a bug regarding the viewport and tilesets. Would you provide sample source code and/or assets to check it? If you really have found a bug, I cannot debug and fix it without reproducing it first...

Thanks for your feedback and good luck too!