How do I make a Infinite weapon generation system? (Borderlands-esk)

I’m really new to this kind of stuff, honestly my friend has just been teaching me. And I was just wondering if there is a way I can make a weapon pool type deal like Gearbox and 2K’s famous “Borderlands” series?

Get some resizable gun parts that are adjusted by code. Make a few variables that affect gun stats, and adjust them by code. Mix those two systems and you’re set.

If you’re new, I would focus on either making modular gun parts or the variable weapon stat parts.

1 Like

Thank you so much! do you happen to have any pre-written coding i could use or is this gonna be hours of extra work?

If you want something AAA-quality, yes it’s going to take a lot of work! Check out this dev blog that lays out exactly how loot rolls in Borderlands 2 works.

That’s probably overkill for you. Just thought I’d stop by with this link. Yeah, not very helpful I know. >.>

EDIT: Re-reading your post, you’re asking about randomizing the weapons themselves, not how to pick which weapon to drop as loot. You might still get some insight into the weapon stats part of it, but it’s not exactly what you’re asking for.

It’s -esque

/grammar nazi

My lazy, phonetic eyes went right past that mistake D: I feel so ashamed…

You could make a weapon property script. Here’s something so basic that I wrote it line by line in the insert-code window on this forum page. You might want to replace damage with a bullet class that you would need to also write, since you’d like to have custom bullets as well. I suggest you first write a list of the properties & parameters that you want players to be able to modify, then decide which should be grouped together.

class Weapon : MonoBehavior
{
    /*damage per shot*/
    int damage;
    /*variables for fire rate*/
    float delay;
    float delay_max;
    /*clip size*/
    int clip_size;
}

If you’re interested, I’ll walk you through something silly that will help you lay out your game. Making a board game out of it.

1 Like

Id love for you to help me honestly! My mom knows c++ and shes willing to teach it to me just she told me to look up tutorials.

1 Like

It’s settled then. You should PM me so you can add me on skype, then the 3 of us (including your mom) can discuss turning your idea into a board game over winter break, then turning the fully planned out & functional game idea into a digital game (assumed at this point to be an fps).

#altruism

-edit

Here’s my initial thoughts for the board game.
1864081--119599--boardgame_with_guns.png

I think if you have a little thing setup for players to hold & use their cards on, it’ll be a pretty awesome game. Then you need a board of course to be the world the players occupy. Then, since you want modular weapons, you need a list of parts. That could be its own deck. And you’ll need lots of rules for determining when you draw cards and which deck you draw from. Maybe one space on the board is your reserved space for the weapon shop. Then a rule similar to…

When a player lands on the shop space, draw several cards from the parts deck to make up the shop’s inventory. The player can then take one card and the rest get shuffled back into the deck / the player can spend in-game coins collected from jobs for parts & sell parts they’ve collected for more coins.

As for the bottom bit of the image I posted here, that is the weapon the player has. The parts will determine the stats on the weapon which will add up for the success or failure (or dice roll & influence) on completing jobs.

Stuff.

Wait so youre saying you think I should put cards into the game whet? XD and my mom is a bit busy with a my nephew… hes 2 and uhm ill pm you right now

Cards are just by far the best way to handle having so many parts.

Alright, we only really need her at the end so she can learn you some programming and then you can turn the game into a digital one. I’ll check that PM.