Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

DragonRuby Game Toolkit

An intuitive 2D game engine. Fast, cross-platform, tiny, hot loaded. · By DragonRuby

Barebones generator?

A topic by A-A-ron created Jun 19, 2020 Views: 671 Replies: 3
Viewing posts 1 to 4

Hi! 

I have the GTK MacOS version; I'm able to get it to run, though I would like to strip out all the demos and extraneous stuff so I can keep my code organized. I'm finding it a little frustrating because the whole zip file unpacks and it's really unclear which files / directories are the magic combination of files / directories to get it to execute correctly. What I was hoping to see was a subdirectory that was the barebones skeleton of a game that I can then build from.  Having to work from the direct-unpacked archive feels very cluttering.

I've tried stripping out the files that seemed like they may not be necessary (eg. they seem only related to the demo) and when I attempt to boot up the game it tells me "couldn't create game context" with no additional information about why it failed.

I understand that `dragonruby` is the main entry point, and that it executes the code in `mygame` (can this be changed? could we get a YML configuration file or something?) but I have no idea what else is needed.  Also -- +1 for rubygems support -- it feels weirdly isolating not to be able to tap into the ruby ecosystem -- I understand that certain gems that require native extensions wouldn't be able to be included, but there are many that would just be useful to have for development (RSpec, for example)

What I do is move the unzipped dragonruby folder (since it has some invisible stuff) to my development folder and rename it.  From there, the text files and the documentation from the mygame project get moved into a documentation folder, and samples are moved into an examples folder.  That pretty much takes care of the non-runtime stuff - other project folders and resources are (re)added to the development folder as needed.

The dragonruby executable will use the mygame folder if you don't provide a name, but you can use any name you want as a parameter.  Previous commands are available in the Terminal history, so it is easy to reuse them.

As for gems, standard RubyGem support can be problematic in any custom Ruby implementation (such as the Game ToolKit and RubyMotion), since they may not have all the classes and/or methods, and often don't include all the shared libraries.  Test and debug gems even more so, since they are mostly expecting the regular MRI Ruby.

I understand the challenge in incorporating Gems, since this is a custom binary. It’s a nice to have, I suppose, but if it’s possible for the future of the engine, that would be great. If we can’t use rubygems, then having some kind of automated testing framework would be nice. Even though we’re coding in Ruby, this doesn’t feel like Ruby.

I don’t want sample code, demos, and API documentation about the engine in my project. Can we get a config file that allows us to override these defaults? I would like to be able to organize my project as I add code, and it’s unclear how to do that.

(+1)

DragonRuby GTK expects its resources to be in the main toolchain folder, but your project folder(s) can be wherever and have whatever layout you want.  Personally, I keep all the projects I’m working on in a single folder in the toolchain folder, and move the changelog, ctags files, docs, and samples to their own archive folders.  Pretty much everything else is used by the build system.

Within a project, the app (with main.rb) and metadata (with game_metadata.txt and icon.png) folders are required, anything else is referenced relative to the project folder and can be named to your liking, e.g. app/my_classes/some_class.rb or sounds/boom.wav.

The default mygame project folder just has a basic "Hello World" app layout.  You can duplicate that as a starting point or create your own layout or template.