vendredi 11 décembre 2020

[DirectX12] Match 3 on my Game Engine

 I made a Match 3 game with my game engine with Direct X12

Gameplay

Like the a lot of game like Candy Crush, the idea is to match 3 identicals candy vertically or horizontally. To make it, player have to pick 2 adjacent candy to swap them. When this occur , the candys are destroy and all the candy above fall, and news candy are create if need

Special candy can be create if more than 3 candy are destroy

- If it'is 4 candys vertically , a new candy is create which will  destroy all the line on the location of the candy
- If it'is 4 candy horizontally, a new candy is create which will destroy all the column on the location of the candy
- If it's 5 or more than , a special candy is create. If the player match with a candy near the special candy. All the candy same that the candy match are destroy

Multi threading

The gameplay algorithm is not very difficult. But I think the matching algorithm can be parralized 

Instead of iterate on each slot of the grid. I use a thread pool, when on each threads I send each lines of the grid.


Joker bonus

Start Grid

Vertical bonus candy


dimanche 6 décembre 2020

[DirectX12] Collision Function

 Collision is essential for any game engine. Most entity have basic shapes (Triangle, Sphere, Quad).

Their is a lot of kind of intersection here is the result on my game Engine


Line Line Collision

Line Line Collision (False)

Quad Quad Collision

Quad Quad Collision

Point Collision (False)

Point Collision

Point in Sphere

Point not in Sphere

Ray Sphere Collision

Ray Sphere Collision (False)

Ray Triangle Collision

Ray Triangle not Collision

Sphere Sphere Collision

Sphere Quad No collision

Bounding Sphere
Sphere Quad Collision





 



    


jeudi 8 octobre 2020

Unity 2D Sample Game

Here is my first project in Unity . I first start to make 2D game sample in Pixel Art. This goal of this article is to display basic skill in Unity

Sprites are from this website :https://opengameart.org/

In this project I made :

- A platform game design with sprite tile palette
- Manager 2D collision
- Create a UI interface which manager life and coins 
- Create collectable likes lifes coins , open chest 
- Create a pattrolling snake enemy which can damage player but can also be kill (by jumping on his head like Mario)
- Transition between different scene and create a transition screens (fading screen)

Start game with health life, chest and snake !

Exit door to the next level

                                                            The door transition to the next level






lundi 7 septembre 2020

Child and Components

Game Object are a combination of Component (Collision or physics components) or childs game objects (Matrix palette or objects bind to another object)

For that , on each Game entity, I create 2 linked list when we can attach Components of Child games objects


The green ground is a "child" of the cube actor, the cube actor have a white collision component



mardi 1 septembre 2020

Space Partition DX12

 Grid Partition

Grid 5 x 5
                                                                            Grid 5 x 5


QuadTree

Quad Tree Level 1
Quad Tree Level 2

Quad Tree Level 3

   Quad Tree decomposition

Octree

Octree 


jeudi 13 août 2020

BTA Game : Enemy AI

 On this small subject, I focus on enemy AI. On a bta game, one of difficult task is to keep ai balancing.Enemy should not be too weak but also no to skillful.

Design 

I'am playing the latest  Devil May Cry on PS4, and I try to reproduce the enemy behavior. Enemy on this game are weak, they are mainly use for player to perfom combo. But they sometime have some reactions 

Architecture

I use a Finite State machine to present different states of the AI :

- Approach : Enemy approach player from a random distance
- Idle : It's will stay idle for some time. If the player come to close to him, it will sometimes attack. Always attacking will make him to strong.

Eneny will have 2 attacks : 

- Attack : It's will try perform an attack, to do that, its will come near to player and attack him
- Rush Attack : It's a special attack. Enemy will rush to the player know position to attack him. If the player move , enemy will attack on his last know position.

Because this enemy is a common enemy, it's shoud be more weak than strong

Standard Attack


Rush Attack
Rush Attack


mercredi 1 juillet 2020

RPG Game (UE4)

RPG in Unreal Engine 4

Here is the project of an rpg game "semi automatic turn by turn "

Note this project is not finished, and I have no intention to make a real game. It's just a demo , so the graphics or UI will not polish but I'am more interested to make a working gameplay

Game start


Gameplay

The player control a team of 3 actor (soldier,healer and magician).Each characters have skills, soldier have strong attack, healer can cure injuries and magician can cast magic attack.

After the waiting time is over (when the bar is full) actor player have differents actions

- Attack with a weapon an enemy
- Use Skill (heal or magic attack)
- Use Object
- Defense

The specifity is that each actions have cost value (maximum of 1 pts). So by example his is a combination of actions :

attack (0.25 pt) + attack (0.25 pt) + attack (0.25 pt ) + attack (0.25 pt) = 1.0
fire skill (0.5) + attack(0.25) + attack(0.25) = 1.0
Object (0.5) + Heal Skill (0.5) = 1.0
Defense = 1.0

Player's actors can use multiples actions in one turn. After that player input each action to 1, actor executes each actions

Healing action


Record actions

To avoid that player have to input the same sequence, last actions are saved and can be replay immediately with a menu.  Player can also save 2 configurations which he can program some actions (Like gambit in FF12)

Create command


IA Control

With the record of the actions and the possibility to record 2 actions, player can set theses actions on the actor to make them perform automatically in loop. Player can open menu to change the action setup.

If the actor player performs an action that he can't do (like no MP or the item), it's will replace by a defense move

auto command


Fastest Input

I recently play Persona 5 , and I like that each actions are set on a button. It's make the battle faster. That why on the game, each action are set on button. D Pad is to select directly target or ally. The only moment when there is a menu , it on select object or skill.

It's important to faster action during rpg battle to keep dynamic of the battle

shortcut on the left side