Pygame Ide


eyecreate

Member
Joined
Feb 3, 2009
Messages
253
Website
git.eyecreate.org
I was thinking about games people were making for the Pandora and so I got to looking for a compatible game editing tool to use for the pandora to help me ease into starting a game. My search basically game up with nothing much, especially in open source tools. So I decided to help ease getting started on games by making an IDE/designer for and on pygame. The current goal is to get it up and working to put sprites and sounds etc up and to output python pygame code. This can be edited to customize more than the IDE allows and can be distributed like other py files. Save data is in XML and game data will be in zlib archives. I currently have only worked on it for a day or so, but have gotten alot done. Just so others get an idea of what it looks like, I'll upload a pic of me working on the code. Let me know what you think of what I'm doing.

http://www.box.net/shared/ieta0mzu4u
 
Okay, I've had a bunch more things made, and some changes. In the first post, I said it would use zlib archives, but technically I decided to use tarfile in python which makes tar archives. Also, I separated the editor which visually places your items and saves in XML style format from the program that turns the XML into python. I did this for modularity and so those wanting to use command line tools can still use the compiler, I just have the editor import the compiler. Here is a current sample of the XML used to make a python file.

CODE
<?xml version="1.0" encoding="UTF-8"?>
<Game name="file"><properties title="test" resx="640" resy="480"/><Canvases><canvas name="canvas1"><Sprites><sprite name="sprite1" src="pandora.gif"/></Sprites><Objects><object name="object1" type="sprite" resource="sprite1" width="28" height="28" startx="20" starty="50" firststart="true"/></Objects><Sounds><sound name="sound1" src=""/></Sounds></canvas></Canvases></Game>


This will yield the program seen in this picture.

http://www.box.net/shared/x1nltno0dc

Also, on the editor, I made it automatically refit the game canvas. This means, you can still view the canvas of a screen larger than the one you are editing on, but zoomed out. The editor will notify you of this when it does it. I tried to make the editor able to be use screen sizes of smaller devices so it's not just limited to full computers, but Pandoras too!

My next steps should be finishing implementing the resource loading and then get the game dynamics worked out.
 
Last edited by a moderator:
I was browsing the net about pygame to read up on it when I found this library I had forgot about.

http://cocos2d.org/

It looks alot friendlier for starting games and supports cool effects because it uses opengl from pyglet. A downside is it requires more libraries installed.
So I'd like to know if anyone thinks changing my codebase of the final output of the compiler to use cocos2d would have more benefits than drawbacks.
Maybe it should be added as an optional alternative compiler output instead of replacing pygame.
 
Last edited by a moderator:
I don't know if anyone is still curious about what's going on with this project, but here's another update.
I haven't had too much time to add things with school and other projects, but I added a few event system items about a month ago. Now, objects in the game can be assigned an event to respond to directly in the XML file(and soon eventually ide). The property name is the exact name of the pygame event, so as long as the event exists, you can use it in the compiler. My next step will most likely be collision detection.

CODE
<object name="object1" type="sprite" K_RIGHT=" object1rect[0]+=10"/>
 
I haven't had too much time to actually code more, but I was able to start mind-mapping my plans for my project so I don't lose track of important things. If you are interested, I have my latest revision of the mind map the reflects current code:

http://share.xmind.net/eyecreate/pygame-is-pygxml-1/
 
I haven't been to active recently on this project, sorry for those interested, but I've also been scouring the web for ideas/info. While doing so, I found this interesting project.
http://pyoctane.sourceforge.net/index.html
This project has some similar goals to my project and is also written in python. The only problem pandora-wise is what Tripmonkey_uk said, that Octane currently uses opengl and it may not support opengl es. One thing I was thinking about, to save code time, is maybe using the nice/familiar IDE of this project and tying it to the compiler I'm making. Does this sound like a good idea to anyone or should I just abadon my compiler and just support adding opengl-es support into octane?
 
eyecreate said:
I haven't been to active recently on this project, sorry for those interested, but I've also been scouring the web for ideas/info. While doing so, I found this interesting project.
http://pyoctane.sourceforge.net/index.html
This project has some similar goals to my project and is also written in python. The only problem pandora-wise is what Tripmonkey_uk said, that Octane currently uses opengl and it may not support opengl es. One thing I was thinking about, to save code time, is maybe using the nice/familiar IDE of this project and tying it to the compiler I'm making. Does this sound like a good idea to anyone or should I just abadon my compiler and just support adding opengl-es support into octane?
Hey, nice find! I'll have to keep an eye on that project. One thing though: What's with the "Works best under sudo"?
 
Last edited by a moderator:
B-ZaR said:
eyecreate said:
I haven't been to active recently on this project, sorry for those interested, but I've also been scouring the web for ideas/info. While doing so, I found this interesting project.
http://pyoctane.sourceforge.net/index.html
This project has some similar goals to my project and is also written in python. The only problem pandora-wise is what Tripmonkey_uk said, that Octane currently uses opengl and it may not support opengl es. One thing I was thinking about, to save code time, is maybe using the nice/familiar IDE of this project and tying it to the compiler I'm making. Does this sound like a good idea to anyone or should I just abadon my compiler and just support adding opengl-es support into octane?
Hey, nice find! I'll have to keep an eye on that project. One thing though: What's with the "Works best under sudo"?
@eyecreate - Yeah that seems like a good idea. It should allow you to concentrate on the core of the program more and get it stable. What I could also suggest, is that if the project complies with about 90% of your idea, then you can also help out with that project for a while. You could always fork it and replace the engine with your own later on. You never know, maybe the projects developer would prefer your way of doing things?

@B-ZaR- Works best under sudo, just means that it will work better with root access on a Linux box.
 
Last edited by a moderator:
Thanks for the replies Tripmonkey_uk and B-ZaR.

@Tripmonkey_uk: Yeah, I probably should talk to the dev first, as there's many options that could be taken. Our engines function a little different and each has their strengths and weaknesses. The current Octane engine puts all the resources into the python file directly, which means less files to worry about and makes it feel like gamemaker in the fact all the data is in the "game file". The problem with that lies in the fact you have to "recompile" the data in each time you change things. The way my engine does it makes more files, and sometimes mess, but it allows a possibility to have game data be updated without code or vice versa. This would be good if a larger game was made with the engine, as it's much easier to make mods: just replace/change/add files to the datapack.(almost like WAD files from Doom) Another feature that can be neat is the fact he put the info the IDE can read as comments in the top of the python file. This again makes the game an easy transport and is something I may add myself, but I personally am not too fond of the fact the data is not "human readable", meaning you need the IDE to edit it properly. Because I chose XML as the format of the editor info, it allows more flexibility in how you want to change/read what you have.(you can make changes even without the editor, even in something like notepad or a terminal) I guess there's lots to think about.
 
eyecreate said:
(you can make changes even without the editor, even in something like notepad or a terminal)
I definitely prefer this. B)
 
Last edited by a moderator:
Tripmonkey_uk said:
@B-ZaR- Works best under sudo, just means that it will work better with root access on a Linux box.

Yes, I know what it means, but why in the name of [insert deity or an object of worship] would it need root access? I really can't think of any good reason.
 
Last edited by a moderator:
Just throwing it out there, sqlite can be used for custom file formats, and support is built into python. It's the best of everything...you can treat the data like python objects (you don't need to know any SQL), but AFAIK you get the speedup from a b-tree layout. There are a lot of sqlite GUI programs out there that could be used to load the db and edit strings and things without opening the editor.

One version would be a big sqlite db file with a table for each data type, and a row for each instance. So a "maps" table with columns for binary data, strings, and each row is a different map.

http://docs.python.o...ry/sqlite3.html

And if you're good with XML then you probably don't need (or are already aware of) these, but:
http://docs.python.o...nfigparser.html
http://docs.python.o...brary/json.html

As you can see, I hate parsing text files, but luckily python's standard library is second to none :D
 
@b-zar:I read on the pygame website that the creator said it was something to do with pyqt4. It'd be nice if that "feature" could be cured.
 
eyecreate said:
@b-zar:I read on the pygame website that the creator said it was something to do with pyqt4. It'd be nice if that "feature" could be cured.

Do you have a link? I've used both pygame and pyqt4 for some time and haven't bumped into anything like that. I'd like to know the reason to take it into consideration when designing my own programs. Thanks in advance!
 
Last edited by a moderator:
B-ZaR said:
eyecreate said:
@b-zar:I read on the pygame website that the creator said it was something to do with pyqt4. It'd be nice if that "feature" could be cured.

Do you have a link? I've used both pygame and pyqt4 for some time and haven't bumped into anything like that. I'd like to know the reason to take it into consideration when designing my own programs. Thanks in advance!
This is all I got:
http://www.pygame.org/project-Octane-1115-2252.html

I haven't figured out by searching online what part of pyqt4 needs it yet.
 
Last edited by a moderator:
Back
Top