Shared World by YSelf Tool

[raw]
made by YSelf Tool for LD30 (COMPO)
Update (again): You can restart the server by calling following address:
http://tooldev.de/ld/30/restart.php
Use this if you see a gray screen. It's far from an ideal solution, but it's better than before.

Update (deprecated): The server is too unstable and automatic restarting does not solve the problem, so please don't waste your time trying to play this game.

Shared World is a world, populated by animals and villagers. Every player gets the same world and can see (and change) what other players built.
The world is completely randomly generated and consists out of water (oceans, lakes), beaches, grassland (green), savanna/forests/highlands (I haven't decided which, so it's up to you) in a different green and mountains (gray). Mountains are currently rare.
Animals are the moving rectangles, there are plant-eaters (green/blueish) and meat-eaters (red), when hovering an animal with the mouse you can see what it is currently doing.
You can build buildings (change the type with the button on the bottom) by drawing a rectangle in the world. They appear light at first because a villager needs to build them to become darker.
When you build a center villagers will appear there. They choose their work themselves. If you build a storage, they will store whatever the got there. Villagers are the circles, each population has its own color (with a dark and a light variant).
You can move the camera with the arrow keys. Every session starts at a random location. To make it easier to share your population with other people, you can determine the location with GET parameters like ?x=12&y=1704.

The idea is to build your own population, seek for others and to find them, maybe connect your population with them.

Shared World is written in JavaScript(/HTML/CSS) with HTML5 canvas at the client side and with Python (2.7) with cherrypy and ws4py at the server side and uses WebSockets. Unluckily Python has a problem with sockets which did not appear when using and testing locally. To make the game stable enough to play, I had to reduce the size of the landscape structures, so mountains are really rare, islands are not. It may still happen (regularly) that the game tells you the error appeared. Please reload (as often as needed). When the whole screen is loaded successfully, it is usually stable.

Disclaimer: The server runs on a Raspberry Pi and currently stores the whole world in memory. If your screen keeps being white, it could have crashed, so I would like to hear that, so I could restart the server.

A word to the source: For the client the index.html, js/game.js and css/style.css files are simply to be served by any web server (apache, nginx, ...). The server consists out of main.py and conworlds.py. To execute it, run main.py with python (2). cherrypy and ws4py need to be installed. Be aware that the default server location (tooldev.de:2048) is hardcoded in the client (js/game.js).

Feedback

geekygenius
25. Aug 2014 路 02:35 UTC
The game isn't working for me. I see a large gray box, and below it is a number and a button. I think the button switches modes or something. I tried it on chrome and firefox with the same results. I'm running Win7 64 bit. The game looks pretty neat though, you don't see many networked games in LD.
ViliX
25. Aug 2014 路 02:39 UTC
The game doesn't work on chrome 36 :/
Njord
25. Aug 2014 路 14:23 UTC
Not working for me on Chrome, large gray box + button/coordinates below. The idea looked interesting, hope you can get it fixed soon !
馃帳 YSelf Tool
25. Aug 2014 路 15:22 UTC
The problem is that the server is crashing to often. I can stabilize it by catching more exceptions, but the core problem of crahsing sockets is a problem of python, I fear I can't fix that. Maybe I could restart sockets when they crash, but I'd need to rewrite huge parts of the network stuff.
coffeemuggames
27. Aug 2014 路 20:40 UTC
Too bad, it really looks interesting.
grayhaze
29. Aug 2014 路 21:00 UTC
It's a shame I didn't get to play this, as the idea looks good. Hope you have more success next time! :)
OinkIguana
29. Aug 2014 路 21:07 UTC
Only getting a large gray box in Firefox with the coordinates and button...
jomomomo
29. Aug 2014 路 21:17 UTC
Couldn't get it to startup...
udo
29. Aug 2014 路 22:15 UTC
Couldn't get it to play, but those screenshots look interesting!
Super Hamster
29. Aug 2014 路 22:59 UTC
I see a large gray box as well. I guess the server is down. It's unfortunate because I was excited to try this game out. :(
mrexcessive
30. Aug 2014 路 17:43 UTC
Likewise no server or other reason for grey screen. Consider making server stateless (simple webservice wrapper or something ?) More network overhead but might be more stable.
馃帳 YSelf Tool
31. Aug 2014 路 23:47 UTC
Yes, as you saw, the server is down, since I can't keep it up. Making it stupid and simple is not an option since a lot of the logic (> 50%) is server side.
I've made a small script that restarts the server. That's far from an ideal solution, but should make the game at least a little bit playable (which is better than a gray screen).
The link to the script is:
http://tooldev.de/ld/30/restart.php
Please call (and only call) this script when you need to restart the server.
tbam
01. Sep 2014 路 05:28 UTC
The buildings I make seem to be massive compared to those around me. not sure whats up, but a cool concept nonetheless!
Dining Philosopher
02. Sep 2014 路 11:08 UTC
Cool idea, I'd like to create something like this sometime :D Too bad it's so buggy and there's not much gameplay, but props for trying.