For this project, the aim was to make a network-connected simple game, in a similar style to the game « Stardew Valley » using assets from the « SunnySide World » asset pack designed by danieldiggle on Itch.IO, and the Player.IO API to allow multiplayer connection.
The player is able to connect to the game and join other player which he will do interact and move in real-time, and can the cut trees, collect carrots or fight skeletons.
Particular attention was brought to the animations of the interactible items and players. Frames of animations were included in the given assets, but each animator states and transitions were designed by myself. To facilitate the use of the animators in the program code, I programmed a Unity script to have an interface into the animators.
Using these interface scripts, if the animator is formatted correctly, the coder can control the animation states simply by setting a Boolean of the interface to true, and it will trigger the state change if it is possible at that instant (otherwise it will discard the information), as well as know which state the animation is currently in through another set of Booleans.
For each interactible items, I designed as well scripts to allow in a single command to tell the item what to do. For example, it is a matter of a single line to tell a tree that it received a hit from an axe, and it will by itself toggle the right animation, adjust its hitpoints, and if it’s hitpoints reach zero it will also automatically become a stump, and wait a delay to regrow.
This allows very simple instructions to be sent via the network system while the game still being autonomous.
Here are a few extracts from the game to help understand what I’ve said better :
Base Scene before joining the game
2. Animations for Tree Chopping, Player Using Axe, and a Carrot Regrowing
3. All animations for a Skeleton getting hit, dying, and re spawning
Comments