Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where to start? #14

Open
arteeh opened this issue Jan 5, 2023 · 2 comments
Open

Where to start? #14

arteeh opened this issue Jan 5, 2023 · 2 comments

Comments

@arteeh
Copy link

arteeh commented Jan 5, 2023

I'm a little familiar with C++, but getting into F4SE/CommonLib modding seems like wizardry to me. There's pretty much zero tutorials or documentation for any of this (i did find this, but it's been inactive for 7 months and is meant for the Skyrim version).

  • Is the readme up to date? It mentions and old preview of an old version of Visual Studio. Took me a while to figure out i'm apparently supposed to have VS2019 installed while using VS2022 for opening and building the project.
  • Is it expected to get familiar with F4SE before moving on to CommonLib?
  • Is it expected to work with Skyrim's version first? That one does seem to have tutorials.
  • Is it expected to just learn how to use this just by reading the code (and be an experienced modder and C++ programmer / reverse engineer who already knows Bethesda's engine well)?
  • I see the example project has F4SEPlugin_Load, is this the function that F4SE calls?
  • Am I supposed to create my own plugin by forking this full repo, changing the example project and building its dll?
  • What do events like onUpdate look like? Are there simple mods whose code I can read to learn how to do things?
  • @shad0wshayd3 and @powerof3 seem to be actively working on CommonLib, what are they doing? Which fork is currently the most usable?
  • Is there a Discord server where this is all being discussed?
@Ryan-rsm-McKenzie
Copy link
Owner

Hey, thanks for taking an interest in this project. I know it can seem overwhelming at first, I remember how it felt when I was starting out.

  • The readme is not up to date. You should be able to build this project with the latest version of vs2022 community + cmake + vcpkg.
  • I think you'll experience the same difficulties/feeling of being lost if you try to start with f4se instead. If you're comfortable with f4se, then clib won't be much of a leap, but I don't see a point in starting with f4se if you have no experience with reverse engineering. Of course, I wrote this project, so I may be biased ;)
  • You'll find there's a lot more interest in the modding scene for Skyrim over Fallout 4, both from users as well as developers. However, the engine didn't change too much between the 2 releases (apart from rendering), so any knowledge/tutorials should transfer over easily.
  • It can seem absurd to a novice when you see this massive repo full of code with no discernible documentation, or direction as to how to do anything. This is very common for reverse engineering. The vast majority of code you see in the clib folder is recovered from the compiled executable, or exists to aid developers when working with these recovered structures. There exists no documentation for classes, because I don't know what they do; I didn't write those classes. Some engineer at Bethesda did, and I reverse engineered it. You're probably asking yourself "what can I do with this code?", but the better question is "what do I want to do with the game, and what code do I need to hook to accomplish this?" The resources you'll use from clib then will come naturally.
  • This is the moral equivalent to int main. It is important to remember that you're writing a dll that's injected into a running process. You are not in control of the main execution flow, so you must program with an event driven mindset.
  • People have many opinions on how to make clib/f4se based plugins, but that is the example workflow, yes. You may also consider copying only the example plugin folder, and adding clib as a submodule.
  • There is no onUpdate event. The Creation Engine is written in C++, so we reverse engineers don't get niceties like automatic reflection or easy decompilation like you might expect from modding resources for engines written in managed languages (e.g. Stardew Valley, Minecraft, etc.). If you want something done, then you must roll up your programmer socks sleeves and do it yourself. You may look at mods that require the Fallout 4 address library to see if any of them make their source available for learning.
  • Everyone is expected to make a personal fork of commonlib. The Creation Engine is massive and was written by many salaried engineers over many years and contains lots of code. ClibF4 was written by one unpaid nerd over the course of a summer. It does not contain everything you will ever need, nor could it ever feasibly accomplish that. I've simply provided a suitable starting point that you are expected to add to as you develop your own mods.
  • There is some discord server floating around with a lot of people who write mods for bethesda's games. Ask around on the r/skyrimmods discord server, and someone will point you in the right direction. I don't wish to be a part of the modding community anymore, so I don't have a link to it on hand, but don't let that discourage you.

C++ development is hard™ and reverse engineering is hard™, and by combing the two, you get something that's extremely hard™. So hard™ in fact, that it seems a sisyphean task to even build the example project. I understand your struggles, and I'm sorry I haven't put in the work to make it easier for beginners to enter the scene. I remember when I was starting out, and the frustration I felt when reading other people's plugin code that seemed to me like a cross between wizardy and total insanity. It is a steep learning curve to start developing your own plugins, steeper than for other games especially, but it does eventually start to make sense. I have been working on a new project for Creation Engine modding that would hopefully greatly lower the barrier to entry, but until that day comes (sometime between now and the heat death of the universe), we're stuck with subpar tools like this that are functional, but unpleasant to use.

@ootkin
Copy link

ootkin commented Oct 8, 2024

Hey @Ryan-rsm-McKenzie

I hope you're doing well. I wanted to reach out to see if this library is still actively maintained and if it's recommended to use it with the NG version of Fallout 4.

I've been trying to build the library using Visual Studio 2022 and CMake, but I've encountered several issues that I haven't been able to resolve. I was wondering if you might be able to provide any guidance, or perhaps a basic template and step-by-step procedure for setting up and building a simple DLL for Fallout 4 using CommonLibF4. This would be incredibly helpful, especially for those of us just starting with modding for the NG version.

Thank you very much for your time and any help you can offer!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants