Destruction Productions


Make Games. Make Money. Make Friends.
 
HomeRegisterLog in

Share | 
 

 Gun system

View previous topic View next topic Go down 
Go to page : 1, 2  Next
AuthorMessage
Neko
Admin
avatar

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

PostSubject: Gun system   Wed 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
avatar

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

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

It's okay but I'm not sure if it will be usefull... Anyways, thanks

__________________
WTF = Welcome To Finland

"I'm a Finnish man. I eat iron and sh*t chains!"
Back to top Go down
Neko
Admin
avatar

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

PostSubject: Re: Gun system   Wed 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
avatar

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

PostSubject: Re: Gun system   Wed 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.

__________________
Commander~DEST | Admin of Destruction Productions

Making games is not a hobby, but a commitment.
Back to top Go down
http://dest.nice-board.com
Neko
Admin
avatar

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

PostSubject: Re: Gun system   Wed 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
avatar

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

PostSubject: Re: Gun system   Thu 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.

__________________
WTF = Welcome To Finland

"I'm a Finnish man. I eat iron and sh*t chains!"
Back to top Go down
Neko
Admin
avatar

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

PostSubject: Re: Gun system   Thu 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
avatar

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

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

Good, I can help you with the probabilities if you want.

__________________
WTF = Welcome To Finland

"I'm a Finnish man. I eat iron and sh*t chains!"
Back to top Go down
Neko
Admin
avatar

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

PostSubject: Re: Gun system   Thu 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
avatar

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

PostSubject: Re: Gun system   Thu 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.

__________________
WTF = Welcome To Finland

"I'm a Finnish man. I eat iron and sh*t chains!"


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

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

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

:O... Im lost, im not that big on programming anymore.

__________________

Back to top Go down
Hegemege
Moderator
avatar

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

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

I haven't used GM for a month or so... Smile

__________________
WTF = Welcome To Finland

"I'm a Finnish man. I eat iron and sh*t chains!"
Back to top Go down
Neko
Admin
avatar

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

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

Your aslo a freakin genious.

__________________

Back to top Go down
Hegemege
Moderator
avatar

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

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

well thank you Very Happy

__________________
WTF = Welcome To Finland

"I'm a Finnish man. I eat iron and sh*t chains!"
Back to top Go down
Commander~DEST
Admin
avatar

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

PostSubject: Re: Gun system   Thu 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.

__________________
Commander~DEST | Admin of Destruction Productions

Making games is not a hobby, but a commitment.
Back to top Go down
http://dest.nice-board.com
Neko
Admin
avatar

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

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

Switch is like a crap load of compairing and all.

__________________

Back to top Go down
Hegemege
Moderator
avatar

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

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

Switch can replace many if-statements. And switch is also faster.

__________________
WTF = Welcome To Finland

"I'm a Finnish man. I eat iron and sh*t chains!"
Back to top Go down
Hacker

avatar

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

PostSubject: Re: Gun system   Thu 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

avatar

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

PostSubject: Re: Gun system   Fri 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?

__________________
Watch Awesome Videos!!
Back to top Go down
http://www.freewebs.com/nragemachine/guitarwarriorsforum.htm
Neko
Admin
avatar

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

PostSubject: Re: Gun system   Fri 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

avatar

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

PostSubject: Re: Gun system   Fri 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
avatar

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

PostSubject: Re: Gun system   Fri 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

avatar

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

PostSubject: Re: Gun system   Fri 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
avatar

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

PostSubject: Re: Gun system   Fri 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

__________________
WTF = Welcome To Finland

"I'm a Finnish man. I eat iron and sh*t chains!"
Back to top Go down
Hacker

avatar

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

PostSubject: Re: Gun system   Fri 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




PostSubject: Re: Gun system   

Back to top Go down
 
Gun system
View previous topic View next topic Back to top 
Page 1 of 2Go to page : 1, 2  Next
 Similar topics
-
» How DVPS (Delivery Versus Payment System) will benefit to CSE.
» Manipulators hail the new system upgrade
» Who is running our system? From economy to education.
» Sri Lanka banking system well capitalized, solid: officials
» Capital Trust "ATRAD"online trading system

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