SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SHIII Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 11-05-26, 01:14 PM   #1
wade88
Swabbie
 
Join Date: Jul 2017
Posts: 10
Downloads: 38
Uploads: 0
Default Exploring AI Decompilation to Target Career Memory Leaks & 64-Bit Optimization

Sinking companions,

Like many of you, I’ve spent years running massive overhauls (like FotRSU / GWX) and hitting the same absolute structural brick walls that have plagued the Silent Hunter engine since 2005. No matter how much we optimize our data files, flatten .dat files, or apply external Large Address Aware (LAA) 4GB patches, we are always held hostage by the un-flushed asset leaks during long career patrols and the dropped-frame calculation bugs under high time compression.

With the community recently discussing the evolution of frontier AI decompilation models—specifically setups utilizing tools like Claude and the Reverse Engineer Anything (REA) pipeline alongside Ghidra—the technology has finally matured to a point where we can realistically transition from "band-aiding" the old compiled executable to natively refactoring it.

I am proposing a structured, highly prioritized open-source hobby project to systematically break down the legacy binaries. The goal is not a massive, immediate rewrite of the entire game, but rather a hyper-focused, three-stage roadmap designed to solve our most critical pain points first.

Priority 1: Eliminating the Career Memory Leaks

Instead of a full engine overhaul, Phase 1 targets only the memory allocation and asset-disposal subsystems. We know the engine fails to safely flush out 100% of dynamic data structures (like particle effects, weather changes, and audio loops) when transitioning between sectors, causing a fragmented heap and an inevitable CTD after several hours.
• The Plan: Isolate the known asset-flushing memory offsets using Ghidra, feed the assembly to an LLM decompiler, and generate clean C++ garbage-collection hooks to force native de-allocation.

Priority 2: Native 64-Bit Migration & x86-64-v4 (AVX-512) Brute Force

Once the memory bugs are solved, we can use automated refactoring scripts to migrate old 32-bit pointers to architecture-agnostic equivalents. This allows us to recompile the engine natively for modern 64-bit operating systems—completely deleting the 4GB RAM ceiling forever.

• The Time Compression Solution: Rewriting the engine for true multi-threading across 8 cores is a multi-year architecture nightmare. However, by compiling the 64-bit source tree explicitly for modern instruction sets via the compiler flag -march=x86-64-v4, we unlock native AVX-512 (SIMD) support. This allows a single CPU core to process up to 16 floating-point vector calculations simultaneously. By brute-forcing the massive math load of ocean wave geometry, vector trajectories, and sensor sweeps, we can drastically reduce calculation times during high time compression without the nightmare of multi-core data synchronization.

Priority 3: Modern Online Multiplayer Integration

With a stable, 64-bit base engine established, the final stage is cutting out the obsolete, brittle Windows DirectPlay network loops entirely. We can leverage AI to write a clean network wrapper that routes packet data through modern UDP socket layers or open-source matchmaking relays, allowing us to hunt in online wolfpacks smoothly over the internet without clunky virtual LAN software or router port-forwarding issues.

This is a massive undertaking, but the tools to start are free, accessible, and running locally. We don't need corporate funding or studios; we just need to lay the initial foundation.

I’d love to hear from any system programmers, reverse-engineers, or veteran modders who have already mapped out specific memory address offsets or crash logs. If we pool our structural knowledge of how this engine behaves, we can stop patching the holes and finally fix the hull.
Good hunting,
Master Gunnery Sergeant Retired Wade
__________________
silent hunter 3/4, cold waters, command: versions, DCS et al, 32 core threadripper 3 128GB ram 8TB of sata flash, 8TB nvme flash, 2 16TB HDD's, a lot more HDD's on the lan.
wade88 is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 05:36 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Copyright © 1995- 2026 Subsim®
"Subsim" is a registered trademark, all rights reserved.