I looked up online a bit for making a modable game but I’m not quite sure how to do it. The idea is basing off of Halo 3’s forge system but with more complexity. My game will have weapons spawn on the map based on what prefabs exist.
Here is a link to a map editor:
and a thread about making a modable game:
the second link mentions designing your game to be modable from the start, which I sort have already done in a way. I’m in the very early stages of development; To start I have a weapon system I started working on that is customizable, and after I finish that I want to create a special type of map creator.
My weapon system basically works like this:
the player has a shooting script
the player makes the gun a child
the gun has the stats of the weapon in a script
when the player shoots, it finds the damage variable on the script on the weapon that’s the current child.
I want players to be able to set their own damages for weapons and import their own models with textures, and animations for their own weapons with a toolkit in the game. No scripting by their part, only entering in values.
For instance:
player opens weapon toolkit
player imports model for gun
player types in, or adjusts a slider for different stats (ie damage to keep it simple)
modded weapon is saved as a prefab.
Now the player can create a custom game:
player selects map
player chooses new modded weapon to be on the map
player can pickup the new modded gun, and have all the parts working as if I made it before building my game
After this I wanted to make a map editor that would mostly work in the same fashion:
The player uses pre-fabs I provide from making the game
The player moves all the pieces around to make the level how they wish
The player makes a nav mesh to allow bots to find their way around the map
The player exports the newly created piece as a prefab(if they made a base they will want to re-use), that can be used again later, or as a scene to be a complete level.
Is there any help you can provide for this? If you need any further explanation to how I plan to program my basic systems, or any suggestions for how to create things that would be beneficial.
I find it interesting that your poll has no “I will help” option… implying that you don’t expect anyone will actually help.
…
Here’s the thing on forums when you ask questions. We don’t write tutorials or code for ya (well some of us are a little long winded… like myself), which I sort of understand (or so I assume from your poll options).
It’s best to ask smaller type questions that build up to large ideas. You seem to have found a lot of resources so far, so you’re making way with that.
So how about you pick something out of that and ask a specific question… rather than talking about weapon systems, AND map editors, AND ask for general help.
How about ask for specific help.
What exactly are you having a problem with, what part is a hang up for you.
Thanks for the reply! I wanted to put everything in the OP because I didn’t want people to stop helping once I got one question answered.
My main question is how to allow players to create prefabs with their own models, and then use those for their games.
ie weapons based off my design.
failing this perhaps just how to let players create their own stats for weapons. For instance change the M16 damage from 10 to 20 and save it as a new gun.
You can have them create prefabs in Unity, export them as an Asset Bundle, then that becomes the mod file.
Otherwise you need to import all of that at runtime, which can be subject to a lot of human error, less friendly and generally more difficult for both sides.
The best approach to modding is to give users the same tools that you use to build your game.
Kerball achieves this by offering an editor extension for Unity that can be used to build asset bundles that can then be loaded by the game at runtime. This is probably the simplest way to produce mods.
You’ll also want to expose as many levers as possible to modders. This means nothing gets hard coded, everything gets read in from external data files. It also means you make the tools to create these external data files available to modders. Either through editor extensions or as stand alone tools.
Can you give me an idea of how I would instantiate a pre-fab from a folder? For instance adding all the items in a folder to an array so I can choose one randomly if the player wants to do random weapons on map? Or can you link me to a guide that would explain more on using packages in mods?
I don’t have the technical knowledge to make my own tools for the game as of now, so I would just be using standard Unity. Would this suffice the “Give users the same tools you use to build your game” tip you advised?
I haven’t actually played Kerbal but I’ve messed with the Fallout 3 and Fallout 4 GECK or modding tools so I think I have an idea of what you mean.
I was hoping to do something to prevent modders from having to write their own scripts so it’s easy for those not experienced to make fun changes to the game fine tuned to their liking. Like a menu option that would open a scene where they could import a model and change the stats of it to make their own cool and fun guns.
Finally thanks for the optimism! I felt it would be complex if possible.
If you’re not having the user change the actual model of the guns, then you’ve got a pretty easy solution. Just drive the values for your guns from config files.
Here’s me spitballing a little bit.
Have a scene where they can load a base gun (lets say… a pistol).
The pistol has:
Fire rate 5
Reload rate 5
Damage 5
Recoil 5
The user is given 5 points they can distribute how ever they see fit. They make:
Fire rate 10
Reload rate 5
Damage 5
Recoil 5
and they name their new gun SpeedyPistol. Then they hit save.
You write out the new values to a file called SpeedyPistol.config and when the gun is created in the game, you read back those values.
If you are clever about how you model and skin your guns, I bet you could allow the user to change the color(s) as well.
Edit:
Your prefab also becomes super basic. You call it “Gun” and it has whatever gun script you need to make it aim and shoot and do all the things all guns should do. Then you can just instantiate that as normal and load the config file at run time. No need to make a new prefab for every new gun