00:00
00:00
MonoFlauta
Indie Game Developer + Senior Software Engineer @ Etermax

Facundo Balboa @MonoFlauta

Age 30

Indie Game Developer

Escuela Da Vinci

Buenos Aires, Argentina

Joined on 7/30/08

Level:
27
Exp Points:
7,866 / 8,090
Exp Rank:
5,253
Vote Power:
6.87 votes
Rank:
Police Sergeant
Global Rank:
9,162
Blams:
214
Saves:
823
B/P Bonus:
12%
Whistle:
Bronze
Trophies:
15
Medals:
773
Supporter:
8y 3d

MonoFlauta's News

Posted by MonoFlauta - July 4th, 2021


Full Post - Twitter Account - DevBlog


Hello, everyone!

I am going to explain the Object Pool I usually use. You can find the full version on my Framework Goat if you are interested.

iu_348517_2529638.webp

Witchcraft used Object Pool for the spells


What is an Object Pool

Object Pool is a programming pattern used to reduce performance issues related to object creation by expending extra ram by doing so.

The main concept or idea is that you don’t create new instances of object but instead recycle the ones you have after finish using them.

The full loop of an Object Pool would be something like this:

  1. You start with x amount of the object
  2. Each time you need an object, you ask for the Object Pool to give you one
  3. Once you finish using the object, instead of destroying it you give it back to the Object Pool

Of course there are some extra considerations to take care of like these ones:

What happens if the Object Pool runs out of objects? It creates new ones? Returns null?

  • I personally recommend creating new ones. They will be added to the stock in case you reach a new amount and you will not need to check for null references.

With how many objects should I start?

  • It will depend on what the Object Pool pools. You can make tests to see the max amount and use that as base so you don’t have to create them on runtime.


Why use generics?

You can make an Object Pool without generics but using generics will give you a huge advantage. Basically, generics allows you to define placeholders for the types you are going to use in some parameters.

So, instead of doing something like:

public class ObjectPoolForBullets {
    //Stuff
}

and

public class ObjectPoolForEnemies {
    //Stuff
}

and…

public class ObjectPoolForEffects {
    //Stuff
}

You can solve all of them by doing:

public class ObjectPool<T> {
    //Stuff
}

And when you define the field type you will just need to say what type between the <> like this for example:

private ObjectPool<Bullet> _bulletPool = new ObjectPool<Bullet>(); //This will have parameters inside

Even more, you will be able to have this class pre-saved and use it in any game jam you want to participate!



Why use Factory Method?

When using generics, you won’t know what type of object you are going to use. Yet, you will need to know how to create it if you want to have more during runtime.

The goal of factory method is that you have a method you can call and it will return that object to you. You will only need to know the method instead of how to create it. So you can have something like this as parameter:

public ObjectPool(Func<T> factoryMethod...) //It will have more parameters

Notice how that T will be the same that the class defined. Basically, as it is a Func<T>, you will be able to call that method without parameters and it will return you a T created. So, thinking only in making this Object Pool, you have all what you need. You don’t have to worry anymore on how to create T, you just know what you need to call in order to create it and get it.

iu_348516_2529638.webp

We used the exact Object Pool you can see in Framework Goat for Blight (a game jam game) for all the bullets and enemies



How to create it

I am going to show you step by step how to create this Object Pool. Notice you can make changes if you want or you have different requeriments.

So, first of all, as I showed before, we will need a Object Pool class with the generics <T>.

public class ObjectPool<T>
{
}

From there, let’s create the constructor and see each value we will need:

private readonly List<T> _currentStock;
private readonly Func<T> _factoryMethod;
private readonly bool _isDynamic;
private readonly Action<T> _turnOnCallback;
private readonly Action<T> _turnOffCallback;


public ObjectPool(Func<T> factoryMethod, Action<T> turnOnCallback, Action<T> turnOffCallback, int initialStock = 0, bool isDynamic = true)
{
    _factoryMethod = factoryMethod;
    _isDynamic = isDynamic;

    _turnOffCallback = turnOffCallback;
    _turnOnCallback = turnOnCallback;

    _currentStock = new List<T>();

    for (var i = 0; i < initialStock; i++)
    {
        var o = _factoryMethod();
        _turnOffCallback(o);
        _currentStock.Add(o);
    }
}

So lot of stuff going on here. First, lets check what every parameter will be used for:

  • factoryMethod – As mentioned before, this one will be used in order to us be able to create new objects when needed without having to know how to create it
  • turnOnCallback – We are going to use this method to activate our object. So, each time someone request an object to our Object Pool we will make sure it is ready to use and activated. We are using Action<T> because we don’t know how this object will be activated but we can send it by parameter.
  • turnOffCallback – We are going to use this method to deactivate our object. So, each time someone returns an object to our Object Pool because they doesn’t need it anymore, we make sure it is deactivate. As in the last one, we will use the Action<T> for the same reasons.
  • initialStock – This one is the initial stock we are going to use for the Object Pool. I had given it a 0 default value in case the user of the Object Pool doesn’t want to have an initial stock.
  • isDynamic – Remember the question of what we should do if we run out of objects? Well, the Object Pool is called dynamic if it creates in runtime when running out of objects. If not, it will return the default value of the type.

Those are all the parameters our Object Pool will need to work. You can make it simpler than this but I prefer to have all this functionality in order to don’t have future issues like forgetting to activate or deactivate the objects.

Now let’s check the body of the constructor. The first lines are just saving those values and initializing the list of objects. Then, we have a for that creates each object, it deactivates it just in case and then adds it to the current stock of the Object Pool.

That is all for the constructor. We asked for everything we need, we saved all the stuff we are going to need later and we created the initial stock.

We are going to need to extra methods now. The first one we are going to do is a method that lets me get an object from the Object Pool.

The method will be like this:

public T GetObject()
{
    var result = default(T);
    if (_currentStock.Count > 0)
    {
        result = _currentStock[0];
        _currentStock.RemoveAt(0);
    }
    else if (_isDynamic)
        result = _factoryMethod();
    _turnOnCallback(result);
    return result;
}

So, let’s see what we are doing here. First, let’s check the method firm. The Get Object will receive nothing, because we just want to get an object and it will return a T type that is the type of the object that saves the Object Pool.

Now we can check the body. First, we assign our result value as a default(T). Why default(T)? Because we don’t know if the object we are going to use has a null state.

Then, in the if we are going to check if we have stock. In case we do, we take the first one and remove it from our stock. If we don’t, we check if the pool is dynamic and we create a new one using the factory method.

For last, we now have the object we are going to use so we just need to turn it on using the turn on callback we got from the constructor and return it.

Now we have the constructor to set all what we need and a method to get objects from the Object Pool. The last method we are going to need is one that lets us return the object to the Object Pool. For this, we are just going to need the following method:

public void ReturnObject(T o)
{
    _turnOffCallback(o);
    _currentStock.Add(o);
}

As you can see, it is a really simple method. We just need to pass it a T object and it will deactivate and add it to the stock. That’s all it needs to do.

Final result

The final result of what we did is the following:

public class ObjectPool<T>
{
    private readonly List<T> _currentStock;
    private readonly Func<T> _factoryMethod;
    private readonly bool _isDynamic;
    private readonly Action<T> _turnOnCallback;
    private readonly Action<T> _turnOffCallback;

    public ObjectPool(Func<T> factoryMethod, Action<T> turnOnCallback, Action<T> turnOffCallback, int initialStock = 0, bool isDynamic = true)
    {
        _factoryMethod = factoryMethod;
        _isDynamic = isDynamic;

        _turnOffCallback = turnOffCallback;
        _turnOnCallback = turnOnCallback;

        _currentStock = new List<T>();

        for (var i = 0; i < initialStock; i++)
        {
            var o = _factoryMethod();
            _turnOffCallback(o);
            _currentStock.Add(o);
        }
    }

    public ObjectPool(Func<T> factoryMethod, Action<T> turnOnCallback, Action<T> turnOffCallback, List<T> initialStock, bool isDynamic = true)
    {
        _factoryMethod = factoryMethod;
        _isDynamic = isDynamic;

        _turnOffCallback = turnOffCallback;
        _turnOnCallback = turnOnCallback;

        _currentStock = initialStock;
    }

    public T GetObject()
    {
        var result = default(T);
        if (_currentStock.Count > 0)
        {
            result = _currentStock[0];
            _currentStock.RemoveAt(0);
        }
        else if (_isDynamic)
            result = _factoryMethod();
        _turnOnCallback(result);
        return result;
    }

    public void ReturnObject(T o)
    {
        _turnOffCallback(o);
        _currentStock.Add(o);
    }
}

You should be able to take this C# script and take it to any project. Even more, you can make this structure in other languages. I did something similar in AS3 for my Framework Mono.

iu_348515_2529638.webp

The spheres in Skeleball also used this Object Pool



You can finish reading this post at my DevBlog (for free of course!). Though with all this content you can already create it and use it :)


Thank you for reading and feel free to ask me if you have any question!


Tags:

Posted by MonoFlauta - June 13th, 2021


Hello, everyone!

We just published Paw Pals for the GMTK Game Jam 2021. We made this game in less than 48hs and we are really happy with the results. Hope you can try it and have fun with it!

iu_330040_2529638.webp

Paw Pals is a game where you manage a bunch of kitties trapped on the top of a tree. Your goal is to investigate enough of the big book of “How to get down of a tree for dummy kitties” while making sure your kitties have enough food.

But here is the catch: Your kitties have personalities and some of them may not be too happy about working with others therefore making them feel more and more stressed. High levels of stress will make the kitties work a lot less so take care of the kitties!

iu_330041_2529638.webp

Features:

  • Lots of cats to discover and make friends with
  • 4 Unique areas
  • The big bucket for fishing
  • Balloon Bay for sending kitty explorers
  • Scratching Posts to lower cats’ stress
  • Big book of knowledge to learn how to get down of trees if you are a cat
  • Multiple cat traits making the clowder diverse
  • Fun for the whole family

Hope you have fun with it and stay tuned for more updates regarding my other projects!


Tags:

2

Posted by MonoFlauta - July 12th, 2020


Hello, everyone!

Last time I wrote here we were around the days 45 day of quarantine in my country. Now we are around 110? Not sure really... Well, it can't be helped ¯\_(ツ)_/¯.

Anyway, in other news, have updates on all the projects I am working on!

Summer Snow Day

Chad already started with the second chapter. Well, actually, he already sent all the scripts and I just have to add them. I didn't start with it yet because we have a last small bug to fix from chapter 1. Once it is finished, we are going to officially start with the second chapter which should take a lot less with all the working base chapter 1 will leave to us.

iu_142489_2529638.jpg

These last weeks had been a most of tweak and get everything in order before continuing from my side. Also, I know that Chad had been working on the main menu so we have that too working from our side. We had been thinking about how the save files are going to work and that. Hopefully, all this pre-production will result in a better game.

Is This Still Tennis?

This is the project placeholder name we gave with FuNaNdMoRe to a project we are working on during our free time. Yes, you read well, with FuNaNdMoRe! The last game we did together was Billy's Barricade in 2012 for the Newgrounds Game Jam 8, if we don't count Divine Carnival in the Bayou and Order of the Narwhal were FuNaNdMoRe came to add his awesome music. If you are insterested in games we made together, remember to visit the page of Fun+Mono in my blog.

Both of us had been working and learning a lot about videogame development through these many years. Even though, we got to met each other almost two years ago. Well, a month ago, more or less, we decided to start working on a small web game as a nostalgic thing for Newgrounds.

iu_142490_2529638.png

We are still trying out the mechanics and we don't have 100% defined what the game is going to be but for now, we have an otter protecting its baby otters from evil enemies that throw stones to them. If you checked out my Twitter account you probably saw already a gif of it but if not, go and check it!

Roque's Life

The truth is that we still don't have a final name for this but we are using this one as placeholder. This is the game we are making based on Sense of Unity, a game we made for the Stay Safe! Jam.

So far, we have the mechanical parts of the menu, the editor and the some of the special tiles of the gameplay. We had been working slow on this since most of the team members have other jobs but we are ready to start adding art to the game. Hopefully, we will be updating a lot more soon.

End

Hope you are doing well and taking care of yourself during these difficult times. I don't have any more news but please consider following me on Twitter for the latest news. Good luck and thanks for reading!


Tags:

1

Posted by MonoFlauta - May 10th, 2020


Follow me on Twitter!



Hello, everyone!

Long time I don’t write an update here so I decided to make some time for this. Hope you are taking care of yourself and everyone during these strange times.

New features for Summer Snow Day

With Chad we had been adding new features to Summer Snow Day. There was a small period with no updates but now things are running smoothly.

Some of the new updates include the addition of video clips between moments that give them a huge new feeling to the game. Also, I think they will be of a high quality since Chad is an expert at editing videos and he will make some great results with the tools he has.

iu_119952_2529638.jpg

I think the only downside Summer Snow Day project has now is the legacy code I made. I had learned so much since we started and now I am carrying with some crappy code. Anyway, I am making some refactors so this won’t affect on the long run.

Other projects

Regarding other projects. I am working in two other ones.

One of them is based on Sense of Unity, a game we made for the Stay Safe Jam. If you didn’t try it out yet, please consider playing it.

What we are planning to do is to expand on the mechanic we had and even add a level editor in game.

iu_119953_2529638.jpg

(Character made by Hugo Miraballes)

One of the things that gives me special interest in this project is the fact that we are coding it using Test-Driven Design. Probably the first thing I learned at my new job is TDD and I was looking forward to use it in my personal projects. Since all the programmers for the project work at the same place, we all know TDD and therefore we decided to give it a shot. Also, we believe it will help the game to develop faster and to be less prone to bugs.

iu_119954_2529638.png

We are still working on it of course. But one highlight I can give, as you had seen in the character picture, we are making a rework of the theme and it will be a lot more friendly and cute one than the plague doctor. You will be playing as this old owl helping people while you travel through your long journey. But that is what I can show so far. Hopefully I will have more to show in a near future.

Meanwhile, on the other hand, I had been talking with a long time friend and we are playing to make a game again together. We hadn’t decided on what yet but I would love to work with him again and I hope this happens.

Other than that, I am going to start having a different approach for the games I am working on. Till I don’t see that the project is advanced enough to say “well, looks like this is really happening” I will not add them on Working on or even give them names if that depends only on me.

iu_119955_2529638.png

This is mostly because I had seen a lot of projects started and died because of lack of work on them (from all the members including me). But don’t worry, I will still keep adding updates and showing on stuff on my twitter account.

More

This is the day number 45 of official quarantine in my country (day 46 for me because at my work they decided to start just one day before the government announced). Though it has been a very stressful moment, I have to admit that things managed well in my country and everyone I know is safe as far as we know. I hope you are taking care of yourself too.

Also, this week I received an email from Steam that my newest payment for YBit earnings was ready. Sadly, I also received an email from the bank saying that I won’t get my money till I show some documents that I can’t recall. I will call the bank on Monday and see if I can do something about it but this kind of things always make me think about how difficult is to freelance outside of the country and how much needed is the payment to PayPal option from Steam.

For last, I am having a great time at my work. I learned a ton of new things and I am excited to learn more of them. I read a book called The Manager’s Path: A Guide for Tech Leaders Navigating Growth and Change by Camille Fournier and I am reading Conscious Business by Fred Kofman. These both books helped me to learn a lot of negative things that happened at my last work and I can’t believe how positive is my new workplace when taking care of its employees. So just wanted to tell you that I am really happy right now and feel blessed for my opportunities.

Thank you for reading and stay safe!


Tags:

3

Posted by MonoFlauta - April 1st, 2020


iu_106227_2529638.jpg

Hello everyone!

I know it passed less than seven days since my last post about a new game but… Sense of Unity is a new game and it’s out now!

The game was made in Unity for the Stay Safe! Jam and it was made by a total of 8 persons including artists, programmers and game designers.

iu_106228_2529638.jpg

I had never made a game jam game with that big amount of people and it was incredible fun and worth it. Hopefully we will get to make another game together like this in the future.

So please go and try it out!


Tags:

3

Posted by MonoFlauta - April 7th, 2019


Hello, everyone!

I have updates regarding all my current projects. Half of them, almost finished. So, here we go!

Unblocky is complete

For Unblocky we have already completed the game. Just a few tweaks with the playstore and a final version for the japanese language left.

Regarding the playstore, we have a few problems with the privacy policy. Google asks us to make a privacy policy for the game, which we made with a creator I found only, but apparently, it wasn’t enought. We are still not sure what else do we need but we already contacted support.

While we work on that, we are also waiting for the final revision of the Japanese language. Hopefully, we will get both during the next week.

iu_17681_2529638.png

Once we have these two things. We aim to make a soft-launch, in order to fix bugs in case they appear, and after that, we will make a full release for Android while we also make a release for a web version which will be at Newgrounds (with medals and leaderboards) and itch.io.

Finished Summer Snow Day UI

We finally finished the Summer Snow Day UI! It took a lot longer than expected, but I can say I am pretty happy with it.

iu_17683_2529638.jpg

From now on, we will be focusing in the characters expressions and poses. Hopefully, from now on, things will move a lot faster. Sorry for the delays, but they were totally worth it!

VR Escape Game

From here, things are still moving really slow. Hopefully, during the following weeks it will be a lot faster.

I had re-made all the input settings with the new VR Steam API (which is poorly documented) and I made a new grab system which I hope it will give the player a better feel and more customization to the artists regarding on how to interact with the objects.

Stickerboy final revisions

For last, regarding Stickerboy, we are in the final revisions. I think we will have soon a release for web and a upcoming release for Android.

iu_17682_2529638.jpg

One of the changes the client asked was a negative feedback when pasting a sticker in a wrong place. Good thing they noticed the need of this because now it is a lot clear. We had been working in this for so long in our spare times that we sometimes lost the notion of what does the game need.

This and other changes had been added to the game. Hopefully, this will be the final revision for the web game and we can start showing the game to you.

Buy me a ko-fi!

For last, I made a Ko-Fi account. All the money I get from it, if I ever get something, I will use it for developing games. So, if you like them, please consider donating a ko-fi to me!

Thanks for reading, please stay tuned for more updates!


Tags:

1

Posted by MonoFlauta - March 17th, 2019


New game called Blight

Hello, everyone! I have a lot of news. The first one is, if you haven’t check it out yet, a new game called Blight.

iu_14009_2529638.jpg

The game was made for the Extra Credits Game Jam #3. I am planning to make a post-mortem in a near future, but meanwhile, please consider trying it out and let me know your thoughts about it!

Bunch of updates for Unblocky

From all the projects I am working on right now, this one is probably the one with the fastests progress so far. Thanks to the simple mechanic, we are being able to focus already in polishing (although we still have to add a few more things to the gameplay).

iu_14008_2529638.png

So far, we have planned three modes and only one still needs more work. The modes we have planned are:

  • Traditional – You have 5 seconds to mark every pattern. Each round, you get a new pattern.
  • Arcade – You have 5 x Ammount of patterns to finish the whole sequence. Each round, you get a new pattern. Also, there are special nodes that can give you more points or make you re-think the movement because they block specific directions. We still have to make more special nodes for this one but it is already fun to play it.
  • Zen – Is like traiditional except you have no timers. You can take all the time you need to play it.

We also have this already in the PlayStore and we are being able to test it directly from there. Rollouts for Android work a bit slow but this is the best option since we can also add friends as beta testers and give them the updates automatically. Hopefully, will give you a lot of more updates in a near future.

My other projects

While I work with these projects, I also keep working in the other two ones. For Stickerboy we are sending the client all the updates they had been asking. Most of them are balance changes or small changes so we are hoping to realease it soon.

Regarding the VR game. Things had been really slow because of our jobs. It gets really difficult to get everyone to be available the same day so the updates we had been working on had been more an individual thing. The good thing, is that I re-made most of the game to work in the latest VR Plugin so we had been able to update the Unity version.

That will be all for now. Please consider following me on Twitter for the latest small updates and thank you for reading!


Link to the original post: https://monoflauta.com/2019/03/17/unblocky-modes-and-more/


Tags:

2

Posted by MonoFlauta - December 9th, 2018


Original post: https://monoflauta.com/2018/12/09/all-characters-from-summer-snow-day-and-more/

Summer Snow Day

Hello, everyone!
We finished presenting all the main characters from Summer Snow Day. The last one, Honji, is the main character and the one you will control during your adventure.

2529638_154437896583_SummerSnowDayMeetHonji.png

Also, Chad published a wip of the in gameplay finish result which you can check here! Even more, we are having a big progress on the visual side of the game. From my part, I had been working on the postprocess that will let Chad control and give a great feeling to the game. If you want to have the latest updates consider following the Happy Ghost Studio twitter account!

Saiba-Run

The results of the Epic Mega Jam 2018 are out and we didn’t make it once again. Sadly, we had a lot of issues when using Unreal this time. Being the only member that could update the project, because of repository issues, plus a bug where the intro video would only display in the computer where the project was published, leaded us to a result we weren’t looking forward.
As a team, we are not sure if we are going to participate in another one of these ones. We had too many issues, probably because inexperience, that we would normaly don’t have in Unity. Maybe, in a future we try again but for now, we need to rest a bit from Unreal.
You can play the game HERE.

2529638_154437908581_K3wKlJ.png

Framework Goat

I also had been updating Framework-Goat. I added a bunch of new changes and also added an UpdateManager that will help to optimize big Unity applications. Probably, going to keep adding new updates now that I will have more spare time for projects, leading to have more ideas and utilities I can add to the Framework.
As a changelog of the last time I posted about the Framework, I added:

  • Added UpdateManager, this will be a huge performance improvement when using a lot the update functions
  • Changed Start for Awake and added Stop All Themes option to the Sound Controller
  • Added a Clear and Subscribe clear to EventManager
  • Fixed a null reference when removing events in the EventManager

StickerBoy

We had been adding audio updates and new mechanics to the StickerBoy game. Now you can paste stickers and get points because of it. I also created a wave editor so Kevin can edit easily the waves and balance the game from there.
So far, the game is getting better and better and giving a lot of fun when playing and making it. Hopefully, we finish with a nice polished game.

2529638_154437916492_StickerBoyUpdateDecember9.png

That's all for now! Please consider following my Twitter account for more updates!


2

Posted by MonoFlauta - August 21st, 2018


2529638_153487438253_s1.png

Hello, everyone!

This week I had been working on a new game called Shot Wave, a game made for the Unreal Engine 4 Summer Game Jam 2018.

It has been a really intense weekend because it was not only a game jam, it was also the first game we do in Unreal Engine 4. So please, go and check it out!


Posted by MonoFlauta - July 14th, 2018


2529638_153161516313_Skeleballs-Screenshot.pngHello, everyone!

This week I had been working on Skeleball, a game made for the Minimalistic Jam #3. It has been an intense week at my work but, luckly, I managed to make some extra time and worked on this with Galit “shoze” Weisberg and Iván Piccione.

I coded this game in Unity using as base my, under construction, Framework Goat. I think it is always a good to test for frameworks to be used in game jams.

Anyway, please, feel free to try it out!

Also, please consider following me on Twitter!


1