A New Chapter

     This week has presented the biggest change probably since the release of Mini Solar System; I was offered a full-time position as a junior programmer at Studio 369 which I was happy to accept. I start on Monday and I couldn't be more excited to work with the team there! However, this did mean though that my priorities shifted quite instantaneously. I went from working full-time on "RPG_Game" to preparing for this new job. This mainly meant getting up to speed on networking as that is the one area of Unreal Engine I feel I have a lack of knowledge in (I'm already proficient in UI, AI, gameplay, materials, and general backend work), and since 369's specialty is networking I figured I would come prepared. I did do a little work on "RPG_Game" but it was minimal just to tie up some loose ends.



Unreal's Multiplayer Framework

    As explained by the Unreal Engine documentation, "multiplayer programming [is] inherently more complex than programming for a single-player game", and they're not kidding. Networking alone takes up a large chunk of the engine documentation and is woven into almost every file in the source code. Over this week I dug through what I thought were the most important parts of the documentation as well as many hours of "Inside Unreal" videos, and took notes on them. Here's a sample of those notes:


    I now feel that I have a decent understanding of the theory of making a multiplayer game and I decided to try to apply as much of it as possible. I first fixed up a replication issue with a previous networking coding test I had taken by changing a single line. I then made my own challenge to recreate Unreal's relevancy example with a chest that has a particle effect when opened. Granted, this was quite simple, but I got a better understanding of the concepts I learned in the documentation by doing these small exercises.
    After all this, I feel I am quite well equipped to deal with a codebase of a multiplayer game, but there is one thing that I am still a little unsure about; cheating. I'm not too sure how to design a system to make it as hard as possible for a client to cheat. It was touched on a little in the docs, mainly in the section about client prediction, but nowhere that I saw did it specifically teach about anti-cheats. It's possible that that kind of software is just too low-level, but I would still like to know what I can do to prevent cheating as best as possible.


Wrapping Up RPG_Game

    I only did two notable things over this week on the game, I fixed that freeze when picking up a spell and added an in-game menu to switch between acquired spells.
    The freeze was simply do to using a range-based for loop when deleting the spell which changed size as the loop ran causing an ensure statement to fail. For some reason this didn't outright crash the editor like it usually does which is why i didn't catch it last week when it first started happening.
    The "spell menu" as I've called it resulted in more problems than I was anticipating and didn't get polished off this week like I had hoped. The idea of this menu was heavily inspired by the weapon wheel in DOOM Eternal: its a radial menu, center-left of the screen, that would slow down time when opened and still allow you to move around but not look or interact while it was open. The last part was the hardest to get right. Disallowing certain inputs (looking, interacting, and casting spells) while allowing others (movement, clicking on the menu, and closing the menu) was a nightmare.
    It seemed no matter what I did I could get only some of the conditions met. I was able to keep movement while opening the menu, but it would still allow the player to interact and fire the spell. If I focused the player controller on the widget, then I could have the widget consume those inputs but it would also stop the movement input causing the player to stop dead in their tracks unless they re-pressed the movement keys. I tried to do this system without having to set booleans on the player like bCanInteract and bCanCastSpell, but to be honest the way widget focusing is setup it seems like that might be the only way. 

Comments

Popular posts from this blog

Mini Solar System Postmortem

Polishing the Foundation