Poll: Would you like a MMO-style levelling system?
I'm thinking of adding an MMO-style levelling system, with various levels for each gun type and also base stats like attack and health. You'd level up by getting shots on target for XP, and levelling up can unlock new weapontypes/boost your stats.
This is just an idea, but wouldn't it be better to just use tags for everything, one tag for durability, one for color and so on, that way you'd just need a few items, one if you want to.
This wouldn't have such an inpackt on performance because there won't be a billion items rendered like this.
If you want to reduce the lag even more you could seperate the color and item type from the rest of the information like this:
You use the item damage for those, the first byte for the type and the following three for the color, so rendering would get faster, another option would be to use the metadata differently:
You'd use the first byte still for the type, but the remaining bytes would be for a material id, from which you could query the information needed from a global (or local) dictionary of materials that could be read from a config file.
These are just some ideas that have worked for me in the past, if you find your one doesn't fit the mod for whatever reason.
As far as item rendering goes, that would have zero impact - The game will render the item in just the same way regardless of how it's loaded - but that is basically how I'm doing it. All component data is saved into it's NBT, the game uses that for initial rendering (recolouring the base texture I provide) while it's a component, and when you put it in the gun that data is merged together to a larger tag on the gun. Previously I was physically saving each item to the gun and I could still do that, but I'm trying to make things easier for players to understand, so I'll just merge the data instead. This also makes it much easier to modify data for things like crafting skill level (which has a small impact on most of a guns stats; better crafters build better guns), if you're using the skill system.
So, say you've got three materials; iron gold and steel. Iron has durability 100, weight 200 accuracy 500 etc, gold dura 50 weight 300 accuracy 1000 and steel durability 500 weight 500 accuracy 200 (example values). If you then make a gun using (for simplicity just three parts) an iron bolt, gold frame and a steel barrel, it would merge those values together so the guns durability would be 650, weight 1000 and accuracy 1700. The player can also call up a list and see "This gun was made with an iron bolt, gold frame and steel barrel", and of course they'd be able to physically see those parts on the gun if they looked at it.
That's a very basic example; there's quite a few parts used in building guns and not all parts have an impact on all statistics (The charging handle doesn't change your fire rate, for example). I'm not very good at explaining things
The main benefit of NBT vs item ID's is solely less item ID use. Most mods don't have to care about such things, because they use at most maybe 500 items and that's the huge mods - The only other mod that jumps to mind that uses more is GregTech, which uses damage. Some of my items will be damagable, so I can't really use that either - Plus, damage still has a limit of 32k. NBT works great and has no limit to how many items players can add, it just needs a little more work to get going It shouldn't have any performace impact at all either, except maybe 2-3 seconds loadup time once I've done ALL the items- but that's to be expected with any mod that adds this many things. In game will be unaffected.
When I was talking about performance I meant that it could, in theory cause slight framerate drop when the game has to select what model to render when it has to be loaded from NBT.
I only had this problem once when I had literally thousands of rendered items building and rebuilding models every frame from their changing NBT.
Ah; model isn't defined by NBT, only materials and specs. Each different item will use an ID; so an Assault Rifle Bolt will be one ID regardless of how many different material types are used. On top of that, raw components are simply item textures, not models - I only use models for final gun parts.
While I remember, I also need a list of brand names!
AA will have two types of components; player-created, and game-created. Game created have the potential to be a lot more powerful than player ones, but will also be rare.
I need about 40-50 brand names to use for these game created components. Nothing copyrighted, but beyond that throw ideas at me
(I suggest not using brands you've created on a server either; in the future I'll be setting up a Patreon reward system which lets people get custom brands in-game which only they can craft (at the same cost/specs as an existing material) so if you're the kind of person who uses Patreon you might want that instead ;))
As far as item rendering goes, that would have zero impact - The game will render the item in just the same way regardless of how it's loaded - but that is basically how I'm doing it. All component data is saved into it's NBT, the game uses that for initial rendering (recolouring the base texture I provide) while it's a component, and when you put it in the gun that data is merged together to a larger tag on the gun. Previously I was physically saving each item to the gun and I could still do that, but I'm trying to make things easier for players to understand, so I'll just merge the data instead. This also makes it much easier to modify data for things like crafting skill level (which has a small impact on most of a guns stats; better crafters build better guns), if you're using the skill system.
So, say you've got three materials; iron gold and steel. Iron has durability 100, weight 200 accuracy 500 etc, gold dura 50 weight 300 accuracy 1000 and steel durability 500 weight 500 accuracy 200 (example values). If you then make a gun using (for simplicity just three parts) an iron bolt, gold frame and a steel barrel, it would merge those values together so the guns durability would be 650, weight 1000 and accuracy 1700. The player can also call up a list and see "This gun was made with an iron bolt, gold frame and steel barrel", and of course they'd be able to physically see those parts on the gun if they looked at it.
That's a very basic example; there's quite a few parts used in building guns and not all parts have an impact on all statistics (The charging handle doesn't change your fire rate, for example). I'm not very good at explaining things
The main benefit of NBT vs item ID's is solely less item ID use. Most mods don't have to care about such things, because they use at most maybe 500 items and that's the huge mods - The only other mod that jumps to mind that uses more is GregTech, which uses damage. Some of my items will be damagable, so I can't really use that either - Plus, damage still has a limit of 32k. NBT works great and has no limit to how many items players can add, it just needs a little more work to get going It shouldn't have any performace impact at all either, except maybe 2-3 seconds loadup time once I've done ALL the items- but that's to be expected with any mod that adds this many things. In game will be unaffected.
Paving the way to a better world!
Ah; model isn't defined by NBT, only materials and specs. Each different item will use an ID; so an Assault Rifle Bolt will be one ID regardless of how many different material types are used. On top of that, raw components are simply item textures, not models - I only use models for final gun parts.
Paving the way to a better world!
While I remember, I also need a list of brand names!
AA will have two types of components; player-created, and game-created. Game created have the potential to be a lot more powerful than player ones, but will also be rare.
I need about 40-50 brand names to use for these game created components. Nothing copyrighted, but beyond that throw ideas at me
(I suggest not using brands you've created on a server either; in the future I'll be setting up a Patreon reward system which lets people get custom brands in-game which only they can craft (at the same cost/specs as an existing material) so if you're the kind of person who uses Patreon you might want that instead ;))
Paving the way to a better world!
Are you still working on this mod?