How To Make A Game Like Bomberman

Also, project is going well. I’m working on the AI for the enemies right now, so it’s taking some time haha. If you message me at my email or facebook, I’ll let you know more. I’ll be easier to reach on those links

Hi @luongtien

Making a bomberman AI is quite hard as there a lot of factors the CPU players need to “think about”.
Making an AI isn’t “level 1” however you go about it, I’ve been programming for more than 10 years and I still can’t make a decent AI. You can start experimenting with it, but I’d advise to start small with pong AI for example.

If you insist on starting with bomberman AI, I can advise you to take the problem and divide it into chunks. What do the AI players need to be able to play? Implement each one and test it out before moving on:

  • A finite state machine to “think”, this can be as simple as a few enums like “Walk, Attack, Avoid” and a switch statement.
  • Map awareness & movement: A* & a representation of the map in a data structure
  • Laying down bombs at strategic positions
  • Avoiding other players and their bombs

I wrote “Intellisense” by the way and as @froboy449 said, it’s the handy code completion in Visual Studio & MonoDevelop.

Good luck on your gamedev journey!

Thank you for your advice @blackdragonbe !!!
:blush:

@blackdragonbe !!!
I have finished the AI enemy. Im very happy now, i almost done this game but i have a trouble that i cant solve. May I send you my project. Pls help me. i have done 99%, this is the last problem.:confounded:

@luongtien

What problem have you run into exactly?

Cheers

@blackdragonbe !!!
haha, when i was typing the problem, i just got an idea to solve, i almost finish the game, now i try to make a story, a concept, give player a mission. when i finish , i will show u, haha.
By the way, i have a question, what do u think about Unity, is it the best free engine now, do u think size of data when build is large. Why Nguyen Ha Dong can made Flappy Bird 700kb. What engine u usually use to make your game?

Ah, and what software u use to make animation… I just know Spine, now asset store has new tool Anima2D.
i dont know use what, full features of Spine is 300$, Anima2D is 60$, but i dont know whether Anima2D = Spine 300$? or what tool more interesting u are using? can u give me a advice.:grin:

@luongtien

Glad to hear that! I’m very curious what the result will be :smiley:
As for your questions:

By the way, i have a question, what do u think about Unity, is it the best free engine now, do u think size of data when build is large. Why Nguyen Ha Dong can made Flappy Bird 700kb. What engine u usually use to make your game?

First of all, Flappy Bird is so small because it was made using a very small and efficient 2D engine for Android called AndEngine ( http://www.andengine.org/ ), because it’s such a tiny engine the file size can stay small. Unity is an all-in-one engine and with that comes a lot of overhead, that’s why even the simplest mobile games are 10MB+.

I’ve tried a lot of different engines and frameworks including GameMaker & XNA but I’ve finally settled on Unity because I love programming in C# and it has everything I need including a visual editor, multi-platform output and a comfortable asset workflow.
I use Unity almost daily for years now and I still haven’t grown tired of it :smile:

Ah, and what software u use to make animation… I just know Spine, now asset store has new tool Anima2D.
i dont know use what, full features of Spine is 300$, Anima2D is 60$, but i dont know whether Anima2D = Spine 300$? or what tool more interesting u are using? can u give me a advice.:grin:

I’m terrible at making 2D animations, but when I do make them I usually use the Unity editor or Spriter (for 2D skeletal animations). I’m more comfortable with Blender and its animation tools so that’s what I use most often, even for 2D sometimes.

Cheers!

Thank You for the information,
do u have any link of your game, i will download to play :relaxed:

by the way, i see the next game in your tutorial is tower defence. So amazing, tower defence is the game I love most. I can spend all the day to play it. i was impressed by Kingdom Rush, its so cute. make a tower defence game is my dream, mabe it is going become true. So excited.

Hi @luongtien!

You can find most of the games I made here:

http://blackdragonsoftware.weebly.com/games.html

I’m glad you like tower defense games too! I’m sure you can make one, they’re quite simple at their core and it’s great fun to add stuff to them. :smiley:

Cheers!

The most recent version of Dyna Bros has online multiplayer by the way, so you can play against a friend if you’d like :smiley:

Thank you very much for this awesome tutorial

I just wanted to say, that in the topic- Bigger! The Explosions Must be Bigger- the return null have to be deleted, havent it?

Hello, i think i found an error in chais reaction to explode.
8 images here: http://share.pho.to/AM5ka

→ I have a bomb that explodes 2 blocks around.
(Images 1 and 2)

→ If i drop a bomb in the second block to the right, it will be a chains reaction.
(Images 3 and 4)

→ If i drop it in the four block, the bomb has not to explode, because the range is two blocks.
(Images 5 and 6)

→ If i drop it in the four block, the bomb has not to explode, because the range is two blocks.
ERROR! The problem is that it explode =(
(Images 7 and 8)

So, i downloaded your final code, and make the same error.
Can you tell me how to fix it? Thanks

I am new in unity, and my english language is bad. I speak spanish.

@onepointzero
The return null; part is temporary and necessary because IEnumerators always need to return a value. A bit further in the tutorial it gets changed and you can delete the return null; line. :smiley:

@rrphacker
Yeah, that shouldn’t happen, you can try decreasing the size of the bomb’s Sphere Collider unitil it doesn’t happen anymore. It’s probably because the explosion’s collider just barely touches the bomb.

Cheers!

can you renew the series? please :smiley:

i would like to do this but i don’t know how to do it:

-Change the local multiplayer to an online multiplayer
-Limit the amount of bombs that can be dropped
-Add breakable blocks that get destroyed by the explosions
-Find a way to allow 4 players

this is the only bomberman tutorial that i love!

@blackdragonbe
Hey, may i have a question? There it is: what do I need to make the script DisableTriggerOnPlayerExit work in my onw project…? I’m just making my own Bomberman-like game and has this buggy state when bomb pushes player away and want to solve it like in your project!
I would really appreciate any replies and tips :slight_smile:

Hi @firestone!

To make the script work, make sure the bomb collider has “Is Trigger” checked when its created, this makes sure objects like the player can pass through.
Once the player leaves the bomb’s collider the script you mentioned disables that checkbox so the bomb becomes “solid”.
I hope this helps.

Cheers!

@blackdragonbe
Do I have to add this script to any component…?
I also want to mention I make 2D game, so I changed the function name to OnTriggerExit2D(Collider2D collider) and I call function GetComponent() to get a isTrigger field. My Bomb has added Component BoxCollider2D and checked isTrigger, (and RigidBody2D with isKinematic field checked, like in your project), same goes for my Player, has RigidBody2d and BoxCollider2D but without isTrigger and isKinematic. Still sth is not right… Any ideas what could I do wrong…? :frowning:

EDIT:

@blackdragonbe
OK, I got it - I added new GameObject and added Collider2D component with the script to it. Script of course has changes function name, and all Collider to Collider2D. Thanks a lot for all of your help :slight_smile:

EDIT2:
If anyone make a 2D game and use the same method of propagade explosions like in this tutorial, I found what to need to be changed to work in 2D. Just PM me and I can help (probably ;p ).

Thank you for this great tutorial. While expanding the game I have learned much about unity. This is the link to my final game called “BombRun” :slight_smile: