NetLogo Game Demos

I spent a good chunk of time this last year creating little NetLogo games and simulations. I ended up taking an ‘Agent-Based Simulation’ class at Middlebury, and a lot of these games were the results of indirect assignments. Needless to say, I threw myself into the assignments (we get to make games? That’s awesome!) and these were the results. If you want to play any of these games, you’ll need to download the most recent NetLogo environment (it’s free!) from here. Otherwise, you can just read about the games below.

1) Dijkstra’s Shortest Path (Random Weighted Graphs)

Play here

NetlogoScreen1

This one was a fun exploration of Dijkstra’s algorithm and a good refresher on efficiency. Each node needed a record of the shortest path from itself and also every other node, so that required some delicate thinking. Controls: The first two buttons will create random weighted graphs (a full graph will create a graph wherein each individual node is connected to n/2 other nodes), The ‘Dijkstra Computation’ button will run the algorithm and fill the table for each node, and the ‘Shortest Path’ button will highlight the shortest path from the two given nodes, with an index of 0, 1, 2… n-1. ‘Agent Search’ will spawn a series of bugs that will crawl from node to node, visually demonstrating Dijkstra’s method.

2) Asteroids

Play here

NetlogoScreen5

This was a lot of fun to do, and a great example of NetLogo’s agent capabilities. I added some functionality to the formula, for yuck’s sake– in addition to dodging boulders, the player will have to look out for any enemy ships warping into the area, considering that their missiles are (fairly) good at hitting the player. The player gains a life each time a board is cleared, before starting onto the next one (which gets progressively more difficult!). Controls: Pressing ‘Start’ will setup the board, and the ‘Move’ button will set the game into motion. The movement controls are set to WAD hotkeys, so make sure to click inside the board to use those. Remember that the E key fires bullets, and if you ever find yourself in a tricky spot, the D key will teleport the ship to a random unoccupied space (which is automatically set to avoid the immediate vicinity of asteroids, fyi!)

3) Warring Kingdoms

Play here

NetlogoScreen2

This I poured my heart into. It’s a little peculiar, upon first glance, but easy to get into. It was designed to function like a discount Risk; it’s a two-player game where the focus is to build and develop your kingdom and create pawns to overtake the enemy. While I ran out of time developing it (you can’t, for instance, take control over enemy territory) much of it is still playable. The controls were designed to be intuitive and mouse-based– after creating your city-state, the city state can be clicked on to create pawns. Different icons (spades, hearts, diamonds, clubs) create different land types. For instance: a club is a forest and requires two workers to create one, and at least one worker within it to get a wood resource, etc. So it’s a little bit like Settlers of Catan, I think. There’s a ton more information on the Info tab, next to Interface, so if you want to check it out, I’d recommend looking at it there.

4) Wolf Population Simulation

Play here

NetlogoScreen3

This is definitely less of a game, and more of a homework assignment. We needed to create an environment of creatures (mine were wolves) that aged, bred, and died, all the while monitoring their population and ‘fitness’, an arbitrary float variable from 0.0 to 1.0. The objective was to play with different breeding methods that maximized the average fitness of the population. Formally, this homework was intended to introduce us to the study of simulated environments using the ODD protocol, which formed a compulsory component of the assignment. It’s nevertheless fun to look at!

5) CLUE

Play here

NetlogoScreen4

For my final project, I decided to recreate the game Clue in the NetLogo environment, in part a personal test– would this even be possible to accomplish? Turns out it’s possible, but mind you, it’s definitely tricky to keep track of digital cards being passed back and forth. Regardless, it’s a ton of fun to play and it functions rather like a text-based game, which was also fun to briefly explore. The rooms are connected via a graph structure, and the game makes heavy use of the user input function, built-in to NetLogo (no need to reinvent the wheel, I always say). To accommodate this, saving your roll will automatically spill over into your next roll, so it’s easier to get out of some of those rooms. Anyway, good luck! The computers are pretty good!

 

Leave a Reply