Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Best way for grenades? (also, any tips on shaders?)

Author
Message
Interplanetary Funk
16
Years of Service
User Offline
Joined: 19th Apr 2010
Location: Ipswich, United Kingdom
Posted: 4th May 2010 23:12
I'm just wondering the best way to make grenades. I have dark physics and was trying to figure out how to make a grenade spawn where the player is and go in the direction he's facing, which I have no idea how to do. Also, what would be the best way for explosions, I was thinking a collision sphere and just rapidly expanding that for the explosion, but I have no idea how I'd go about making the actual explosion visuals, I'm guessing particles, but I have no idea how to use them.

Also, just wondering, how do you use full screen shaders? I tried loading it and setting it to the screen shader but nothing happened , which is annoying, because almost all decent visuals in games nowadays use shaders.
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 4th May 2010 23:34
I have never experimented with this myself yet, but, I would just use a plane for both the grenade and the explosion. Since you won't see much of the grenade during the toss except a little black circle, you can just use this and texture it with a black circle.

For the explosion, just use a plane as well. It'll save on using 3d objects for something that you won't really notice in 3D in the first place. So, if you animate the plane (or sprite) with an explosion, and rotate it so that it is always facing the camera, I'm sure it'll look good enough. You could even use a couple of planes to get a more layered effect.

Many games, ie: Oblivion use planes for effects such as fire and explosions.

For shaders, I'm not that good myself, but I know there are many tutorials online, and there is a thread at the top for help on shaders. They can be extremely tricky.

www.myspace.com/norseblod
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th May 2010 00:22
Quote: "Many games, ie: Oblivion use planes for effects such as fire and explosions."


And it's often obvious they are using planes because they've been careless with the edges or with the transparency. Happens a lot in Dragon Age: Origins.
Matty H
17
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 5th May 2010 00:45
Pretty sure you can't expand the collision sphere, I don't know if Dark Physics supports force fields, if not you could manually apply forces to any dynamic objects around the explosion.

My first post in the DBPro forum, I like what you guys have done with the place

Interplanetary Funk
16
Years of Service
User Offline
Joined: 19th Apr 2010
Location: Ipswich, United Kingdom
Posted: 5th May 2010 00:55
I think there is forcefields, I'll have a look in the demo folder. =) are there any basic particle tutorials as well? even if it's a very basic one, I should probably get my head around them at some point or another.
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 5th May 2010 05:02
@GG, that is true... there are some cases where it is very obvious, otherwise it wouldn't be known that it was a plane. Although, done properly it could work. I don't know much about working with particles. It seems like it would be quite slow, correct me if i'm wrong, because I would like to know as well what the best method for effects is.

www.myspace.com/norseblod

Login to post a reply

Server time is: 2026-07-27 20:18:22
Your offset time is: 2026-07-27 20:18:22