Devlog 3
This is the third devlog, where the topic Enemies / Interaction / Puzzles will be covered.
Not a whole lot was done this week compared to last week as the main focus was getting the multiplayer section to work. However, before doing that I had to fix the lasier. I did this by using a coroutine that ends after 1 second or so. The coroutine disables, then re-enables the line renderer component, which means the laser disappears, but can come back when fired next. The only problem with this, is if the lasier is spammed, it can get a little glitchy due to the coroutine.
Figure 1: Showcase of the lasier turning off as well as it glitching.
P1 (sandbox) mode:
I wanted to finish the p1 section to make it feel more polished and finished. So I added one last puzzle at the end as well as a 'finish' to the level. There are also various nooks and crannies that can be reached as the different characters. These spots, as well as anything else in the p1 level, are mostly just bonuses, it's not intended for you to do any of it, it's more just a place to mess around with the 3 characters. Even though it is finished, it's currently impossible to reach the end as all 3 characters, due to the reason you can't yet turn around as the white character.
Figure 2: The now finished p1 sandbox level.
Main menu creation:
Before starting work on the multiplayer gamemode, I needed to make a main menu in order for the player to choose between the single player or the multiplayer mode. Because I have not yet started the graphics, I just threw together a basic menu.
Figure 3: There's no I in teiam main menu, first edition.
Figure 4: Gamemode picker menu (yes the back button works)
Main game:
The main aspect of this game will be the multiplayer gamemode. This should hopefully give the best experience, at least compared to the single player gamemode. For now it'll just be 2 player, but if I have time once I'm finished I might add a third or fourth player (and an option to choose how many players are playing). The first thing I needed to do was create a character selection screen. However, because I'm really lazy (and because it ended up pretty cool) I decided to not create a seperate sene or screen for character selection, instead it takes place within the first level. This not only makes it easier for me to make, but it also gives the player a chance to feel how their character works within the box I confined them to.
Figure 5: Character selection screen
The buttons used to be better lined up, but because of how the ui works with the camera changing, they kinda just float under the respective player. The boxes that the players are trapped in disappear once both players are ready.
How the character selection screen works:
As stated earlier, it's not really a screen as it's inside the first level. The player has the ability to cycle through the 3 different characters by pressing either the right or the left arrows. Pressing the right arrow increases an integer value, and the left arrow decreases. The integer value starts at 0, which means the red character is selected. 1 means the purple character is selected and 2 means the white character. If the integer value reaches 3, then the value is set to 0. If the value reaches -1, it's set to 2, thus making it loop around. Unlike the single player mode, the multiplayer mode uses prefabs of the characters allowing for multiple instances of them, which is how multiple players can have the same character. When a clone of the prefab is created, it's assigned the proper key binds for the player (which required a slightly different script for the second player as they use different controls), as well as assigning that character to the camera tracking list.
First multiplayer level and controls:
The controls for multiplayer needed to be different to single player. However, it does explain the weird lasier controls in single player too. I needed to design controls that fit in just the 4 buttons, wasd / ijkl, as this makes it the same for both players. This means I can't have the lasier controlled by the mouse, or even use the space bar for anything. So w/i is the jump button, a/j moves left, l/d moves right. For the lasier, it's the same as single player, except with w and a. If more players are to be added, either more buttons on the keyboard need to be added such as tfgh or [;'return (which just doesn't work with 4 hands on the keyboard) or some sort of controller support. The first level itself is designed to showcase the chosen character's movement without any danger. There's no way to die in this level (except to the lasier) so the steaks are low. There's also a showcase of the burnable blocks, and the purple characters ability to move through mist (don't worry the other characters can't access that area (I know you were shivering your timbers)). For now, there is no text or any sort of instructions in game which makes this level randomly long at times. But this is because text will be added explaining controls and things.
Figure 6: Showcase of all of level 1.
Making the doorway to level 2 (and making level 2):
At this point, the hardest part of multiplayer was getting the character selection screen thingy to work. However, I would face an even tougher challenge when trying to get the characters to switch between scenes. This is also where the implementation of the topic for this week comes in. Although most of the interaction has already been created, the hardest interaction has yet to be made. At first it seemed simple enough to keep the characters when moving to level 2. However, because this is multiplayer, and that each player can choose their character, instead of just setting up the players in the next level, I had to save data on which character, each player was. When both readys are pressed, an invisible collider2d checks to see what characters there are. It saves data on the character in the left THEN the character of the right (yes that's important). Firstly, it checks if the game object inside it has the tag 'player'. Secondly, because unity only allows 1 tag per game object (and yes I could just change each characters tag to their own unique tag, then change a bunch of code to include all 3 characters tags but instead:) I created a new component on each character with a script that has a single line of code, which is a boolean saying that this character is character 1 (or 2 or 3). So, if the game object has the tag 'player', and has the character's unique component, a string is saved to a static array (static means that the data can be transferred across multiple scenes). The first item in the array is p1 and the second item is p2.
Ok actually making the doorway:
The doorway is at the end of the level, as seen in figure 6. It's just a simple hexagon with its very own poly collider 2d set to trigger. Once both players are inside the hitbox (it uses the same logic as the checkpoints btw) it will activate the next scene, level2.
Ok actually making level 2:
Level2, for now, is a very simple single platform. I had planned to actually make level 2, but getting the multiplayer aspect to work properly took a lot longer than expected to work out, and I was too busy getting distracted by things. Once level 2 is loaded, however, an invisible gameobject reads the static data array of strings. Depending on which string is saved (eg 'char1') it will summon a clone of that character for player1, then do the same for player2. Then the characters decided to render themselves behind the background somehow so I spent a while trying to fix that (it ended ups being a problem with the camera btw).
Figure 7: Level 2 in all its glory
All this was done in time to show the class for feedback.
Feedback:
This time I received a lot more feedback than previously. I got feedback that the controls for the lasier felt a bit awkward, which I do agree with. This led me to think that I could use e/o as a fire button instead of 2 buttons. Also I received feedback saying how the camera felt too zoomed in. Because I haven't experienced the game solely in play mode, I never realised how zoomed in the camera felt, I would have to zoom it out a little, especially in order for the player to read any text on screen. More advice I got was on how there should be a cooldown on the lasier in order to prevent it from being spammed. I hadn't actually thought of this before, but I do agree that this would be a good idea. Other feedback I got involved saying how the level felt empty, which is ok because I am yet to add text, and that having the ability to ride on each other's heads should be a mechanic. It's not vital to the game at all, so if I were to add the ability to ride on each other's heads I would do that at the end, but I might not do that at all because it could lead to some interesting level design. Also, without it, it makes the red characters (not yet implemented) ability to pick a things more helpful / annoying to other players as the red character could pick up other characters. Lastly, other feedback said how the lasier mechanic was interesting, the camera felt good and overall positive feedback regarding the multiplayer and character selection aspect.
Closing thoughts:
That was all I did this week, which wasn't a lot quantity wise, but with multiplayer (pretty much) finished, I should be able to make content a lot faster. I also didn't spend a lot of time on the game this week, as I was focusing on other things (primarily procrastination lol). My plans for next week include implementing people's feedback, specifically on the camera and lasier. As well as finally doing graphics for the game (don't get your hopes up too much as I'm not an artist lol). I realised I haven't included many gifs and I can't be bothered going back to change anything, so here's proof of multiplayer working:
Figure 8: Selecting the white character as p1 and the purple character as p2
Figure 9: Proof that when switching scenes, the same characters are kept as the same players.
Files
There's no I in teiam
Status | In development |
Author | Dinorexisthebest |
Genre | Platformer |
More posts
- Devlog 43 days ago
- Devlog 218 days ago
- Devlog 124 days ago
- Game concept devlog41 days ago
Leave a comment
Log in with itch.io to leave a comment.