game making advice

18 views
Skip to first unread message

Brian Blais

unread,
Sep 16, 2011, 8:38:47 AM9/16/11
to pyglet...@googlegroups.com
Hello,

I've played a little bit with pyglet, and hope to use it for a project idea for a game with multiple agents. What I am having trouble with planning is the way to implement the interaction between the agents (human and ai) and the game. I'd like to separate them out, so I could write an independent function, say, for an AI agent that has access (or can query) parts of the environment and can send instructions to the environment which will then be updated and displayed with pyglet. I thought maybe some message passing scheme, or perhaps something else like xmlrpc. I don't want to reinvent the wheel, and this seems to be something that should be pretty common I'd imagine. Are there some examples for this sort of thing? Any ideas?

thanks,

Brian Blais

--
Brian Blais
bbl...@gmail.com
http://web.bryant.edu/~bblais
http://bblais.blogspot.com/

Peter Enerccio

unread,
Sep 16, 2011, 10:17:15 AM9/16/11
to pyglet...@googlegroups.com
What you want is probably event based AI with its own (probably threaded, but not necessarily) event loop.
Here is mine, but it was build for panda3d (should not be a problem to adapt, since its thread based loop).

Server: http://paste.pound-python.org/show/12608/
Node: http://paste.pound-python.org/show/12609/

2011/9/16 Brian Blais <bbl...@gmail.com>



--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To post to this group, send email to pyglet...@googlegroups.com.
To unsubscribe from this group, send email to pyglet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.


Brian Blais

unread,
Sep 21, 2011, 12:18:03 PM9/21/11
to pyglet...@googlegroups.com
On Sep 16, 2011, at 10:17 AM, Peter Enerccio wrote:
>>> 2011/9/16 Brian Blais <bbl...@gmail.com>
>>> Hello,
>>>
>> I've played a little bit with pyglet, and hope to use it for a project idea for a game with multiple agents. What I am having trouble with planning is the way to implement the interaction between the agents (human and ai) and the game.
>>

> What you want is probably event based AI with its own (probably threaded, but not necessarily) event loop.
> Here is mine, but it was build for panda3d (should not be a problem to adapt, since its thread based loop).
>
> Server: http://paste.pound-python.org/show/12608/
> Node: http://paste.pound-python.org/show/12609/
>

this is very interesting. Do you happen to have an example system, even for panda3d? I can roughly see the logic, but I can't quite place how an agent would subclass Node properly, and how the communication is done.

you were the only response to my question! I would think that this would be a good item to have in the pyglet docs, something that would pretty much be common to nearly all games.

on a similar note, is there a repository of examples of pyglet games? there are some in the source, but it would be really helpful to have a place to post and to view projects that people are working on. perhaps I've missed it somehow.

thanks,

bb

Peter Enerccio

unread,
Sep 21, 2011, 1:45:57 PM9/21/11
to pyglet...@googlegroups.com
Ma (which is also a client, and first in the list of clients, thus has priority 1): http://paste.pound-python.org/show/12850/
Unit: http://paste.pound-python.org/show/12848/
Zombie: http://paste.pound-python.org/show/12849/

If you need any help, I can provide description how to use it.

George Oliver

unread,
Sep 21, 2011, 9:01:34 PM9/21/11
to pyglet...@googlegroups.com
On Wed, Sep 21, 2011 at 9:18 AM, Brian Blais <bbl...@gmail.com> wrote:

on a similar note, is there a repository of examples of pyglet games?  there are some in the source, but it would be really helpful to have a place to post and to view projects that people are working on.  perhaps I've missed it somehow.


There's a few places to look; the repository of games made for Pyweek, the Pygame site (which has some pyglet games, search on the pyglet tag), and possibly the new pyglet forum created recently (search the list for the info).

The Pyed Pypers site is yet another project and forum site but it has relatively few pyglet games (compared to Pygame) I believe. 

Jonathan Hartley

unread,
Sep 22, 2011, 6:07:45 AM9/22/11
to pyglet...@googlegroups.com
Hey. I think the lack of response is because readers might not be clear on exactly what problem you want to solve. I'd advise starting with something simple, to see whether it's sufficient for your needs. One form of 'message passing scheme' might be to call methods on objects, for example.
Reply all
Reply to author
Forward
0 new messages