Search Unity

RetroBlit - A Retro Game Framework

Discussion in 'Assets and Asset Store' started by Dafu, Oct 19, 2017.

  1. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    Hello all!

    RetroBlit - A Retro Game Framework is a different take at retro game development in Unity. RetroBlit aims to provide a simple hassle-free API for a frictionless pixel perfect environment in which to develop 1990s era true retro games. What makes RetroBlit different is that it does away with the Unity IDE almost entirely, opting out instead for a code-only classic game-loop based environment. There is no scene management, no game objects, no fiddling with camera and asset importing. With RetroBlit you don't need to worry about how to cram that perfect retro feel into Unity, retro is what RetroBlit does. RetroBlit has its own rendering pipeline, and its own audio and input APIs.

    Here are some of RetroBlit features:
    • Pixel perfect rendering
    • Primitive shape rendering, lines, rectangles, triangles, ellipses, pixels
    • Multi-layered tilemaps with extensive TMX file support which includes support for infinite maps, objects, and custom properties
    • Rendering to and from sprite sheets
    • Unicode text rendering, with text alignment, overflow settings, and custom pixel font support
    • Sprite packing support
    • A set of 30 tweening/interpolation functions
    • Clipping
    • Custom shader support
    • Sound and music APIs
    • Simplified input handling
    • Optional wide and tall pixel support (think 1980s computer games)
    • Post processing and transition effects, such as scanlines, screen wipes, screen shake, fade, pixelate and more
    • Garbage Collection aware code, for smooth play without hiccups!
    Here is what a simple "Hello World" app looks like in RetroBlit:

    Code (CSharp):
    1. public class HelloWorld : RB.IRetroBlitGame
    2. {
    3.     public RB.HardwareSettings QueryHardware()
    4.     {
    5.         var hw = new RB.HardwareSettings();
    6.  
    7.         hw.DisplaySize = new Size2i(320, 180);
    8.  
    9.         return hw;
    10.     }
    11.  
    12.     public bool Initialize()
    13.     {
    14.         return true;
    15.     }
    16.  
    17.     public void Update()
    18.     {
    19.     }
    20.  
    21.     public void Render()
    22.     {
    23.         RB.Clear(new Color32(128, 128, 128, 255));
    24.         RB.Print(new Vector2i(137, 80), Color.white, "Hello World");
    25.     }
    26. }
    RetroBlit ships with a detailed manual and API documentation, which you can preview here: RetroBlit Docs. For a live WebGL demo, and demo builds for several platforms you can have a look here: https://pixeltrollgames.itch.io/retroblit

    You might be wondering now... why make this on top of Unity, why not standalone? Well actually it did start as a standalone project because I was not even sure if it was possible to pull off what I wanted in Unity, turns out it was. Unity also has many great features that still apply to RetroBlit, especially the fantastic multi-platform support, ease of deployment, and APIs for tying into various game stores.

    Thank you for reading. I hope I have poked your retro feels in just the right place.







    Release Notes:


    v2.2.0 June 19 2019:
    New:
    • Added Unicode support to built-in and custom fonts!
    • Added Multitouch support, up to 4 touch points can be tracked with RB.PointerPos.
    • RB.BTN_POINTER_ABC renamed to RB.BTN_POINTER_ANY, RB.BTN_POINTER_D added.
    • Added RB.NativeScreenToDisplayPos for translating native screen coordinates to RetroBlit display coordinates.
    • Added RB.NO_ESCAPE_CODES flag for Print to ignore RetroBlit string escape codes and print the raw string.
    • Rewrote and vastly improved documentation, including over 9000 lines of API documentation!

    Bug Fixes:
    • Fix music not stopping and audio not cleaning up when switching games with RB.Initialize.
    • Don't let sprite sizes be bigger than sprite sheet size.
    • Fix sprite clipping when using RB.ROT_90_CW.

    v2.1.0 March 5th 2019:
    New:
    • Sprite Pack support! RetroBlit can now generate optimized sprite sheets out of individual sprite images. This allows you to reference sprites by their file names, rather than sprite sheet coordinates.
    • Sprite Sheets can now be created out of existing Unity RenderTextures, this can allow for better integration with more typical Unity scenes.

    v2.0.0 December 3rd 2018:
    New:
    • FES is now named RetroBlit! See http://www.pixeltrollgames.com/RetroBlit/docs/namechange.html
    • Tiled TMX support reworked!
    • TMX files are automatically converted into a RetroBlit binary format for faster access.
    • Added support for TMX map, layer, object, and tile properties.
    • Added support for TMX objects, with support for object templates.
    • Added support for TMX infinite maps, and chunk by chunk loading.
    • All TMX compression formats are now supported.
    • Significant performance improvements, sprite benchmarks are up to 2-3x faster.
    • Allocation garabage generated in RetroBlit from frame to frame is reduced from 500-2000 bytes down to 40 bytes. No Garbage Collection hiccups.
    • Added FastString class, a zero-garbage replacement for strings.
    • Added a set of 30 easing functions for interpolating values, vectors, colors and more!
    • Added ability to render into any sprite sheet, as well as creating blank sprite sheets which now replace offscreen surfaces.
    • Added new Clear(color, rect) method for clearing only a section of the display or sprite sheet
    • Added DrawTriangle and DrawTriangleFill primitives.
    • Added new Wavy and Shaky text effects
    • Added ability to change text font inline
    • Added a flag for ignoring inline text color changes (you can use this to render drop shadows behind text with inline color changes)
    • Added ability to retrieve RetroBlit rendering surface so that you can render it manually, see the new OldDays demo scene!
    • Added OldDays demo
    • RetroBlit can now be reinitialized at any time by subsequent calls to RB.Initialize and should no longer cause trouble if the Scene is reloaded. It's also possible to switch between different RetroBlit games by calling RB.Initialize for a different game.
    • Removed Indexed Color Mode support and all related APIs. See rationale here: http://www.pixeltrollgames.com/RetroBlit/docs/indexmode_removal.html
    • Removed Size2i, now Vector2i also has width and height members (which are aliases for x, and y)
    • Removed ColorRGBA, use Color32 or Color instead
    • Removed HelloWorld demo, improved MyGame template instead

    Bug Fixes:
    • Fix SpriteSheetSize() returning wrong values
    • Fix sprite sheet not loading if only tilemaps are being rendered
    • Fix rendering of primitives on some old hardware
    • Fix bad default audio compression on audio import

    v1.5.0 April 9th 2018:
    New:
    • Added BrickBust complete brick-breaker demo game!
    • Added FES.Ticks and FES.TicksReset APIs
    Bug Fixes:
    • Fix game FES.Effect.Slide not clipping to FES.Display bounds corrects
    • Fix FES.PaletteSwapGet not returning the same value as set by FES.PaletteSwapSet!
    • Fix Tilemap rendering issues when FES.HardwareSettings.MapSize is not a multiple of the internal chunk size (16)

    v1.4.2 February 22nd 2018:
    Bug Fixes:
    • Fix regression in alpha blending where colors get darker as alpha approaches 0, this bug was introduced in v1.4.0.
    v1.4.1 February 22nd 2018:
    New:
    • Added FES.BatchDebugEnable and FES.BatchDebugDisable which shows how many batch/flush operations are being performed and why
    Bug Fixes:
    • Fix tilemap chunks not being clipped at an early stage in the pipeline if they are completely out of clip bounds. This should improve tilemap rendering performance in some scenarios
    v1.4 February 5th 2018:
    New:
    • Added custom shader support! Shaders can now be applied in pixel-perfect space when drawing sprites/primitives/fonts, and also at post-process effect time. See FES.ShaderSetup(), FES.ShaderSet(), FES.EffectShader()
    • Added FES.EffectApplyNow() API which specifies when post-processing effects should be applied. This is very useful if you want some drawing (eg GUI) to be affected by different post-processing effects (or none at all)
    • Added FES.PaletteColorSet() overload that allows for setting colors directly from another palette file, rather than manually one at a time
    • Added FES.SpriteIndex() overload that takes sprite sheet index as a parameter, previously FES.SpriteIndex() only worked for current sprite sheet
    • Added Unity Crash Course to the Documentation to help new Unity developers get started with FES
    Bug Fixes:
    • Fix incorrect clipping region on Offscreen surface of different size than FES.DisplaySize
    • Fix Tilemap cell not updating when only the Tint Color or Flags are changed
    • Fix some Tilemap chunks becoming invalid and unsuable if all tiles set manually set to empty/invalid with FES.MapSpriteSet()
    • Fix some Tilemap chunks not rendering on Offscreen surface of different size than FES.DisplaySize
    • Fix Tilemap rendering when using the Offset parameter, some chunks were not rendered
    • Fix Tilemaps leaking Meshes
    • Fix built-in font not rendering properly if there is no sprite sheets loaded

    v1.3 January 4th 2018:
    New:
    • Add support for multiple offscreens with custom sizes
    • New APIs OffscreenSetup(index, size), Offscreen(index), OffscreenDelete(index). There is no longer a default offscreen created, an equivalent one can be created with OffscreenSetup(0, FES.DisplaySize)
    • Optimized DrawCopyOffscreen
    • Added SoundDelete, MusicDelete and SpriteSheetDelete APIs for explicitly releasing resources
    • Added more error logs for Tilemap and Font operations which were previously failing silently
    Bug Fixes:
    • DrawCopyOffscreen was flushing too much, causing too many draw calls

    v1.2.1 December 21th 2017:
    New:
    • Add Stress Test app
    • Add FES.SpriteSheetGet() for retrieving current sprite sheet index
    • ColorMode.RGB is now the default ColorMode if one is not specified
    • Added NineSlice struct to define the pieces of a nine-slice image more conveniently
    • Added FES.ClipDebugEnable and FES.ClipDebugDisable to visualize clip regions and assist in debugging clipping related issues
    Bug Fixes:
    • Fix music not restarting when FES.MusicStop() & FES.MusicPlay() is called
    • Fix crash when sound is played inside of IFESGame.Initialize()
    • Fix occasional crash with FES.MapClear() when clearing all layers
    • Don't set targetFrameRate in WebGL builds to prevent emscripten warning
    • Fix clipping region on some older hardware
    • Fix inverted ellipse rendering on some older hardware
    • Fix nine-slice rendering

    v1.2 December 7th 2017:
    New:
    • Added FES.DisplayModeSet() API for changing the pixel resolution of FES at any time
    • Added support for wide pixel (2x1) and tall pixel (1x2) modes which can be set in QueryHardware or in FES.DisplayModeSet()
    • Allow Update FPS to be configured in QueryHardware, defaults to 60fps
    • Added API FES.FPS() and FES.UpdateInterval() to query update FPS, and time between update frames in milliseconds
    • FES.SpriteSize() and FES.SpriteSheetSize() now take optional sprite sheet index parameter to specify which sprite sheet should be queried
    • Replaced ColorRGB with ColorRGBA. The alpha component is compounded with the global alpha set by AlphaSet()
    • New Rect2i apis Center() and Intersect()
    • Added some predefined basic colors to ColorRGBA

    Bug Fixes:
    • Palette pixels in multi-row palette files should now be read in top-left to bottom-right order, instead of bottom-left to top-right
    • Fix custom font issue with sprite sheet boundaries

    v1.1 November 20th 2017:
    New:
    • Add support for multiple sprite sheets. See SpriteSheetSetup(), SpriteSheetSet(), and MapLayerSpriteSheetSet().
    • Add new Print() APIs that allow for specifying the text area, and text alignment within it, as well as text overflow handling strategy (overflow, clip, or word wrap).
    • Greatly improved performance when rendering primitives, in particular lines, and ellipses.

    Bug Fixes:
    • Fix "false" return value when loading a TMX map from a CSV formatted file
    • Fix exception when using MapDataGet() on a null data element
     
    Last edited: Jun 19, 2019
  2. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    The free voucher keys are all gone. Thank you all for your interest!
     
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Please use code tags. Also I'm shocked that @GarBenjamin hasn't jumped on this yet :D
     
  4. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    Ooh, code tags do look a tad better! Thanks for the tip:)
     
  5. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    v1.1 is now available! See top of thread for release notes.

    Thank you, thank you to everyone who has given FES a try!
     
  6. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    v1.2 is now available! See top of thread for release notes.
     
  7. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    v1.2.1 is now available. This is mostly a bug-fix release, see notes at top of thread!

    In other news, I'm currently developing a FES game myself, a roguelike called Merl, you can track it as it develops in this WebGL build: https://simmer.io/@Dafu/merl
     
  8. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    v1.3 is now available! See top of thread for release notes.
     
  9. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    v1.4 is now available. This one is kinda a big deal as it brings in custom shader support, and ability to selectively apply post-processing effects at various points in render frame. See top of thread for release notes!
     
  10. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    v1.4.1 is now available. This is mostly a small bug fix release with performance improvements for tilemaps. See top of thread for release notes!
     
  11. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    FES is now at v1.4.2. It has seen a whole slew of improvements since the original release, but not as many adoptions as I would like to see! Today I'm putting it on a 100% sale (FREE) for a week only, in hopes of spurring some new interest! I hope you give it a try and find something in it to love!
     
  12. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    hodgepodge2022 likes this.
  13. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    RetroBlit 2.0.0 (formerly FES) is out now! This the largest update yet and contains many changes and improvements.

    Some highlights include:
    • Better and fast TMX support, with support for properties, objects, and infinite maps!
    • Render to a sprite sheet!
    • Incorporate the RetroBlit rendering surface into any Unity scene!
    • Near Zero-Garbage-Collection for smooth gameplay without hiccups!
    See top post for complete patch notes, video, and screenshots!
     
  14. Shturmovik

    Shturmovik

    Joined:
    Nov 5, 2014
    Posts:
    29
    Extremely cool update!

    I recently returned to one of my old projects based on this to continue development, and realised that I could make my life a lot easier by having MonoBehaviors run alongside RetroBlit, eg. to handle AI, pathfinding and cutscene scripting, and just have my main game logic query those objects during RetroBlit's Update() and Render() functions. Even cleaner when having long-running tasks happen in coroutines.

    Basically just spawning a number of helper objects, then let RetroBlit deal with the game's overall logic, input and rendering with the ability to go and pick up current values from subsystems churning away in the background.

    I know it's not the puristic old-school approach, but I thought I'd mention it anyway in case anyone else out there is as dense as myself and hasn't thought of this already ...
     
  15. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    Hybrid approaches can definitely work. In particular RetroBlit doesn't do much for you in terms of Networked Multiplayer, so tricks like yours would be useful there.

    Thanks for sharing, apologies for not noticing the post earlier!
     
  16. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    RetroBlit 2.1 is out now! This update adds support for Sprite Packs! You now have the option of storing folders full of individual sprite images and then letting RetroBlit stitch them together into Sprite Packs for you.



    If you're considering using RetroBlit but would like to evaluate it first then please send me a private message.
     
    Last edited: Mar 15, 2019
  17. Dafu

    Dafu

    Joined:
    Aug 22, 2006
    Posts:
    124
    RetroBlit 2.2 is out now! This update has completely revised documentation with over 9000 lines of API docs alone, and new features and bug fixes!

    NEW:
    • Added Unicode support to built-in and custom fonts!
    • Added Multitouch support, up to 4 touch points can be tracked with RB.PointerPos.
    • RB.BTN_POINTER_ABC renamed to RB.BTN_POINTER_ANY, RB.BTN_POINTER_D added.
    • Added RB.NativeScreenToDisplayPos for translating native screen coordinates to RetroBlit display coordinates.
    • Added RB.NO_ESCAPE_CODES flag for Print to ignore RetroBlit string escape codes and print the raw string.
    • Rewrote and vastly improved documentation, including over 9000 lines of API documentation!

    BUG FIXES:
    • Fix music not stopping and audio not cleaning up when switching games with RB.Initialize.
    • Don't let sprite sizes be bigger than sprite sheet size.
    • Fix sprite clipping when using RB.ROT_90_CW.
     
  18. the_unity_saga

    the_unity_saga

    Joined:
    Sep 17, 2016
    Posts:
    273
    Thank you for working hard to keep this up to date, loving the new line draw functionality. RetroBlit is basically SDL/SFML/Alegro for unity as far as I'm concerned.

    Hope to support a isometric addon or separate asset if you ever make one. Or support for isometric tmx files.
    (although I'm aware of doing it myself it'd be a nice thing, to be able to render out games similar to:

    )