handmade.network » Forums » Dynamic game code loading for "live code editing" with Visual Studio
mindspyke
9 posts
#15614 Dynamic game code loading for "live code editing" with Visual Studio
3 months, 4 weeks ago Edited by mindspyke on June 24, 2018, 8:18 a.m. Reason: Initial post

Hi,

In episodes 21 and 22 Casey implements dynamic loading of the game's dll which enables him, in the later episodes, to do some pretty neat stuff. This looked promising to me for iterative testing of code, but I have a question:

I prefer to work with Visual Studio as an IDE, but I can't figure out how to get this working? How can i start up my game and then rebuild a certain dll without having to restart it completely?

Has anyone managed to get this workflow setup with Visual Studio?

Thanks!
ratchetfreak
404 posts
#15615 Dynamic game code loading for "live code editing" with Visual Studio
3 months, 4 weeks ago

I believe that VS built in edit-and-continue can do most of the same in that regard.

It's not quite as full featured as reloading the dll though.
Guntha
14 posts
#15629 Dynamic game code loading for "live code editing" with Visual Studio
3 months, 3 weeks ago

Hello,

I presume you have one VS project for the platform-layer/executable and one project for the game/DLL. I guess you can rebuild only the DLL project, the running executable will take care of reloading it (as far as I remember from these episodes, the platform-layer's code takes care of checking if the DLL is newer than the previously loaded one, every frame, and reloads it if necessary?)
MandleBro
Jack Mott
111 posts / 1 project

Web Developer by day, game hobbyist by night.

#15759 Dynamic game code loading for "live code editing" with Visual Studio
3 months, 1 week ago

Did you get this working?
It definitely works fine, you set the platform layer as the startup project. So F5 runs the game. Then you can right click on the game project, build, and build just that.
mmozeiko
Mārtiņš Možeiko
1811 posts / 1 project
#15760 Dynamic game code loading for "live code editing" with Visual Studio
3 months, 1 week ago

As far as I remember that does not work at all. Once you instruct VS to build something while you are debugging project, it will pop up question "Do you want to stop debugging?"

Alternative is to either set up custom tool under Tools menu that calls "build.bat", or to use Edit&Continue feature.