Jump to content

  • Log In with Google      Sign In   
  • Create Account


Starting in Python: best graphics module?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
18 replies to this topic

#1 totheteeth   Members   -  Reputation: 100

Like
0Likes
Like

Posted 30 March 2012 - 04:50 PM

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!

Sponsor:

#2 MLillowitz   Banned   -  Reputation: 23

Like
-2Likes
Like

Posted 30 March 2012 - 06:27 PM

Hi, totheteeth.

I suggest you try this one: http://www.ogre3d.org/tikiwiki/PyOgre

It is very well suited to beginners.

Any more info, just ask.

- Mikey

#3 kloffy   Members   -  Reputation: 865

Like
0Likes
Like

Posted 30 March 2012 - 07:51 PM

I haven't used Ogre, but it looks a bit heavy for a basic 2D project. Maybe also have a look at PySFML.

#4 MLillowitz   Banned   -  Reputation: 23

Like
-3Likes
Like

Posted 31 March 2012 - 04:45 PM

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

#5 kloffy   Members   -  Reputation: 865

Like
0Likes
Like

Posted 31 March 2012 - 06:47 PM

If you're saying that getting an image up on the screen with PyOgre is as easy as this:

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()

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

#6 MLillowitz   Banned   -  Reputation: 23

Like
-1Likes
Like

Posted 01 April 2012 - 03:34 AM

Hi again, kloffy.

It only takes about 14 continuous non-break code lines to perform the same thing.

- Mikey

#7 flembobs   Members   -  Reputation: 102

Like
0Likes
Like

Posted 01 April 2012 - 11:48 AM

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.

#8 jbadams   Senior Staff   -  Reputation: 17248

Like
1Likes
Like

Posted 01 April 2012 - 07:23 PM

PyGame is popular, well documented, and well suited to a basic 2d game.
PySFML (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 pyglet 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 much 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 meant for 2d, and have documentation and examples focussed on that usage.


@Mikey: 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 really think it's better than a dedicated 2d library with dedicated 2d documentation and samples? Really?

#9 MLillowitz   Banned   -  Reputation: 23

Like
-2Likes
Like

Posted 02 April 2012 - 04:52 AM

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

#10 jbadams   Senior Staff   -  Reputation: 17248

Like
1Likes
Like

Posted 02 April 2012 - 05:13 PM

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 disagree with the correct and intended usage of a smart pointer without explaining why (and you'll note your suggestion is apparently very unpopular given the down-votes), and apparently don't have a properly set of development machine and seem to show a poor understanding of DirectX model loading.

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 you have written.


please keep in mind and an open mind to the suggestions of others.

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 why 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?

@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.

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.

#11 MLillowitz   Banned   -  Reputation: 23

Like
-1Likes
Like

Posted 02 April 2012 - 06:03 PM

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 your way. Okay?

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

#12 jbadams   Senior Staff   -  Reputation: 17248

Like
0Likes
Like

Posted 02 April 2012 - 07:51 PM

So just to be clear: you asked me to back up my opinion -- which I did -- but you're not willing to back up your own?

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

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.

#13 MLillowitz   Banned   -  Reputation: 23

Like
-2Likes
Like

Posted 02 April 2012 - 11:07 PM

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 professionally 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

#14 jbadams   Senior Staff   -  Reputation: 17248

Like
0Likes
Like

Posted 02 April 2012 - 11:25 PM

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.

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.

#15 DarkHorseKnight   Members   -  Reputation: 143

Like
0Likes
Like

Posted 03 April 2012 - 10:33 AM

that teacher is an asshole I'm on jbadams side on this

#16 LorenzoGatti   Crossbones+   -  Reputation: 2513

Like
0Likes
Like

Posted 04 April 2012 - 03:25 AM

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.

PyOgre might 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.
Produci, consuma, crepa

#17 jbadams   Senior Staff   -  Reputation: 17248

Like
0Likes
Like

Posted 04 April 2012 - 06:58 PM

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.

#18 Inrideo   Members   -  Reputation: 102

Like
1Likes
Like

Posted 05 April 2012 - 03:32 AM

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.

#19 pyirrlicht   Members   -  Reputation: 618

Like
0Likes
Like

Posted 12 April 2012 - 12:45 AM

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!

Look at the pyIrrlicht. This have simple 2d examples and pyMunk 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++ Irrlicht code.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS