I downloaded shootergame from marketplace this morning. Working with 4.6.1 and I run the engine and load up shootergame. All works as expected. I generate visual studio project and build the project and run it fine.
Now my problem starts when I try and compile from within the editor. It seems like there’s some disconnect between the DLL that’s building from the visual studio project and the one that the editor is tracking. I can build from visual studio and the engine will say its hot reloaded, but the project doesn’t seem to use the modified code from visual studio. If I quit the editor and run the build from visual studio with the exact same code I get the modified version as expected.
So I’m wondering if there’s a way to figure out whats going on here, in terms of what is being built and what is being reloaded etc. Is there a document that goes into the detail anywhere?
Thats the strange thing. There is no error. It says it compiled in VS and says it hot reloaded in the editor, but the code doesn’t get run. If I close the editor and run it as debug from VS then it does work as expected.
What changes are you making in the code? Is it simple changes to the value of a variable or adding/deleting variables or is it more complex like adding an entire new class to the project? Also, was the name of the project left as the default ShooterGame when created or was the named changed when you created it?
In this case it was making some simple value changes to a variable in a constructor that weren’t being propagated. In the one case, I changed the code and hit “compile” from the editor and it said it was built and reloaded but the change had no effect.
I then quit the editor, pressed build in visual studio which ran the editor again (with the exact same code mind you) and this time when the game played the associated variable value worked as intended.
So it seems like there was some issue with picking up the value from the hot reload.
It seemed strange because I’ve done the exact same thing before with previous engine versions on other projects and its been just fine. So I figured it might be something specific to shootergame’s setup.
Just to add, if I did the same thing in visual studio (just press build, wait until it builds, then watch in the editor as it says it has hot reloaded) I get the same error. It only works once I quit the editor and then use the local debugger to run the editor again. So it seems like the DLL being produced doesn’t get built correctly, or the DLL loaded by the editor isn’t the correct one.
So the only working use case for this project is to restart the editor, which frankly is a pain
Any chance you can run me through what exactly is happening with a hot reload in terms of how the engine determines which DLL’s to load etc? I’m just interested in understanding the potential failure points here as I might well hit this kind of issue with my students (and I’ve already hit a few similar things so far).
My understanding currently is that the editor monitors a set of DLL’s in some directory somewhere and on seeing a change to those DLL’s it reloads them using the usual windows functions (been a while since I’ve done any DLL loading but I am fully aware of the process).
Is there a manifest the editor uses to determine which DLL’s to monitor? Does it just monitor a given directory?
I apologize for the delayed response. It appears that there was a known issue with changes made to constructors or any code that only ran when an object is created not being updated properly with an in-editor compile. This has been addressed internally and should be included in a future update to the engine.