Search Unity

Games Mini Micro

Discussion in 'Works In Progress' started by JoeStrout, Jun 16, 2019.

  1. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    I'm working on a neo-retro modern-80s style virtual home computer! It's called Mini Micro, and it uses MiniScript as both the command language and the programming language.



    In addition to the standard MiniScript intrinsics, it'll have an API as defined here that lets you easily make 2D games. This Flappy Bat game took less than an hour, and that was while monkeying with the underlying code (adding non-uniform sprite scaling, for example) too.

    I'm super excited about this project — I think it's going to be a fantastic way for newbies to learn programming, and for old timers to hack around and have some fun too.
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    1,434
    You mean people like me, who may be nostalgic for programming on an old Apple ][ or C-64? I might be interested from that angle.

    If I spent a year-and-a-half grinding out some sort of TSI-gold-box style game using your system, will I be able to make a regular Desktop build of the final product?
     
    owlhowell and JoeStrout like this.
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    Yep. I'm in the same boat (obviously). Nostalgia value is definitely there, but I also honestly think it would be a good environment for teaching or learning. It's hard to beat a REPL for "learn by doing."

    Yeah, I've been thinking about that. I don't see why not. It would be basically just Mini Micro itself, bundled with a "startup disk" (zip file) that contains your code and assets, set to automatically run on launch. Should be pretty easy to deploy that as a desktop or web app.
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    Noodling around this evening with some turtle graphics, just for fun.

    Screen Shot 2019-06-15 at 9.23.25 PM.png
    That's not an approach to drawing that's part of the standard Mini Micro API; it's just something I defined as a class that combines a turtle sprite with the standard line-drawing routines (that's what's in the first 70 lines of code not listed above). I'll probably provide it as library you can import when you want to do this sort of thing.
     
  5. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    1,434
    Will there be simulated low-level stuff like POKEing numbers directly into the virtual frame buffer? This is where you could really get creative, back in the day.

    I could definitely understand why you wouldn't want to include that sort of stuff, though, as it was mostly just to get around the suffocating performance and memory restrictions, which aren't really a problem anymore. It could be seen as adding a bunch of pointless complication.
     
  6. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    Right. An early version of the system did have PEEK and POKE, but then (like you) I realized that was just a workaround for various limitations that no longer apply. You can still directly get/set pixels, for example, but you do it with gfx.pixel and gfx.setPixel.
     
  7. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    Last night I wrote a little "Mochi Bounce" game in Mini Micro.

    MochiBounce.png
    If you want to try it, this link will take you right into the game. When the game is over, enter
    run
    to play again, or
    edit
    to monkey with the code. :) Use
    help
    to learn other commands that are available (including how to find and run the other built-in demos).
     
  8. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    I'm thrilled to announce the very first public release of Mini Micro as a stand-alone Mac and Windows app! Grab it here:


    This is version 0.1. It does not yet have support for sounds or tile maps, but text, pixel graphics, and sprites are all working fine! See the development roadmap for details. And be sure to grab the Mini Micro Cheat Sheet, which gives you everything you need to know about Mini Micro and MiniScript itself in only two pages!

    I welcome any feedback. Thanks for giving it a try!
     
  9. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    1,434
    I was looking at the code. Does "sys/pics/" refer to a path in the build, or does Mini Micro have it's own virtual file system?
     
    JoeStrout likes this.
  10. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    It has a virtual file system; each "disk" is actually a zip file. The /sys disk is built in and read-only; there's also a "/usr" disk (in the Mac/Win desktop versions) that is created automatically on first run, where you can store your own files.
     
  11. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    Mini Micro version 0.2 is now released! This version adds extensive sound support, including sounds loaded from WAV files and sounds synthesized in code. Grab the latest here:


    See the development roadmap for details on how this fits into the grand scheme of things (hint: the only major feature not done at this point is tile maps!). And be sure to grab the Mini Micro Cheat Sheet, which gives you everything you need to know about Mini Micro and MiniScript itself in less than three pages!
     
  12. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    This week I'm adding support for tile maps. It supports both rectangular and hexagonal grids, via "oddRowOffset" and "oddColOffset" properties you can set as needed to shift the hexes into place.

    upload_2019-7-7_20-39-43.png

    This is the last of the display types, along with Off, Solid Color, Text, Pixel, and Sprite. Mini Micro has 8 display layers, any of which can be set to any display type. For example:

    upload_2019-7-7_20-41-39.png

    This shows the default setup, with layer 7 (at the back) set to a solid color, layer 5 set for pixel graphics, layer 4 for sprites, and layer 3 for text, with the other layers turned off. In the hex map test above, I set layer 2 to a tile display.

    In early testing, I'm finding this a very nice combination of simplicity and power — you can configure the eight display layers to easily make any sort of 2D game.

    The new tile functionality will appear in Mini Micro version 0.3, probably next weekend or so.
     
  13. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    If anybody is interested in learning to use Mini Micro, I've started a "Getting Started" series of posts that guide you through it step by step. The first post is here.

    This is really aimed at people who have never done any programming before, or at least not where they have to type (Scratch would be a decent backgrounder, but is not necessary). Most folks here are probably way beyond that level. But maybe you know somebody who would like to learn, but finds Unity a bit intimidating? Point them to that link, and by Day 2 they'll be doing stuff like this! :)

     
  14. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    I'm happy to announce that version 0.3 of Mini Micro is now available!

    This version adds support for Tile displays. A tile display is a regular grid of little images which are drawn very efficiently. Good for things like game boards, maps, all the static stuff in a platformer, etc. All the classic Nintendo games, for example, were built on a combination of sprites and tiles — now you can do the same in Mini Micro!

    As an example, try the new "Wumpus Trap" game. You'll find it in the /sys/demo directory, or if you want to play on the web, try this link (you may have to flush your cache or use a private window if it's still loading v0.2 for you).



    As you can see, the Tile display supports both rectangular and hexagonal layouts (and other arrangements too, such as isometric — it's very flexible!). What will you create?
     
  15. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    I'm happy to announce the release of Mini Micro version 0.4! This release adds a whole bunch of new file-related APIs, including:
    • the view command for previewing any text file, MiniScript source file, image, or sound
    • File.readLines and File.writeLines for easily reading/writing a text file (or MiniScript source file)
    • File.open for detailed control over reading/writing a file, including random access to any position therin
    and much more! We also fixed a little bug in the pixel display that could cause it to fail to display any drawing done immediately after setting a display to pixel mode for the first time.

    In addition, we also gave the code editor a major update, with improved auto-indentation, and a nifty "shift-return" feature that inserts the correct block closer for the last block opener! For example, try typing while true in the code editor, and then instead of just pressing Return, press shift-Return. This will insert a blank line, then end while, and put the cursor on the blank line, ready for you to fill in the body. Works with any kind of block, including for, if, and function!

    So head over to https://miniscript.org/MiniMicro/ and grab the latest build for Mac or Windows (want Linux? Post here to let us know!). And be sure to get the version 0.4 Mini Micro Cheat Sheet too, which has been updated with all the latest goodies!
     
    GarBenjamin likes this.
  16. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    I've just posted version 0.5 of Mini Micro! This version rounds out the pixel display drawing routines, including drawEllipse, drawPoly, and fillPoly. In addition, all the "draw" commands, plus line, now take an optional penSize parameter, allowing you to draw lines, rects, ovals, and polygon outlines that are more than 1 pixel thick. The turtle module in /sys/lib has been updated to have a penSize property too!



    We've also added a mathutil module in /sys/lib, which provides functions for testing whether a point (or any of a whole set of points) is within a polygon, converting degrees to radians and back, and other handy stuff.

    You'll also find a new Tic-Tac-Toe demo in /sys/demo, which uses the new pen size parameter to draw the board. It also plays a half-decent game, but could probably be made smarter... why not see if you can improve it?

    This is the last major feature update for Mini Micro. All the pieces are in place now! Version 0.6 will focus on fixing any inconsistencies or small gaps in the APIs, making more demos, and polishing up the ones we have. Version 0.7 will probably focus on performance optimizations. And as always, if any bugs are found, they will be promptly squashed!

    So give it a try, and please let me know what you think!
     
  17. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    It's been a long while since an update; version 0.6 is supposed to be wrapping up last-minute features and polishing off the demos, and doing all that just takes time.

    Today I got inspired by Kenny's 1-Bit Pack, and used it as an excuse to finally add support for per-tile tint colors to the TileDisplay APIs:

    upload_2019-8-13_18-9-46.png

    I'm also working on some utility libraries to go in the /libs folder, including some character controllers, like this platformer character:

    upload_2019-8-13_18-11-20.png

    So... lots of great stuff going on! Hoping to finish up v0.6 in about a week.
     
    KarlGG likes this.
  18. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    8,062
    Mini Micro version 0.6 is finally available!



    This version includes a lot of refinements, more consistent APIs, and new demos and library code. Among the fresh goodness:
    • new drumMachine demo lets you lay down a sick beat
    • new levelEditor serves as both a demo of tile displays, and a handy utility for laying out maps for use in your own games
    • new libraries in /sys/lib including spriteControllers, tileUtils, and sounds, to make your coding go even faster
    • code editor now has keyboard shortcuts for Cancel as well as Save & Exit
    • for the first time, includes a Linux build!
    • included MiniScript now supports line continuation, improved import behavior, and several other enhancements
    I did not, unfortunately, have time to finish the textAdventure demo... but I'll do that in 0.7 for sure, in addition to making various under-the-hood optimizations to increase performance even further. Versions 0.7 through 1.0 will include new & improved demos, help, and sample code, as well as external features such as publishing your games to the web or as a stand-alone app.

    At this point, the Mini Micro API should be considered complete; any changes between now and 1.0 will be minor, and even that only when there is a very strong reason. So this is a great time to check it out, download the Cheat Sheet, and get started!
     
    StevenPicard likes this.