This entry is part 8 of 9 in the series Artificial Galaxies

Sorry about delay, I had some extra fun doing a bonus project along these lines of our artificial galaxy creation, but more on that later.

OK we’ve managed to save out the information for our galaxy, stars, species, etc. Now, let’s load that data back up and display it from scratch. I’ve added the Deserialize() function to the galaxy object, so now it will load everything back up as it was during the last Serialize() call. Remember, it will error out if you try to Deserialize and there’s no data.

I’ve gotta get organized so here’s what I’m planning:

  • Create a github repo for this project
  • Have it contain a couple of ‘main.lua’ files
    • One will be for use with Corona so you can see all the cool graphics stuff if you’re using Corona
    • One will be pure Lua so you can roll your own but still have the awesomeness of the OOP galaxy
  • Rework the galaxy creation method so you can pass it all the needed data at the beginning (Like number of civilizations, number of stars, species to put in the galaxy, etc…) I did like the idea of a black box sorta option where you just stamp out a whole galaxy, complete with species, empires, stars, etc. but I think at the end of the day the user doesn’t mind doing a little prep work. I’ll refactor everything for the next release.

Now my fun side project I worked on was a Lua OOP version of Stars Without Number, a conversion of the existing Ruby and Python versions.

A Python version is here, Ruby version is here, and my Lua version is here.

What’s cool is like the others I listed, my version only outputs text, keeping it language agnostic, but it also makes it OOP…sort of. All the different things are object classes, such as NPCs, Planets, architectural traits, trade goods, etc., but I don’t have them contained within eachother….yet. I’ll work on that going forward and try to blend some of them together. For now, it just outputs text, so if you were doing a table top session of RPG’ing with your pals, you’d run the app and you’d see somn like this for a description for a planet…a very detailed description:

Pretty glorious eh? It’s a great start to flesh out your own ideas for whatever you’d need in an artificial galaxy generator.

OK rock on, and I’ll see you next post.

By the way, aliens:

Series Navigation<< Serialization, loading and saving!GitHub repo set up and Namegen stuff >>