Jump to content
  • Advertisement
Sign in to follow this  
Pxtl

2D .NET Game library?

This topic is 4809 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'm getting back into gamecrafting after about a 5 year hiatus. My last game was VB sprite game - this time through I'm using C# and want to make it compatible with opensource platforms, so directX and suchlike is out. I'm considering SDL.NET, but I had bad experiences with PyGame being slow as molasses in the anything but the hardware mode that most guides say not to use.

Share this post


Link to post
Share on other sites
Advertisement
SDL.NET is probably the best choice if you're coming from Visual Basic. C# is an excellent language no matter what your background. Heck, you can even use SDL.NET with VB.NET if you want. Jendave (the author of SDL.NET) has been very busy with making it compatible with Linux and Mac, you can check out The Absolute Newbie's Guide To SDL.NET on more information about that.

The limitations your talking about with PyGame are the results of the limitations from SDL. SDL uses bitmapped surfaces for rendering, therefore implementating rotations and zooming on these surfaces is slow. If you think your game requires a lot of complex rotations and scaling, you might want to go with OpenGL via the Tao Framework. SDL.NET implements use of SDL_gfx's rotozoom library for rotation and scaling of surface objects. Just be aware that those opperations are slow so you might want to cache the rotations in memory instead of doing the rotations realtime.

Share this post


Link to post
Share on other sites
This raises an interesting question.

I originally thought that the general slowness of PyGame was because of Python itself, not because of SDL. Soooooooo, which is it? Granted, this question is coming from a complete newbie, so I don't really know what the slowdown is. (besides, y'know, the virtual machine bit that Python implements)

Thanks! :D

Share this post


Link to post
Share on other sites
The question you should be asking is "C# or Python". Both SDL.NET and PyGame use SDL for rendering so it doesn't really matter, although SDL.NET deals with a more high-level interface than PyGame and, of course, is CLS-compliant. Since you're coming from Visual Basic, C# might be a better step forward then Python. A lot is planned for the upcoming release...

Later on, after you're comfortable with SDL.NET, you could take a look at Boo, a CLS-compliant Python-inspired programming language. Check out SDL.NET SimpleExample using Boo. I've heard that an addin for Visual Studio is in development [cool].

Share this post


Link to post
Share on other sites
Quote:
Original post by Arydrall
This raises an interesting question.

I originally thought that the general slowness of PyGame was because of Python itself, not because of SDL. Soooooooo, which is it? Granted, this question is coming from a complete newbie, so I don't really know what the slowdown is. (besides, y'know, the virtual machine bit that Python implements)

Thanks! :D

Actually, it is both, as far as I know.. The problem is that rendering to the screen is pretty slow with SDL, at least a lot slower than using OpenGL for 2D stuff would be.
It's not that bad, however, as long as you don't do anything too fancy (such as rotations or zooming or the like), it will probably be enough.

Now, PyGames problem is this and additionally the slowness of Python, and combined it means you have to be very careful only to update those parts of the screen that need updating.

Share this post


Link to post
Share on other sites
to clarify - my VB game was 5 years ago. I spent those 5 years getting my computer engineering degree. I'm coming from C++ and Python - but yes, I found that Pygame was quite slow in software mode - rendering some 100 small tiles once per frame had a limited framerate. I was wondering if there was anything platform-agnostic and yet fast.

Share this post


Link to post
Share on other sites
Quote:
Original post by Rob Loach
The question you should be asking is "C# or Python". Both SDL.NET and PyGame use SDL for rendering so it doesn't really matter, although SDL.NET deals with a more high-level interface than PyGame and, of course, is CLS-compliant. Since you're coming from Visual Basic, C# might be a better step forward then Python. A lot is planned for the upcoming release...

Later on, after you're comfortable with SDL.NET, you could take a look at Boo, a CLS-compliant Python-inspired programming language. Check out SDL.NET SimpleExample using Boo. I've heard that an addin for Visual Studio is in development [cool].


I've been considering Nemerle instead of C# actually, but I was hoping for proper IDE bindings. C# is so much better supported by IDEs.

Share this post


Link to post
Share on other sites
Quote:
Original post by Pxtl
I've been considering Nemerle instead of C# actually, but I was hoping for proper IDE bindings. C# is so much better supported by IDEs.
Wow, I hadn't even heard of Nemerle. I'll make a note of it for future use. If you're just learning, it might be a better idea to learn C# before you jump into Nemerle as they say it's mostly similar to C# then anything. Looking at the differences between Nemerle and C#, C# looks like it's a bit easier to understand [wink].

About a month ago, I made up a test program that included any number of moving, rotating surfaces being rendered realtime. You would increase the number by pressing up and decrease it by pressing down. It was at a constant 60 FPS at about 120 moving and rotating surfaces so I tried it without the rotations and I couldn't find the FPS cap without the rotations because I gave up just after it got to 500 moving surfaces. Once I get the time, I'll write up the test again and see how it does.

Share this post


Link to post
Share on other sites
That's just what I wanted to hear. I'd some funky stuff with particle-trails in mind, but 120 objects shouldn't strain things at all, and rocket trails don't need rotation. And I already know C# and want to use Nemerle, but I think I might stick to C# for the better IDE support.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!