Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    14
  • comments
    6
  • views
    5915

Dynamic resource reloading

Vilem Otte

1022 views

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 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!