Skip to content

Latest commit

 

History

History
22 lines (11 loc) · 1.11 KB

File metadata and controls

22 lines (11 loc) · 1.11 KB

10. Bytecode

What if other people want to help you with your game, but these people have no coding skillz. A solution is to invent a simpler programming language everyone can learn, and then you integrate it with your game.

How to implement?

The programmers with no skillz write their code in a .txt-file. You read that file, loop through each row, and then use a switch statement to translate the code from your programming language to C#.

When is it useful?

  • To add modding support.

  • To avoid hard-coded behaviour.

  • To handle cutscenes and dialogue systems. Scripted sequences or dialogue interactions can be expressed in bytecode, allowing for easier management and execution of these sequences during gameplay.

  • To manage and execute the conditions and actions required to unlock achievements or track player progress.

  • I was watching this video on Quake 3. Apparently John Carmack decided to use the Bytecode pattern to isolate the game logic from the engine. If people can't access the game engine how they want, they can't hack it to cheat!