CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Jun 2015
    Posts
    13

    Question Implementig a hot-reload system

    Hi! Some months ago I did a Master's Degree in 3D Game development. There I learn't that you can do something called hot-reload or reload on runtime which allows you to do changes without having to rebuild it again.

    Example to understand it better: You build the program, run it and see an object that is not in the right place.


    - Normal way would be: close it, go to the code and change the coords, save and build again it, and after the time needed to build, run it again and see the change. If build took 5min... total time spent = 7 min.

    - Hot-Reload or reload on runtime (what I want): Without close it, go to the xml where you have the coords, change the coords, go to your program and press the key you have programmed to recharge the xml, see the changes. Total time = 1min.

    In videogames you can do this using the lua scripting system for example.

    Now I am joining a project (not a videogame itself but with a lot of graphics and 2D animations/mini games) and I think that hot-reload would be very helpfull. The project is made in eclipse, on a fedora (unix system) so the question is: Do you know other languages or ways to do the hot-reload besides Lua? If you do, which system do you think is the best to implement on my case and why? (i.e. Lua in unix is easier than in windows as I've read). I need something easy to implement /add ...

    Thank you so much!

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: Implementig a hot-reload system

    Note that this has also been posted elsewhere.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #3
    Join Date
    Jun 2015
    Posts
    13

    Re: Implementig a hot-reload system

    Quote Originally Posted by laserlight View Post
    Note that this has also been posted elsewhere.
    Yes, sorry. You can close this topic as I have the other opened.

  4. #4
    Join Date
    Mar 2001
    Posts
    2,529

    Re: Implementig a hot-reload system

    Looks like both badly missed the point. If the XML doesn't change, but the logic does, then you might want a hot reload. Perhaps you could create an interpreted logic section in another XML file that uses regex or something.
    ahoodin
    To keep the plot moving, that's why.

  5. #5
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: Implementig a hot-reload system

    There are game engines that support this, so it's just about enabling the feature, and making sure your static game files are created in the ways outlined in the engine for that feature to work.

    If you have a custom game engine. you'll have to do all the necessary implementations to make this happen yourself.

  6. #6
    Join Date
    Jun 2015
    Posts
    13

    Re: Implementig a hot-reload system

    Quote Originally Posted by OReubens View Post
    There are game engines that support this, so it's just about enabling the feature, and making sure your static game files are created in the ways outlined in the engine for that feature to work.

    If you have a custom game engine. you'll have to do all the necessary implementations to make this happen yourself.
    Yes, its a custom engine so that's why I asked for different options to do it as easy as possible.

  7. #7
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: Implementig a hot-reload system

    If it's a custom engine, then it depends entirely on how easy it is to "reset" your game engine at runtime and restart it with a new game world/game objects.

    If it's about being able to click on an object in the game world and then somehow selecting to "edit this object", then your game engine will need to provide feedback as to the selected engine, and possibly feed this into yout game editor, or into the editor you're using for the XML. If you're using an existing editor, then you'll need to look up what features it has to start/open a file and position/highlight the selected object I fyou have your own editor as well,... then it's about adding such features to the editor.

    We don't know your game engine, so giving concrete advise is impossible, it'll be necessarily as vague as I did here.

    My personal take on the matter. "don't bother"
    Features like this are nice in a game engine that you can afford the time for developer conveniences. That typically means you're making a game engine for the purpose of the game engine alone (either you're going to be selling the game engine, or you plan on making dozens/hundreds of games with this engine).
    If it's an engine for a single game, I would focus on the game itself first, and worry about game engine features for later. Even if you plan on selling the game, if you have a Publisher, they'll be wanting to see results, and game engines tend to not be the kinds of results they want to see (quite the opposite even, they want to see progress being made on the actual gameplay).

  8. #8
    Join Date
    Jun 2015
    Posts
    13

    Re: Implementig a hot-reload system

    Ohhh I see what you mean OReubens.

    Its a little game engine which is able to run some little games. It has 2 2D games so so so easy where you move a couple of things with the keyboard (you just need to use arrows and Return keys) but the idea is to run more games like those. Then, thinking about the future, the hot-reload system could help a lot because you spend a lot of time placing the items on the screen.

    That's why I need a little system that can be very very simple because I don't need to re-load AI or something like this. Just some positions of the items/images/...

  9. #9
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: Implementig a hot-reload system

    If you design your game engine the right way,
    then you can re-use your displaying/drawing code in a dedicated game editor.

    It won't do feedback from inside the game, but at least you can design your game in a more visible way than editing spreadsheets/xml/textfiles/script/whattever, and then test-run the game.

    Going even further, you can add editing features in the debug/development/testers-build of your actual game

    There's plenty of possibilities, but they'll all require some effort in coding to get done, for one-use game engines, this may be overkill, unless you have a LOT of level desining to do. I've seen enough technically simple games, but with hundreds of different game levels/zones/missions. If the 'level designing' ends up being the bulk of your development work, then yes, this might be worthwhile.

  10. #10
    Join Date
    Oct 2008
    Posts
    1,456

    Re: Implementig a hot-reload system

    off the top of my head, alternative solutions could be

    1) write a plugin for an existing 3d editor ( I'm personally in love with 3dstudio max and it's perfect for this purpose, but it's costly ... or you could borrow an editor from one of the many existing engine editors; then, you can setup all sorts of "gizmos" to dynamically interact with your app, to position elements etc.., eventually with the help of the editor own scripting system. This is also useful for those environments ( like Apple iOS ) where usual dynamic code/data loading techniques are not easy/possible; say, your editor plugin could establish a socket connection with your app to perform all sorts of dynamic tunings ... yes, it requires some work but it's nowhere like writing your own editor ...

    2) buy one of those MIDI mixers ( I have a Novation mixer with 24 pots, 8 faders, etc.. exactly for this purpose ), they're very easy to program ( at least, as far as this simple usage is concerned ) this has the ( possibly big ) advantage of adding "physical" feedback to tunable parameters ...

    of course, both 1) and 2) are not like a full blown scriptable engine, that is, you'll still need to recompile whenever the set of tunable parameters changes; OTH, this has the benefit of leaving no trace in the final "release" executable ( unless you want so ) avoiding the script engine overhead ...

    just my two cents

  11. #11
    Join Date
    Jun 2015
    Posts
    13

    Re: Implementig a hot-reload system

    Quote Originally Posted by superbonzo View Post

    1) write a plugin for an existing 3d editor [...]

    2) buy one of those MIDI mixers [...]
    Thanks for your help but...
    1) They are 2D as I said, not 3D and I'm not looking for a level editor because there aren't so much elemnts (maybe 10/level maximum only?)
    2) buying something is not an option right now (company policy)

    But I'll keep that in mind too if someday I do another different project

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured