Sign in to follow this  
totheteeth

Starting in Python: best graphics module?

Recommended Posts

totheteeth    100
I've seen a few different graphics modules floating around, and I was wondering if there's some consensus on which is the easiest to understand/most flexible/whatever. I'm looking to get started on a basic 2D project. Thanks!

Share this post


Link to post
Share on other sites
MLillowitz    23
Hi, totheteeth.

I suggest you try this one: [url="http://www.ogre3d.org/tikiwiki/PyOgre"]http://www.ogre3d.org/tikiwiki/PyOgre[/url]

It is very well suited to beginners.

Any more info, just ask.

- Mikey

Share this post


Link to post
Share on other sites
kloffy    1318
I haven't used Ogre, but it looks a bit heavy for a basic 2D project. Maybe also have a look at [url="http://www.sfml-dev.org/tutorials/1.2/start-python.php"]PySFML[/url].

Share this post


Link to post
Share on other sites
MLillowitz    23
Hi, kloffy.

Ogre is one of the most basic graphics modules for beginners to use in Python.

I use it to teach my students, and even those not native to programming basics pick up fast on it.

It is very well suited for basic 2D projects, and it is not "heavy" as you're making it seem.

20+ years of programming experience and teaching.

- Mikey

Share this post


Link to post
Share on other sites
kloffy    1318
If you're saying that getting an image up on the screen with PyOgre is as easy as this:

[CODE]from PySFML import sf

def main():
window = sf.RenderWindow(sf.VideoMode(800, 600), "SFML Sprite")

image = sf.Image()
if not image.LoadFromFile("image.png"):
return

sprite = sf.Sprite(image)

while window.IsOpened():
event = sf.Event()
while window.GetEvent(event):
if event.Type == sf.Event.Closed:
window.Close()

window.Draw(sprite)
window.Display()

if __name__ == '__main__':
main()
[/CODE]

I'm going to have to take your word for it. Like I said, not much experience with Ogre3D on my side...

Share this post


Link to post
Share on other sites
flembobs    102
I recommend Pygame (http://www.pygame.org).

It's a great library that is very easy to use. There's a lot of documentation, including a few free books, to get you going.

Share this post


Link to post
Share on other sites
jbadams    25713
[url="http://www.pygame.org/"]PyGame[/url] is popular, well documented, and well suited to a basic 2d game.
[url="http://www.sfml-dev.org/tutorials/1.2/start-python.php"]PySFML[/url] (suggested above) could also be a good choice, although you'll find less reference materials available than you would for PyGame; there is however an active and helpful community of SFML users who can offer assistance.
You might also consider [url="http://www.pyglet.org/"]pyglet[/url] if neither of the above interest you.

I would agree with kloffy's suggestion above that PyOgre might not be the best choice; it's certainly a very capable option, and would not involve [i]much[/i] more work than alternatives to do 2d work, but it certainly is a "heavier" option than the pure 2d libraries available. A lot of the available documentation is also focussed on 3d applications, and you'll find less 2d examples available. This is a library that is not strictly intended for 2d usage, with documentation aimed at 3d programming; it would do what you need, but the other libraries suggested here are [i]meant [/i]for 2d, and have documentation and examples focussed on that usage.


[b]@Mikey:[/b] PyOgre is certainly suitable for 2d applications, and I'm sure your students have had a good experience with it, but remembering that totheteeth does not have a teacher walking him through examples in a classroom environment, and that his stated goal is to "get started on a basic 2d project" do you [i]really[/i] think it's better than a dedicated 2d library with dedicated 2d documentation and samples? [i]Really?[/i]

Share this post


Link to post
Share on other sites
MLillowitz    23
Hi, jbadams.

Define "heavier".

I have freely available tutorials for absolute beginners in game programming to get a window started up and get images and functions going. Any documentations can be provided solely by me, and are written by me.

I can assure you that with the right pointers, and not saying PyGame nor PySFML are not essential or good, but I've always relied heavily on PyOgre for beginners and can tell you from years of experience that its engine is more forward, able to establish a better interface, and less error prone. Perhaps we should consider what the engine can do rather than how well it's suited to document proper use. Again, not saying that either of the options recommended before are bad, but please keep in mind and an open mind to the suggestions of others.

Certainly it would be best to describe what you mean by the terms you use as well, throwing around word such as "heavy", but I'll just let things slide for now since I believe you're an honest person and willing to compensate consideration for my efforts here.

@flembobs

I suggest you take an appropriate measure and consideration for another person above you's opinion rather than gloating about your recommendation. Thank you.

- Mikey

Share this post


Link to post
Share on other sites
jbadams    25713
Ok, that's fair, I wasn't very specific in my objections.


The original poster wants to create a 2g game. PyGame and PySFML are meant for 2d usage, and they provide functionality intended specifically for that usage and have documentation intended specifically for that usage. PyOgre is capable of 2d but is primarily meant for 3d. It provides a lot of 3d functionality that is simply of no use to the OP, and the overwhelming majority of the documentation is for 3d rather than 2d.

The original poster is a beginner, and will probably run into cases where help is needed. A lot people using PyGame and PySFML will also be doing 2d applications and will be able to offer help and examples that are directly applicable. The majority of people using PyOgre will be creating 3d applications, and would therefore only be able to offer general suggestions (and probably won't have any examples on hand) to a 2d user.

A search for additional resources about PyGame and PySFML turns up lots of 2d material. A search for additional resources about PyOgre turns up lots of 3d material.


You mention that you provide some tutorials yourself -- but you haven't provided a link. Your tutorials don't really factor in if the OP hasn't been told where they are. Additionally -- without meaning to be impolite -- you've mentioned years of experience, but haven't given much reason to be confident in your abilities in your recent posts, where you [url="http://www.gamedev.net/topic/622643-smart-pointers-question/"]disagree with the [i]correct and intended usage[/i] of a smart pointer without explaining why[/url] (and you'll note your suggestion is apparently very unpopular given the down-votes), and [url="http://www.gamedev.net/topic/622666-can-somebody-here-help-me-with-directx/"]apparently don't have a properly set of development machine and seem to show a poor understanding of DirectX model loading[/url].

I'll quickly apologise for what could be perceived as a personal attack, but I believe your experience is directly relevant given that you're saying the OP should rely on tutorials [i]you[/i] have written.


[quote name='MLillowitz' timestamp='1333363940' post='4927431']
please keep in mind and an open mind to the suggestions of others.
[/quote]
I believe I have done so. In my first reply, I acknowledged that PyOgre is very capable as a 2d option; but I feel that it might not be the best choice given the 2d-specific options. In my second reply I've clearly stated [i]why[/i] I think the 2d-specific options might be a better fit. Perhaps it's your turn to keep an open mind to the suggestions of others?

[quote name='MLillowitz' timestamp='1333363940' post='4927431']
@flembobs

I suggest you take an appropriate measure and consideration for another person above you's opinion rather than gloating about your recommendation. Thank you.
[/quote]
What are you on about? He just suggested an appropriate library that had not yet been mentioned, and made no mention what-so-ever of the posts above.

Share this post


Link to post
Share on other sites
MLillowitz    23
Hi again, jbadams.

We should just drop this.

We don't want to escalate in to bigger problems here.

Also, don't think for a second that general dislike from a majority in a group means an idea is incorrect or not worthy.

I will do things my way and you can do things [i]your way. [b]Okay?[/b][/i]

I've programmed enough to know what works well for me and my class, and my efforts to prove my points arise trouble.

So let's start this all over, please.

- Mikey

Share this post


Link to post
Share on other sites
jbadams    25713
So just to be clear: you asked me to back up [i]my[/i] opinion -- which I did -- but you're not willing to back up your own?

[quote name='MLillowitz' timestamp='1333411432' post='4927707']
Also, don't think for a second that general dislike from a majority in a group means an idea is incorrect or not worthy.
[/quote]
Not at all, but you have been asked to provide your reasoning (in the other topic) and refused to do so -- not even a single example. You're the one making a claim contrary to common wisdom and disagreeing with official library documentation -- I don't think it's impolite or inappropriate to ask you to back that up, especially if you're planning to continue giving potentially controversial advice and claiming to have years of experience.


If you're really unable to prove your points without "arising trouble" maybe it's worth considering that you might be wrong? We're reasonable people, and we're just asking you to back up the claims you're making -- if you're not willing to do that, you shouldn't really give controversial advice as an expert, or should at least be prepared to be questioned.

Share this post


Link to post
Share on other sites
MLillowitz    23
Hello again, jbadams.

Very sorry all these problems have arisen. To avoid me having to continue putting wood in the fire that I'm sorry for starting, I suggest we just until my site is published.

I will have over 50 blogs there, and updates daily. From my main homepage of my blog you'll understand my points and reasons why I don't believe that PyGame or PySFML are good starters.

Like I said I have been teaching programming freelance for over 15 years, been teaching it to my class and everyone in my class can act as a reference for me on this, and have been programming [b]professionally[/b] for almost 30 years.

Instead of flooding these messages, we'll put this on hold.

Is that fair enough? Sorry for this whole situation. Very much do I apologize.

I hope our paths cross again, and sorry for any belligerence.

- Mikey

Share this post


Link to post
Share on other sites
jbadams    25713
[quote name='MLillowitz' timestamp='1333429653' post='4927773']
To avoid me having to continue putting wood in the fire that I'm sorry for starting, I suggest we just until my site is published.
[/quote]
Fine, but perhaps it would be a good idea to stop suggesting people read your non-existent blog until that time, hrm?

Again, it isn't everyone else that is being unreasonable in wanting you to back up your claims. Frankly, your claims of lengthy experience are simply ridiculous otherwise.

Share this post


Link to post
Share on other sites
LorenzoGatti    4450
[quote name='MLillowitz' timestamp='1333429653' post='4927773']
I will have over 50 blogs there, and updates daily. From my main homepage of my blog you'll understand my points and reasons why I don't believe that PyGame or PySFML are good starters.
[/quote]
PyOgre [i]might [/i]be surprisingly suitable for 2D projects, but I'm still waiting for you to provide a PyOgre code example that can be compared with the PySFML one given by kloffy sevaral posts ago; if drawing sprites with PyOgre is as easy as drawing them with PySFML, it shouldn't take you too long.

Share this post


Link to post
Share on other sites
jbadams    25713
Just a quick note for those still participating in the conversation: after incidents in a number of other topics as well as outside of the forums, it was decided by the moderators (not me, as I had been engaging with him extensively in topics such as this one and did not want to bias the decision) that MLillowitz is obviously trolling, and as such his posting privileges were removed a couple of days ago.

PyOgre probably is still a suitable suggestion, but -- as I argued above -- probably not an optimal one, and I believe you can safely ignore all of MLillowitz's unsubstantiated claims to the contrary.

Share this post


Link to post
Share on other sites
Inrideo    102
Wouldn't a dedicated 2D engine simply be the best option for a beginner wanting to work in 2D just for the succinctness of the API documentation?
As a newbie coder I wouldn't want to have to wade through tons of function docs to find something I need buried among a large volume of functions I don't.

Share this post


Link to post
Share on other sites
pyirrlicht    643
[quote name='totheteeth' timestamp='1333147826' post='4926807']
I've seen a few different graphics modules floating around, and I was wondering if there's some consensus on which is the easiest to understand/most flexible/whatever. I'm looking to get started on a basic 2D project. Thanks!
[/quote]
Look at the [url="http://pir.sourceforge.net"]pyIrrlicht[/url]. This have simple 2d examples and [url="http://pymunk.googlecode.com"]pyMunk[/url] physics usage examples, all see from SVN.
Also this have mixed 2d and 3d mode, and you always can easy translate your Python code to C++ [url="http://irrlicht.sourceforge.net"]Irrlicht[/url] code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this