P(h)y-sics

Python? The Py- prefix? Get it? Never mind…

So in my wonderful game-making quest, I’ve been exploring some different physics options:

Pymunk – Seems pretty powerful. Built on top of chipmunk with a wrapper in Python. I’ve already downloaded and submitted it to some stress tests. Appears that it can take a pretty significant amount of abuse before fps takes any serious hit.

PyBox2D – Like the above: its a Python wrapper for the popular Box2D physics engine. Can’t say I’ve downloaded it and messed with it much in Python, but I have some general experience with it’s workings in Stencyl. Also a nice-looking possibility.

Simple hack with Pygame – This may be what I do at first. I don’t have any super fancy, built-in physics, but it has some basic stuff I can work with. Read below for more details on what I’m getting at.

Build my own – Of course. I like being in control, and I can tailor it to my wants. But I’d probably have to build it in C/C++ (and then write a Python wrapper) if I want the same performance as Pymunk or PyBox2D and, quite frankly, I need to ask myself if that’s an undertaking that is really worth my time when I have the other two options. Oh sure, it sounds nice, but would it “distract” too much from actually finishing a game?

———

I haven’t quite decided what I’m doing yet there. I think the important thing to remember is, ultimately, to finish a game. I have ideas on how to build some nifty tools/libraries, but I can’t be consumed to the point that I never get to the game; I’ve heard it’s a pitfall that you want to avoid (building engines instead of building games). So my train of thought is this:

  1. Build a module for a particular functionality (graphics, stage handling, etc.)
  2. Build a game that utilizes this feature; see how it holds up and how useful it is
  3. Repeat as I want to implement new ideas

This will give me a chance to see what’s working and what’s not, of course, before I structure a whole series of game-making modules after the same pattern or template. Currently, I have a graphical system that I’ve been brainstorming with. I’m not going to go into too much detail, but a main idea is to localize graphics in one place for easier organization and blitting, and then let other objects manipulate them from there. For those unfamiliar with Python, Python passes references (essentially, something similar to pointers) for all assignments unless otherwise instructed, so different actors can store images as references by default as opposed to receiving their own copies (or messing with an abundance of pointers, which can get ugly to deal with). In that regard, Python seems like an ideal candidate for my way of thinking. Python seems ideal in a lot of ways for what I’m doing, actually.

I suppose over time we’ll see. 🙂

Advertisement
Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: