Casey, thanks for all your hard work. Cant believe Ive only just now found your guides. Keep up the awesome work!
Anyway, Im following along with Casey, but implementing it as a side scrolling game to kind of learn more by experimenting instead of copying everything Casey is doing. So my code base is quite different, as Im sorting different functions into different files. For someone whos never used unity builds with VS, it was quite confusing to even get started. And then throwing in dlls. Ive learned a lot about the debugger just by watching him, so thanks for that Casey.
Now, Ive got the game working as expected, however the live code editing is not working, and Im not sure how long ago it stopped working. Im not sure exactly why, obviously, and I cant seem to find a guide about what is required for it to work. Ive found a few things, like no global variables and dont edit the platform layer and such. I dont have any of those issues. Can someone post a guide or rules to make this work? Id appreciate it.
Im going to keep playing around with it myself, and if I find the reason for it breaking, Ill post back for others. Thanks!
-On a side note, Im not nearly as proficient with the debugger as Casey is, and perhaps I could find the problem if I was. Any good in depth guides for the VS debugger anywhere? What Ive found is ridiculously basic for what I want to know. Thanks!
As you said - you cannot use global variables in DLL across reloads.
You cannot use static variables in functions inside DLL.
You cannot use function pointers to functions defined in DLL. If you are doing C++ then this includes virtual functions - you cannot have them in classes defined in DLL.
Do not change memory layout of structs used in platform layer, meaning - don't add new members in middle of existing ones, don't erase existing members (unless it is last one), don't reorder members. In some cases it is OK to do that, but be careful and aware of what data is in memory.
What exactly does not work for you?
You should debugger to understand what is wrong. Put a breakpoint, write down memory addresses for variables and/or values before reload, then do the reload again, and check in debugger if everything is the same.
Reason: Found the answer by searching!
So, partly from some late night stupidity, and partly from having a static variable in my jumping code, Ive found the answer. Thanks for the help!
So, what happened was when I was changing the file names, I had forgotten to update the builddll.bat I had to point at the new name. Between that and the static variable, the problem is fixed.
I appreciate the quick responses. Thanks ratchetfreak for the ideas on having globals and such. Ill take that into account if I decide to throw those in there some other time.
Thanks mmozeiko for the list. On that though, one thing I was having trouble with was when I edited the code, then tried a hot reload, the debugger no longer worked because the code had changed. But, because it never compiled correctly to begin with, I suppose the function and variable addresses would not have changed anyways. So that wouldve been a bust I guess.
But now that I got the reload to work, the debugger still stops working. Im pretty sure Casey had that fixed in one of his videos, anyone know which one to look into for that?
Know what? After a search (like maybe I shouldve done first) I found the video. #39 @ 52:38 is what...actually, mmozeiko posted. Thanks again mmozeiko!