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.

Code Snippets / For beginners: A first person shooter engine, fully compatible with collision, jumping and gravity..

Author
Message
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 9th Sep 2004 17:41 Edited at: 26th Sep 2004 21:50
collision libary on page 2

>>>NEWEST UPDATES:

one with not really smooth ramp code, but it works..



And this one with a simple ai player that's chasing you:



for DBC users:




Hi everyone ,

This engine is very easy to use, The only thing you need to do is:

setting up your game
do
move_player_with_collision(object,coll,y angle)
loop

That's it!!! well if this isn't easy..

click the source button for the code.

please tell me what you think

Do you need a complete FPS,3rdPS engine ?? Or a collision command libary?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 10th Sep 2004 02:56
no comments ...

syntax error??? it isn't an error, it is a feature

teh game wiz
20
Years of Service
User Offline
Joined: 24th Feb 2004
Location: EWS
Posted: 10th Sep 2004 03:03
i like it, the jumps good and the sliding collision makes it look professional. this will defantly help those who want to get straight in designing levels etc... without having to code a fps engine.

Atreides
21
Years of Service
User Offline
Joined: 11th Oct 2003
Location: Switzerland (but NOT on a mountain !)
Posted: 10th Sep 2004 03:21
I tested, and I found that code very good for its lenght
but I think you could improve it a bit by adding comments explaining what does each part of the collision system, this part of the code is the most important

The sleeper must awaken !
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 10th Sep 2004 03:33
@atreides: working on it

syntax error??? it isn't an error, it is a feature

sadsack
20
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 10th Sep 2004 10:50
very nice thank you I can use some if not all of the code renny
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 10th Sep 2004 22:20
mouse is a little sensitive. does collision only work with boxes?

"eureka" - Archimedes
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 11th Sep 2004 02:45
You can use it on a poly collision object, "set object collision to polygons", but you'll need to get the radius good. That is diffrent with each object.. if im right..

I'm trying to make ramp collision so you can walk up a ramp/stairs.. its pretty hard to make ..

syntax error??? it isn't an error, it is a feature

Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 11th Sep 2004 03:04 Edited at: 11th Sep 2004 03:05
UPDATE:
added the command explaination.. as suggested by atreides




Hope you all like it

syntax error??? it isn't an error, it is a feature

Kequor
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location: United States
Posted: 11th Sep 2004 04:25
REM REM REM REM REM REM REM REM REM REM

`YOU MUST PUT THESE VARIABLES GLOBAL!!!

REM REM REM REM REM REM REM REM REM REM
Whats that mean?

Dont worry and keep a cool head. And click the URL below the image.

http://www.kalepia.cjb.com
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 11th Sep 2004 04:34
do you use dbpro or dbc?

if you use dbpro you must make these global:

global jumping
global start_y#
global jump_angle#
global jumpable

syntax error??? it isn't an error, it is a feature

granada
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 11th Sep 2004 16:32
Works great ,hope you get the stairs & ramp code in

dave

Windows XP Home 2002 Service Pack 1,1AMD Athlon(tm)XP 3200+ Barton 2.20 GHz ,1 GB of RAM
NVIDIA GeForce FX 5600 256MB DDR
http://www.granadagames.com/
Spaceman Spiff
20
Years of Service
User Offline
Joined: 27th Jan 2004
Location: Smacking my head on your keyboard.
Posted: 11th Sep 2004 20:03
Wow! cool It was great I love the way you can jump off into nothingness and fall forever! I'm going to go and play with it some more!

Takes 1 2 no 1
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 11th Sep 2004 22:40
thanks space man

@granada: I finished the ramp code you can walk up an ramp now if its 30 degrees or less. But it isnt smooth.. well here it is..



syntax error??? it isn't an error, it is a feature

Kequor
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location: United States
Posted: 12th Sep 2004 04:00
Classic.

Dont worry and keep a cool head. And click the URL below the image.

http://www.kalepia.cjb.com
Kequor
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location: United States
Posted: 12th Sep 2004 04:08
Also when I take those out I get this when I run it. Runtime Error at line 47. Specified angle must be 0 to 360 degrees at line 47

Dont worry and keep a cool head. And click the URL below the image.

http://www.kalepia.cjb.com
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 12th Sep 2004 04:44 Edited at: 12th Sep 2004 08:03
yes that's right, because you use classic



This one is made with some ramps.. as i said already it isnt very smooth, but have a look and tell me what you think!

syntax error??? it isn't an error, it is a feature

ALPHA ZERO PRODUCTIONS
21
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Mom ! I forgot where we live !
Posted: 12th Sep 2004 10:39
can u please post the controls for if the rookie does not know how keystate #s

ALPHA ZERO PRODUCTIONS
21
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Mom ! I forgot where we live !
Posted: 12th Sep 2004 10:40
and don't forget to add shooting

Dot Merix
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Canada
Posted: 12th Sep 2004 13:02
Nifty.

- Merix

Athlon xp 2400+, 1.0GB Ram, Radeon 9800PRO 128mb
ALPHA ZERO PRODUCTIONS
21
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Mom ! I forgot where we live !
Posted: 12th Sep 2004 13:12
but needs bullets

Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 12th Sep 2004 19:16
@alpha: yes thats a good idea! ive already made function that can move an ai player.. have a look:



Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
Mitchell
20
Years of Service
User Offline
Joined: 1st Mar 2004
Location: The Netherlands
Posted: 14th Sep 2004 03:38
Great Snippit! If I hadn't bought NuclearGlory I would certainly use it

"A delayed game is eventually good, a bad game is bad forever"
- Shigeru Miyamoto
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 14th Sep 2004 06:17
wow...not really sure how you got sliding collision with that code...but it's nice

"We make the worst games in the universe."

Oz_
20
Years of Service
User Offline
Joined: 30th Jul 2004
Location: Exeter, United Kingdom
Posted: 14th Sep 2004 07:32
You should make it so that when in midair you continue in the direction you jumped in, like in real life, that always makes fps seem more realistic, great tho


Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 14th Sep 2004 07:35
thanks guys How do you think about the ramp code.. it isnt smooth, but is it smooth enough or must i improve it (i got no idea how to do that.. ) ?

Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
PiratSS
22
Years of Service
User Offline
Joined: 18th Oct 2002
Location:
Posted: 14th Sep 2004 08:02
Imrpove it by askin the user the angle the ramp is.

DK_
20
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 14th Sep 2004 09:48
I've been looking for something like this for a long time now! maybe now I can finally make a decent 3D game.

Just now I was trying out your code on a .x object I have but it didn't work. It worked when I set the collision to boxes, but then it was like the whole map had a huge invisible block around it and I was walking on top.
When I set the collision to polygons, I just fall through the ground into infinity. What's wrong? Are '.x' files supported by collision?
They should be.

Please help me.

Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 14th Sep 2004 18:58
Quote: "I just fall through the ground into infinity"


I think that that is happening because you've set the radius incorrect.. but im not sure. In theory it should work on any object, I'll take alook at it..

@piratss: Yes, but what if there are ramps with diffrent angles ?

anyway im happy to see that its useable for some guys .

Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 14th Sep 2004 20:10
ok, look at this one. it hase some stairs



Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
ALPHA ZERO PRODUCTIONS
21
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Mom ! I forgot where we live !
Posted: 16th Sep 2004 11:48
u in a TEAM ???

ALPHA ZERO PRODUCTIONS
21
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Mom ! I forgot where we live !
Posted: 16th Sep 2004 11:53
and btw how do ya shoot ??

ALPHA ZERO PRODUCTIONS
21
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Mom ! I forgot where we live !
Posted: 16th Sep 2004 13:53 Edited at: 16th Sep 2004 13:54


Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 16th Sep 2004 19:36
I haven't add shooting yet and im currently setting up a team with some other guys.

Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
Game Freak10K
20
Years of Service
User Offline
Joined: 29th Apr 2004
Location:
Posted: 17th Sep 2004 03:50 Edited at: 17th Sep 2004 03:53
I loaded a level into your engine and while it does indeed have professional collision, it also has total collision. Theres no way to get inside of the level. Is there a workaround for this?
EDIT
What I mean is, when I load my level, I can walk around it and over it , but I cant walk thru it...

Comics and Games-Bread and Butter.
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 18th Sep 2004 00:49
Yes, That's because the collision is set to boxes.. you can set it to polygons but its acting very weird then.. because of the radius. The best thing you could do is make a level editor

Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 18th Sep 2004 00:57
I can make a level editor for ya!

Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 18th Sep 2004 05:30
Yeah. A simple level editor is easy. I was working on one a while back. All it needs to do is add in primitive objects or load in small objects, add textures etc. then save the lot as arrays in files. If you want me to help you then e-mail me: andrewneale2004@yahoo.com.
By the way, great collision there. A bit of work on it and it will be perfect for my RPG.

Realms Of Tutopia: Rise Of Evil v0.2
www.freewebs.com/elbsoftware/index.htm
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 18th Sep 2004 21:01
Thanks andrew

Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
granada
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 19th Sep 2004 00:44
Thanks for working on this Jopie dopie,I'me enjoying folowing this
Quote: "I can make a level editor for ya!"
sounds cool

dave

Windows XP Home 2002 Service Pack 1,1AMD Athlon(tm)XP 3200+ Barton 2.20 GHz ,1 GB of RAM
NVIDIA GeForce FX 5600 256MB DDR
http://www.granadagames.com/
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 19th Sep 2004 06:15
What kind of options do you want to have in it ?

-textures..
-lights..
-event editor..

tell me

Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 19th Sep 2004 07:06
yay! 2 pages

Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
granada
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 19th Sep 2004 07:46
Quote: "What kind of options do you want to have in it ?

-textures..
-lights..
-event editor.."

What a great start they would be

dave

Windows XP Home 2002 Service Pack 1,1AMD Athlon(tm)XP 3200+ Barton 2.20 GHz ,1 GB of RAM
NVIDIA GeForce FX 5600 256MB DDR
http://www.granadagames.com/
Major Payn
20
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 19th Sep 2004 09:58
I would like in an editor....

1)The ability to load .x, or .3DS models
2)An easy terrain tool
3)a point and click type environment
4)the ability to set up collision boxes for your models from within the editor
5)ability to paint textures onto terrain
6)an easy way of saving, and importing the level into the game engine!
7)DBC support!

Thats all I can think of!

Guns arnt the problem, people are the problems, shoot all the people and guns arnt a problems anymore.
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 19th Sep 2004 18:08
@dave: ok working on it!

@major:
Quote: "1)The ability to load .x, or .3DS models"


I haven't figured out yet how to get right collision for .x or .3ds models, that's why im making a level editor.

Importing the level will be easy, such as:

load_heremapeditorname_level(filename$,startobj,startimg)



Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
granada
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 19th Sep 2004 19:41
Thanks,take your time thers no hurry.Will we be able to see the code as you build it!!

dave

Windows XP Home 2002 Service Pack 1,1AMD Athlon(tm)XP 3200+ Barton 2.20 GHz ,1 GB of RAM
NVIDIA GeForce FX 5600 256MB DDR
http://www.granadagames.com/
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 19th Sep 2004 20:58
yes, open source

Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 19th Sep 2004 21:02 Edited at: 19th Sep 2004 21:03
ow btw, I'm thinking about to make a FPS libary , with level editor and very easy commands, for example:
Move_ai(objectnr,action)

something like that, actions(for example):
1=attack
2=idle
just fill it in the function
it will be though, but very handy to newbies.

I think that a game made with my lib (when finished) will look like this:



Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 19th Sep 2004 21:35
or should i just make an engine, like the 2d shoot m up engine, but than for 1st person shooter gaems so you only have to make the media, guns, sound etc en load it in the game, enter the amount of enemies, clips, lives and done !

Do you need a complete FPS engine ?? well here it is:
http://forum.thegamecreators.com/?m=forum_view&t=38869&b=6&p=0
granada
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 19th Sep 2004 22:00 Edited at: 19th Sep 2004 22:02
Both sound cool to me
Quote: "but very handy to newbies."

like me

dave

Windows XP Home 2002 Service Pack 1,1AMD Athlon(tm)XP 3200+ Barton 2.20 GHz ,1 GB of RAM
NVIDIA GeForce FX 5600 256MB DDR
http://www.granadagames.com/

Login to post a reply

Server time is: 2024-11-23 19:38:49
Your offset time is: 2024-11-23 19:38:49