It is a simple Match3D game which developed using Entity Componet System Architecture with Entitas Framework. This project serves as a demonstration for implementing ECS/Entitas, Dependency Injection, Unity Physics, and JSON configuration data. The architecture of this project has a similar approach as directed in the original project guidelines.
Objects will drop at fixed intervals, starting with a 5-second gap. Pressing the timer button reduces the drop time and to a minimum of 1 second. When matching identical objects, they merge to form the next level object. If the maximum level has been reached, no new object will be formed. The objective is to match every possible pair to progress through the level.
MatchPool3D_Gameplay.mp4
It tooks 8-9 work days to complete.
I started by creating a Game Design Document for this project, then continued by development.
Basic game config can controlled by GameConfig.json.
{
"goldPerStandardMerge": 5, // earned gold after every standard merge
"goldPerFinalMerge": 15, // earned gold after every final merge
"goldPerLevelSecondsLeft": 5, // earned gold for every second that remains after level finishes
"objectsMaxSpeed": 10, // max speed of an object can reach
"mergeVelocityThreshold": 7, // if an object collide by velocity greater than this will merge, otherwise it won't merge
"objectsMass": 5, // objects rigidbody mass
"objectsBounciness": 0.5, // objects physics material bounciness
"timerCountdownTime": 5, // objects will drop by interval
"timerSpeedFactor": 1, // initial timer speed factor
"timerSpeedFactorMax": 6 // max timer speed factor
}
Levels are generated by the values at Levels.json. There are 3 types of level: onboarding, standard and random. Levels are generated by this json. It starts with order. After the list of levels has reached it continues randomly with the random type levels.
Levels are generated with level generation algorithm which produces maxProducedObjectCount count of objects with each level of object till maxProducedObjectLevel level.
It starts to generation by first level of objects. There must be even number of level 0 objects. Subsequently, it recursively computes all potential merges from the preceding levels to determine the quantity of newly generated objects. The objective is to ensure no objects are left unmerged when all objects matched.
{
"levels": [
{
"name": "Tutorial",
"type": "onboarding",
"duration": -1, // infinite duration
"maxObjectLevel": 1, // index start at 0, maxObjectLevel: 1 means after 1 level objects merge the object will disappear
"maxProducedObjectLevel": 1, // maximum level of produced object, maxProducedObjectLevel: 1 means only 0 and 1 level objects can be produced
"maxProducedObjectCount": 12 // maximum count of objects in the level
},
{
"name": "Level 1",
"type": "standard",
"duration": 50,
"maxObjectLevel": 1,
"maxProducedObjectLevel": 1,
"maxProducedObjectCount": 16
},
...
{
"name": "Level 23",
"type": "random",
"duration": 240,
"maxObjectLevel": 5,
"maxProducedObjectLevel": 5,
"maxProducedObjectCount": 72
}
]
}
There are 5 types of objects in the game. It can be bought through shop. The level system produces only objects in available types. It can be extended by Objects.json.
{
"objects": [
{
"type": "fruits",
"shop": {
"name": "Garden Fruits",
"sprite": "Sprites/Objects/fruits", // sprite path of object type in shop
"price": 0
},
"levels": [ // represents object prefab's path of object levels
"Prefabs/Objects/Garden/Fruits/F_Strawberry_0",
"Prefabs/Objects/Garden/Fruits/F_Kiwi_1",
"Prefabs/Objects/Garden/Fruits/F_Orange_2",
"Prefabs/Objects/Garden/Fruits/F_Banana_3",
"Prefabs/Objects/Garden/Fruits/F_Pineapple_4",
"Prefabs/Objects/Garden/Fruits/F_Watermelon_5"
]
},
{
"type": "vegetables",
"shop": {
"name": "Garden Vegetables",
"sprite": "Sprites/Objects/vegetables",
"price": 2000
},
"levels": [
"Prefabs/Objects/Garden/Vegetables/V_Garlic_0",
"Prefabs/Objects/Garden/Vegetables/V_Lemon_1",
"Prefabs/Objects/Garden/Vegetables/V_Tomato_2",
"Prefabs/Objects/Garden/Vegetables/V_Cucumber_3",
"Prefabs/Objects/Garden/Vegetables/V_Broccoli_4",
"Prefabs/Objects/Garden/Vegetables/V_Aubergine_5"
]
},
...
]
}
It requires single touch inputs, multiple touches does not supported in this version. Objects can be merged by swiping, and timer can be speed up by tapping.
ECS, Entitas 13.1, URP, Odin Serializer, Unity 2021.3.15f1
- OmniShade Pro - Mobile Optimized Shader
- Odin Inspector and Serializer
- DoTween Pro
- Flexalon
- NiceVibrations
- TextMesh Pro
- Environment Mega Pack - Animation Assets
- GUI Pro - Simple Casual
- Epic Toon FX - I developed particles using this as basement