Blogg of the week: Alpha

Hello, this week hasn’t been that successful so I do not have a finished artifact to write about. So I figured that I would write about what I have been doing instead.

I have been working with Box2D, which is a physics engine that we use for collision. Last week I worked with getting collision to work. Collision is working by itself Box2D so it is more about being able to use it, and getting used to the structure. It probably isn’t that hard to learn, but since I haven’t programmed before I started this school it took a bit of time and some help to get things running.

So for this week we were supposed to make so that you can detect when objects collide. This is made by a “contact listener” in Box2D and the idea is simply to make it detect collisions so that you can then state what should happen. The contact listener have four steps. The first one is “Begin contact event” which checks when two object overlaps. The second one is “End contact event”. This is called when the collision ceases. Next is “Pre-solve event”, this is called after collision detection, but before collision resolution. This gives you a chance to disable the contact based on the current configuration. Lastly we have the convenient enough “Post-solve event”. The post solve event is where you can gather collision impulse results. If you don’t care about the impulses, you should probably just implement the pre-solve event.

weekly

It looked really strait forward so we thought we could continue to use Box2D even though we initially used it to be able to make smoothly made walls. But we could not figure out how to actually use it. We got all the above written and shown parts of a contact listener but we did not know how to actually use it. Documentation was not that great and often it was written in flash or java so we gave up on it after a while and thought it was simpler to just use regular collision. So as I am writing this we  are almost done with the collision and the alpha with help from our technical artist: Oscar Mohlin and my group member in my last project Sebastian Rosenblad. Since our lead programmer has more important things to do as we had some problem with syncing our project it is great that we can get help from these guys.  I think i might look up the contact listener later since it seems really good, but right now we just need to get things done.

That is all for now, hopefully I will have some more to write about next week.

One thought on “Blogg of the week: Alpha”

  1. You really aren’t making it easy for me to comment on you ^^

    I don’t doubt even in the slightest that getting Box2D to work properly would be both a big help now and in the future, but for a project like this it sounds like overkill to me, or at least a headstart.

    I’ve been messing around with different engines and occasionally stumbled upon Box2D, but I never made anything too complex, meaning that I never had to look into it too much. If I recall correctly, some engines used it by default which gave me another reason to not look into it too much.

    There aren’t really much I can say about your work on Box2D since I haven’t really seen any of it. It would have been nice to see how your current collisions work though, but yeah, don’t really know how you got that to work either.There aren’t really one collision-manager that everyone in the business uses, but I’m going to assume that you used the one provided by Tommi earlier. We’re currently using a modified version of that one ourselves and it does the job for us, so it should for you as well.

    Good luck with the project (and maybe check your post for errors next time)!

Leave a comment