Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Into Space, a game I have been working on
Not sure if this is the right forum, but I would like to post this somewhere.

The past month or so I have been working on a game engine for retro 2D games, in order to easily create this new game I have been working on, which uses Tilengine.
I have to say, the experience is extremely fun, and this is a great way to learn C++ even with the lack of documentation for Tilengine (which upped the challenge, but it taught me a lot more than if there was more documentation).
I don't really have much beyond a demo that scrolls through a scene and plays music, but it took a lot to get there, and I basically made my own system from scratch for handling objects, layers, cameras, etc.
The best part of this project is that it uses LUA for a scripting system so you can create the game without having to compile the engine ever again, and it makes it extremely easy for anyone to make their own retro 2D game, because it abstracts everything to a level where you don't have to worry about anything besides making the game.

This engine though, is really rough around the edges, there is still a lot to implement and clean up, and things I need to work on to make it usable, which is why I wont be releasing any of the builds for it yet, but I would love to eventually do that and even possibly make it open source similar to Tilengine, but that is still a long ways off.

Here is a picture of the game so far (all pixel art created by me and a friend):

Here is the LUA code it took to make that happen (not using Tilengine LUA bindings):
function startup ()
     -- Play theme song (looped by default)
     playMusic("theme", "game_theme.ogg")

     -- Add image as background layer on X: 0 Y: 0 that is immovable
     addImage("logo", "menu_logo.png", 0, 0, "immovable")

     -- Add image on background layer on X: 0 Y: 0 Distance: 0 (Moves with foreground)
     addImage("ground", "menu_ground.png", 0, 0, 0)

     -- Add image on background layer on X: 0 Y: 0 Distance: 8 (Moves slowly with background)
     addImage("water", "menu_water.png", 0, 0, 8)

     addImage("sand", "menu_sand.png", 0, 0, 10)

     addImage("grass", "menu_grass.png", 0, 0, 12)

     addImage("mountains", "menu_mountains.png", 0, 0, 14)

     addImage("mountainsBG", "menu_mountainsbg.png", 0, 0, 16)

     addImage("moonBG", "menu_moon.png", 0, 0, "immovable")

     addImage("starsBG", "menu_starsbg.png", 0, 0, 500)

     addImage("spaceBG", "menu_spacebg.png", 0, 0, 1000)


function update ()



I already have this running on a Raspberry Pi, and I plan on adding other features like integration with some sprite editors, as well as integration with a LUA IDE.
One problem I had, since I am using SDL2 for windowing and sound, was getting the CRT effect to work. I made a post earlier which megamarc kindly replied to about how to get it working, but I had to copy a lot of code from Tilengine's source files and it ended up being very clunky and unstable (which is my fault, I'm not the most experienced with SDL2), and it would have been way easier if it were a standalone module of some sort. Other than that I recommend Tilengine 100% if you can get over the learning curve!

Thanks for checking this out!
Congratulations for your work! I hope that it has good progress. What kind of game you're attempting?

There was a LUA binding for Tilengine, provided by a contributor named Terrence Young. I had to remove it from the main repository when I released the bindings as separate projects, outside the main trunk. Have you used it as a basis, or have you created your own from scratch?

Tilengine doesn't have much documentation, that's true. The full reference is always online, and there are some working examples. But you have direct support from its author (me). Feel free to ask here anything you may need to know :-)

I don't understand the problems with the CRT effect in SDL2. I guess you're implementing the windowing framework in LUA instead of using the built-in windowing, right? So you wanted to port the CRT effect to your own window. Please let me know. Richard Khan is working with GLSL shaders for postprocessing, that would be a better way than the current mixed software/hardware approach.

Let us know your progress!
Thank you! I am attempting a shooter style game, where you control a space ship and shoot asteroids, enemies, and avoid obstacles. It will include a variety of types of levels on top of the shooter sections, like platforming and racing, and I intend to use Tilengine's raster graphics capabilities to it's full potential for these. The game uses game controllers or mouse and keyboards for input. I will also be adding network support to allow for multiplayer, and allow for an easy way to synchronize the game world across clients.

I haven't actually used the LUA bindings. I wrote the entire engine in C++ and used LUA's ability to be embedded into C++ programs as a regular library. So basically I created my own from scratch, and just used Tilengine as a graphics library only and made the engine handle the actual manipulation of sprites and layers, and the LUA code is ran through the game engine itself and has no ties to Tilengine's API. I am going for simplicity, and even though the way Tilengine does it is great, I wanted to make something so simple even a child could do it, so I had to sacrifice a bit of control for ease of use, but I plan to add the control back in some form later. In other words, the engine will handle all of Tilengine's advanced features for you so you don't have to.

Thanks for the support! It's nice to be able to have the actual developer to help out with problems, it really makes things easier! Expect this forum to be a lot more lively for a while! Wink

Like I mentioned, the problem with the CRT effect is because I am using my own windowing system written in C++ with SDL2, not Tilengine's with LUA. I set up Tilengine to render to a framebuffer, then make SDL2 draw that framebuffer to the screen. So yes, I want to port the CRT effect in my own window. Can I get some more info about what Richard Khan has been doing with GLSL shaders? I would be absolutely interested in that!

I will be making some more posts about this game as I work on it!

I really like Tilengine, and would love to contribute to the project whenever I get a chance! If I do add something, it would probably be text rendering support for debugging purposes, for features such as an FPS counter. I may even help with documentation if I can!

Again, thanks for your work on this project!
Thanks for sharing your work! I understand your approach: you write a game engine  in top of Tilengine in C++, and script your engine from LUA, right? This model would fit very well with the idea of integrating it inside libretro/RetroArch for loadable games. A scripting language is the missing piece, as in libretro one expects to load many games from a single core
  • A game engine written in C/C++ with:
    • tilengine as the renderer
    • embedded LUA to call external scripts
    • exposing libretro interface to act as a libretro core
  • Many loadable games written in LUA
The integration to libretro is a good fit for tilengine games, as you benefit from its standarized input system, windowing and all sorts of retro shader effects without having to develop your own.

I did a basic text rendering system for tilengine some years ago, the "old way": you have a tileset with one glyph/symbol on each tile that acts as a fixed width font. Writing text is just a matter of having a layer with the tileset font attached, and update the layer tilemap in real-time, one character per tile. This is how actual 8/16-bit era games render text. The "RetroPang" prototype made with tilengine you can watch here uses this method for the scores.

I expect this forum becomes more lively, and I really appreciate your enthusiasm about this project. I hope you have fun, learn and make good progress!
Hi jakers1403.

I like that engine that is doing with tilengine as a base, you have something that can be tested with some examples to know how to use it.

I warn you that I don't know almost any English, I write with the google translator.

Forum Jump:

Users browsing this thread: 1 Guest(s)