Skip to content

Instantly share code, notes, and snippets.

@nahiyan
Last active November 1, 2020 16:24
Show Gist options
  • Save nahiyan/1dc20d8ccc6ed70e32861d5f8cc2c94f to your computer and use it in GitHub Desktop.
Save nahiyan/1dc20d8ccc6ed70e32861d5f8cc2c94f to your computer and use it in GitHub Desktop.
Darwin Changes
  • All of Darwin's dependencies (cocos2d-x, OpenNN, FlatBuffers, SQLite3, wxWidgets, etc) are merged into the repository. This is to reduce burden on the developer to manually build the libraries themselves. Instead, CMake handles building the dependencies. Moreover the dependencies are modified to harmonize with each other and prevent conflicts such as duplicate symbols.

  • Darwin now comprises a single executable. Previously there was a separate executable for each extension. Instead, a GUI-based Control Panel is created to manage everything - from resuming evolution to choosing extensions.

  • wxWidgets is used to create the Control Panel's GUI. It's cross-platform and has a friendly API.

  • OpenNN's randomization isn't seeded properly by default, resulting in "randomized" neural network parameters (weights and biases) being the same all the time. To resolve this issue, we used our own randomization techniques.

  • Rotation of Jumpers is disabled to prevent them from falling over to the ground.

  • All timers (accurate to the nearest second), used for calculating durations, intervals, etc are replaced with a much better timer (whose precision can be controlled). This improves scoring system of extensions which involve timing, such as Jumper.

  • Evolution is now generic. Each extension only handles crossover, mutation, and scoring. Rest is handled by the core of Darwin.

  • Each generation state is stored in the database right after a generation is scored. If evolution resumes relative to a selected generation, a new generation is created out of the "selected generation" based on the scores, and evolution continues from there.

  • Jumpers are now scored based on number of obstacles they faced and the time they survived. They are also penalized based on the number of jumps relative to the number of obstacles they face. This is to discourage jumpers from jumping unnecessarily.

  • Use FlatBuffers to store state of generations. In Jumper extension, the state of each generation include weights and biases of every member in the population along with their scores. FlatBuffers is a data serialization/deserialization library by Google. It's used in Darwin to store data in binary form.

  • FlatBuffer schema files are used to define the data being serialized and deserialized in Darwin. This is compiled into a C++ header file using the FlatBuffers Compiler.

  • Database class is created to utilize SQLite3 for fetching extensions, sessions, generations, etc. It's also responsible for fetching the generation state binary (as generated by FlatBuffers).

  • Web Portal is created to let user manage the extensions, sessions, and generations, along with viewing visualizations (such as charts) of statistical information, such as the trend in scores of population members of a generation, etc. The portal is based on Laravel.

  • The Portal can ONLY be used to list extensions, sessions, and generations, as of now. Other features are being developed.

  • A common SQLite3 database holds all the information. It's shared by the web portal along with Darwin itself.

  • Impulse is used to make a jump instead of using a "JumpBy" action in cocos2d-x. This is to make a time-independent jump.

  • New extension, called Predation, is being planned and developed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment