• Advertisement
Sign in to follow this  

I created a game…

This topic is 981 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I created a game ! It is ugly, small, not user-friendly, made by an amateur (me), but I like it. And I am awaiting for your feedback !

 

The name is PythonBot, and it is about coding AIs in Python. Bots are fighting each others in an arena. They can move around, fire and scan their environnement. You can't really "play" this game, I would rather say that you "watch" it (personally I "enjoy" it) . The fun part is in the creation of a bot, and in the process of testing it against other bots.

 

Here is a picture (so that you are not disappointed after having installed it):

 

890833ScreenshotPythonBot.png
 

You can see the bots (the triangles), some walls (grey circles), and a bunch of bullets. But it is much more enjoyable seeing it live !

 

For those interested in technical details (you can skip):

Behind the scene, it consists of a C++ game engine which manage almost everything. I used SFML because I find it light and simple to use ? and because I liked SDL at the time I was programming in C; SFML being basically SDL + OOP in my opinion ?. But if the game is named PythonBot, it is because there is Python somewhere; that is, in the bots wink.png

I have a thread per bot in Python. Each communicates to the game engine in TCP/IP. The game is started by a Python script which start the C++ game engine, create as many thread as there are bots available, and execute the bots in their thread.

 

As a picture is worth a thousand words:

 

 

bXBmq.png

 

 

Well, enough of technique. I would enjoy seeing people create bots and share them back here, it would be great (the supreme ? the utmost ? reward for me actually !). I do not have a compiled version to distribute (because I am lazy, I can code a game but I cannot share it properly afterwards…), but the sources are available on GitHub (open source, yeah !) here. The GitHub page contains all the instructions needed to launch PythonBot.

 

Let me know if you find bugs (almost nobody except me tested this game until now) so that I fix them. And of course, let me know if you like it (or not, err…). If you are even lazier than me, ask for a compiled version (would be for Windows), and I'll try to satisfy your request.

 

On a sidenote, I think that for those not familiar with Python, it could be a good start to learn it; a bot does not require complex manipulations in Python ? the only limit is your imagination though ?.

 

I hope you'll be interested, and maybe that you'll enjoy it !

 

Update: I finally uploaded the compiled version for Windows: [sharedmedia=core:attachments:28437]

 

Instructions:

  1. Install Python 2.7
  2. Unzip the game
  3. Double click on pythonbot.py
  4. Press the space bar to unpause !

Update 2: The instructions for writting your own bot are on the GitHub page, or in the README.

Edited by jeanmarie.baran

Share this post


Link to post
Share on other sites
Advertisement

So your saying. You have a game where you program bots with a real language and make them fight each other. Thus forcing the person to learn to program in a sense? That so cool. Do you know the educational possibility could be done with this? Just wondering. Why not make an online version of this. Where the game might be in something like javascript or clojurescript. While the bots are written in a online text editor. Though you probably would have to create your own interpreter for the python part of it :) Really cool though

Share this post


Link to post
Share on other sites

Yes, it would be possible, and it could be very fun and easy to use (more than it is now); even if I am not a big fan of web developments. Actually, I am not sure how an online editor could work (without being a incredibly wide security breach).

 

I think there are already a lot of these "educational" programs out there, starting with the well known Robocode. I don't know if there are some in Python though.

Share this post


Link to post
Share on other sites

Oh, I did not think of it this way. I was more considering having the code uploaded to the server when a user validate the bot. Then the code gets executed on the server which send back the game situation to the client. So the client would only render the game, while the actual game would take place on the server (which permit to reuse the existing C++ game engine).

In this case, players could do awful things with the Python executed on the server.

 

I am not sure if you meant that the entire game were in the client side (so you play alone, but the game is directly available on any computer) or if only the bot were in the client side (and fighting against bots at different locations in the world). In the latter case, I am afraid that it would be a pain to deal with lattency problems, disconnections and other network related issues.

Share this post


Link to post
Share on other sites


And of course, let me know if you like it (or not, err…). If you are even lazier than me, ask for a compiled version (would be for Windows), and I'll try to satisfy your request

 

Game sounds interesting, but to be honest I'm too busy (and lazy) to go for the trouble of downloading dependencies, setting up a project and compiling it. I'm sure many people would agree. So if you have the time to provide binaries, that would be great :)

Share this post


Link to post
Share on other sites

Time is an element I did not take into account, you're right. Here is the game already compiled for Windows: [attachment=28437:PythonBot.zip]

 

Just make sure you have Python 2.7 installed, then double click on pythonbot.py, and finally press the space bar happy.png

Edited by jeanmarie.baran

Share this post


Link to post
Share on other sites

This is good stuff! especially for game development learning purposes :D

I recommend you to put it as a browser game with a text editor or something. 

Share this post


Link to post
Share on other sites

I recommend you to put it as a browser game with a text editor or something. 

 

Well, you couldn't have said better, because I am actually porting it to the web browser with online editing as well :D

I figured out that it would interest more people, as the only thing to do would be to go on a web page, edit the bot, and click a button.

 

So far I have the game running in my browser (more precisely on a server which send the state to the browser), but a lot more work needs to be done on the server side (support for multiple clients, security, and robustness). I will come back with a demo in a few weeks I think :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement