Over the past few weeks I gave myself the goal of starting my Student Innovation Project (SIP) and getting far enough with it to have something presentable for the SIP Reaffirmations. Since the aim of my SIP was to develop AI for RPG party members, the first thing that I had to do was find an engine that could benefit my SIP’s development process.
I first started with Unity, which I had minimal experience in. While I did have some knowledge of programming in C#, it was not that expansive. I did, however, have experience with 2D game development! On top of that, Unity did have the capability of using Tensorflow, which opened up the possibility of developing machine learning within the engine. This seemed like the best choice, but the issue that ended up deterring me from using Unity was the sensitive and extremely complicated installation process for Tensorflow. It took me days to get anywhere with installing Tensorflow on my computer, and with every step came its own set of issues that took hours to resolve. That, alongside the incredible amount of other applications that you needed to install in order to complete a single step of the installation process simply deterred me from continuing with it.
After trying to download Tensorflow, I looked for another way to start development on my SIP. This then led me to Python and its Pygame library. I had much more experience programming in Python than in C#, but I had no experience with using Pygame. I have played games that were made in Pygame, and even saw one of the professors here use Pygame as a tool for developing a visual novel game. However, having never actually programmed using its library, I was pretty intimidated, but when it came down to the point where I had only a few weeks before the SIP Reaffirmation, I had to make a choice.
The first moments of using Pygame were pretty easy, actually! Getting a window up and changing the inside color of that window was easy, But when I started trying to place sprites on the screen, I started experiencing some issues. As I said before, I had no experience using Pygame. I was used to just picking up sprites and dropping them into the scene of an engine, so when faced with having to manually load sprites using Pygame, I struggled a lot.
I decided to look up some tutorials to help me out, but I couldn’t really get a grasp on what was happening. Some tutorials showed me how to draw rectangles to the screen, but it was hard to apply the same procedure to actual PNG files/sprites. Some used classes in their methods, while others just used pygame.image.load to do it, (which was the method that I went with since it was the easiest to grasp), and others used a sprite sheet (which was apparently the smart way to do it). In the end, there were so many ways to do it, but not many of them really explained what was happening or what I was supposed to do clearly. Trying to find a tutorial that I could understand felt like a wild goose chase around the internet.
While what I did with Pygame was simplistic, my overall experience using the library showed me that there are numerous other options for game development out there that could prove to be more worthwhile than Pygame, such as Unity, GameMaker, and Construct 3. With these engines, in most cases, all you have to do is drag a sprite into a scene and you’ll have a sprite within your game, unlike in Pygame, where you have to do multiple operations just to make a sprite appear and look right on the screen. I am not saying that Pygame is unusable, but it is just harder to achieve some things that are otherwise easy and instantaneous with other engines.
With that said, Pygame is not all that bad. It uses Python, which means that whatever is built within it can be used on a multitude of platforms. No worrying about the platform issues that Unity and Unreal occasionally run into; Python/Pygame has that going for it from the get-go. And, as I said before, the process of actually loading assets was not that complicated. While it is not as easy as getting sprites working in Unity, it still only took that few lines of code.
Lastly, let’s talk about Pygames possible applications. While it was made to be used to develop games, it pretty much opens up the ability for programmers to visualize what is happening within their code. Someone has previously utilized Pygame for their SIP where they were able to bring up a map that would auto-generate red points when their code detected something online. The Pygame library is flexible, so you can do a lot with it.
In the end, Pygame has its faults, but it also has its successes. It also has plenty of competitors out there. What matters is whether or not using Pygame or those competing game engines helps you achieve what you ultimately want for the development of your project. Let that be the defining part of your decision. From my experience, Pygame takes a bit to get used to, But, when it comes down to the fact that Python is the best language for AI and how Pygame is the only thing out there that can turn my SIP into an actual game that people can play and enjoy, it seems like I’m going to be sticking with Pygame until my SIP is done.
A special thanks to Jordan Brown with helping me revise my blog. Without you, I would not have been able to get the point across as effectively as I wanted.
References
Real Python. (2018, June 11). PyGame – A Primer – Real Python. Retrieved May 05, 2019, from https://realpython.com/pygame-a-primer/
Craven, P. V. (n.d.). Program Arcade GamesWith Python And Pygame. Retrieved May 05, 2019, from http://programarcadegames.com/index.php?chapter=introduction_to_sprites&lang=en
Bradfield, C. (2016, August 15). Pygame Lesson 1-2: Working with Sprites. Retrieved May 6, 2019, from http://kidscancode.org/blog/2016/08/pygame_1-2_working-with-sprites/
Baumgarten, P. (2018, January 23). Learning Python 12: Using sprites (images) with Pygame. Retrieved May 6, 2019, from https://www.youtube.com/watch?v=2ClnBpKGx7o
Comment