Twitter Freesound.org Ludum Dare One Game a Month github npm Youtube

Welcome to brianmacintosh.com. I'm Brian MacIntosh, and I am a game programmer in the Orange County area of Southern California. This site serves to host and distribute some of my games and my blog, below.

I have developed games and apps for the XBox 360, Windows PC, iPad, Amazon Alexa, and Windows 7 Phone. I'm particularly interesting in procedural generation, pixel art, and emergent gameplay, and I'm looking forward to developing more games with these technologies.

Blog RSS E-Mail

You are filtering on tag 'random'. Remove Filters
Previous Page | 11 total posts | page 2 of 3 | Next Page

Keeping cmd windows open with /K


January 29th, 2014 @ 13:28
Tags: cmd, nodejs, random

I like using .BAT files to run common tasks like compiling Java code or starting my NodeJS server. It's very convenient to just execute a .BAT where you've already written out all the proper parameters rather than typing out an entire call every time you need it. This does cause a problem, though - if any of the programs that execute from the .BAT returns an error code, the command window will immediately close. This makes it impossible to debug those programs.

I tried adding the pause command at the end of each file, but to no avail - the command window exits immediately when a program returns an error and doesn't execute the rest of the file (which is responsible of it, admittedly).

The solution was to use a parameter to the cmd program itself:

cmd /K bat/mybat.bat

The /K parameter keeps the window open even if the .BAT stops executing. I simply copied all my .BATs to a subdirectory and created wrapper bats using this line.


Permalink

Computers in computers - Camera Obscura Adder


March 17th, 2013 @ 1:00
Tags: random, camera obscura

It's always fun to see people building computer-like circuits in games like Minecraft and Dwarf Fortress. While it's outlandishly impractical to build computers in computers, it's just so much fun and so educational. Well, today I figured out how to do it in the Camera Obscura engine using moving platforms and I was irrationally excited about it, so I built a four-bit adder circuit. It adds two four-bit numbers together and show the results. Check it out:

You can download the level here.

Boring details on how this works: there are several very small sets of logic gates, the basic building blocks of electronic chips, that can be provably used to create every other possible logic gate (trivia: NAND gates alone are sufficient, as are NOR gates). Camera Obscura's mechanics are capable of creating two gates: OR, by simply linking multiple sources to the same moving platform, and NOT (at least as far as I've discovered). Fortunately these two gates together are sufficient. Information can propagate through the system because moving platforms can press buttons that trigger other platforms...and so forth.

This possibility also provides some pseudo-scripting functionality to game levels. Imagine a passcode-protected vault that only opens when you enter the right number, or even a game of Mastermind within the level.


Permalink

Side Project: Random Music Generation


December 10th, 2012 @ 21:18
Tags: random

This week's random side project was inspired by my friend Bryan Ploof and my Music and Technology class. We've been discussing music generated by computers with little or no human influence, including attempts to map anything from fractals to sorting algorithms to musical notes. Michael Matthews gave a lecture on his research in creating music using cellular automata. Cellular automata are sets of simple rules that define how a grid of "cells" evolves over time. They provide very interesting possibilities in the generation of music because their rules often generate musically interesting patterns and progressions. Michael's approach was to use a one-dimensional automata to control the pitches and timbres of sound available to a player, who modulated the sound directly through motions picked up by a webcam.

My goal was to make a system that could act autonomously to create a unified tune with a strong melody. My approach was to create three seperate automata to control different aspects of the music. One controls the rhythm of the song by selecting the timing of each note (quarter, eighth, etc). The other two control the notes that are played: one selects a chord from a pre-defined set, and the other selects which notes from the chord are activated.

Here's a sample! This video uses a few chords selected from the Star Wars theme to generate a tune.

An executable and the full C++ source are available on my code page. Future plans for the project may include replacing the chord-selection mechanism with a Markov chain to make it more musically coherent, and implementing samples and ADSR so the notes can be things other than sine and square waves.


Permalink

Side-Project of the Week: Randomized Dungeons


October 03rd, 2012 @ 14:55
Tags: random, lizards and labyrinths

This week, my friends Chris and Kevin and I were hanging out late one night. This, of course, led to a number of crazy ideas being bounced around (this, of course, is how most software engineering gets started). I actually decided that one of these crazy ideas might be doable, cool, and useful: a program that procedurally generates tabletop-RPG-style dungeons: monsters, loot, and most importantly, interesting and complex maps. I'm also using the project as an opportunity to learn more about rendering custom controls in a native Windows Forms project.

This is what it looks like, about three days later:

Random dungeon generator screenshot

It can certainly generate some very entertaining map layouts, what with the occasional hallway where the floor is lava.


Permalink

Normal Mapping Code Released


April 22nd, 2012 @ 22:59
Tags: code, random

I was working on adding specular mapping to the normal mapping demo (a technique that imitates the "shininess" of a surface), but I ultimately decided to release the basic code now and perhaps create an updated library later. Enjoy :).

Download Here


Permalink


Previous Page | 11 total posts | page 2 of 3 | Next Page