buckmaster Posted February 13, 2015 Share Posted February 13, 2015 This hasn't been announced extremely publicly, but the issue has been hanging around on GitHub for ages now, with a corresponding discussion at GG. I thought I'd bring it up again since we're nearing the release of at least the preview version of 3.7.The idea, briefly, is to move all the stock template scripts around so that we don't have so much duplication. Two examples are the entire core/ directory, and more egregiously, the tools/ directory, both of which are identical duplicated in Full/ and Empty/, and would have to be duplicated in any other templates you added. This is frustrating and irritating, so we thought we'd do something about it.My proposal is to move common script code into a top-level directory Packages, which looks like this currently. There's, for example, a Core package, and an Editors package. This way, those scripts aren't duplicated. So, before, your folders looked like this: Templates/ Full/ tools/ Empty/ tools/ But now they'll look like this: Templates/ Full/ Empty/ Packages/ Editor/ tools/ This means that when you create a project, instead of just copying the template to the new project, you must also copy the package scripts you want. I've made some changes to the Project Manager to do this automatically, the way it currently copies templates. However, this also required some additional infrastructure: a template.xml file in each template dictating which packages should be copied (since you don't just want all of them).Unfortunately I wasn't able to get this to work with the Project Manager UI, so you can't choose which packages to include at project generation time - if you want additional packages, you either need to edit template.xml, or copy the package manually after project creation.@Azaezel mentioned that this seems like a large change to be introduced, especially without much fanfare. My reasons are that it doesn't actually change the structure of a project, or any code - just moves it around. Projects generated the new way should look identical to projects generated the old way. And it does cut down on a lot of duplicated code that needs to be updated twice every time.Anyway, the point of this post is to raise awareness, but also to make sure I haven't made any fatal miscalculations that mean this is a bad idea. The obvious large downside is that this change will break any pull-requests involving changes to the templates, but I'm happy to weather that and help fix/resubmit them. Quote Link to comment Share on other sites More sharing options...
rlranft Posted February 13, 2015 Share Posted February 13, 2015 I'm all for stomping core anyway - especially since it'll mean you won't have to update two identical copies of the prefs.cs file....I suppose for most people the largest real difference is a smaller download. Quote Link to comment Share on other sites More sharing options...
buckmaster Posted February 13, 2015 Author Share Posted February 13, 2015 The scripts don't take a huge amount of space. It's the art assets hat do that, though hopefully we can de-duplicate some of those. The tools folder is about 6MB, so that's a saving. But doesn't make much difference compared to 300 or however big the whole thing is :P. Quote Link to comment Share on other sites More sharing options...
buckmaster Posted February 22, 2015 Author Share Posted February 22, 2015 I just made a fairly significant update to the Project Manager and the structure of the packages. I realised that if, for example, you wanted a package to be a git repository, then the .git directory would be copied from the package to your game template, which was a bad thing. Ditto with, for example, a package readme.So I've edited the PM to look for a 'package/' directory inside the package. Now a package ends up looking like this: Packages/ Editor/ stuff here package/ tools/ This makes it more gooderer and stuff. I also renamed the 'path' attribute in template.xml to 'name', since that makes sense. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.