Jump to content
  • Advertisement
Sign in to follow this  
asdqwe

Question concerning beginner project

This topic is 2611 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 have read in this forum that Python is not a good language for projects where precise timing is needed. Is it true?

I want to make a 2D shooter so timing is of importance.

What languages and free libraries (maybe even free engines) would be available for this kind of project?

Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Python would work perfectly for 2D shooters using a library like SFML (python-sfml) or SDL (pygame). Could you describe a bit more of what kind of shooter you wish to make?

Share this post


Link to post
Share on other sites

I have read in this forum that Python is not a good language for projects where precise timing is needed. Is it true?
I want to make a 2D shooter so timing is of importance.
What languages and free libraries (maybe even free engines) would be available for this kind of project?
Thanks.

The only problem is sometimes there are a lot of enemy sprites on the screen, at once. I didn't think Python could handle it.

Share this post


Link to post
Share on other sites
Speed depends on your code also to some extent. SDL (from my experience) is good enough for handling fast-paced 2D graphics without choking and remember, SDL itself is written in C and pygame is only a wrapper to the C graphics library. Even commercial games are written in SDL. If you handle your game logic properly, there should be no speed problems with using Python.

If, of course, you are going to crunch a ENORMOUSLY HUGE lot of numbers or data in your game, C or C++ might be better suited. Otherwise, Python will be just fine for arcade type 2D shooters.

Share this post


Link to post
Share on other sites

Would this be true even with those sprites being translucent?
[/quote]
Yes.

Rendering is rarely implemented natively in Python. Libraries are almost always used, and any popular library will either delegate to dedicated C/ASM routines, or to hardware acceleration.


The only problem is sometimes there are a lot of enemy sprites on the screen, at once. I didn't think Python could handle it.
[/quote]
Write a "realistic" stress test. Run this on your target minimum hardware. There is no way to guess, it is too context dependant.

Python isn't fast or slow. A particular programmer writing a particular application in Python, with a given level of experience in Python, will produce a faster or slower application than another programmer, writing the equivalent application using some other technology, with their level of experience in said technology (assuming a practical deadline preventing infinite research and optimisation).

The technology is only one factor in the final program's performance, and not necessarily the most important one.

Share this post


Link to post
Share on other sites

Python isn't fast or slow.


Reading stuff from the Net, I have often come across the general opinion that an application written in Python *is* slower than its C equivalent, should all the above-mentioned parameters (experience etc.) be equal.

...and thanks for the info.

Share this post


Link to post
Share on other sites
I have often come across the general opinion that an application written in Python *is* slower than its C equivalent, should all the above-mentioned parameters (experience etc.) be equal.[/quote]

Sure, but what's your point? You want to know if you should discard Python as a valid choice. We're telling you that the performance concerns you have about Python aren't going to apply in your case.

Now, either you'll accept that, or you won't. Make your decision, and then take action.

Share this post


Link to post
Share on other sites
Yes, most of the time, a perfectly optimised C program will outperform a Python equivalent. That doesn't mean anything, because the amount of effort required will still differ.

That said, the above mentioned parameters are almost never equal. If they are equal, then you're in a good position to decide which is the best option yourself. For example, a programmer who is proficient in Python and C, might accept a speed hit to gain programmer productivity. It would depend on the nature of the program.

In fact, a programmer proficient in both could write the majority of the game in Python, knowing they can re-write a particular module in C if necessary.

Given that you are posting in For Beginners, I'm guessing you don't have equal experience in two languages. What languages/technologies do you have? What is important to you at the moment, the success of the project itself, or the learning experience the project represents?

If the former, I recommend building it with technologies you are familiar with. If the latter, go for the new technology. Even if the project fails, or takes a very long time, you will learn lots of new things trying.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!