Monty Hall problem, updated

Whoops, looks like the Monty Hall program didn’t work correctly. Turns out the random number generator never picks the maximum value you give it.

I’ve also changed the interface a bit. You now make your final pick by clicking a door, rather than clicking a button that doesn’t even look like a button.

Play the game!

Posted in Uncategorized | Leave a comment

Monty Hall problem

I wrote a simple program to demonstrate the Monty Hall problem.

This program simulates the game described in the problem. You could try running some experiments to see if your chances of winning a car really are better if you switch.

Play the game!

Posted in Uncategorized | Leave a comment

Walker Boys Unity Course, Lab 4 – 2D Mario Clone

It took me a while, but here it is: my 2D Mario clone.

Play the game!

Name: Thomas de Goede, aka Lord Herman

Timeframe: Tuesday Feb 21 – Tuesday Mar 6

Project Detail: A clone of the original Super Mario Brothers game by Nintendo. It has your usual side-scrolling platformer controls, enemies with some basic AI, power-ups, and two levels that involve falling down holes a lot.

Software Used: Unity 3, Notepad++, FileZilla, Paint.net (for the amazing star sprite I drew)

Final Thoughts: This project was a lot longer than the previous ones. I got stuck a few times trying to fix some bugs, but in the end I have a working game. I enjoyed the part where I got to write some AI for the gumbas, and I hope to learn some more AI programming in the future. Also, I think I’m beginning to learn how to approach bug fixing, which will probably come in handly later.

Time Breakdown:

Videos: 20 hours, 31 minutes.

Word Balloon: 28 minutes (planned 1 hour).

Flag Pole and Finish: 2 hours, 17 minutes (planned 2 hours).

Scene Transition Wipe: 15 minutes (planned 30 minutes).

Design the Next World: 2 hours, 21 minutes (planned 1 hour, 30 minutes).

Menu Screen: 59 minutes (planned 1 hour).

Bug fixing: 4 hours, 47 minutes.

Total: 31 hours, 38 minutes.

Posted in Uncategorized | 3 Comments

Walker Boys Unity Course, Lab 3 – Unity Tool Development

Lab 3

Name: Thomas de Goede, aka Lord Herman

Timeframe: Tuesday Feb 14 – Monday Feb 20

Project Detail: See individual projects below

Software Used: Unity 3, NotePad++, FileZilla

Final Thoughts: I thought this lab would be less interesting than the others, but I ended up learning quite a lot of useful things. Building tools to make other parts of development easier will certainly come in handy in later projects.

This was also the first project where I noted exactly how long I worked on each part, rather than estimating it after the fact. It was a chore to do, though, and I forgot about it a few times. In the end, I made a time logging tool the subject of one of the On Your Own assignments.

Time Breakdown:

Folder creator: 1 hour, 15 minutes
Video: 50 minutes
Homework: 25 minutes

Prefab creator: 45 minutes

2D Ani Sheet: 3 hours, 42 minutes
Tool Description: 12m
Research: 46m
Instruction manual: 5m
Pseudocode: 5m
Write it already: 2h 34m

Time Tool:
Video: 5 hours, 8 minutes
Homework: 1 hour

Think About It:
4 hours, 10 minutes

Total: 16 hours

Part 1 – Folder Structure

Although I haven’t made much use of folders before this project, I do think I have an idea of what kind of structure I’d use:

– Documentation
— Plans
— Logs
– Sound
— SFX
— Music
– Graphics
— Textures
— Fonts
— Shaders
— Materials
— Meshes
— GUI
– Prefabs
— Objects
— Lighting
— Particles
– Scenes
— Menus
— Game
– Scripts
— Object Scripts
— Tools

The idea is to have large categories, which contain more specific smaller ones. I divide some objects of the same type (e.g. prefabs) into multiple categories because I already noticed in Lab 2 that having particle prefabs and object prefabs all in the same place can get confusing.

My guess is that this setup works for projects slightly larger than what I’ve done so far, but that it’ll break down in much larger projects. I guess I’ll just have to see if it’s suited for the upcoming labs.

Part 2 – Time Tool

Here is the working time tool. I went with the classes approach. I think that’ll work nicest when I use this tool in a larger project; everything will be in one place, and I can easily make multiple timers by instancing the class.

Click here to test the timer tool

Part 3 – Time Logger

I studied my workflow, and the one thing I seem to have trouble with is keeping track of how much time I spend on which things. To make that a bit simpler, I decided to make a tool that lets me set up timers within the Unity editor.

The result is a editor window that can keep track of any number of timers. The user can add new ones, continue existing ones (by typing in the name of one that already exists), pause the timer system, and clear all timers. The window also displays a total of all timers. Time is displayed in hours, minutes and seconds for readability.

It doesn’t save the timers, so the timers are lost when the window is closed. I haven’t found a satisfactory way to handle this yet. Maybe a later lab will cover saving and loading data.

Click here to download the javascript file for the tool

Put the .js file in a project’s Assets/Editor folder to use it. You can open the time logger from the Window menu in the Unity editor.

Part 4 – Extra Credit

The tool for creating a material was relatively easy, as I could model it on the tool for making a prefab. Still, it took some time to figure out how to apply the same principle to textures, as they don’t appear directly in the scene.

Click here to download the javascript file for the material maker

(The other assignment will follow later, once I know what I’m supposed to do)

Posted in Uncategorized | Leave a comment

Walker Boys Unity Course, Lab 2 – Space Shooter

I’ve finished the second lab project for the Walker Boys’ Unity course.

Play the game

Name: Thomas de Goede, aka Lord Herman

Timeframe: Friday Feb 10 to Monday Feb 13.

Project Detail: A top-down space shooter game. The player has to shoot down as many asteroids as he can within the time limit, all the while avoiding being hit by the asteroids.

Software Used: Unity v3 as IDE, Notepad++ as script editor, FileZilla for uploading the final product.

Final Thoughts: This was an interesting project, and also a bit of a nostalgia trip for me as I loved games like Tyrian as a kid. Most of the build went pretty smooth – smoother, indeed, than the first project. The only issue I encountered was that I couldn’t get the solid blocks to block the player’s movement. I guess the Mario games will teach me how to do that properly.

Time Breakdown:

Research– 4h for watching the lab videos. This time I paused the videos a lot to look something up or to catch up with the coding.

Design – 1/2h. Same as last time. The On Your Own objectives were pretty straightforward, and I’d already figured out how to do them while I was working on the video tutorials.

Build5h. Like last time, I ended up spending a lot of time on one issue I couldn’t resolve. The rest of the build went relatively quickly, though.

Play Testing – 1h. I did more testing on this game than the last one. Maybe because this game was more interesting to play.

Additional Notes:

The player can move through the solid blocks. The instructions weren’t entirely clear about it, but I assumed they were supposed to block the player as well as the asteroids. I couldn’t get that to work properly, though, so I left it as it is now.

I did a few things that weren’t in the instructions. I added a powerup that gives the player an extra use of his shield (and set his initial number of shields to zero), and I gave the bullets a little trail effect. I also added some GUI elements, such as a level indicator, a indicator for the number of shields the player has, and some lines in the instructions explaining which powerups are which.

Posted in Uncategorized | Leave a comment

Walker Boys Unity Course, Lab 1 – Point and Click

I’ve just finished my first lab assignment for the Walker Boys’ Unity course.

Play the game

Name: Thomas de Goede, aka Lord Herman.

Timeframe: Monday Feb 6 to Tuesday Feb 7.

Project Detail: A simple game where the player has to click shapes that appear on the screen to accrue points. To win, the player must get enough points before the time runs out.

Software Used: Unity v3 as IDE, Notepad++ as script editor, FileZilla for uploading the final product.

Final Thoughts: Although the game itself is very simple, I think I’ve learned quite a bit about using the Unity API and structuring the scripts for my project. I think I did a few things in a rather roundabout way that I could do more efficiently once I get more familiar with the API.

Time Breakdown:

Research– 2h for watching the lab videos. Add about an hour for figuring out some of the API functions during coding.

Design – 1/2h. Most of the design of the project was already set up in the lab videos, so all I had to do was figure out how to do the On Your Own objectives.

Build6h. Most of the coding was done quite quickly, but I spent a lot of time getting the moving cubes and spheres to work correctly.

Play Testing – 1/2h. There wasn’t really all that much to test. Once I get to more complex projects, I’ll need to remember to spend more time on this, though.

Additional Notes:

The popping sound I used for the disappearing blocks was made by Herbert Boland and used under the Attribution Licence.

I wasn’t sure how the moving square was supposed to move across the screen, so I made two. One moves about in a random pattern, while the other flies straight across the screen in a random direction.

Posted in Uncategorized | Leave a comment