Monday, March 3, 2014

Project Aurora, post 8, Solving problems

Last week I still had problems with light circles overlapping so I booked a private time with my teacher Tommi to see if he could help me solve this problem. We sat down and I explained the problem to him. I wanted to get rid of the black border when two lightcircles overlap. (See picture) 


He came up with a solution where I could try using sf::Image to manipulate the pixels to get rid of the borders. It sounded like a good idea. I was about to get started and Tommi about to leave when I asked if maybe sf::BlendMode could be used. We checked what kind of blendmodes SFML had and he told me to try BlendMultiply and it worked great! 
It  saved me atleast a days work.


(the light is not centered around the player for testing)

Another thing happened today when I sat with my groupmate Oscar and the problems he had with getting collisions to work. He had som collision check code that worked perfectly in a prototype but for some reason it didn't work in our project. I looked at it and it looked good and because the collision behaved so strange I told him to try to limit the collision area by adding more walls just to try to narrow the problem down. Something I have learned with many days of problems with my light circle. He tried it and we figured out what the problem was within 5 minutes.

Conclusion:
Bouncing Idea's with people really help getting to a solution when the solution is unknown.

1 comment:

  1. Heya!

    Great work on fixing the light system, it looks really neat as well! Good thing you managed to help out with the collision as well, sharing ideas is indeed a great tool in programming.
    You explain what the problem was and how you solved it well. However, later in the post you mentioned that you've been trying to solve this problem your-self for a while and it would have been interesting to know what you've been doing, at least hints to what theories you've been trying out. The solution to the problem was fairly simple and it would have been fun to read of other methods you could have been doing the same thing with, like the sf::Image manipulating pixel solution.

    Well, that's all I had to say. Great job and good luck in the future!

    ReplyDelete