Escape grupp 4 – Light and Collision

My name is Robin Holmgren, and I work in group 4, aka. ”Boring warriors” on the concept ”Escape”.

We choose Escape because we felt it would be the most challenging to make, and most of us felt that we could actually want to play the game after it is done, the Light engine in particular drew our attention.

My primary job in the group so far has been implementing the light engine and some different managers, like Hull manager and Wall manager, as well as being QA for most of the programming artefacts in the project.
My secondary job is making the game cross-plattform, seeing as I use Mac for programming (so I see if the game compiles in both Mac OS and Windows).

We are using the library ”Let There Be Light” for the Light engine, with some modifications. We choose this library because it did what we wanted; limiting vision, soft spread on the edges, cast shadows from objects like walls as well as working well with the noir style we are aiming for the game to have. There were some difficulties implementing it though, it being outdated for the latest SFML as well as being painfully complicated to setup without much (up to date) documentation to go on.

Bild

 

 

 

 

 

 

 

 

I made the Light manager to link to an object, for example the pointer to the player (or the manager itself) or guards, making the light ”belong” to them, so to get the light associated with the particular object, you just have to send in the pointer or adress of the object, and it’ll get the light for you, if it has any.

Similarly, I made the Hull manager to link to shapes, so if you change a shape, you can get the hull by sending in the pointer to the shape (if it has a hull) as well as a load function to load a map (with all the hulls and shapes) directly to the manager.

This recent time I’ve been working on the Collision manager, I’ve made a collision check for the walls vs circles, and circles vs circles (untested but should be working), though it only returns a boolean if it collide or not, it only write out if it collide or not in the console window (bottom right). The walls vs circles go through all the vertices of the shapes in Wall manager, checking if any line penetrates the circle and returns true if it does. this isn’t optimal for very small circles (like those of a bullet might have) that has a high speed, as the circe might skip past the line between the frames (there is a solution for this, but this’ll do for the alpha).

Bild

1 tanke på “Escape grupp 4 – Light and Collision

  1. dfpgaming

    Hello
    I have read and will now comment on your work, real good work if might add. I am supposed to give you more than a good work and tell you what needs improvement and what does not. But I have to tell you I can’t find much to make your blog post better. It’s clear of what you have done this week and what position you have in the group.

    If there is something to improve it would be that you dumb it down a notch, so that those with lesser experience know exactly how you did it. You really nailed it when you explained what you were doing but the deeper understanding in how is lost on me.

    I am not an expert programmer far from it, but taking a small part of your code that you had a problem with and making it a picture. Then explain what part that was the hardest to implement and what you did to get a solution. If there was a webpage involved or credit to a friend it would have been good to know where the answers to your problem came from.

    With that as an exception you have done a really good blog post and finding something to improve on the post is actually hard.
    Keep up the good work.

    Posted by David Ferencz Pizarro.

    Svara

Lämna en kommentar