For Devember I’m going to work on polishing some of my Lua libraries.
Keep in mind that these are all not really production-quality code, and I want to improve that. Feedback is very welcome(especially from someone who is better at C than I am), so is any help(even documentation, spelling mistakes, etc.). Really, I’m just bored, so feel free to ask anything.
My libraries are all on Github, under the MIT license: https://github.com/max1220
A bit of backstory…
The idea is mostly to get the lua-db[1] library ready for some real applications. It’s a small graphics library(db means drawbuffer, not database) implemented in C and Lua. I have programmed a game in it before, but I wanted to improve the code base a bit to make it more convenient and work on some of the “weak points” I’ve noticed: this game[2] was made for the Linux game Jam(From The Linux Gamer Gardiner), and was a minimal buildroot-based bootable linux kernel+initramfs running a small platformer game on the framebuffer(Yeah, I submitted a Linux to the Linux game jam, and it was only 15MB!). It had a lot of ugliness, but it worked(see some youtube video[3][4]) and was lots of fun making. I’d like to do that again, but with a game that is more… say, sanely programmed[5] and less… raw. It would also be cool if it could boot a graphical desktop. I’ve implemented something like this before[6], but it would go great on a bootable game/distro/hacky demo. Since the Linux game Jam, I’ve also manager to implement a read software 3D rendering “engine”[7], so maybe it could be a 3D game. Ideally, that bootable demo would be finished, or at least work mostly. I get that this is a strange combination of things, but it worked before ™.
[1] https://github.com/max1220/lua-db
[2] https://max1220.itch.io/robohobo
[3] https://www.youtube.com/watch?v=xKjzS07yqSU
[4] https://www.youtube.com/watch?v=1isA7k5SsdQ
[5] https://github.com/max1220/engine/blob/master/game.lua
[6] https://www.youtube.com/watch?v=6BSQNjJ03oM
[7] https://www.youtube.com/watch?v=zXw2vwezdjI
The plan
Polish my Lua libraries, then implement a crazy bootable demo.
I’ve written a TODO-list of what I plan to do for Devember. I hope I can get at least some of the things actually done. I should be able to get something bootable, the question is the bodge factor. Wish me luck.
The TODO
- lua-db
- This is my Lua graphics library and my primary focus. It’s CPU-only, and is written in Lua and C.
- Improve documentation. Currently, only basic functionality is mostly documented
- Update and improve bitmap reading(also update lua-bitmap)
- Implement a Lua only FFI version of the base library, increasing the performance for some workloads significantly.
- Create some benchmarks for the basic functionallity. Currently, only the multithreaded pixel functions have a benchmark.
- Overhaul the input_output system
- Implement a “unified event interface”, that is capable of translating various input event types to another. Specifically getch to SDL, linux input to SDL, and SDL to getch. Better decouple the input from the output systems.
- Re-Implement the Linux framebuffer output backend. (was implemented in a previous version)
- Re-Implement the terminal output backend. (also implemented in a previous version)
- properly handle mouse events
- Implement a “window manager” for input_output based applications
- Can this be done usefully with only coroutines, or are thread required?
- If all goes to plan, I should be able to write an application that could run the same on all useful combinations of input and output systems:
- Output using SDL, input using SDL
- Output using Linux framebuffer, input using getch translated to SDL
- Output using Linux framebuffer, input using Linux input translated to SDL
- Output using an ANSI Terminal, input using an ANSI terminal
- lua-getch(required for the terminal input in the input_output system)
- This is my Lua wrapper library for getting a character from a terminal in raw mode.
- Publish the editor to git
- Finish implementing the editor, document it.
- Implement a basic terminal multiplexer example using getch. (Demonstrate using the get_mbs function to resolve some basic escape sequences using functions)
- lua-input(required for input in the input_output system)
- Finish the work undone work on the v2 examples:
- Implement an example mouse/keyboard sharing application using these libraries.
- Finish the work undone work on the v2 examples:
This seems like a lot, and it may be, but a lot of that is just glue logic and finishing up partial and/or old implementations.