I'm a long time hobbyist programmer and there's been a few times where I've felt compelled to create a fairly elaborate custom level editor to use to help create some cool game ideas I've had. I've attempted projects like this before, but I find my code gets horribly complex before I get as far into it as I would like. I've also had a difficult time finding good advise on how to go about creating an application like this.
Basically stuff I'd want a level editor to be able to do would be:
- Have a map of 2D objects that's pannable and zoomable, where the map can have arbitrary dimensions
- Be able to select any object and change it's properties in properties window
- Be able to select multiple object and change their properties together
- Have a reliable undo system
- Be high performance enough to be comfortably usable
- Have a highly maintainable, readable and extendable codebase
I usually get the first two things in before my code becomes messy and hard to read and make significant changes to. At the same time I think all these features don't sound like anything special and are nothing less than what most users would expect from a good level editor and many applications, like Spine, seem to manage all these things with grace. I don't expect getting all these features in a single application to be easy, but I expect there must be much better approaches to organising code for applications like this than I know.
I'm a huge fan of Spine btw, and I think it's a fantastic example of a program that has much of the feature set that I hope to have in some applications I write in the future, though I don't plan on writing any animation software =p. The whole application feels very solid, well thought out and seemless. So I'm wondering if you could offer me tips for writing software like this? Some people have mentioned using models like MVC and MVVM, I'm fairly familiar with these already and use them a lot, but could certainly learn a lot more, is this a good direction to look in? Would you have any advise on articles to read or programming patterns to learn about? Anything useful you've learned while creating Spine? Good frameworks to use?
Any advise would be helpful