I think it is time for a status update on what I am working on.
I have had two bigger problems thus far in this project. The first one is about our physic. It was apparent early that Unity’s own 2D physic did not work so well for us. Because of how we want the magnetism to work and that things in the environment should be able to knock you around a bit, we could not just set the players and the objects velocity directly. So instead we tried to add a force instead, but the problem with that approach was that it felt that the player was gliding around on ice; it took a while before the character came to a stop. Neither of those approaches seemed to work so well for us.
I tried to change the physics material on the players and on the ground, changing its friction to try and work it out. If I had low friction the “ice-skating” was horrible. If I turned it up it felt sluggish to get momentum, it took too long before the character got up to its maximum speed.
When I could not get it to work with the Unity’s own physics I decided to try to write my own simple physics. After some trial and error I thought I had gotten in as we wanted it. There was almost no more sluggishness or slipping around.
Now, the only problem was the boxes the players could throw around were behaving very strange if thrown into the air. They lost all their momentum on the x-axis after just half a second even if it took it more than a second to get back to the ground. This meant that if anyone threw a box in a 45 degrees angle it would, almost instantaneous move to a much steeper angle and going almost straight up before losing y-axis momentum and coming straight down again.
To do this I made a couple of exceptions in the physics. Instead of treating everything the same, no matter what was happening I changed so that if something did not touch anything else, it would not lose any x-momentum. This gave the box-throwing a much nicer arc while still making sure that they came to a quick stop when they touch ground.
Another exception I had to do, in response to the exception above was to only apply that exception on the object if it was not a player. Otherwise the player would have a hard time controlling its character in air, and that would make it very frustrating for the player because we want the player to have much control while in the air.
Alpha version of Scrap Pirates. Some placeholders still there, most notably the doors and the healthbars
The second big problem I have had is something else entirely. It has to do with “parallaxing” the content of windows on the ship. It is very frustrating and hopefully I will find a solution soon, or else we will have to go with something easier.
The window problem has to do with that we want to give a depth to a room seen through one of the ships indoor windows by having multiple parallaxes. For example: We want a window where the back wall is slowly scrolling, then a couple of pipes scrolling in another speed and yet another layer with more pipes or something else, everything scrolling when the camera moves and at different speeds. I have tried to only scroll the Texture and not having to use multiple Quads, but so far I have not been able to make it look good. Hopefully I will come up with a solution soon; otherwise we will have to rethink if we can do it without having multiple layers of parallaxes.
Bye. It is back to work for me now.