I’m a bit of an organizational freak. When it comes to code, I dislike everything being in one file because it can make finding things a chore which is why I like the many files option so I can sort them under certain folders and know where to find x or y.
Now, if there is a metatable / object being written ( such as fileio which will be included in an update very soon, networking and data will also be included very soon ) and all functions are related then, yes, I will put it all in one file ( or 3 depending if something is clientside vs shared vs serverside ).
There are drawbacks such as the Lua file limit, but I’ve found an interesting way to get around the file limit. When you are in the game and you’ve hit the file limit: you can autorefresh / loadgm and the files that are missing will be sent to the client, so if you are over the limit you can still execute all of those files. Once they are in cache then it doesn’t matter, they’ll be loaded.
With the fileio, there is one function to combine all files from the list format that it generates. It looks like this ( old list, got rid of a lot of _s on file names ): https://dl.dropboxusercontent.com/u/26074909/tutoring/_file_structure/files_sh.txt
And combines them in the exact load order into 2 files ( such as init.lua and cl_init.lua ), making uploading a finished game-mode to production server easy and it can incorporate other filters such as removing blank new lines, removing all comments, obfuscating, etc… So, that will be one useful feature when everything is done if people choose to use it, if they don’t then there will be x number of files.
I may eventually fork the dev-base and do what you suggest so meta entity functions all go in 1 to 3 files, etc. BUT, when I do that I’ll use fileio to generate the mechanism for doing that so there won’t be massive maintenance to keep both forks up to date. Essentially update my end, type a command and have the files sent to my webserver and packaged in a zip with correct extensions instead of going into data and having to rename the .txt to .lua so that I only need to actively update ONE fork and have a system in place to pack up like functions into one file which will also serve as a demonstration as to what can be done with some of the building blocks that I aim to provide…
So, I agree that right now there aren’t really that many “good” functions in the release aside from the auto-loader, the hooks, and a few other things, but it’ll be built up as I add basic versions of some of the code I am running in my current dev. When the networking and data update is released, it’ll open a few more doors in terms of things to be included.
My goal is just to provide the easiest possible method to create a game-mode from scratch by including helper functions / building blocks that people can use. I heavily comment them so even an inexperienced user can read through it and understand what is happening line by line.
I’ll be rewriting TTT using this base and ensure that it is as optimized as possible; some of the game-modes I write / rewrite will be released for free with the base for people to learn from or run.