Tilengine - a freeware 2D graphics engine with raster effects

Hi everybody,

I’ve released a graphics engine for developing retro/classic style games. It’s based on the internal working of actual 2D graphics chips (called VDPs), so it uses tiled layers, sprites and color palettes.

Its rendering algorithm is scanline based (it draws full scanlines in sequence), so it natively supports raster effects -visual tricks accomplished changing rendering parameters at individual lines- through a raster callback -like a virtual h-blanking interrupt-.

It has builds for Windows and Linux, and can be used from C/C++ (natively), Java and Python (through wrappers).

The supported file formats for loading maps are Tiled tmx and tsx, so I think it’s appropiate to anounce it here.

For more info and downloads please go to http://www.tilengine.org

1 Like

It looks like an awesome engine for its purpose, and it’s cool that it can directly load Tiled maps!

What I’m missing from your package is the source code of the actual library, and the license under which you are releasing it. The website also does not seem to mention a license anywhere.

Wow, this looks awesome! :smile:

The missing license or licensing model leaves me wondering, too. “Freeware” is a rather unusual term for a programming library - it sounds as if perhaps the precompiled version is free, the source code will be commercially licensed. Would be good to at least tell interested users the intention (no need to specify price or licensing details at this point).

Hi Bjorn,

Nice to talk to you. Let me tell you how much I like Tiled editor, as a developer I admire how it’s powerful and flexible, yet intuitive and easy to use at the same time. Great combination!

Thanks for taking your time to look at Tilengine and for your compliments about it. Regarding your questions, I suppose the answer is related to both. You haven’t find the source code of the library itself because I’m not distributing it (it’s closed source at this moment). About licensing, I’m a technical guy not versed in legal stuff, but my idea is: Tilengine is free to download for anyone and to be used in any free or commercial game. I won’t ask for money or rights. I’ve created it because I love classic games and I’d like to contribute to the indie community with a tool to make this kind of games. I don’t know which existing license better adheres to this idea…

Hi TilemapKit! Thanks for your comment :grinning:

Your question is related to Bjorn. By “Freeware” I mean free to download and to use in any free or commercial game. But the library itself is closed source (at least at this moment). Unusual? Maybe. But it’s how I feel it. I don’t know about licensing, I suppose I should search for a license mode that describes this vision…

Well, typically for the “anything goes” except misrepresenting authorship and maybe explicit protection against “patents” there’s several popular licenses:

  • MIT (X11)
  • BSD
  • Apache 2
  • LGPL
  • GPL
  • “Public Domain” (PD)

This is the list of licenses I encounter the most, with MIT having become very popular with FOS software authors (I would recommend that unless you have very specific requirements regarding patents - in that case I think Apache 2 offers some additional protection but I believe it has been said that the patent amendments are either superfluous or just not effective).

One reason for MIT’s popularity is that it’s short and simple, everyone understands it (plain english), and even commercial bodies and their legal departments accept it from a legal perspective.

The GPL (Tiled uses that) forbids commercial use of the software so based on your comment you should not use that.

PD does need a “license” which is basically just saying that “this software is released into public domain”. However: anyone could now slap any kind of license to what is essentially your project, so I wouldn’t recommend PD at all even if it sounds like the simplest option.

Wikipedia has a list: https://en.wikipedia.org/wiki/Comparison_of_free_and_open-source_software_licenses#Approvals

FSF has another list with comments: http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses

Hmmm it may also be important to ensure the license you choose is compatible with GPL, because for example that would allow Bjorn to embed the retro renderer as a filter in Tiled. Something like that would not be legal if the license is not compatible with GPL.

Most importantly: pick one that’s FSF approved, and one that developers know and understand (did I mention MIT? :smiley: ).

Are you out of your mind? GPL is first of all about the freedom to do anything you want with it, which certainly includes commercial use. The only thing it forbids is to turn Tiled itself into proprietary software.

Though, you’re right that when applied to a library, it will require any application based on it to use the GPL as well, and as such to release its source code. This can limit the opportunity of selling the game, or even to distribute it on certain app stores. Hence of course I would not recommend it for a library unless the intension is to have it only benefit free software. libtiled, the low-level plumbing in Tiled, is BSD rather than GPL, for example.

Unfortunately this advice only applies if the author is willing to release the source code. @megamarc has indicated that this is not the case, at least for the moment.

Thanks! Of course personally I still consider a lot to be lacking in terms of flexibility and I think Tiled is also growing a bit of bloat that makes it less intuitive. It’s great to hear your feedback, and I’ll keep thinking about ways to improve it further.

If this is your goal, I would encourage you to not shy away from releasing the source code. As long as you don’t, it is a proprietary solution that can only help development of proprietary games. As it is, you’re excluding all free software from using your tool, even though you have no monetization strategy that makes this inevitable. That said, it’s your call and I’m sure there will be people who will find your library useful in its current form as well.

Yeah sorry, I sometimes apply this overly broad because I’ve almost always encountered GPL when looking for libraries to include in another commercial software project - that’s a problem with GPL (the “viral” aspect). So I tend to say (for both ends being source code projects) that the GPL and commercial projects don’t mix although it’s a generalization.

I read “for the moment” as the usual “until it’s mature/stable”. :wink:
For closed source the precompiled library needs a proprietary license. Or at best one of the Creative Commons but they don’t really apply to precompiled code either, much less for source code.

Hi Steffen, thanks for pointing out the licenses. Aftrer a bit of research I think the MIT may be the most suitable for Tilengine, because it doesn’t require releasing the source code, doesn’t forbid commercial use and is compatible with GPL. I’ve found this link too: http://choosealicense.com/licenses/

Is this true? As I’ve seen MIT License doesn’t require releasing the source code as GPL does.

According to the MIT license, I’m not required to release sources and it allows being used in free and commercial games alike. I’m not against releasing the sources, but I need a good reason to do this as I’ve put a lot of work on it (as everybody does with their personal projects in which they believe). A good reason would be that keeping it closed may limit its adoption. But this is not the case, I’m getting good feedback but no one is yet developing with it, nor even there are plans to use it on a new game.

I think that not releasing the sources should not be a reason to at least give it a try and evaluate it. Yes, there are some people who have asked for the sources without any reason. Time will tell if I’m right or not. But I use many great free tools that are closed source and I have never questioned their utility just because I don’t have the sources.

That said, I really appreciate your comments and thoughts about this issue! I have many years of experience in corporate projects but I’m new to releasing free software and licensing.

The public download is totally free, uncapped and always will be. Maybe money could someday come from commercial game development tool makers (like for example YoYo Games) interested in integrating Tilengine rendering in their development suites, in the form of support, training, exclusive features, adaptation, etc. This is how I work with customers (I work in consultancy).

Donations, partnership, patronage are also other options, but in its current stage it first needs to start rolling and generating some interest

Well, I think technically you can apply the MIT License to any kind of software, ie a simple app or precompiled binary. However the expectation when using this (or similar) license from developers will be that there’s source code for it. Those licenses are used primarily (exclusively?) by open source projects.

So yes, you can use MIT and withhold the code. It’s just unusual. At a minimum you should make sure on the website that there aren’t any misunderstandings to that regard.

But there may also be a problem if you ever intend to do a betatest. Because if you distribute the code under MIT you’d have to rely on the goodwill of your testers for them not uploading the code on the web and sharing it with others. Of course you could simply omit the MIT license for these purposes, or generally until the first source release (if ever). Because as long as you only give away the binary, I think it’s enough to state that this is a “free evaluation version” without restrictions other than “no source code”.

Btw, how is the TIleEngine renderer implemented? Is it OpenGL based? Do you plan on supporting OpenGL ES 2.0 for mobile devices?

Since I work on a tilemap renderer myself (http://tilemapkit.com) I’m curious to know if there might be an option to migrate your renderer on top of (most likely) the C++ cocos2d-x engine.

Well, MIT would be unusual as @TilemapKit pointed out, since it’s usually applied to the source code. It explicitly gives people the right to modify the software, but you make this impossible if you don’t release the source code. Also the right to use it is severely restricted when distributed in purely binary form.

You’re confusing free vs. commercial with free vs. proprietary. One is about money and the other about freedom. If you don’t release the sources, then free software (like Tiled) can’t use your library.

I think it is the case, but you may not have noticed yet, and of course it’s impossible to tell to what extend this is a factor.

For sure I won’t be able to use this library, since I’m not interested in developing proprietary software (I do this professionally while working at Ubisoft, but I consider this a temporary necessity). I also enjoy learning from other people’s code, I end up contributing small improvement or fixes sometimes, or I can better debug issues I’m encountering. As it stands, I can learn very little from your library, debugging crashes would be a pain, and I would be bound to its limitations. Anyway that’s just me, and I don’t know how many feel the same way.

One practical problem of source-less libraries is called “vendor lock-in”: if I start developing with your library, and I find a bug in it, I would be dependent on you to fix the bug. If a new version of OpenGL (or whatever you use) comes out and the library no longer works, only you can fix it.
And if you ever happen to lose interest in the library, no one else can fix any bugs, and games written with it are left in the cold. (Also, you could start demanding big money for bug fixes – which might be good for you but doesn’t put the users in a good position.)

A practical benefit of releasing the code is, for example, that others can re-compile it. I see you don’t provide the library for Raspberry Pi. Or Android. Or that exotic OS on my phone. The number of platforms you personally have access to will always be limited.
Or, maybe with source, I could leave out some unneeded parts and make the final game download smaller. (If not now, then surely when the library grows.)

On the other hand, managing a community of users is different than a community of users and contributors; and having your code reviewed by anyone interested in it can be frustrating at times (though there’s no better way to show that the code is well-written). And, sadly, it seems the gamedev community is not yet too familiar with the benefits of open-source tools.

I see you have a potential business model that wouldn’t be hurt by releasing the code. What have you got to lose? : )

Thanks for pointing out all these issues. How complex is this! I just wanted to give my work for free :grinning: But I must know about all this legal stuff and other considerations.

These are big arguments for going open source! I appreciate your detailed reflexions about this issue. And you guys are experienced about it (@bjorn author of de facto standard mapping tool, developer in a big gaming company, @TilemapKit engines and books published on paper…) I would be short-sighted if I don’t consider what you have to say! Now I’m starting to think seriously about fully releasing it. After all, what I want is to give Tilengine the opportunity to reach as many developers as possible, and being used to make actual games.

What I need now is a good source of information (book or website) about open source management. From my ignorance I fear that open source projects are a kind of anarchy where everybody can put its hands on it, and projects end growing out of control. I’m sure this is not how actually works, but I need knowledge about this. I have a rodamap, a list of things that I’d like to implement, and an “identity” about what Tilkengine is that shouldn’t be lost. How new features make its way to the roadmap? Who have the rights to make commits? etc… So if you can recommend some literature, I’ll read it.

The renderer is software based (CPU), the GPU is not used at all. Current GPUs and 2D VDPs (the things Tilengine is based on) are very different and I don’t think a GPU can be used to emulate them. Of course pixel throughput is lower than modern GPU engines, but this is not a problem because this engine is designed for retro style graphics, that are low resolution in nature but require scanline rendering to implement the raster effects properly.

For what it does the performance is quite good: on my humble 6 years-old Compaq Mini 110c Netbook (Atom N270 1.6 GHz), the majority of samples, which have an internal resolution of 400x240, take about 22% CPU. I’ve run three of them at the same time and still get 60 fps on each.

The usual workflow should be getting the low-resolution frame from tilengine and upscale/postprocess it through the GPU with HLSL filters such as CRT effect, etc. This is how arcade emulators like MAME do: software rendering and hardware post-processing.

The short answer: as long as you can allocate a pbuffer, a MemoryImageSource or any other kind of video surface that you can lock in to access pixel data, and a native build of Tilengine, it is possible to integrate it inside any framework. One of my Java samples renders inside an AWT JFrame.

The long answer: it may not be feasible in your engine, because if I understand well, your TilemapKit is a complete Tiled loader (it supports all kinds of maps, all features, etc). Tilengine is not that complete, in fact it can only load 8-bit (256 colors) tilesets and orthogonal maps -its not a Tiled loader, but uses its file format-. On the other hand it has extensive palette animation features, layers don’t need to be of the same size (as in Tiled), and has the raster effects. Oh, and I don’t have OSX / iOS builds yet :disappointed: I hope that when I’ll go open source you can help with the porting because I don’t own Apple equipment.

Congratulatiosn for your TilemapKit engine! It looks great and full-featured. Unfortunately I’m not in the Apple world so I can’t try it.

I don’t know about books, but no, I wouldn’t describe it as an anarchy. You still control Tilengine is. You’re the author; your roadmap and list of goals are what drive the project. If someone makes contributions, they might share them with you, and if you like them you can incorporate them into your library.
Later (if you’re lucky), you might start getting more contributions and your work might become more of a steward of the code and reviewer of new contributions, and less of an actual programmer. But still it will be you who defines the direction of the project.
On the flip side, if someone disagrees with your direction, they can “fork” – release their own copy with their own modifications. Maintaining a fork takes lots or resources though. In the vast majority of cases better for everyone to work together.

You can start by simply putting the source online (for example on Github, like Tiled), and linking to it. You’ll probably not get people flocking to make contributions at first (usually you need users before you get contributors), but when they come, just treat them as humans who wish to help : )

Community management skills are important if you want to actively grow a community of contributors. You can start doing that later, but for now you can just put the code out there, and focus on programming and getting users.

On Fri, Aug 28, 2015 at 10:20 AM, megamarc noreply@mapeditor.org wrote:

Well, it looks like the email -> forums feature ate my entire post.
Pasting below to see if it works this time:

I’m not sure of a source that details it, but here is the basic approach I

Make the project on github or bitbucket (github has more “cred” in the open
source space so you’re more likely to get help from other devs, bitbucket
allows free private repros so the project can be in the same place as your
game’s code).

When creating the project you can specify the license (I also prefer MIT
since it’s the “do what ever you want, no warrenty, and can’t use my name
without permission” license).

Other developers can then fork (i.e. clone) the code to their own
repository and make changes there that do not affect yours. They are able
to send you “pull requests” to merge a feature back into your version, and
you can accept or reject this.

These sites have support for forums and bug reports, features lists, etc.
Users and developers can comment on these and again, it’s only the people
you’ve given admin access to that can do anything with them.


On Fri, Aug 28, 2015 at 11:05 AM, michael_neel noreply@mapeditor.org

Well, what will be most likely is that you’ll have 2-3 enthusiastic developers maybe sending you pull requests for review and integration in the project for the first 1-3 years - depending on adoption rate / popularity. You will not be swarmed by hundreds of developers trying to contribute code anytime soon after the first public release. :wink:

Any book on that topic is definitely going to be over the top for your needs. Just work with contributors, and figure stuff out as you go. Github helps a lot with collaboration btw. So if anything you may want to get a good book on managing projects with/on github.

You can still retain ownership based on permissions, ie by default you’ll be the only one with permissions to your repository and wiki. You can open that up at a later time as needed. I wouldn’t worry too much about all this just yet.

Too bad it’s a software renderer. I understand the reason. Perhaps in the future a shader-based solution might be possible?

I’d be happy to run some iOS / OS X tests for you. I probably can’t help with porting because I’m not very good at low-level rendering stuff. TilemapKit is built on sprites, which would make integrating your renderer more difficult than the “not complete” aspect. But, come time come opportunities. And inspiration. Now that I know TileEngine, I can imagine that TilemapKit might benefit from postprocessing shaders that emulate certain effects (ie scanlines, or pixel art scaling) to give off an old-school feel.

Thanks all of you @encukou, @michael_neel and TilemapKit for the detailed description about open source management. I see you all agree. It’s similar to administering corporate projects, not everybody has rights to push commits to the repository. In fact Git is still more strict than Subversion (where I manage company projects), because commits must be reviewed before being accepted. In SVN any user with write rights can commit without supervision. So this is good news.

Nobody has attemped this. The usual approach with GPU is render each tile and sprite as a quad composed by two triangles. Tilengine draws horizontal lines, not quads. But it may be implemented as decomposing the tileset in many 1D textures, and the tilemap and the palette encoded as textures passed to the shader and generate line primitives from the main program… of course there are challenges, (especially in affine transformed layers) but challenges is what drive developers! :grinning:

The rendering code is totally platform agnostic, what needs to be ported is the makefile, compiler and linker flags… But having the linux working, and knowing that OSX is FreeBSD based (Unix), I think that the differences may be small.

This is really impressive. I’ve been working on something similar using OpenGL shaders (https://www.youtube.com/watch?v=8q1TClk9JeU) but this is way fancier, has more features, and seems to be faster too. And I’m already working in Python so… nice! I reckon I’ll be dropping my implementation and using this.

Thanks for your feedback @birdrun! I’ve seen that you were working on a similar topic about raster effects. I’m glad you are willing to use Tilengine for your project :slight_smile: At this moment it’s a 100% software renderer, that can be built and run on any platform without requiring hardware acceleration of any kind. But right now I’m working on an OpenGL 3.0 implementation with shaders. This version will achieve full HD resolutions and more effects, but staying true to the “retro” paradigm (paletted tilemaps, sprites, and raster effects), however it will only run in OpenGL 3.0 compatbile hardware. The API is going to be nearly 100% compatible with the current one.

Please feel free to contat me regarding any questions or support you need about adopting Tilengine, I’ll be glad to help you.