Jump to content

  • Log In with Google      Sign In   
  • Create Account

Full-Scale RPG in Python using Pygame


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
4 replies to this topic

#1 shadowgamesco   Members   -  Reputation: 326

Like
0Likes
Like

Posted 27 July 2012 - 08:57 PM

For the last 6 months I've been planning a full-scale 2D rpg. The ideas are great and I have people that are going to help me with sound and art. I'm doing all the programming though because that's my hobby and I love it. I recently started working on it and have come accross some performance issues. I've gone over the small ammount of code I have, and it's very efficient. I decided the problem is the API that i'm using. I'm writting the game in Python using the Pygame library for input and rendering. But Pygame is based off of SDL and is software (not hardware) accelerated. So I'm assuming for such a large and full-scale project, that I should use an API that is hardware accelerated. What are some of your suggestions or ideas? Am I using the wrong language/API? Thanks in advance.

** EDIT **
I forgot to add that I have been doing game programming for almost 3 years now. I'm not claiming to be anything special but I'm not a newbie. I also have experience in Java and C/C++. I've done some basic stuff with SDL and SFML. And I am most definitely willing to learn something new so that wouldn't be an issue. Time is not a big deal for this project, its just a hobby of mine. But I would like to do it the right way.

Edited by breinygames, 27 July 2012 - 09:10 PM.


Sponsor:

#2 MrDaaark   Members   -  Reputation: 3555

Like
0Likes
Like

Posted 27 July 2012 - 09:57 PM

You can write a full scale anything in any language. PyGame and SDL are more than up to the task.

If you are having performance issues, run your game through a profiler and see where the problem areas are.

#3 shadowgamesco   Members   -  Reputation: 326

Like
0Likes
Like

Posted 27 July 2012 - 10:02 PM

You can write a full scale anything in any language. PyGame and SDL are more than up to the task.

If you are having performance issues, run your game through a profiler and see where the problem areas are.


I've done that, everything runs really smoothly other than drawing each individual 'tile' to the screen. I have a giant world, but the program only draws the tiles it needs to on the screen depending on where the 'camera' is. So its never drawing tiles that are off the screen. The screen size is 800x640 with 32x32 tiles. So every frame it is drawing 500 tiles to the screen. I'm not exactly sure how to get around this... It's a tile-based RPG. How can I make it run faster then?

Edited by breinygames, 27 July 2012 - 10:03 PM.


#4 MrDaaark   Members   -  Reputation: 3555

Like
0Likes
Like

Posted 27 July 2012 - 10:35 PM

1) Use a profiler so you know what is actually causing you to slow down. No one can guess what is slowing you down.
2) IF your rendering actually is at fault, try some other methods, such as dirty rectangles.
3) Post your rendering code, and your game loop. But I can't help much there, I barely know any python.

#5 jbadams   Senior Staff   -  Reputation: 19350

Like
1Likes
Like

Posted 27 July 2012 - 11:22 PM

You're correct that PyGame doesn't take advantage of any hardware acceleration, and this can be an issue if you're drawing a lot of objects - it'll be an absolute performance killer if any rotation is involved.

Profiling for bottlenecks and implementing more efficient drawing methods as suggested are a good idea that's worth pursuing, but in this particular case it's well known that PyGame can be a cause of performance concerns: you might investigate writing your own OpenGL drawing code, or using PySFML (which uses hardware acceleration) as possible alternatives.

You certainly don't need to abandon your choice of Python.




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