Wednesday, September 7, 2016

In-depth look at Minigame Simulator

 Well, here we are again! After a mere 2 years, I've finally got to a point where I can proudly present my Minigame Simulator! Why this long, you ask? Well, it wasn't always like this, of course, and it definitely didn't take that long. So in this post, I'll guide you through the creation of this "emulator", as well as its functionality!

 It started way back around August of 2014. I've had this idea of making a game that could play other games within it, like those old "Minigame consoles" (of which, of course, I own one):

Picture from LÖVE Forum user lost_RD.
Pretty similar to the one I have in real life.

 What I had in mind for this project was ambitious, but it had to start small. And I mean small. This is what version 0.1 looked like:

 It was only the bare bones of what I planned for this. It's not obvious from this picture only, but version 0.1 didn't have anything! All it did was play the Snake game, and a pretty lame first version for that matter. Pause and Settings didn't work, and you couldn't change games. There was no secondary screen for score, level, etc, and the skin was that, no changing.
 However, right on this first "sketch" (can barely even call that a "Simulator", to be fair), I've started paving the ground for what I planned. I started setting up multiple game loading, preparing custom skins, etc. With this, came version 0.2. We already had pausing, settings and customizable skins. I've also updated the game to LÖVE 0.9.1 (version 0.1 was made for 0.8.0).
 After 0.2, I kept working on it. But the more things I added, the more complicated it got. Massive bugs emerged, the game became super laggy, so I paused development on it for a while. I tried updating it a few times along these two years, but other projects started taking priority, and this started falling behind.
 It wasn't, however, until a couple months ago, that I decided to pick up the pieces of what I've left behind, shake off the dust, untwist the knots, and polish up what I had in order to add it to my Portfolio.

 What I left behind was pretty good already: I had a working menu, two custom skins, customizable settings per game, and a decent documentation of how to make games and sets. However, bugs and lagginess was still present. I also had a lot of things I wanted to add but never had the time or motivation to do so.
 I've started working on a small game called "Filler" (for now, may change it later), but I decided that, before I release that, I should finish this, since I've made a lot of progress with the project, and leaving it behind again would be a massive waste of work and time. So for a couple days I picked this up seriously, trying to clean the code, add missing features, test the heck out of it, and make sure it runs as smoothly and bug-free as possible. And that's what I've accomplished! I still have a few features I want to add here and there, but for the time being, this project is pretty much finished! It has all of the main features I wanted for it, documentation for people to create their own content, and I've also updated it to LÖVE 0.10.1!

 But now, let's go through all that's available for the general user:

Screens:

 This is the area where the player, obviously, sees what they're interacting with. The main screen is where the game will be drawn, as well as the menu and settings screens. Any other screens are optional, and depend on the custom set you're using (not all sets may contain secondary screens, and some may contain one with completely different functions and purposes).
 In the default set, we have, besides the main screen, the side screen. It provides the following information: your score, the highscore for the selected game, how many lives you have, time left, current level, current speed and progress through the level.









Controls:

 The controls are pretty straight forward: up, down, left and right for controlling your character, or whatever the game offers, a "big" button for any additional action, pause, for pausing the game, and settings, for configuring the game options, the skin options, or for leaving the game and returning to the menu.
 You can use these controls both with a mouse and a keyboard, and they can be fully configurable in custom sets: you can change their position, size, and even shape, as well as add exclusive buttons, not present in the default set! You can also choose which keys trigger which button, if you desire.









Menu Screen:

 This is the screen you see when you first open the Simulator, or as soon as you quit a game. In it, you have a variety of options and functions. First and foremost, this is where you select your game. By default, you can choose between "Snake", "Tetris" and "3D Cube Demo", but if you've installed/created any other game, it should show up in there too. It also shows the game's creator underneath.
 Then, next to the game icon, you can configure the game's speed and select a level (you can only choose levels you have unlocked already, so there is no way of "skipping ahead" in the game. Additionally, you have access to the "Settings" screen, even though it can be accessed at any given time through the "Settings" button.








Settings Screen:

 This is where you can change the default skin settings, as well as custom game settings (if the game supports it). You can change the skin's color by changing its rgb value, change your simulator skin, or return to the menu from within the game.
 Additionally, when the game provides it, you have access to a variety of different custom settings to change the game environment. As an example, the "Snake" game provides the following settings: "Flip snake", which toggles whether or not you can turn your snake around by moving to the opposite direction it's heading, "Snake maximum size", which determines how large the snake gets before you go to the next level, "First person mode", which toggles the camera following the snake's head, and "Directional speeding", which sets speeding up when holding the directional button corresponding to where the snake is going.
 However, these options are not present in other games (except for the skin customization and returning to menu), but they may contain completely different options that best fit them.



Game Screen:

 This is where the "magic" happens. The game itself, whatever it might be, is displayed in the main screen. Besides playing the game with the directional buttons plus action/big button, you can pause it at anytime with the pause button, or access the "Settings" screen with the Settings button. That way, not only can you return to the menu or change your skin settings, but also change the configurable game properties while you play it, making it easier for you to set up the best environment for yourself!






 And that's about it, guys! If you want more details on how to make games and/or sets, you can have a look at the Reference.lua and Sets.lua files present in the source code for this, or simply check the rest of the source and default set for a better understanding. If you still have any questions or anything to say about this, be it a bug report or a suggestion, feel free to do so via the game's Love2D Thread. Do note that making custom screens for a set or making a game require coding, so you need at least a basic understanding of the Lua scripting language, as well as the LÖVE Framework. Additionally, you will need to check the game's Reference file for a list of available game functions, such as for drawing, detecting buttons, setting scores, lives, etc.
 But that's basically it! Thank you guys for reading, and I see you in my next post!

3 comments:

  1. hey,a 100 subscribers youtuber here.i have to say (this might seem a little,just a little out of place)i liked that mod you made for Mari0,and im really interested in it.so,i am going to start watching your posts for now on,to see how FAR that project can go��.

    -Sincerely,Benjamin Wendel.

    ReplyDelete
    Replies
    1. Hey Benjamin, I'm glad you enjoy my mod! Unfortunately, I discontinued it a few months ago. You can still download the latest version here:
      http://forum.stabyourself.net/viewtopic.php?f=13&t=3477

      Delete
  2. Well then,good luck with any other project!(also,sorry,i cant reply).

    ReplyDelete