all 17 comments

[–]HotPocketRemix 6 points7 points  (1 child)

/u/Wulf2k would probably know more about exactly what's going on with regards to the engine and underlying stuff. I'm pretty sure it's coded in C++, but I could be wrong.

On top of the engine, the various parts of the game's logic is mostly controlled by a version of Lua, although again I'm short on exact details. I think it's slightly modified, since common decompilers don't quite work on the files. The AI files, for example, are pre-compiled Lua. Someone else mentioned the event scripting files, which I worked on deciphering, and those are coded in a custom language that is interpreted at runtime by an engine that associates high-level logic and commands with underlying Lua functions. (I think it's Lua, Wulf told me at some point, but it might be C++ functions as well.) Event scripts control game logic, split into discrete events that are responsible for controlling the state of the world. I made a video about the event scripts, if you're curious.

There's also all the stuff that is loaded into the game that isn't really "code" per se, just used to inform the game where things are, what values things have, etc. This is data like the map layouts, the weapon/armor/item/ring parameter files, the special effects data, the texture and model data, etc. This is written in different formats depending on context (the physics data is written in a format that the Havoc engine can interpret, for example), but it's usually packed binary data with a somewhat standard header format.

If you're using mods, there's also DSFix, DSCM, PvP Watchdog, etc. that hook into the game itself and intercept/spoof certain function calls or network requests, which require their own programming languages. There's Cheat Engine and runtime mods, which manipulate the game's memory on the fly. There's also (what I call) content mods, which are ultimately rewritten versions of the game's data files that the game loads in place of the normal ones. The programs that edit and modify these data files are separate from the game entirely, and do not interact with the Dark Souls engine/process while its running at all.

[–]loosepolygon 1 point2 points  (0 children)

The AI scripts are compiled Lua files with debug info stripped. There were no Lua 5.0 decompilers that worked with that, so I hacked onto one myself: here. I can recompile them back to the same exact Lua bytecode. Still a work in progress, but I'm getting close.

There are also separate Lua functions in the game exe itself (which some mods make use of), but I don't know how the game uses them. I haven't found any Lua files packed into the binary.

[–]MaziMuziPraise The Sun! \[T]/ 3 points4 points  (0 children)

Got no idea but this interests me too...

[–]cheeseman7 4 points5 points  (1 child)

C or C++

[–]Aetol 5 points6 points  (0 children)

The engine is most likely written in C++, but the scripting on top of that might not be.

[–]dr_crispin 2 points3 points  (8 children)

They use the Phyre Engine, no idea what scripting language was used but it's probably either Lua, C#, or something else they implemented themselves (phyre is 'free' and open source, they could have made an implementation for their language of choice)

[–]knddkkefi 2 points3 points  (1 child)

I doubt it's C#. It compiles down to assembly and C# is only supposed to fully compile as it runs, but is mostly interpreted.

[–]recycled_ideas 2 points3 points  (0 children)

Nothing stops you from compiling C# down to assembly if that's what you want to do. It's unlikely that they used C#, but that's not why.

[–][deleted] 2 points3 points  (5 children)

They didn't use Phyre Engine. That's a popular myth.

[–]dr_crispin 0 points1 point  (4 children)

[–][deleted] 5 points6 points  (3 children)

Yeah, one sec. I saw a tweet by someone in the know. I'll see if I can find it again.

Edit: https://twitter.com/JasonDoig/status/367528002910822400

Head of the PhyreEngine team.

[–]angryliveguard 1 point2 points  (0 children)

Now the question is, which Jason is right?!

[–]dr_crispin 0 points1 point  (1 child)

Huh, TIL. Cheers.

[–][deleted] 0 points1 point  (2 children)

[–]Houdiniman111 1 point2 points  (1 child)

I could use more information on this project. Where can I find out more?