DEV Community

Cover image for Hacktoberfest #1 - Skyrim Community Shaders
Roy J. Wignarajah
Roy J. Wignarajah

Posted on • Updated on

Hacktoberfest #1 - Skyrim Community Shaders

Links Mentioned

Project Issue: https://github.com/doodlum/skyrim-community-shaders/issues/87
Project Pull Request: https://github.com/doodlum/skyrim-community-shaders/pull/119
Draft Release Workflow: https://github.com/rjwignar/skyrim-community-shaders/actions/runs/6426477319
Published Draft Release: https://github.com/rjwignar/skyrim-community-shaders/releases/tag/issue-87

Hacktoberfest

For my open-source class, we are participating in DigitalOcean's Hacktoberfest, a month-long event every October in which developers around the world are encouraged to contribute to open-source projects. Hacktoberfest and our course require us to make four (4) contributions to different open-source projects during October.

Skyrim

The Elder Scrolls V: Skyrim (commonly called Skyrim) is a popular role-playing video game by Bethesda Softworks, which has won many Game of the Year awards since being released in late 2011.

Skyrim Mods and Skyrim Community Shaders

This game holds a special place in my heart, as I played it extensively on the PlayStation 3 throughout high school. However, the game was and is more popular on PC, where players can download and install mods that provide new weapons and improved graphics. Many Skyrim mods are built on top of the Skyrim Script Extender (SKSE), a tool that expands scripting capabilities and allows modders to (relatively) easily add new features to the game.

One such mod is Skyrim Community Shaders, an SKSE plugin that provides advanced graphics modifications to the game.
Based on the GitHub project's star count, it may not seem like a popular mod. However, looking at the mod page on Nexus Mods shows it is fairly popular, with almost 100,000 users.
Image description

My contribution and Text-Wrapping

For my first Hacktoberfest contribution, I was searching for issues with simple solutions or solutions already suggested. Working on issues like this allows me to gain confidence working on a project and allows me to become familiar with the codebase.
In Skyrim Community Shaders, I worked on a code enhancement issue: https://github.com/doodlum/skyrim-community-shaders/issues/87.

Skyrim Community Shaders uses Dear ImGui, a graphical user interface (GUI) library for C++, for menus and tooltips. The issue I worked on involves the multiline handling of the Dear ImGui method that displays text on the menu GUI, ImGui::Text(). The menu module implementation, Menu.cpp handled some multiline tooltips by using consecutive calls of ImGui::Text(), which could break text wrapping depending on window size. This could be corrected by combining these strings into one ImGui::Text()call to preserve word wrapping.

For example,

ImGui::Text("This is one sentence.");
ImGui::Text("This is another sentence.");
Enter fullscreen mode Exit fullscreen mode

Could be combined into the following:

ImGui::Text(
    "This is one sentence. "
    "This is another sentence.");
Enter fullscreen mode Exit fullscreen mode

To preserve word wrapping, an extra space is required at the end of each period (except in the last sentence where it's optional).

To make my changes, I had to read a bit on Dear ImGui and study how the ImGui::Text() method is used in Menu.cpp. After doing this I was able to make my changes. In my pull request, I converted a few menu tooltips using the first multiline handling method to the second one.

My first contribution 'in the wild'

In the past month, my classmates and I gained 'open source' experience by developing and contributing to each others' projects. However, Hacktoberfest would be my first time contributing to projects "in the wild", or outside the classroom. Because of this I was initially intimidated and worried about having my work vulnerable to criticism and rejection. But my fears were dispelled when I started working on this issue.

Difficulties

One setup I had was I was unable to test the changes myself. Testing the changes required having Skyrim installed on my machine and having Skyrim Community Shaders installed, which just wasn't possible at the time because I hadn't purchased Skyrim for PC.

Luckily, after consulting with the maintainers I learned they created a GitHub Actions workflow that creates a draft GitHub release on my fork. After running this workflow and publishing the draft release, the maintainers were able to test the build with my changes and approve them.

Although I was unable to test the changes myself, I found it appropriate to attempt this issue because my changes were limited to one file, and focused on enhancing text display. However, I think in future contributions I may not be as lucky, and I should probably be able to test future projects I contribute to.

You get back the energy you put in

When starting this course I was taught that in Open Source development, you get back the energy you put in. The amount of interest and enthusiasm you put into working on a project will be returned in kind. This couldn't have been more true when working on Skyrim Community Shaders. The maintainers I worked with were welcoming and eager to work with me on how they wanted the issue solved and to test my changes. The questions I asked in the Issue and Pull Request returned answers that gave me more knowledge about the codebase. For example, consulting with them on the issue Working with them helped me learn about Dear ImGui, Draft Releases, and a bit of the GitHub Actions workflows they've made. After working with them on this issue, I was offered the chance to apply these changes to other multiline tooltips in the project, which I agreed to do throughout the month. I think applying these changes to the rest of the project would be a good opportunity for me to learn more about the codebase and learn how a medium-large C++ project can be designed and maintained.

Top comments (0)