Game Programming With Matlab and Octave

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.

http://ef.engr.utk.edu/gs2011/computer/matlab-games/

Some games (and their codes) showcased on Mathworks and other sites.

Stellaria (Tech Demo) – The best MATLAB shooting game ever

If you think you have played the best MATLAB game before. Think again after you try this one.

http://joeweinhoffer.com/portfolio-items/lunar-lander/

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.

http://wikis.swarthmore.edu/ENGR005_2009/index.php/MatLab_Minesweeper

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

Download and share free MATLAB code, including functions, models, apps, support packages and toolboxes

RoteAugen/flappybird-for-matlab

Download and share free MATLAB code, including functions, models, apps, support packages and toolboxes

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.

http://www.matlabtips.com/gaming-in-matlab/

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.

GitHub – sinhas/TicTacToe: Tic-Tac-Toe minimax algorithm implementation in Octave

Tic-Tac-Toe minimax algorithm implementation in Octave – GitHub – sinhas/TicTacToe: Tic-Tac-Toe minimax algorithm implementation in Octave

This implementation of game of life in Octave can be really useful.

No Title

No Description

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

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

Download and share free MATLAB code, including functions, models, apps, support packages and toolboxes

Here is another nice tanks game that uses graphics.

Renegade Legion: Centurion

This game is a turn based wargame that features two platoons of grav tanks battling it out.

This chess game in Matlab can help draw a board at least. It integrates well with external chess engines.

Chess Master

Download and share free MATLAB code, including functions, models, apps, support packages and toolboxes

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
byu/martin123444 incellular_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 | briandalessandro.com

A tutorial on how to remove the spacing between images when imshow() is used with subplot() in a MATLAB figure.

The second edition of the book, Artificial Intelligence for Games, by Ian Millington and John Funge can be found here.

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

A tutorial that presents the A* search algorithm for determining the shortest path to a target.

A* Algorithm

Download and share free MATLAB code, including functions, models, apps, support packages and toolboxes

Demonstration of Astar (A*)

Download and share free MATLAB code, including functions, models, apps, support packages and toolboxes

A Star implemented in Matlab

Download and share free MATLAB code, including functions, models, apps, support packages and toolboxes

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.

CC BY-NC-ND 4.0 Game Programming With Matlab and Octave by Psyops Prime is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

Leave a Reply