Bits of Eight - Day 6

Just a quick update, since I'm so tired. I can't be around tomorrow so I'm wrapping up Pyweek tonight. The rest of my team will carry on.

Tonight I added the rest of the combat mechanics and a basic AI. I made painful progess in spite of having written a few tests: the ships are so slow it's really time consuming to assess whether they are doing the right thing. I found it useful to view the action from high up above:

Meanwhile Arnav was working on the control scheme, which is via a WebSocket server that you access on your mobile device. It doesn't have all the features we dreamed up on day 1, but the concept is there. You can issue orders and see stats (well, one stat, the angle of the wind direction to your ship). This is it running on my Nexus 7:

I hope the team has a good day tomorrow and polishes up some of the rough edges. I'll catch you all in the judging!

(log in to comment)

Comments

I've just had more fun than I should be allowed to have making pirate noises :-)
I couldn't get lepton to install on OSX I keep on getting a clang error when I try. Any advice?
Yeah, we were having major problems with the 32-bit version of lepton on 64-bit systems. This one's only really tested against Linux 64 bit. You could try loading in the regular version of lepton, rather than our little fork, see if that helps.
I think Arnav has had it working. He might be able to help.
justinmeister: if you could please pastebin us the error, we will look into it.
@justinmeister: wasabi-lepton compiles fine on my Mac using llvm-gcc compiler. It might be worth trying to compile with GCC instead of Clang. Otherwise, please send us the error as @mauve says, and we'll take a look. Also, what OSX version are you on?
As far as I know I'm using the llvm-gcc compiler. Here's the error message: Error Message

I'm using OS X 10.9.2.
@justinmeister: Try installing after setting the ARCHFLAGS env variable:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install wasabi-lepton==1.0b2

Apparently since Xcode 5.1 unrecognised compiler params cause an error...
Ok, so I no longer get a clang error.
Ok, so I no longer get a clang error. But I got a different error this time
@justinmeister: Looking at your first error, clang is being used, not gcc. It might be worth a try uninstalling lepton and then installing again with
CC=gcc
flag.
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future CC=gcc pip install wasabi-lepton==1.0b2
So I uninstalled lepton and reinstalled it using the line with CC=gcc. I still get this error: http://pastebin.com/eCpYwSpd
Arnav, can you build some sort of egg/wheel?
@justinmeister: I've built an egg on my Mac running 10.7. Hopefully it should work on 10.9 too:
easy_install https://pypi.python.org/packages/2.7/w/wasabi-lepton/wasabi_lepton-1.0b2-py2.7-macosx-10.7-intel.egg
Can't run from source on windows. That specific version of pyglet throws an exception
$ ppython run_game.py
Traceback (most recent call last):
  File "run_game.py", line 1, in 
    from bitsofeight.game import main
  File "F:\Games\Pyweek18\bitsofeight-1.0.0\bitsofeight\game.py", line 11, in 
    from wasabisg.scenegraph import Camera, Scene, ModelNode
  File "F:\Games\Pyweek18\bitsofeight-1.0.0\wasabisg\scenegraph.py", line 4, in 
    from pyglet.graphics import Group
  File "F:\Panda3D-1.9.0-x64\python\lib\site-packages\pyglet\graphics\__init__.py", line 162, in 
    from pyglet.gl import *
  File "F:\Panda3D-1.9.0-x64\python\lib\site-packages\pyglet\gl\__init__.py", line 510, in 
    import pyglet.window
  File "F:\Panda3D-1.9.0-x64\python\lib\site-packages\pyglet\window\__init__.py", line 1684, in 
    gl._create_shadow_window()
  File "F:\Panda3D-1.9.0-x64\python\lib\site-packages\pyglet\gl\__init__.py", line 494, in _create_shadow_window
    _shadow_window = Window(width=1, height=1, visible=False)
  File "F:\Panda3D-1.9.0-x64\python\lib\site-packages\pyglet\window\win32\__init__.py", line 423, in __init__
    super(Win32Window, self).__init__(*args, **kwargs)
  File "F:\Panda3D-1.9.0-x64\python\lib\site-packages\pyglet\window\__init__.py", line 686, in __init__
    self._create()
  File "F:\Panda3D-1.9.0-x64\python\lib\site-packages\pyglet\window\win32\__init__.py", line 467, in _create
    _user32.RegisterClassW(byref(self._window_class))
WindowsError: exception: access violation reading 0xFFFFFFFFFFFFFFFF
Disregard the Panda3d stuff. that's just my install of python 2.7 64bit. It comes with the panda3d sdk and that's where I tried to install the deps. Unless you think that's what's causing it.
on Ubuntu 14.04 with Python 2.7 I can get the game to run, however when I try to fire I get a pyglet exception. All the other commands work.
Hi, can you pastebin the exception? If it is sound/media related then you may have to install an up-to-date AVBin (10 or 11). The version of AVBin that ships with Ubuntu is broken.
mauve: I don't think I can make it work in my system, limitations of my Intel card it seems :( Mesa 10.1.3 implementation error: Failed to compile fragment shader: FS compile failed: Register spilling not supported with m14 used

reidrac: That's probably a problem with the sea shader. It does a load of perlin noise stuff (it should really use textures) and occasionally I saw a similar error when I made it too complicated. Try this to change to a flat-shaded sea:

diff -r 89877c1026b5 bitsofeight/game.py
--- a/bitsofeight/game.py       Sun May 18 00:17:14 2014 +0100
+++ b/bitsofeight/game.py       Tue May 27 07:22:48 2014 +0100
@@ -141,8 +141,7 @@
         self.scene.add(self.skydome)
 
         # Sea
-        self.sea = SeaNode(sea_model)
-        self.sea.shader = sea_shader
+        self.sea = ModelNode(sea_model)
         self.scene.add(self.sea)
 
     def spawn_ships(self):

OK, thanks. I'll give it a go without the shader (I kind of patched it already).

I still have to compile lepton as it is not packaged for Fedora 20.

Your patch doesn't work, still compiles the shader :)
Oh, a compile time error, right. Try deleting line 37 in game.py where bitsofeight.sea is imported.
I think I got it right, thanks for your help (and for the game!).