#obvious second prototyping is one of the brobot prototypes
Explore tagged Tumblr posts
Text
solo sprited hal would have been a little fucked up if im being honest. nothing like being an crazy villain or anything, more like a fucked up kid who is now kind of realizing everything at once.
#d talks#obvious second prototyping is one of the brobot prototypes#disastrous choice is he fuses with dirk in a fit of rage and they promptly explode
27 notes
·
View notes
Text
Week 3
27/07/2021 Tuesday
Mantle Movement
Today I implemented movement onto the mantled platform. Firstly, I needed to find the height of the object the player is mantling onto. Last week I made a variable that finds the height of mantled game objects, I added an extra 2f to this height variable so that I could use it for the players new y position. From there I needed to move the player onto the object, to do this I made a variable that takes the forward direction of the player. This variable is then used in a function that moves the player for 0.1 seconds. This gives a nice quick mantle movement.
I found that the player needs to stop rotating towards the object before I move them on top of it. This is because the player would no longer be colliding with the object that the player is turning towards, making the player continuously turn. To fix this issue, I created a check that would only allow the player to move once they have rotated towards their desired position.
An issue has occurred, the player will rotate at inconsistent times. This is an issue with the function I’m using to rotate the player. The closer the player gets to reaching its desired value the smaller the rotation becomes. This becomes obvious when one mantle takes 1 second while another can take around 6 seconds. For now, the movement does work but I will need to fix this issue later.
28/07/2021 Wednesday
Repeatable Mantle
I spent today working on my mantle system. Currently, the player is stuck after they are rotated and moved. So, I prioritised making the player transition back into normal movement and making the mantle a repeatable process.
My mantle system disables movement and enables my mantle movement code when the player is not on the ground and has collided with a mountable surface. To re-enable this movement code, I created a Boolean that I will refer to as ‘mountedWall’. When ‘mountedWall’ is set to false it allows the player to collide with mountable surfaces, this would then transition it into mantle movement. After this movement is completed ‘mountedWall’ is set to true. This stops the player from mounting onto objects and re-enables the movement code.
With this base setup, I next had to make the mantle reset. To do this I had to set the ‘mountedWall’ Boolean back to false. I also had to reset certain variables in my mantle code otherwise it would not work as intended. To do this I made it so that when ‘mountedWall’ is set to true those certain values would all be reset. Then after a set time ‘mountedWall’ would also be reset back to false.
While I was working on this Ashton and Matt got the following feedback for some new Brobot designs.
Images of design data:
30/07/2021 Friday
Mantle Orientation
Today I fixed the mantle orientation issue. I started off our call by chatting with Matt about my mantling system. While walking him through my code we found that the object I was using to get the rotation for the player was changing while the player rotated. This was because it was parented to the player.
I tested the mantle with an object that wasn't parented to the player, this reduced the frequency of its position changing but didn’t completely stop it. I found that I had basically let the ‘new rotation’ variable call repeatedly causing it to change throughout the rotation. To fix this I moved the variable into a function that only allowed it to be called once upon mantling. This stopped the position from changing but the speed at which the player rotated was still inconsistent. This had something to do with the function I was using to rotate the player. When looking it up online people recommended against using this function. Due to this I just made it so the player would instantly rotate towards the object with no time delay. This fixed the player rotating at different speeds.
The last thing I did for the mantle was to edit the length of it. I did some testing to find a length that I thought was appropriate. This was to give a one-second delay after the player rotates towards the platform and has moved up to the edge of it. After this delay, it will move the player on top of the platform.
Gif for final mantle:
Coyote Time Fix
While testing my mantle system I found that my coyote time function was not working. This coyote time function basically gives the player point one of a second to jump off a platform after leaving it. The reason I added this is because it is a common addition to most platforming games and is basically a necessity to make your movement feel smooth and responsive.
In my jumping code, I had created a checker that basically says if the player is on the ground, is pressing the jump button and if coyote time equals greater than 0 the player can jump. Coyote time would countdown while the player is in the air then reset back to 0.1 when they touched the ground. I thought this would allow for the player to have that small window when leaving objects. However, when looking back at my code I found that coyote time was never being used because it also required that the player was on the ground. I fixed this by making it optional so that it would be if the player is on the ground or if coyote time was greater than 0. this fixed the issue and it's already made the movement feel a lot more responsive.
31/07/2021 Saturday
Magnet Prototype
Today I decided to create a test for the magnet system. I created this on a new game object because I didn't want to deal with editing the BroBot movement code just yet. I started by creating 4 states Off, On, Positive, and Negative. By default, the system is set to Off. I am using a float value that I have assigned to the right trigger on a controller, this value changes the system's states between Off and On.
When the system is set to On the Positive or Negative states are then activated. By default, the Positive state is set but this can be changed by a Boolean which has been assigned to the X/Square button on a controller. This Boolean like the trigger float changes the states between Positive and Negative.
The next thing I did was create a raycast checker. What this does is create an invisible line from the front of the object the script is on for a specified length. This checker returns true when the line interacts with objects that I've set to be on the magnetizable layer. I created two-sphere game objects in my testing scene, I made one have the magnetic script (call this “player”) and the other I set to be magnetizable (call this “magnet”). From there I just did some testing to make sure the raycast accurately collided with the magnet. I next created code to get the position of the magnet object through my raycast checker.
From there I made code that would move the magnet towards the player when hit by the raycast. This code would be called in the Positive state. I then made code for the Negative state. To do this I made a value that would be positioned at the very end of the raycast line and made the magnet move towards that instead of the player.
The last thing I did was creates surfaces that would magnetize the player. I started by creating two tags that the magnetic objects could have. “Small” was assigned to objects that would be moved by the player. “Large” was assigned to objects that would move the player. From there I created a checker in my code to get the tag of the game object the raycast collided with. If the tag was “Small” the movement I had previously explained would take place. If the tag was “Large” some new movement would happen. This new movement would move the player to the position of the magnet when in the Positive state. When this was in the Negative state, the player would move to the end of a raycast going in the opposite direction of the normal raycast. This basically gave the effect of the player being repelled from the object.
Gif for magnet test:
0 notes