Headless Testing and 2X performance


New build!

We did this thing this time, where we'd say "I just want to add this one more little thing," and then that would be done and there was just one more little thing, and then after a month of this there was juuuuuust one more little thing...and then we shipped a build that broke one of the samples, so we pushed a second build right away with that one more little thing fixed. But then we got a real thirst for hotfixes and pushed another build to accommodate a piece of good feedback from the forums.

We're handing out builds like candy. We're the Oprah's Favorite Things of Ruby game toolkits.


Here's what's new since last time.

New features:

  • Amir has been going wild on optimizations! Now you can render about twice as many sprites and still hit 60fps. We still have more work to do, but we're moving in the direction of letting you render much more complex scenes.
  • Headless testing has been added. Take a look at the Basic Gorillas sample app to see how headless testing can help you dial into frame-by-frame problems within your game.
  • We dropped the "Game Jam Edition" subtitle from this. While we think this is still awesome for game jams--where you want to get up and running as fast as possible--we're feeling more confident that DragonRuby is a thing you can use to build games that are meant to be created, lovingly, over a longer time.

Bug fixes:

  • We now publish some form of these notes in CHANGELOG.txt, if you prefer more plain text and less HTML in your devlogs.
  • Text scaling now works on Windows. Resize the window and your fonts should stay crisp now!
  • Exception messages have been significantly improved. Hashes and Type.to_s information is well-formatted. "Stack too deep" exceptions resolved.
  • dragonruby-publish now ignores .git/.hg/.svn directories when packaging games.
  • dragonruby-httpd on Windows now has proper EXE metadata.
  • DragonRuby GTK Console now accepts input immediately, so you can start typing as soon as you activate it, even while it's still sliding in.
  • Windows and Mac icon generation in dragonruby-publish was broken in the previous build. Sorry! Fixed now.
  • DragonRuby binaries we ship are now codesigned and notarized on macOS. We are still working on signing games packaged by dragonruby-publish, but stay tuned for more on that!
  • The "Superscript Two" key can be used to bring up the DragonRuby Console. People with international keyboards (which don't have a tilde key) can now use the superscript_two key (which is in the same place as the tilde key on US keyboards). We plan to eventually allow users to customize this instead of hardcoding it like this, but this is an incremental improvement for now.
  • Framerate warnings now wait 10 seconds before calculating the moving average.
  • Games published to HTML5 now report loading progress status, so you aren't just staring at a blank screen if a backhoe cuts your internet connection at the wrong time (not that there's a right time, mind you).

API changes:

  • Feel like args.outputs.solids is too wordy? Commonly used properties on args are now accessible as top-level methods, so you can just say args.solids instead if you prefer.
  • args.game has been deprecated is favor of the better-named property args.state.
  • Have you been using the magic $dragon variable (in a land named Honalee)? We have renamed it $gtk. The old variable name still works for now, but please update your code.
  • args.outputs.PRIMITIVES += is no longer supported. Use args.outputs.PRIMITIVES << instead. Trying to pick between += and << was confusing; we settled on <<.
  • args.inputs.mouse now respects args.dragon.origin_center!.
  • A new entity type has been introduced and is accessible via args.state.new_entity_strict. The usage of StrictEntity over OpenEntity (args.state.new_entity) yields significantly faster property access. The downside is that args.state.new_entity_strict requires you to define all properties upfront within the implicit block. You will recieve an exception if you attempt to access a property that hasn't been pre-defined. For usage info and preformance differences, take a look at the Sprite Limit sample app.
  • Class macro gtk_args has been added. Instead of having to type:
    class Game
       attr_accessor :args, :grid, :state, :inputs, :outputs, :gtk, :passes, :current_scene, :other_custom_attrs
       def tick
       end
    end
    def tick args
      $game.args    = args
      $game.grid    = args.grid
      $game.state   = args.state
      $game.outputs = args.outputs
      $game.gtk     = args.gtk
      $game.passes  = args.passes
      $game.tick
    end
    

    You can now do:

    class Game
      gtk_args
      attr_accessor :current_scene, :other_custom_attrs
      def tick
      end
    end
    def tick args
      $game.args = args
      $game.tick
    end
  • All keyboard attributes now have a ! variant which will clear the key if the value was true. Example:
    args.inputs.keyboard.key_down.up # returns true
    args.inputs.keyboard.key_down.up # still returns true
    ...vs...
    args.inputs.keyboard.key_down.up! # returns true
    args.inputs.keyboard.key_down.up  # now returns false for the rest of this tick

Samples:

  • All sample apps now have the MIT License added to them, to remove any ambiguity with regards to if you can use them for commercial purposes.
  • Added a sample app called "Sprite Animation and Keyboard Input" that shows how to do repeating and one-time sprite animations driven by keyboard input.
  • Added a Sprite Limit sample app, which we're using to see how much we can render before the framerate drops, and what techniques are most efficient.
  • Added a sample app called "Coordinate Systems" that show the two coordinate systems supported by the GTK.
  • Added two sample apps called "Collision" and "Collision and Entities" that show how to perform collision detection with draw primitives and args.state.new_entity.
  • Added an interactive sample app called "Beginner Ruby Primer" that does a better job of introducing you to the language.
  • The "Controller Analog Usage Advanced Sprites" sample app now has a helper function with named parameters to create the sprite. For example, if you needed to flip a sprite vertically, you'd have to do the following:
    args.outputs.sprites << [0, 0, 100, 100,
                             'fighter.png',
                             0,
                             255, 255, 255, 255,
                             0, 0, -1, -1, false, true]
    

    With the helper method, you can write the following:

    args.outputs.sprites << create_sprite(x: 0, y: 0, w: 100, h: 100, vflip: true)
    

    We're still chewing on the API above before it gets integrated into GTK proper.

  • Amir facilitated a workshop at a local user group. The source code for the workshop is located in a sample app called "NDDNUG Workshop". The video was recorded and you can use that to code along:



That's all, folks.

We'll see you next time. As always, feel free to join us in the community forum or the Slack channel or even just ping Ryan or Amir on Twitter, and whisper sweet nothings in our ears.

Files

dragonruby-gtk-macos.zip 61 MB
Version 13 Jul 12, 2019
dragonruby-gtk-linux-amd64.zip 58 MB
Version 13 Jul 12, 2019
dragonruby-gtk-linux-raspberrypi.zip 58 MB
Version 5 Jul 12, 2019
dragonruby-gtk-windows-amd64.zip 58 MB
Version 13 Jul 12, 2019

Get DragonRuby Game Toolkit

Buy Now$48.00 USD or more

Leave a comment

Log in with itch.io to leave a comment.