{"id":1238,"date":"2013-01-19T15:12:00","date_gmt":"2013-01-19T21:12:00","guid":{"rendered":"http:\/\/www.galcon.com\/news\/?p=568"},"modified":"2013-01-19T15:12:00","modified_gmt":"2013-01-19T21:12:00","slug":"galcon-2-lua-bot-wars","status":"publish","type":"post","link":"https:\/\/www.philhassey.com\/blog\/2013\/01\/19\/galcon-2-lua-bot-wars\/","title":{"rendered":"Galcon 2: Lua bot wars"},"content":{"rendered":"<p>Hey, it&#8217;s been a good week working on Galcon 2 <img src='http:\/\/www.galcon.com\/news\/wp-includes\/images\/smilies\/icon_smile.gif' alt=':)' class='wp-smiley' \/>   I started out this week by adding ships into the whole swarmy mess!<\/p>\n<p><a href=\"http:\/\/www.galcon.com\/news\/2013\/01\/19\/galcon-2-lua-bot-wars\/galcon2screensnapz006\/\" rel=\"attachment wp-att-569\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.galcon.com\/news\/wp-content\/uploads\/2013\/01\/galcon2ScreenSnapz006-300x238.png\" alt=\"\" title=\"galcon2ScreenSnapz006\" width=\"300\" height=\"238\" class=\"aligncenter size-medium wp-image-569\" \/><\/a><\/p>\n<p>Next up I got the swarms &#8220;doing&#8221; something a bit more productive, and added planet ship count numbers.  I also did a ton of analytics on idea parameters for the code to make swarming most efficient.  It seems pretty fast now.<\/p>\n<p><a href=\"http:\/\/www.galcon.com\/news\/2013\/01\/19\/galcon-2-lua-bot-wars\/galcon2screensnapz011\/\" rel=\"attachment wp-att-570\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.galcon.com\/news\/wp-content\/uploads\/2013\/01\/galcon2ScreenSnapz011-300x238.png\" alt=\"\" title=\"galcon2ScreenSnapz011\" width=\"300\" height=\"238\" class=\"aligncenter size-medium wp-image-570\" \/><\/a><\/p>\n<p>Then I cleaned things up a bit, added the user interface for selecting planets and deploying ships and added in a really simple bot so I could play against it!<\/p>\n<p><a href=\"http:\/\/www.galcon.com\/news\/2013\/01\/19\/galcon-2-lua-bot-wars\/galcon2screensnapz013\/\" rel=\"attachment wp-att-571\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.galcon.com\/news\/wp-content\/uploads\/2013\/01\/galcon2ScreenSnapz013-300x238.png\" alt=\"\" title=\"galcon2ScreenSnapz013\" width=\"300\" height=\"238\" class=\"aligncenter size-medium wp-image-571\" \/><\/a><\/p>\n<p>Lastly, a lot of people were asking for the ability to help out with the single player game by doing mods, I build a large part of the modding system.  Below is a movie of me running a Lua based mod with two bots fighting over the galaxy <img src='http:\/\/www.galcon.com\/news\/wp-includes\/images\/smilies\/icon_smile.gif' alt=':)' class='wp-smiley' \/>   The mod has set the game to run at 16x speed so the outcome happens sooner.<\/p>\n<p><iframe loading=\"lazy\" width=\"420\" height=\"315\" src=\"http:\/\/www.youtube.com\/embed\/7wfueVFkMAo\" frameborder=\"0\" allowfullscreen><\/iframe><\/p>\n<p>I decided on Lua because out of my three main options (C, python, Lua), C is basically impossible to sandbox and I want people to be able to download and try out mods without too much concern.  python is my favorite language, but embedding it is non-trivial.  Lua won out, because it simple to embed, and doing basic sandboxing on it is pretty straightforward.  This is the first time I&#8217;ve coded anything in Lua, and I found it was pretty straight-forward.<\/p>\n<p>-Phil<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey, it&#8217;s been a good week working on Galcon 2 I started out this week by adding ships into the whole swarmy mess! Next up I got the swarms &#8220;doing&#8221; something a bit more productive, and added planet ship count numbers. I also did a ton of analytics on idea parameters for the code to [&#8230;]<\/p>\n","protected":false},"author":44,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[121],"tags":[],"class_list":["post-1238","post","type-post","status-publish","format-standard","hentry","category-galcon2"],"_links":{"self":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/1238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/users\/44"}],"replies":[{"embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/comments?post=1238"}],"version-history":[{"count":2,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/1238\/revisions"}],"predecessor-version":[{"id":1241,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/posts\/1238\/revisions\/1241"}],"wp:attachment":[{"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/media?parent=1238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/categories?post=1238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.philhassey.com\/blog\/wp-json\/wp\/v2\/tags?post=1238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}