{"author_name":"YSelf Tool","cat":"LD #30","comments":[{"author_name":"","time":"August 29, 2014 9:23 pm","epoch":1409365380,"text":"I think it&#8217;s fine to be ambitious, but you need to be able to adapt along the way. If you plan for something easy and simple, you&#8217;re gonna get that, but if you plan something very ambitious, you might come up with something amazing, even if the result is not what you originally planned.","spam":"N"},{"author_name":"jahmaican","time":"August 30, 2014 3:45 am","epoch":1409388300,"text":"The first rule of using Dijkstra algorithm is &#8211; &#8220;don&#8217;t&#8221;, it works very well, but only in theory <img src=\"http:\/\/ludumdare.com\/compo\/wp-includes\/images\/smilies\/simple-smile.png\" alt=\":)\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> There&#8217;s A* that does the exact same thing so much faster and is fairly simple to implement at the same time. And very often you could even use best first search.","spam":"N"}],"epoch":1409346360,"likes":3,"metadata":{"p_key":"26376","p_author":"YSelf Tool","p_authorkey":"10854","p_urlkey":"61804","p_title":"My worst entry \u2013 Postmortem","p_cat":"LD #30","p_event":"LD30","p_time":"1409346360","p_likes":"3","p_comments":"2","p_status":"UPD5","us_key":"10854","us_name":"YSelf Tool","us_username":"yselftool","event_start":"1408665600","event_key":"24","event_name":"LD30"},"text":"<p>This Ludum Dare was interesting, as it was my most ambitious game. And it failed. I should have known.<\/p>\n <p>What went wrong? As always I tried to include an AI, random generation of something (this time a world), a dijkstra-algorithm (and removed it again, it always needed too much time calculating the paths) and fun.<\/p>\n <p>And&#8230; it worked! Except for the dijkstra, which was at least bug free, but still not fast enough to calculate paths for 100+ animals every few seconds. And far from fast enough while running on a Pi. I had animals, the player could build rudimenarily, the villagers spawned, there were not exponentially many of them, things were fun (for me).<\/p>\n <p>It was hard work, as I wanted to do a multiplayer game, using Python as a server language (since I love Python) and JavaScript as the client language (since Websites are the most accessible kind of game, and I like JS). That meant writing Python and JS simultaneously, now I can tell: That&#8217;s confusing, fun, challenging and confusing. Did I mention confusing? The way to design a program in those languages are close enough, but the syntax is different. Different enough to confuse.<\/p>\n <p>So, what was the problem? For multiplayer in a website I used websockets, which are great for that stuff, it went better than expected. But then again, it was the first project I successfully used websockets for. I found a python library (ws4py) based on another python library (cherrypy) with which I never worked before, and used them. Bad decision. It was sunday evening, three hours before deadline, when I first tried moving from localhost (lo) to local\/public IPs\/Domains (wlan0, eth0). Didn&#8217;t work. The Python socket implementation has a small bug&#8230; crashing connections far too often. I changed some parts, sent smaller packets, added small time.sleeps, It made the connection more stable. Then at least one in ten survived and worked. For a game based on an active connection that&#8217;s bad. But at least you could reload and play on.<\/p>\n <p>But then not only did the connections crash, but sometimes also the thread handling the sockets. From the library. The bug is in the python standard lib. Without a chance for me to fix the bug. So&#8230; It doesn&#8217;t work.<\/p>\n <p>What did I learn? Don&#8217;t be ambitious. I should have known that. Multiplayer is a lot of work. Use libraries you have already worked with. Did I ever do that? I guess not, but this time that paid out badly. Don&#8217;t use two languages at the same time. Make fun games!<\/p>\n <p>So far, see you in december. I&#8217;m sorry my game does not work. Neither did using different backends for the websockets work, nor using pypy for the server.<\/p>\n <p>I&#8217;m sorry.<\/p>\n \n <p>Tags: <a href=\"http:\/\/ludumdare.com\/compo\/tag\/postmortem\/\" rel=\"tag\">postmortem<\/a><\/p>","time":"August 29th, 2014 4:06 pm","title":"My worst entry \u2013 Postmortem"}