Giter Site home page Giter Site logo

phreeza / cells Goto Github PK

View Code? Open in Web Editor NEW
221.0 18.0 42.0 439 KB

a game where players programm agents that compete for resources in a simulated environment

Home Page: http://phonons.wordpress.com/2010/06/01/cells-a-massively-multi-agent-python-programming-game/

License: MIT License

Python 100.00%

cells's Introduction

cells's People

Contributors

abztrakt avatar elcerdo avatar icefox avatar jaafit avatar jayshoo avatar phreeza avatar radicalzephyr avatar rylans avatar sean-reed avatar seken avatar skraelings avatar swolchok avatar threenplusone avatar wtallis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cells's Issues

Testbench and profiler

On HN, Cakeface raised the issue of performance.

Adding a testbench/profiler would likely be a good idea, especially if Phreeza tries out the interlingual/online/etc feature requests that appeared on HN alone.

No license indicated

How is this code licensed? This needs to get settled before the number of contributors explodes further...

IndexError when running cells.py

Seen every time I run the master at the moment:

Traceback (most recent call last):
File "cells.py", line 547, in
game.tick()
File "cells.py", line 210, in tick
self.plant_population, self.energy_map)
File "cells.py", line 456, in update
pygame.transform.scale(pygame.surfarray.make_surface(numpy.array(img)),
File "/Library/Python/2.6/site-packages/pygame-1.9.1release-py2.6-macosx-10.6-universal.egg/pygame/surfarray.py", line 243, in make_surface
return numpysf.make_surface (array)
File "/Library/Python/2.6/site-packages/pygame-1.9.1release-py2.6-macosx-10.6-universal.egg/pygame/_numpysurfarray.py", line 368, in make_surface
blit_array (surface, array)
File "/Library/Python/2.6/site-packages/pygame-1.9.1release-py2.6-macosx-10.6-universal.egg/pygame/_numpysurfarray.py", line 437, in blit_array
surface.get_buffer ().write (data, 0)
IndexError: bytes to write exceed buffer size

Also seen by icefox on ubuntu karmic. Works on Fedora 12.

My pygame is 1.9.1release and numpy is 1.2.1 on the OS/X box that gets the error.
On Fedora 12, where it works, they're 1.9.1release and 1.3.0 respectively.

UPDATE: when trying to get psycho working, I ran this to force python into 32-bit mode:
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes

it didn't work, but now I can run cells.py just fine on my OS/X box, too.

Documentation

I'm new to python and really interested in learning it with this nice game..
could you please provide any inline documentation to make it a bit easier to understand whats happening? :)

Psyco required

Psyco isn't really needed for the game. It helps a bunch I'm sure, but my computer runs fine without it.

Replace

"
try:
import psyco
psyco.full()
finally:
pass
"

with

"
try:
import psyco
psyco.full()

except (ImportError):
pass
finally:
pass
"

Ladder Server?

Does anyone have a server he would like to volunteer for hosting the ladder?

Right now I just want to get this launched asap, probably with manual vetting of the minds before inserting them into the ladder, and a simple static HTML file with the current scores generated by a future version of the tournament.py script.

Parameters

I'd like to request some parameters for start (later for an UI? ;), like

  • pixel resolution
  • energy (global/local on plants)
  • amount of plants
  • terrain (later ;)

.. any more ideas? :)

Game Statistics

Generate a couple of statistics about the game and the teams. Overall deaths, causes of death, energy collected, average lifetime, etc.

I got an IndexError, but it's hard to reproduce

Traceback (most recent call last):
File "cells.py", line 471, in
game = Game()
File "cells.py", line 113, in init
self.agent_map.insert(self.agent_population)
File "cells.py", line 301, in insert
self.set(o.x, o.y, o)
File "cells.py", line 245, in set
self.values[x,y] = val
IndexError: index (300) out of range (0<=index<300) in dimension 1

Have to use force quit on Ubuntu

I'm running it on Ubuntu 9.10 and anytime I run it I have to use force quit to kill it. It goes nicely, but it doesn't respond to the close button or Alt+F4.

SyntaxError reading commandline arguments

I get this error, I suspect I don't have everything set up correctly.

File "C:\Python31\cells\phreeza-cells-2b942c0\cells.py", line 49 print 'Got error: %s' % e ^ SyntaxError: invalid syntax

Throws exception on first run

You need these two lines at line 61 and 62:

    minds_str = str(config.get('minds', 'minds'))
    mind_list = [get_mind(n) for n in minds_str.split(',')]

Otherwise, you get an exception when the default.cfg is missing. Here's the exception:

Traceback (most recent call last):
File "cells.py", line 526, in
main()
File "cells.py", line 70, in main
print mind_list
NameError: global name 'mind_list' is not defined

Terrain visibility

Currently the terrain isn't visible to the agents. How about WorldView.get_terrain() ?

Game Logs

For the ladder server, it would be nice to be able to record and play back games.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.