Building the Foundation

    This week's sprint had me shifting to working entirely on the new project. However, I'm not yet doing the exciting gameplay but instead I am polishing the less fun, but vitally important, foundation of the game. This means menus, settings, loading screens and anything else that will be needed for a video game.



The Main Menu

    Ultimately, there isn't too much to share, I mean, it's just a menu; the vast majority of games have one and most are forgettable. So, to avoid doing what I've done at least half a dozen of times before I decided to make a scrolling menu. I was thinking that from the main menu, hitting settings would scroll down and below that would be credits and so on.
    I started approaching this with the widget switcher. I planned to animate the transition between menus but there wasn't any built in support for it so to avoid wasting time I moved on (In hindsight, it wouldn't be that difficult to do but would take time to implement so I'm still thinking about it as an alternative if my other option isn't well received). So instead of the widget switcher I turned to the humble scroll box. I disabled all user input to the scroll box and took away the scroll bar visual. I was then able to use the scroll box method ScrollWidgetIntoWiew() to go between menus. The only problem was that when I tested it, the scrolling animation was way too fast. When I couldn't find any way to change the speed in-editor I dove into the engine's source to do it myself.
    After a little digging and two engine rebuilds I got it working. All it required was changing one hardcoded 15 into a variable, which makes me wonder why it isn't a default feature of the engine. I guess because adding that one variable required adding four functions (two getters and two setters), two variables, and a macro due to the way the engine is structured. Once that was done I was able to reduce the animation speed from 15 to 2.5 and it was much more comfortable to watch.

    Now came the issue of getting this change to other team members. To do this was as simple as making a fork of the engine, applying the changes to the forked version, and making it available to anyone who needed access. Now I can make changes to the engine's source and be sure that everyone else will have the same version as mine.


The Settings

    Because we want this game's quality and performance to be scalable, we needed quality settings. Luckily this was super simple and only took me an afternoon to implement thanks to Unreal's game user settings. There are settings for every scalable value that are saved between play sessions, and defaults can be changed in the BaseScalability.ini config file. There is even the ability to benchmark the user's GPU and apply recommended settings but I haven't done that yet. The only settings I did were for colorblindness, display settings (full-screen mode and resolution), and the base quality settings (anti-aliasing, shadows, view distance, etc.).


The Loading Screen

    Again, a super simple job that mainly required porting my loading screen module from my last project to this one. The hardest part was just getting the project to accept C++ source files as it was created as a blueprint project, and that didn't take long at all. As it stands right now, the loading screen works, but I want to be able to dismiss it on a button press. The problem is that it isn't recognizing the level as being finished loading yet. I know that Epic changed how levels and level streaming works in UE5 and I suspect my problem has something to do with that. This will probably be fixed in the first few hours on Monday, then I can move on to a pause menu and a spell wheel!

Comments

Popular posts from this blog

Mini Solar System Postmortem

A New Chapter

Polishing the Foundation