I am currently reading about ways to develop board games in Matlab. I will be really pleased to be able to develop other kinds of games as well. Here on this page, I am just throwing the links and articles that I find useful. To begin with here is a nice thread on quora. More link as follows:
Using MATLAB to Write Games
This is a somewhat odd topic in that one does not think of MATLAB when one thinks of writing games. I mean, seriously? MATLAB is an interpreted language, and thus slow, and is made for crunching math and plotting graphs. Not exactly game-worthy.
Matlab source code of some popular games such as sudoku and tic-tac-toe. This can help you glean what goes inside the code.
Matlab Games
Matlab Games
Some games (and their codes) showcased on Mathworks and other sites.
Stellaria (Tech Demo) – The best MATLAB shooting game ever – File Exchange – MATLAB Central
Stellaria: A Figure-Based Space Shooting Game ============================================= Stellari Studio, 2011. Designed and Programmed by Mingjing Zhang from Vision and Media Lab @ Simon Fraser University * Please note that this is a tech demo and is far from a completed game. * * All I want to do is to demonstrate what MATLAB is capable of.
Lunar Lander | Joe Weinhoffer
Worked with a partner to create a Lunar Lander game using MATLAB. The object of the game is to successfully land the ship onto one of the platforms without crashing into any obstacles or running out of fuel. The force of gravity constantly acts on the lander, requiring use of the ships thrust to maneuver.
Yet another game in Matlab: Risk. For those of you who are familiar.
RISK board game battle simulation – MATLAB Cody – MATLAB Central
Given two positive integer inputs, a (attacker army units) and d (defender army units) return the probablity of victory (from 0.000 to 1.000) to +- 0.02 accuracy. The rules are given below for those unfamiliar with the game. In the board game RISK battles are determined by the conflict of armies, namely the attacking army and the defending army.
Here is a nice article about the implementation of minesweeper in Matlab. It could be really useful for understanding how to develop a game board in Matlab.
MatLab Minesweeper – ENGR005_2009
The motivation for this project came from an old desire to create a game that actually works. MatLab has provided a new outlet to attempt to reach this goal. I choose minesweeper because it presented an obvious opprotunity to use matrices for which MatLab is designed.
Ability to draw voxels (cubes, cuboids) could be of some value, as it was showcased on a gaming site and is available through Mathworks.
Voxel – File Exchange – MATLAB Central
File exchange, MATLAB Answers, newsgroup access, Links, and Blogs for the MATLAB & Simulink user community
RoteAugen/flappybird-for-matlab – File Exchange – MATLAB Central
File exchange, MATLAB Answers, newsgroup access, Links, and Blogs for the MATLAB & Simulink user community
This tutorial on youtube about creating GUIs in Matlab with GUIDE could be useful. Review this as you listen to a nice song.
Create a simple game in matlab gui Part1
This is a nice tutorial and contains links and videos for famous games implemented in Matlab.
Gaming in Matlab
I have recently been looking into how to make very advanced and beautiful GUIs in Matlab. The issue with this is that in Matlab, GUIs seem to be somehow limited compared to other languages. Historically, Matlab was supposed to be a numerical plate-form to quickly put together new ideas for computation.
Following is somebody’s website who has implemented numerous board games in Matlab. This can be really good to understand board development in Matlab.
MATLAB Fun Toolbox
This page contains my library of MATLAB m-files for a simple game and everything else that I make just for fun. All of these m-files are free and you may use or modify them as you like. To download the m-files, simply click the link on each m-file name and a pop-up window will appear, allowing…
I also wanted to list a few games that are implemented specifically in Octave, as many people do not have access to Matlab or they don’t like it. Here is an implementation of tic-tac-toe in Octave. This could be nice to understand how graphics are rendered in Octave.
sinhas/TicTacToe
TicTacToe – Tic-Tac-Toe minimax algorithm implementation in Octave
This implementation of game of life in Octave can be really useful.
The Game of Life in Octave
The Game of Life is a simple cellular automaton invented by mathematician John Conway. The Game of Life consists of a two dimensional grid of cells. Each cell can be “live” or “dead”, often represented mathematically by 1 and 0.
This sounds like a really nice book that was written with the intention of teaching game programming with Matlab.
Matrices, Vectors, and 3D Math: A Game Programming Approach with MATLAB – MATLAB & Simulink
Matrices, Vectors, and 3D Math provides a resource to learn standard topics in Linear Algebra and
Here is a nice tanks game called Staker that is showcased on Mathworks. It is written in Matlab. It could be helpful in understanding how Matlab renders graphics.
Staker v0.6 – File Exchange – MATLAB Central
Description Staker is a 3-D artillery warfare game that was inspired by Tank Wars and Scorched Earth, BASIC games I played many years ago. This is just a beta version, so it doesn’t have everything in it that I would like. For instance, there is only one type of terrain to battle on.
Here is another nice tanks game that uses graphics.
File Exchange – MATLAB Central
File exchange, MATLAB Answers, newsgroup access, Links, and Blogs for the MATLAB & Simulink user community
This chess game in Matlab can help draw a board at least. It integrates well with external chess engines.
Chess Master – File Exchange – MATLAB Central
Chess Master is a fully-functional chess graphical user interface (GUI) for MATLAB. Features: 1. Easily connect to any UCI-compatible external chess engine. I recommend Stockfish (see below for *easy* installation instructions!) 2. Read/write games in PGN format3. Board editor GUI to easily create/explore custom positions4. Move list GUI to navigate through games5.
This is a very nice piece of code that shows you how to draw cellular automata in Matlab/Octave.
10 lines of Matlab code (works also in GNU Octave): a simple Game of Life from cellular_automata
You will find this very handy as it shows how to use imshow to display a bunch of images in a plot without borders.
How to Make a Borderless Subplot of Images in MATLAB
Let’s say that you have a set of images that you want to tile using imshow() and subplot() in a MATLAB figure. By default, both functions add a padded space around the images to separate them, as this example shows: Result: However, what if you want to tile the images without any space between them?
The second edition of the book, Artificial Intelligence for Games, by Ian Millington and John Funge can be found here.
Artificial Intelligence for Games
Artificial Intelligence for Games [Ian Millington, John Funge] on Amazon.com. *FREE* shipping on qualifying offers. Creating robust artificial intelligence is one of the greatest challenges for game developers, yet the commercial success of a game is often dependent upon the quality of the AI. In this book
The pdf of the book can be found here.
Finally, here are some links for pathfinding algorithms in Matlab.
A* (A Star) search for path planning tutorial – File Exchange – MATLAB Central
A tutorial that presents the A* search algorithm for determining the shortest path to a target.
A* Algorithm – File Exchange – MATLAB Central
File exchange, MATLAB Answers, newsgroup access, Links, and Blogs for the MATLAB & Simulink user community
Demonstration of Astar (A*) – File Exchange – MATLAB Central
File exchange, MATLAB Answers, newsgroup access, Links, and Blogs for the MATLAB & Simulink user community
A Star implemented in Matlab – File Exchange – MATLAB Central
File exchange, MATLAB Answers, newsgroup access, Links, and Blogs for the MATLAB & Simulink user community
Photo by Flikkersteph -5,000,000 views ,thank you!
If you found an error, highlight it and press Shift + Enter or click here to inform us.
Game Programming With Matlab and Octave by Psyops Prime is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.