Doom Modding

go back / p4p1


Created on Mon. 29 Jan 2024



While completing the certificates like stated in my last blog post I needed to take the edge off from the stress here and there and my Ultimate Entertainment Setup has helped a lot! During those hours I played a unreasonable amount of Doom and Blood and configuring Doom on the setup I have I discovered of gzdoom and the different mods.

I then obviously since my phone spies on me got a lot of recommendations on youtube for doom content and I started watching videos about how doom is coded and how the actual game engine works. Which got me interested in seeing if I could make a mod! Back in the day I used to play around on my jailbroken iphone and I would modify game files directly on ipa's and change textures / sounds to customize my games (I even did a mlg / montage video of this iphone game mikey shorts... Yes back in the day I was a cringy kid like everyone else).

The concept

Basically my main idea for this was I want to play doom but with only the fist weapon just run around and punch demons to oblivion. I also wanted it to be a bit goofy where the demons would fly on hit a little and just die in one hit after the play got a few kills. I didn't want it to be balanced since like who would play this.

Discovering a new language

So after reading a little through the gzdoom wiki I discovered that doom has a few scripting languages for the different section. The main one I will be working with is called zscript. That language is what people use to create new weapons (what we want to do), new / modified enemies, and more. Basically with this scripting language you can edit a few behaviours and a create brand new things for the game. I also saw that before zscript there was an other language but it is basically considered deprecated a lot of the mods I was looking at to inspire myself on how to code this project where using the deprecated language which is a shame.

Now going through this scripting language It is explained through this amazing resource here that is a full tutorial on how to get started from scratch in zscript which is a life saver to get started.

Basics

Now like every programming language I wanted to start with the very basic a simple Hello World program and after some digging in the wiki I discovered this code:

So this specific code is directly ripped from the zdoom wiki and should basically print Hello World on the terminal after a world load. I tried this out for like 30 minutes and I couldn't get it to work for some reason. After going back through the documentation I discovered this line:

Basically I was 1st not understanding the structure of a mod and also I was not actually loading in the function inside of the game since I was missing the MAPINFO file. After more struggling I got this folder architecture up and the Hello World showing.

          
          helloworld/
          ├── hello.zs
          ├── MAPINFO
          └── zscript.zs

          1 directory, 3 files
          
        

Struggles

There is a good reason why I am a penetration tester and a game dev. First is I don't really like making games they take so long to compile test and make. The algorithm and math involvement of games is not my cup of tea that is why I don't work in crypto in infosec. I did try making games here and there and I really didn't like it for the exception of one that I might cover in this blog at some point (Can be found on my github here) So to build the mod it was actually quite a struggle first understanding how the weapons are made and such is quite more involved than I thought and the replacement is not always there. One of the things I learned in software dev was that I always figured out faster how things worked if I just reversed engineered them for some reason.

So inside of gzdoom there is a gzdoom.pk3 archive where a lot of the weapons are just defined from that I can at least understand how the default fists work. A pk3 file is basically a doom mod pk3's are just .zip file you just have to rename pk3 to zip and vice versa ^^. A lot of the source is also text files which allows for great reverse engineering capabilities since everything is just there for you to read. Now trying to replace the fist using the zscript builtin inheritance and replace keyword was not really working for me and I just got frustrated after doing it for two days so I went on the gzdoom discord... The fists where not loading in game I spammed console.printf everywhere to see what was wrong but nothing was loading why...

Freedoom

So I dropped a message on the gzdoom discord and in one quick sweep after explaining what resources I was using and what problems I was facing this person answered explaining that the Fist are actually a special kind of weapon in the game and you can't just quickly replace them you need to actually make a custom one and then add it to the doom guy loadout before the game starts.

Honestly this mad lad after chatting a bit told me he was the one that wrote the wiki I was reading and that is crazy cool to me since that wiki really is amazing in how it details everything. I am a lazy bastard so I quickly ran into the coding bit but I can appreciate good documentation when I see it.

Gameplay

Now for a change of pace since this blog is always so technical lets all collectively take a chill pill and you can enjoy this video of unedited footage of me playing this mod ^^


Thank you all for reading this new kinda funny blog post to make. Follow me on twitter to see new updates on this blog and hopefully this has inspired you on trying new stuff out. You can also sponsor me if you like my work over on github.

p3ng0s
arch linux iso

A linux distribution with my entire config pre-installed. Great for learning linux and pentesting with a steep learning curve.

wiki | repo
Questions / Feedback
For any questions or feedback you can contact me on LinkedIn or twitter / X. I also use twitter as a platform to update on new posts!
Donate
sponsor me image

If you like the content of my website you can help me out by donating through my github sponsors page.