Midgard, Growing Grass

Now that I have an efficient way to represent a grassy field, I need to allow it to grow. In each iteration, grass will grow from grassy tiles to any barren tiles surrounding the grassy tile. Read more

Tags: C++ , Midgard

Midgard, Recursive Bitfield

Next up, providing the basis for an interesting world. Currently, the “grass” acts like a liquid, spreading out from its initial position. What I’d like is to have a field of grass that can grow outward from whatever location it is in. Machine learning agents in the world can eat the grass, deplenishing it the location of the agent. Read more

Tags: C++ , Midgard

Midgard, Closing Socket Cleanly

Using Ctrl-C to send SIGINT is the easiest and most habitual way to kill a program. When SIGINT is received by a program, unless explicitly handled, the program will be interrupted and close. In this case, the socket we are listening on is not closed cleanly. While not particularly necessary for future development, this becomes obnoxious, as it takes up to a minute for the OS to clean up the open socket, during which a new instance of the program cannot be started. Read more

Tags: C++ , Midgard

Simulated World, Threading

Currently, everything that happens on the C++ backend for Midgard is on a single thread. This includes the static file serving, the websocket handling, and the simulation itself all occur on a single thread. All computation is done at request from the browser, and can’t continue indefinitely, because the thread needs to return to waiting for the next thread. Read more

Tags: C++ , Midgard

Simulated World

A few years ago, I worked on a C++ implementation of NEAT, a method for generating novel neural net topologies. Rather than having a fixed topology, varying only the weights of a neural net, NEAT also varies which nodes are connected to each other. This allows for creation of minimal structures, capable of solving the problem presented without having significant excess neurons. Read more

Tags: C++ , Midgard

Pizza Crust

  • 1 cup warm water
  • 1 package yeast
  • 1 teaspoon sugar
  • 2 tablespoons vegetable oil
  • 1 teaspoon salt
  • 2.5 cups flour
Read more

Tags: Recipes

Cinnamon Bread

  • 1 1/2 cups water
  • 1 packet yeast
  • 3 tablespoons brown sugar
  • 3 tablespoons butter
  • 3/4 teaspoon salt
Read more

Tags: Recipes

Blueberry Pie

  • 1 baked pie shell
  • 1 cup water
  • 3/4 cup sugar
  • 6 tablespoons butter
  • 3 tablespoon flour
  • 2 tablespoons vanilla extract
  • 1 tablespoon almonds extract
  • 1 quart blueberries
Read more

Tags: Recipes

Compiling from emacs

Emacs can launch subprocesses, which can be used to compile code immediately. This is built in with the M-x compile command. It asks for the command to run, then runs it, saving the output in the *compile* buffer. This is remarkably convenient, removing the need to switch between terminal and editor. Read more

Tags: C++ , Make , Emacs

C++ Makefile, Config File

The makefile is starting to get rather large, and so it would be difficult for a user to know all options that are available. At this point, it is time to refactor the options into a separate configuration file. Read more

Tags: C++ , Make