DevLog 02

Level editor and Main menu.

Michael Schöffel

September 30, 20245 min. read

Reworking Roadmap

Last week, when implementing the main menu, I realized that my previous roadmap didn't fit my workflow that well. Before I can put a player in the scene, I first need a level. So I moved the tasks that have to do with levels further up the roadmap and the tasks that have to do with characters, saving, or multiplayer further back.

Main Menu

I took the time to continue working on the main menu. First of all, I redesigned the entire menu visually and instead of the pixel graphics, I decided to use a background image with “glass-like” buttons. I also created the settings menu. But this is where the problems started. I made the UI in Unity with the newly integrated UI Toolkit. This is intended for developers who have a background in web development. XML-like elements are placed and styled by properties. The properties of the elements can then be customized using stylesheets and classes. Very similar to HTML and CSS. But the whole UI toolkit is very rudimentary. The toolkit should be just right for me with more than 8 years of experience in web development. Still, it is enormously slimmed down compared to HTML and CSS and many important functions are missing or can only be implemented with workarounds. The simplest example is the styling of the drop-down. Here it is not possible to visually adapt the field to the other UI elements. The focus state does not work properly and is overwritten by Unity itself, the background of the hover element in the selection menu cannot be customized and the documentation is almost useless. The situation is similar for the simplest input elements such as checkboxes or sliders. Overall, the UI Toolkit is a clear deterioration compared to HTML and CSS. For this reason, I have left the menu as it is for the time being and will only make the visual fine-tuning once the UI Toolkit has been further revised and is more mature. For now, however, it is completely sufficient. The main point with the language selection also works. The available languages are listed in the drop-down menu and can then be selected. The selection also changes all elements and the language of the game.

Level Editor

After the menu, I started to create a level editor in Unity. This should make it easier for me to design the individual levels of the game. Later, in addition to the procedurally generated levels, there will also be levels with self-created layouts. The level editor is a great help for this. In Unity, this can be implemented very nicely and easily. First, a data structure is created that maps and persists the structure in the level editor. This can later be used to generate the actual level. This structure contains the typical elements for mapping the data structure of a graph. Node classes for rooms, a class for the room types and connections, and an editor class for the editor itself. In the editor, it is then possible to add rooms, select their type, and connect them. Nice-to-have functions such as validations, drag & drop and the deletion of rooms and connections have also been added. I am very happy with the editor. If more complex rooms or structures are possible later, I can simply add them to the editor. Unfortunately, loops, for example, are not yet possible. This will change in the future but is not important for the current status. Here are two pictures of the editor. You can see how rooms can be created and connected to create a dungeon.

The upcoming week

Next week I'll get to work on the main scene for the game. I'm also trying to generate the first rooms so that small, medium, and large rooms can be created from tilemaps.

Further posts

Contact me

Contact me

You got questions or want to get in touch with me?

Name
Michael Schöffel
Phone number
Mobile number on request
Location
Germany, exact location on request
Email
[email protected]

Send me a message

* By clicking the 'Submit' button you agree to a necessary bot analysis by Google reCAPTCHA. Cookies are set and the usage behavior is evaluated. Otherwise please send me an email directly. The following terms of Google apply: Privacy Policy & Terms of Service.

Max. 500 characters