[Ann / Help Requested] A nerdy multiplayer game "ants".

B

Brian Schröder

Hello Group,

I hate to put something into the open before it is completely finished,
but time is running out for me.

I'll give a course on ruby for CS students next week. The program I want
to have finished at the end of the course is a kind of a multiplayer
game. It simulates a simple ants world, and the clients have to
implement some kind of AI to steer the ants through their life.

Because I'm not a ruby guru, and I want to teach them "the real ruby
way" I ask you to donate a bit of your time to look at the source and
make improvement suggestions.

I aim on having a compact but readable implementation, that I will be
able to explain.

One thing on which is not too clear to me is how secure my
implementation is.

The source and more information can be found at:

http://ruby.brian-schroeder.de/ants/

Everybody who helps and makes it to Freiburg will be invited on a good
german beer ;)

kind regards,

Brian


PS: Maybe we could elaborate the ants theme to a ruby-quiz?
 
G

Gavin Kistner

Because I'm not a ruby guru, and I want to teach them "the real ruby
way" I ask you to donate a bit of your time to look at the source and
make improvement suggestions.
[...]
http://ruby.brian-schroeder.de/ants/

I don't have either the time or expertise to fully investigate what
you've done here, but I wanted to comment on how similar are your
Observable module:
http://ruby.brian-schroeder.de/ants/source/observable-rb.html
and my EventTarget module:
http://phrogz.net/RubyLibs/EventTarget.rb

I changed mine to use symbols rather than strings after I saw yours,
since it's more Ruby-ish. (I had already decided yesterday morning to
use blocks by default and force &foo for existing method passing.)

I like how yours allows for 'forwarding along' arbitrary parameters,
although I feel like I prefer more structure in my life. (Said
structure being a discrete Event object with specified methods which is
used to shuttle data between the signal and the receiver.) It feels
like it provides a bit more de-coupling between the sender and the
receiver.

Your names are cleaner; mine are sort of ugly and confusing for the
sake of consistency with the DOM 2 Events model.

Oh, and BTW, you have two typos in your Usage example:
observed.register:)foo) do | obeserved, *args |
I'm guessing that shouldn't be "obeserved"...should it be 'observed'
(to match your usage in the string?) or something else (is there a name
collision with the parameter passed to the initialize method)?
puts "Observered object #{observed} signalled foo with arguments
#{args.inspect}
I'm guessing 'Observered' should be 'Observer' or 'Observed'.
 
J

James Edward Gray II

Hello Group,

I hate to put something into the open before it is completely
finished, but time is running out for me.

This is a fun project. Was it inspired by this year's ICFP contest?

I've been browsing through your source and it looks very nice to me.
Naturally, some docs would help a lot.

As far as the game goes, I would like to see more complicated boards.
Even the ICFP simulator had obstacles (rocky terrain) and the
programming environment there was far more restricted. You have a full
programming language to play with, so problems like pathfinding are
much more reasonable. Might as well take advantage of that, I say,
opening up the possibility for some clever ant creations.
PS: Maybe we could elaborate the ants theme to a ruby-quiz?

As a died-hard gamer, I'll be very sad if you don't submit this idea,
when it's ready. :D

James Edward Gray II
 
B

Brian Schröder

Gavin said:
Because I'm not a ruby guru, and I want to teach them "the real ruby
way" I ask you to donate a bit of your time to look at the source and
make improvement suggestions.
[...]
http://ruby.brian-schroeder.de/ants/


I don't have either the time or expertise to fully investigate what
you've done here, but I wanted to comment on how similar are your
Observable module:
http://ruby.brian-schroeder.de/ants/source/observable-rb.html
and my EventTarget module:
http://phrogz.net/RubyLibs/EventTarget.rb

I changed mine to use symbols rather than strings after I saw yours,
since it's more Ruby-ish. (I had already decided yesterday morning to
use blocks by default and force &foo for existing method passing.)

I like how yours allows for 'forwarding along' arbitrary parameters,
although I feel like I prefer more structure in my life. (Said
structure being a discrete Event object with specified methods which
is used to shuttle data between the signal and the receiver.) It feels
like it provides a bit more de-coupling between the sender and the
receiver.

Your names are cleaner; mine are sort of ugly and confusing for the
sake of consistency with the DOM 2 Events model.

Oh, and BTW, you have two typos in your Usage example:
observed.register:)foo) do | obeserved, *args |
I'm guessing that shouldn't be "obeserved"...should it be 'observed'
(to match your usage in the string?) or something else (is there a
name collision with the parameter passed to the initialize method)?
puts "Observered object #{observed} signalled foo with arguments
#{args.inspect}
I'm guessing 'Observered' should be 'Observer' or 'Observed'.
Thank you for looking into it. As written in the header, most of the
observable stuff is taken from a source I don't recall at the moment.
One problem with the implementation is, that it is quite difficult to
deregister, if you don't save the original proc somewhere.

Thanks also for the corrections. Things like this are always slipping,
and I'm not a native english speaker (obviously ;).

Regards,.

Brian
 
B

Brian Schröder

James said:
This is a fun project. Was it inspired by this year's ICFP contest?

I've been browsing through your source and it looks very nice to me.
Naturally, some docs would help a lot.

As far as the game goes, I would like to see more complicated boards.
Even the ICFP simulator had obstacles (rocky terrain) and the
programming environment there was far more restricted. You have a
full programming language to play with, so problems like pathfinding
are much more reasonable. Might as well take advantage of that, I
say, opening up the possibility for some clever ant creations.



As a died-hard gamer, I'll be very sad if you don't submit this idea,
when it's ready. :D

James Edward Gray II
Thanks for looking at the source.
Missing docs shure are a problem. I have to take some more time, the
problem is that I'm graduating and I`'m in the middle of my finals. So
it now seems like a stupid idea to give the course, because it is much
more fun than learning my stuff ;)

I chose a really simple environment, because I did not want it to get
too complicated. People who have been in contact with ruby only four
days should understand it. But it is shure that I'd really like to dive
deeper into this. Only that there is no time for that.

regards,

Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,056
Messages
2,570,446
Members
47,101
Latest member
vaibhav87

Latest Threads

Top