Best Practice - Module Scope and Content

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
Taking this issue on GitHub as a starting point, I would like to discuss some kind of "best practice" guideline for modules.

This thread is aiming at the assets itself (like "here they are, I don't know what you'll do with them, but maybe they'll be usefull") instead of how assets depend and extend each other - this question is topic of another thread!

Basically, the problem to discuss is how general modules should be and which resources should belong to the scope of a single module. The use case this discussion is build around involves the modules PlantPack, Crops and Wood and Stone.
  • Crops - this module does nothing else but defines several crops and its growth stages; there are now items or any other "products" of the crops in this module
  • PlantPack - assembles a bunch of plant definition and growth cycle implementations; this module contains items (as drops of crops), e.g. corn cob or panicles of rice
  • WoodAndStone - the "final" module, which has a dependency on PlantPack; this module adds further "processed" items, such as grains of rice or corn flour
I see the following disadvantages for current setup:
  • all the items/blocks are spread across several modules; it may get complicated to get an overview of "what is where"
  • the set of corn resources is hard to reuse; other modules either need to copy files, add dependencies on PlantPack or even WaS or create new assets
  • if we split up assets, what should stay together? why are crop stages together in one module, maybe I just need the last one, why are corn cob and flour separated again, ...
The only advantage I see:
  • no unnecessary assets are present; the current setup does not have "unused" items from one module dependency to another
Thanks to Marcin Sciesinski and Cervator for their comments already, I hope there will be some other opinions by mod devs and Art Team ;)
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
Now that you all should know what my problems with the current setup are, I'd like to present my solution. To keep it short - here's what I think of:
  • Crops - holds block definitions, textures and icons for all stuff that seems relevant to crops:
    • growth stages, e.g. Corn1.png .. Corn7.png
    • drops, e.g. corn cob
    • processed items without further ingredients, e.g. corn flour, corn kernels, ...
  • Plant Pack - takes the given resources and adds actual growth process, plant drops, ...
  • Wood and Stone - defines how tools work on plants, adds further processed items, like meals, bread, ...
The purpose of this style is that
  • artists can easily create a set of related assets provide access to them in a single location
  • resources are no unnecessarily split up and there is a clean distinction between art and code
  • resources can easily be reused, without modifying the source or copying files
  • single files and prefabs can be overwritten by mods (technical details discussed elsewhere :p)
  • modules can still add very specific files/new assets
  • even if there are different icons for corn, wheat and rice flour, a mod dev can decide to use just the white flour icon for a single flour type for all the crops
One problem that may arise with this approach:
  • at which point is an asset "unrelated" to other ones and should be split out?
My answer to this: "When the artist feels like it!" In the example given above, an artist might have added icons for several versions of porridge, and it would be fine for me. WaS could decide to reuse these icons or create new ones.

I don't see problems performance wise, since most of the time the difference might just be how many icons there are on a texture sheet.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
I think it'll be hard to split this from the other discussion :D

One alternative line-up I see is something like the following - although I'm not sure it is good for anything beyond material for discussion:
  1. A game mode lineup like WaS right now - focuses on a central "spine" of a game mode with some basic items at each level, the modules building the "vertebrae" so to say
    1. Lowest level: Assets like currently in Crops, focused exclusively at that level
    2. Mid level: Plant pack doing the thing as it does now
    3. High level: WaS which puts everything together
  2. Enhancements to the system could add content spanning several layers in a single module. Like a new plant that adds growth definitions, immediate materials, and even recipes for refined goods specific to that plant. Behind the scenes this could depend on other modules for individual pieces, like grabbing a texture from somewhere else, but I'm not sure that'd make sense. But it could be an option.
That's probably more of an example of a secondary modder adding content to a primary modder's system, but I thought it might demonstrate the idea. In that case a single module applies to several others if they're enabled, which really digs into the other discussion about "supporting modules"

And yeah overriding assets on top of all that makes the discussion even more fun ... :)
 
Top