Giter VIP home page Giter VIP logo

matchpool3d's Introduction

MatchPool3D

License: MIT


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.

Table of Contents

Description

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

Duration

It tooks 8-9 work days to complete.

Workflow

I started by creating a Game Design Document for this project, then continued by development.

Game Config

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
}

Level System

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.

Object Production Algorithm

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
    }
  ]
}

Shop System

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"
      ]
    },

    ...
  ]   
}

Controls

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.

Technologies

ECS, Entitas 13.1, URP, Odin Serializer, Unity 2021.3.15f1

Plugins

Art Packages

(back to top)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.