Dynamic resource reloading

Published November 22, 2017
Advertisement

Making editors is a pain. I have a list of thousands of items I'd rather do than this - yet I made myself a promise to drag at least one full featured editor tool over the finish line. There are few reasons for that:

  1. I believe I have quite useful engine, it was my pet project all these years, it went through many transformations and stages - and solid tool is something like a goal I'd like to do with it, to make it something better than "just a framework".
  2. I'm very patient person, and I believe also hard working one. Throughout the years my goal is to make a game on my own engine (note, I've made games with other engines and I've used my engine for multiple non-game projects so far -> it eventually branched to be a full-featured commercial project in past few years). I've made few attempts but mostly was stopped by lacking such tool - that would allow me to build scenes and levels, in an easy way.
  3. And the most important one ... I consider tools one of the hardest part in making any larger project, so it is something like a challenge for me.

Anyways so much for motivation, the tool is progressing well - it can be used to assemble scene so far, various entities (like light or materials) can have their properties (components) modified, with full undo/redo system of course. And so the next big part was ahead of me - asset loading and dynamic reloading. So here are the results:

screen01.thumb.jpg.eb01e06155622181e015b5958eaffbc7.jpg

Engine editor and texture editor before my work on the texture.

And then I worked on the texture:

screen02.thumb.jpg.9c9c207ed626eb3a9ee031815c9b58da.jpg

And after I used my highly professional programmer-art skills to modify the texture! All credits for GameDev.net logo go to its author!

Yes, it's working. The whole system needs a bit of cleanup - but in short this is how it works:

  • All textures are managed by Manager<Texture> class instance, this one is defined in Editor class
  • There is a thread waiting for change on hard drive with ReadDirectoryChangesW 
  • Upon change in directory (or subdirectories), DirectoryTree class instance is notified. It updates view in bottom left (which is just a directory-file structure for watched directory and subdirectories), and also for modified/new files creates or reloads records in Manager<Texture> class instance (on Editor level)
  • The trick is, reloading the records can only be done while they're not in use (so some clever synchronization needs to be done)

I might write out some interesting information or even short article on this. Implementing it was quite a pain, but it's finally done. Now short cleanup - and towards the next one on my editor todo list!

Thanks for reading & see you around!

0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

Merry Christmas!

7696 views

Progress

3726 views

Roadmap for 2020

5263 views

DOOM: Post Mortem

4864 views

DOOM: GROOM

4265 views

DOOM: Placeholders

4840 views

Ludum Dare 45

4573 views
Advertisement