Loading Game Code Dynamically
?
?

Keyboard Navigation

Global Keys

[, < / ], > Jump to previous / next episode
W, K, P / S, J, N Jump to previous / next timestamp
t / T Toggle theatre / SUPERtheatre mode
V Revert filter to original state Y Select link (requires manual Ctrl-c)

Menu toggling

q Quotes r References f Filter y Link c Credits

In-Menu and Index Controls

a
w
s
d
h j k l


Esc Close menu / unfocus timestamp

Quotes and References Menus and Index

Enter Jump to timestamp

Quotes, References and Credits Menus

o Open URL (in new tab)

Filter Menu

x, Space Toggle category and focus next
X, ShiftSpace Toggle category and focus previous
v Invert topics / media as per focus

Filter and Link Menus

z Toggle filter / linking mode

Credits Menu

Enter Open URL (in new tab)
1:29Intro to the episode
1:29Intro to the episode
1:29Intro to the episode
3:06About implementing and using a scripting languages
3:06About implementing and using a scripting languages
3:06About implementing and using a scripting languages
6:15Benefits of loading game code dynamically
6:15Benefits of loading game code dynamically
6:15Benefits of loading game code dynamically
8:29Starting on dynamic code loading
8:29Starting on dynamic code loading
8:29Starting on dynamic code loading
11:38Separating platform and game code to different translation units
11:38Separating platform and game code to different translation units
11:38Separating platform and game code to different translation units
15:56Getting functions from game dll to the platform executable
15:56Getting functions from game dll to the platform executable
15:56Getting functions from game dll to the platform executable
24:29Getting Functions from platform executable to the game dll
24:29Getting Functions from platform executable to the game dll
24:29Getting Functions from platform executable to the game dll
31:00Searching compiler flags for building a dll
31:00Searching compiler flags for building a dll
31:00Searching compiler flags for building a dll
35:18Dll main
35:18Dll main
35:18Dll main
40:08Exporting functions from a dll
40:08Exporting functions from a dll
40:08Exporting functions from a dll
47:27Loading and unloading the game dll on the fly
47:27Loading and unloading the game dll on the fly
47:27Loading and unloading the game dll on the fly
50:17Moving local persist variables from the dll to game_state
50:17Moving local persist variables from the dll to game_state
50:17Moving local persist variables from the dll to game_state
52:31Avoid locking the dll to allow rewriting
52:31Avoid locking the dll to allow rewriting
52:31Avoid locking the dll to allow rewriting
1:02:00Episode recap
1:02:00Episode recap
1:02:00Episode recap
1:03:37Q&A
🗩
1:03:37Q&A
🗩
1:03:37Q&A
🗩
1:03:51-LD to build a dll and removing incremental building
1:03:51-LD to build a dll and removing incremental building
1:03:51-LD to build a dll and removing incremental building
1:06:23Question: We have small code right now. How does dynamic linking and compiling to an exe work with huge games that are multiple gigs?
1:06:23Question: We have small code right now. How does dynamic linking and compiling to an exe work with huge games that are multiple gigs?
1:06:23Question: We have small code right now. How does dynamic linking and compiling to an exe work with huge games that are multiple gigs?
1:07:39Casey spoils tomorrows stream by telling people not to spoil it
1:07:39Casey spoils tomorrows stream by telling people not to spoil it
1:07:39Casey spoils tomorrows stream by telling people not to spoil it
1:08:00Short recap on loops
1:08:00Short recap on loops
1:08:00Short recap on loops
1:10:28Question: Do you recommend playing around with dll files, or are they mainly used in specific cases?
1:10:28Question: Do you recommend playing around with dll files, or are they mainly used in specific cases?
1:10:28Question: Do you recommend playing around with dll files, or are they mainly used in specific cases?
1:11:05Question: Can someone now create a dummy handmade.dll and use it to intercept the GameUpdateAndRender function to get a pointer to game memory and change stuff. Is security something you will cover in a later stream?
1:11:05Question: Can someone now create a dummy handmade.dll and use it to intercept the GameUpdateAndRender function to get a pointer to game memory and change stuff. Is security something you will cover in a later stream?
1:11:05Question: Can someone now create a dummy handmade.dll and use it to intercept the GameUpdateAndRender function to get a pointer to game memory and change stuff. Is security something you will cover in a later stream?
1:13:34Question: We've got a tiny application right now so if code takes minutes to compile, how are we going to do what we just did?
1:13:34Question: We've got a tiny application right now so if code takes minutes to compile, how are we going to do what we just did?
1:13:34Question: We've got a tiny application right now so if code takes minutes to compile, how are we going to do what we just did?
1:16:08Question: Would you be able to load the dll yourself using ReadFile() and implement getProcAddress() as well, assuming there's an easy way to make the memory executable like mmap()
1:16:08Question: Would you be able to load the dll yourself using ReadFile() and implement getProcAddress() as well, assuming there's an easy way to make the memory executable like mmap()
1:16:08Question: Would you be able to load the dll yourself using ReadFile() and implement getProcAddress() as well, assuming there's an easy way to make the memory executable like mmap()
1:18:16Question: Is this technique still possible without using passing of the large memory blob between the dll and the exe?
1:18:16Question: Is this technique still possible without using passing of the large memory blob between the dll and the exe?
1:18:16Question: Is this technique still possible without using passing of the large memory blob between the dll and the exe?
1:21:00Question: Does the dll prevent the compiler from inlining?
1:21:00Question: Does the dll prevent the compiler from inlining?
1:21:00Question: Does the dll prevent the compiler from inlining?
1:21:47Question: How are we going to implement dll's on Linux/Mac?
1:21:47Question: How are we going to implement dll's on Linux/Mac?
1:21:47Question: How are we going to implement dll's on Linux/Mac?
1:23:02Question: Are you ever going to write the platform layers for other platforms on the stream in the far future?
1:23:02Question: Are you ever going to write the platform layers for other platforms on the stream in the far future?
1:23:02Question: Are you ever going to write the platform layers for other platforms on the stream in the far future?
1:24:02Question: Is the process roughly the same for doing the Linux equivalent of sharing libraries?
1:24:02Question: Is the process roughly the same for doing the Linux equivalent of sharing libraries?
1:24:02Question: Is the process roughly the same for doing the Linux equivalent of sharing libraries?
1:25:42Question: Your #define typedef magic kinda bugs me, in that it hides the arguments/return type away from the implementation. How much of a win is having the signature in one place?
1:25:42Question: Your #define typedef magic kinda bugs me, in that it hides the arguments/return type away from the implementation. How much of a win is having the signature in one place?
1:25:42Question: Your #define typedef magic kinda bugs me, in that it hides the arguments/return type away from the implementation. How much of a win is having the signature in one place?
1:26:54Question: How does Windows manage memory in a dll? Is there a dll process page? Where are variables made/the statics stored? How is heap managed when allocated from a dll?
1:26:54Question: How does Windows manage memory in a dll? Is there a dll process page? Where are variables made/the statics stored? How is heap managed when allocated from a dll?
1:26:54Question: How does Windows manage memory in a dll? Is there a dll process page? Where are variables made/the statics stored? How is heap managed when allocated from a dll?
1:37:14Question: Doesn't Windows know [who called it] by the instruction pointers leading up to the VirtualAlloc() call?
1:37:14Question: Doesn't Windows know [who called it] by the instruction pointers leading up to the VirtualAlloc() call?
1:37:14Question: Doesn't Windows know [who called it] by the instruction pointers leading up to the VirtualAlloc() call?

Loading Game Code Dynamically

Notes:

Continuation on how dll uses memory: Day 21's Statement About MSVCRT is Correct...