6 ms·
Show HN: DOME, a framework for making 2D games with Wren
- hurricaneSlider 7y agoYou've obviously put a lot of time and effort into building and documenting this framework. Would highly suggest adding more visuals and some way of very easily playing with runnable demos. Games are inherently audiovisual artifacts, so the lack of audiovisuals on the site is a bit of a negative signal.
- springogeek 7y agoThank you for the kind observation! I'm hoping to improve the visuals, as more games get made with it :)
- cnasc 7y agoYou could always host a game jam!
- springogeek 7y agoI plan to, now things have stabilised. I didn't have a lot of personal reach to get people's attention. Maybe now though...?
- Jaxan 7y agoThe website is a bit glitchy on my phone. Whenever I scroll, it zooms out a bit, which is disorienting.
- __ryan__ 7y agoWorks fine for me on iOS 13.3
- springogeek 7y agoThat's very strange. What phone do you use? It's built from a template, so I wouldn't expect many problems.
- setr 7y agoThat sounds like when your phone is detecting a second finger
- tony 7y agoNice! Starred. I did "sudo apt install libsdl2-dev", make, and "./dome examples/spaceshooter/main.wren" Took less than 30 seconds to build. The game ran instantly. Also I ran it through WSL 2 with these instructions: https://github.com/microsoft/WSL/issues/4793 https://github.com/microsoft/WSL/issues/4793 Thank you for this! First time I've heard of wren also. Aside: Is it possible to do something like sockets / http requests through wren? Where do you plan on taking this? What inspired you to make it?
- springogeek 7y agoThank you for trying it! I hadn't tested with the WSL, so I'm relieved it worked there as well. I put a lot of work into making it build from scratch easily. I started this project because I had been making small games with the PICO-8 and Lua, but I wanted to work on larger projects. There's Love2D, but I find Lua tricky at times, since you often have to reinvent OOP-structures and it's disconcerting with 1-indexed arrays. Wren is closer to more classical programming languages, so I thought I'd give it a go. :) HTTP is tricky since the protocol is quite complex. I think it would require an external library. However, creating an interface for net sockets wouldn't be too hard. I'd love to enable multiplayer games with UDP sockets in the future :) The Wren runtime is very extensible, so if I can code it with C, it can be made available to users of DOME!
- pier25 7y agoFirst time I hear about Wren. Seems like a very nice option for embedding a scripting language in a C/C++ project. http://wren.io/ http://wren.io/
- Jyaif 7y agoCurrent implementation is filled with bugs, which is a real shame because in many ways it is better than Lua: the language is better (for me), and the C API is much simpler.
- springogeek 7y agoI've not run into too many, you just have to be careful around re-entrancy from Wren->C->Wren, and slot allocation in foreign constructors. There's some big stuff in the pipeline, so I'm sure it'll be enhanced soon enough.
- donquichotte 7y agoVery interesting. It reminds me of Love2D, a 2d game engine for Lua that also uses SDL2 as a backend.
- springogeek 7y agoDOME is partially inspired by Love2D, although I've tried to approach things a bit differently. Love2D seems to expose a lot of SDL's underlying functions and concepts, whereas DOME aims to abstract a lot of that away.
- danbolt 7y agoIf you find yourself porting to another platform that’s less PC (eg: smartphone, game console) that’ll serve you well. Wren has some really interesting design choices so I feel like it’s a good fit for performant embedding.
- springogeek 7y agoIt'll be a while, but I think the next step is a move towards web. I've built it to run in browsers before, but that was a while ago. Because DOME sits on top of SDL2, porting to other platforms shouldn't be too difficult in the future. Lofty goals!
- olav 7y agohttps://tic.computer https://tic.computer has Wren support. I don't want to belittle the OP's efforts, just mention this other system.
- springogeek 7y agoYep, of course! TIC-80 is very well done, but it's a more constrained system (intentionally so). DOME was meant to be the foundation for larger projects :)
- nonbirithm 7y agoWhat would be interesting is if there were a language-agnostic library that handles the annoying and complicated game engine things like optimizing the list of OpenGL draw calls or pooling audio resources, which would take forever to buggily reimplement - then have people write bindings to it in whatever arbitrary language they want. For example there is a version of the LOVE game engine that targets ChaiScript instead of Lua[1]. What I really want is a version of LOVE that targets a lightweight LISP like Janet. (I know, fennel exists. But imagine having a battle-tested game engine like LOVE in any LISP at all.) And yeah, I'm implying LOVE should be that library. They have pretty much everything you'd ever need for a gamejam. I'll never touch GL.h again. As for what the author of DOME says on exposing fewer abstractions than LOVE, I found I didn't have to muck around with low-level details like window resolution that much. LOVE provides the functions wrapping all that and preventing undefined behavior while benefiting ergonomics. The process of resizing the window which took far longer than it should have for me to get right in C++ is handled by a single call to love.window.setMode - and it handles hidpi and fullscreen and stencil buffers and MSAA and a bunch of other things[2]. Imagine implementing all that yourself, supposing that yes, you really do need that stencil buffer in the future. The work has been done already. Where LOVE's very large standard library becomes useful is when I code myself into a corner with some inefficiency or wrong drawing output, then I look at the wiki and discover this neat feature I never knew existed that solves the problem. As an example, I wanted to control the size of a sprite batch, but drawing it ignores width and height. Then I found there's a neat thing called love.graphics.setScissor, which lets you push and pop a drawing region. Using it solved the problem with necessitating a rewrite of any internals. Things like that make my day. [1] https://www.libretro.com/index.php/chailove/ https://www.libretro.com/index.php/chailove/ [2] https://love2d.org/wiki/love.window.setMode https://love2d.org/wiki/love.window.setMode
- springogeek 7y agoThank you very much for your insights. Love2D and DOME do similar things for their languages, but I think there's still some key differences in our design sensibility and mission. My hope is that DOME provides a set of sane defaults for a number of projects (game jams, lighter games, etc), and it gives you enough features that you can implement whatever you wish on top. Alternatively, it is open source (and MIT licensed), so you can hack with the internals for customised functionality. I hope you feel like trying DOME at some point. I'd be curious to know what your experience is like.
- danbolt 7y agoI make games as a hobby and I've thought about a "lighweight Wren framework with C++ modules for rendering" has been in my mind for a while. I'm so glad someone's thinking the same!
- ceceron 7y agoFirst time I see Wren. It looks nice. Also kudos for the comment below the benchmarks: "LuaJIT with the JIT enabled is much faster than all of the other languages benchmarked, including Wren, because Mike Pall is a robot from the future." :D
- springogeek 7y agoEveryone's support has been fantastic. I've now scheduled a gamejam in March to give people an opportunity to try out the framework: https://itch.io/jam/domejam https://itch.io/jam/domejam