Destruction Productions
Destruction Productions
Destruction Productions
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Make Games. Make Money. Make Friends.
 
HomeLatest imagesRegisterLog in

 

 Gun system

Go down 
5 posters
Go to page : 1, 2  Next
AuthorMessage
Neko
Admin
Neko


Number of posts : 490
Registration date : 2009-02-22
Age : 28

Gun system Empty
PostSubject: Gun system   Gun system EmptyWed Nov 11, 2009 10:19 am

I was bored so i made this gun generator here.
http://willhostforfood.com/?Action=download&fileid=94088
Back to top Go down
Hegemege
Moderator
Hegemege


Number of posts : 919
Registration date : 2009-02-21
Age : 31
Location : Helsinki, Finland

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyWed Nov 11, 2009 10:55 pm

It's okay but I'm not sure if it will be usefull... Anyways, thanks
Back to top Go down
Neko
Admin
Neko


Number of posts : 490
Registration date : 2009-02-22
Age : 28

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyWed Nov 11, 2009 11:36 pm

Hegemege wrote:
It's okay but I'm not sure if it will be usefull... Anyways, thanks
Its better than making 5000 guns by hand...
PS, press space to randomize the components.
Back to top Go down
Commander~DEST
Admin
Commander~DEST


Number of posts : 1499
Registration date : 2009-01-16
Age : 29
Location : Quispamsis, New Brunswick, Canada

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyWed Nov 11, 2009 11:44 pm

We might be able to use to make enemies have random weapons (with different parameters for different enemies, of course). It owuld add variety to the game and it would be very easy to incorporate this into the game.
Back to top Go down
https://dest.forumotion.com
Neko
Admin
Neko


Number of posts : 490
Registration date : 2009-02-22
Age : 28

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyWed Nov 11, 2009 11:47 pm

Commander~DEST wrote:
We might be able to use to make enemies have random weapons (with different parameters for different enemies, of course). It owuld add variety to the game and it would be very easy to incorporate this into the game.
Having the game run on mostly random generations allows us to add more into the game. Enemies can also drop there randomly generated items, Shops can also provide randomly generated weapons too.
Back to top Go down
Hegemege
Moderator
Hegemege


Number of posts : 919
Registration date : 2009-02-21
Age : 31
Location : Helsinki, Finland

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyThu Nov 12, 2009 12:34 am

Did you use choose(x) or floor(random(x))?

Anyways, we have to limit the enemies weapons in a way, the first enemies cant have bazookas and ultra snipers... But the idea is good! We can modify it to randomize enemies, but we have to somehow organize, what enemies come at a given time. However totally randomized enemies can be used in the other game modes.
Back to top Go down
Neko
Admin
Neko


Number of posts : 490
Registration date : 2009-02-22
Age : 28

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyThu Nov 12, 2009 12:48 am

Just an idea... The weapons that spawn are only good due to the components, which good components are really hard to find at lower levels, that means most enemies are going to have sucky weapons... And not just the components are rare, the chance that the enemy will even have a bazooka is small. The weapon creation is also going to involve component levels and all that so you don't have any overpowered level 1s and all.
Back to top Go down
Hegemege
Moderator
Hegemege


Number of posts : 919
Registration date : 2009-02-21
Age : 31
Location : Helsinki, Finland

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyThu Nov 12, 2009 1:06 am

Good, I can help you with the probabilities if you want.
Back to top Go down
Neko
Admin
Neko


Number of posts : 490
Registration date : 2009-02-22
Age : 28

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyThu Nov 12, 2009 1:11 am

I was thinking that, programmers here at DP have nothing good to do right now. So i was thinking to get the programmers to help with this random gun engine thing.
Back to top Go down
Hegemege
Moderator
Hegemege


Number of posts : 919
Registration date : 2009-02-21
Age : 31
Location : Helsinki, Finland

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyThu Nov 12, 2009 1:31 am

You can use a switch statement. to make a part of the gun more common, add more cases and remember to increase the number of barrels/bodies. To make the random function produce more powerful weapons, make a new function, just replace the common and sucky weapons. Example:

//random_pistol()

n1 = number_of_barrels //here: 3
gun_barrel = floor(random(n1))

switch(gun_barrel) {
case 0: { gun_barrel_type="Basic Pistol Barrel"} break;
case 1: { gun_barrel_type="Silenced Pistol Barrel"} break;
case 2: { gun_barrel_type="Accurate Pistol Barrel"} break;
default: { gun_barrel_type="Basic Pistol Barrel"} break;
}

n2 = number_of_bodies //here: 3
gun_body = floor(random(n2))

switch(gun_body) {
case 0: { gun_body_type="Basic Pistol Body"} break;
case 1: { gun_body_type="Hardened Pistol Body"} break;
case 2: { gun_body_type="Rusty Pistol Body"} break;
default: { gun_body_type="Basic Pistol Body"} break;
}

and the same thing for other components. You should copy a blank template when you include these functions into the game so you need to type less and there less errors too.


Last edited by Hegemege on Thu Nov 12, 2009 1:35 am; edited 1 time in total
Back to top Go down
Neko
Admin
Neko


Number of posts : 490
Registration date : 2009-02-22
Age : 28

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyThu Nov 12, 2009 1:32 am

:O... Im lost, im not that big on programming anymore.
Back to top Go down
Hegemege
Moderator
Hegemege


Number of posts : 919
Registration date : 2009-02-21
Age : 31
Location : Helsinki, Finland

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyThu Nov 12, 2009 1:34 am

I haven't used GM for a month or so... Smile
Back to top Go down
Neko
Admin
Neko


Number of posts : 490
Registration date : 2009-02-22
Age : 28

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyThu Nov 12, 2009 1:37 am

Your aslo a freakin genious.
Back to top Go down
Hegemege
Moderator
Hegemege


Number of posts : 919
Registration date : 2009-02-21
Age : 31
Location : Helsinki, Finland

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyThu Nov 12, 2009 1:49 am

well thank you Very Happy
Back to top Go down
Commander~DEST
Admin
Commander~DEST


Number of posts : 1499
Registration date : 2009-01-16
Age : 29
Location : Quispamsis, New Brunswick, Canada

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyThu Nov 12, 2009 7:26 am

Everything I've read here is great. We really do need to get what programmers we have on this job.

BTW: Hegemege, nice script. I never even knew about the switch statement.
Back to top Go down
https://dest.forumotion.com
Neko
Admin
Neko


Number of posts : 490
Registration date : 2009-02-22
Age : 28

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyThu Nov 12, 2009 7:31 am

Switch is like a crap load of compairing and all.
Back to top Go down
Hegemege
Moderator
Hegemege


Number of posts : 919
Registration date : 2009-02-21
Age : 31
Location : Helsinki, Finland

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyThu Nov 12, 2009 5:53 pm

Switch can replace many if-statements. And switch is also faster.
Back to top Go down
Hacker

Hacker


Number of posts : 98
Registration date : 2009-11-12
Location : Lost in the Binary... Help me...!

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyThu Nov 12, 2009 11:33 pm

Switch is very faster if your including probability, but if not, its something to be wary of.
Back to top Go down
http://www.glitchygames.forumotion.com
Nragemachine

Nragemachine


Number of posts : 296
Registration date : 2009-02-25
Location : Illinois

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyFri Nov 13, 2009 4:10 am

So I'm somewhat confused as to what this actually is? So does it just randomly generate weapons for enemies with specific add-ons and stats like scopes and stuff or is it a way of taking random gun parts together and making them into one gun like frankenstein?
Back to top Go down
http://www.freewebs.com/nragemachine/guitarwarriorsforum.htm
Neko
Admin
Neko


Number of posts : 490
Registration date : 2009-02-22
Age : 28

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyFri Nov 13, 2009 5:41 am

Its randomly putting together random components. The problem now is that it can randomly add a component to any gun... A level 1 enemy could have a super awesome level 30 gun because theres no limits right now.
Back to top Go down
Hacker

Hacker


Number of posts : 98
Registration date : 2009-11-12
Location : Lost in the Binary... Help me...!

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyFri Nov 13, 2009 6:20 am

Yep thats a problem, why not use unlinear equations, maybe something equal to a semicircle?
Back to top Go down
http://www.glitchygames.forumotion.com
Neko
Admin
Neko


Number of posts : 490
Registration date : 2009-02-22
Age : 28

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyFri Nov 13, 2009 6:25 am

Im thinking off assigning each of the parts a few variable... Rarity,level, that stuff. So a gun can never be overpowered or underpowered.
Back to top Go down
Hacker

Hacker


Number of posts : 98
Registration date : 2009-11-12
Location : Lost in the Binary... Help me...!

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyFri Nov 13, 2009 6:32 am

Again, that would be a perfect example of using arrays.
Back to top Go down
http://www.glitchygames.forumotion.com
Hegemege
Moderator
Hegemege


Number of posts : 919
Registration date : 2009-02-21
Age : 31
Location : Helsinki, Finland

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyFri Nov 13, 2009 3:31 pm

Indeed. Or just make many functions which output something like:

Level 1-3 Pistols
Level 11-16 Machine Guns
Level 7-10 Any Weapon
Back to top Go down
Hacker

Hacker


Number of posts : 98
Registration date : 2009-11-12
Location : Lost in the Binary... Help me...!

Gun system Empty
PostSubject: Re: Gun system   Gun system EmptyFri Nov 13, 2009 10:29 pm

Your going about it all wrong, you need to make a x and y relationship with ONE equation.
I personally would need to graph this before I was sure about it.
Back to top Go down
http://www.glitchygames.forumotion.com
Sponsored content





Gun system Empty
PostSubject: Re: Gun system   Gun system Empty

Back to top Go down
 
Gun system
Back to top 
Page 1 of 2Go to page : 1, 2  Next

Permissions in this forum:You cannot reply to topics in this forum
Destruction Productions :: Archives-
Jump to: