Before I comment:
Seriously, on my project and code structure, I have 0 cares available for all the mandates and ridiculous demands of this community. I have been told to use 2 spaces instead of a single tab for my code spacing... I use tabs still. Want to tell my variable names suck? sure go ahead, suggest a better one, if I think it is not verbose enough, hang on while I ignore your suggestion.
+1000, if you use 2 spaces and I like 4 spaces I have to reformat the entire code base. If you use tabs, and you use 2 spaces, but I like 4, I flick a switch in my editor and hey presto, I get 4 and you still get 2. Tab is a dedicated indenting character, using spaces is ludicrous, as it enforces your style on everybody else.
On to modules
I think you're all working off of some basic assumptions, most of you anyway. Namely that a module == an sdz/archive, mod dependency, something that the lobby can download, something that would be in a separate file on the end users machine or merged in auto-magically.
This isn't the only way.
Instead, try looking at PHPs composer, or javascripts Bower, or Nodes npm.
Instead of having a final product dependency, simply declare your dependencies, and the desired versions, and have a tool grab them for you. Use it as a development tool that assembles a single package rather than auxillary packages you declare as dependencies.
For example, here I have a composer.json that tells composer my plugin needs pimple, doctrine 2+ and PHP 5.3 or higher:
https://github.com/Tarendai/wordpress-d ... poser.json
I can then distill it down to this:
Code: Select all
{
"name" : "tomjn/doctrine_boilerplate",
"require" : {
"composer/installers" : "~1.0",
"php" : ">=5.3",
"pimple/pimple" : "~1.0",
"doctrine/orm" : "*"
}
}
I then run:
And it goes and grabs the appropriate versions of those libraries and bundles and puts them in my projects vendor folder, or wherever I demand it. Doctine will have it's own depencies that are pulled in too
Now imagine a package.lua that went something like this:
Code: Select all
return {
name='Balanced Annihilation',
description='Balanced Annihilation',
version='7.81',
require={
zk_chilli = "~1.0",
widget_playerlist = ">2.0",
spring_engine = "95.0"
}
}
Then we did something such as this:
And all of those parts were downloaded and installed in the appropriate places inside your games development folder ready for use
We could then do something similar to composer and do:
Code: Select all
springpackager archive --format=sdz
and hey presto we now have a means of packaging things up too, and we get for example
Balanced_Annihilation_7.81.sdz. One single archive, no dependent archives, no faffing around downloading multiple dependencies, no install instructions saying put this here and that there.
Now say we did this:
Code: Select all
return {
name='Balanced Annihilation',
description='Balanced Annihilation',
version='7.81',
require={
ba_units = "7.8",
ba_gadgets = "7.8",
ba_textures = "7.8",
ba_sounds = "7.8",
zk_chilli = "~1.0",
widget_playerlist = ">2.0",
spring_engine = "95.0"
}
}
Suddenly that lua file is all thats needed to cart around the entire game. An sdz or an svn checkout with various dependencies is now a 1/2kb lua file. Each component can be managed and updated independently with alternate versions. Maybe someone bumped sounds to 7.9, and units stayed at 7.8, or units moved to 8.0 for balancing reasons, you could mix and match dependencies, and they'd be specific to that archive.
While typing that, widget_playerlist updated to v3.0, what happens? We can run:
And the dependency is upgraded. If we decide v3 is bad or it breaks things, we change the requirement from >2.0 to 2.0 using the standard semantic versioning used in hundreds of other packaging systems.
Now lets say I'm bored with BA, and have decided to build a mutator:
Code: Select all
return {
name='AF Aliens Godzilla',
description='OMG GODZILLA',
version='1.00',
require={
balanced_annihilation = "7.8",
spring_engine = "95.0"
}
}
Now my mutator can pull in all of BA, specifically BA 7.8, and be completely self contained. Perhaps I may want an option to use dependencies in separate archives to save space, who knows, but this lets me rapidly prototype things, and encourage modularity in packages, as well as diverge ownership and maintenance of separate components.
Ofcourse this suggests some central packaging point that lists and maintains package details, but that isn't necessary. Packagers such as composer allow you to specify URLs to zip files for package versions, and Git and SVN repositories to export, or to define your own personal package repository