BI - Devblog[#2]

posted in BI - devblog for project Barbarian Invasion
Published April 27, 2020
Advertisement

Hello everyone!

There is the next part of our devblog. This week we work on object pooling system, new type of units, fixing some bugs and one more thing, but its not ready yet and we cant present it right now :(

1. Object Pooling

If you are familiar with Unity you know that you can spawn object in this way

public class ExampleClass : MonoBehaviour
{
    public Transform prefab;
    void Start()
    {
        for (int i = 0; i < 10; i++)
        {
            Instantiate(prefab, new Vector3(i * 2.0F, 0, 0), Quaternion.identity);
        }
    }
}

This is a very easy and simple way, it may suit you if you have few objects in the game, but if you have 5 - 10 units per wave, a lot of projectiles and etc, then this will down your framerate very much.

Instead of creating objects every single time I find object pooling the best solution for this problem. In short, instead of spawning objects each time, you use pre-spawned ones. It will give you a high performance boost, cause you dont need to spawn object at runtime anymore. Of course, a situation may arise when the previously spawned objects are not enough. Then the pool system will create the object that is not worth it and add it to the shared pool. Pooling is also pretty easy to use. For example, this is the sample code from our game

//Get unit from the pool
EnemyMeleeController enemy = PoolManager.GetObject(units[i].unitName, portal.position, Quaternion.identity).GetComponent<EnemyMeleeController>();

But of course, your solution may differ from ours ?

There are some useful links about this:

2. New type of units

At this stage, we have implemented only two types of units: Archers and Infantry. This week we have implemented another type: Mages. It is similar in implementation to archers, but with some differences. Some types of mages are attacking, while others are supportive. We will have different types of mages in our game but now we have only fire mages. The reason for this was the difference in FX, where we dont have any experience and after several attempts, we did not have time to finish them to this moment, even FX for fire mages. I believe that after some practise I will do this ?

Fire Mages showcase

We also implemented fire mage in current gameplay, but as I say earlier we dont have FX for showing battle part

In-Game showcase

3.Conclusion

This week was not the richest in new functionality, but we learned some useful things. We also have some features which we want to present in this blog, but they takes more time than we expected and we didn't finish them in time. The next part promises to be richer in new features that we can show you ?

Thanks for your attention!

Previous Entry BI - Devblog[#1]
Next Entry BI - Devblog[#3]
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

BI - Devblog[#8]

5285 views

BI - Devblog[#7]

2765 views

BI - Devblog[#6]

2735 views

BI - Devblog[#5]

2754 views

BI - Devblog[#4]

6379 views

BI - Devblog[#3]

5786 views

BI - Devblog[#2]

4930 views

BI - Devblog[#1]

2964 views
Advertisement