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.

Newcomers DBPro Corner / last topic for a while :)

Author
Message
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 1st Oct 2005 00:48
ok,im starting to make my game but i need to know one last thing 1st.

how do i code my player to walk on top of my x file ground? & also hit its walls?
Silent Knight
19
Years of Service
User Offline
Joined: 25th Jan 2005
Location: In Your Mind
Posted: 1st Oct 2005 02:02
check out collision in matedit. such as the zones demo. if you wanna hit walls look at collision in a tutorial

Version--DB Classic
900 mhz AMD Athlon, 128 MB RAM,
16 MB NVidia Vanta gfx card, Windows ME System software
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 1st Oct 2005 03:28

whats matedit?????????????
Deep Thought 42
19
Years of Service
User Offline
Joined: 31st Jul 2005
Location: New Jersey, USA
Posted: 1st Oct 2005 05:50
Its TDK Man's matrix editor created in DBC.
http://darkbasic.thegamecreators.com/?m=showcase_view&i=84
Useful tool.

"There are no stupid questions, just a lot of inquisitive idiots."
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 1st Oct 2005 07:40


kooooooooool!
Silent Knight
19
Years of Service
User Offline
Joined: 25th Jan 2005
Location: In Your Mind
Posted: 1st Oct 2005 21:11
omg i cant beleive you dont know about matedit. there should be like a sticky explaining about matedit

Version--DB Classic
900 mhz AMD Athlon, 128 MB RAM,
16 MB NVidia Vanta gfx card, Windows ME System software
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 2nd Oct 2005 07:28

ok,i checked out matedit & i still dont know how to code my player to walk on my x files ground level.

can someone explain how to do this???? :/
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 2nd Oct 2005 12:05 Edited at: 2nd Oct 2005 16:58
if using pro then use intersect object from your position to a point below you and get the distance returned, this is how far down the ground is, then position your object at this height plus half your player object height (or raise the camera by some amount that looks right if it is a fps), if you are using classic then keep moving the player or a object to represent the player and position it slightly too low each frame, if it hits the floor then move it back to the correct (previous) height but the new x/z positions, if it doesnt then leave it at the new position until the next frame, so if the foor slopes down the object will move down to follow it, and if it slopes up then it will move up to follow it, this works but you need to know that has specific angles it works at, if you adjust the height by 0.1 and the forward position by 0.1 then it works for slopes up to 45deg, after that it will struggle to reposition the player fast enough to keep up with the speed the ground is falling away, so you go into free fall, the movement looks weird (like low g), if you make it too high then you stick to the ground like a limpet, if you want to jump then remember that (in this example) 0.1 upwards will not move the player, since it just cancels the amount he moves down, so on a slope if you jumped you would move in a straight line across the scene.



why do they say Aliens are gonna be friendly?, surely the agressive ones wipe out the peaceloving ones, so all you have left out there are crazed flesh eating interstellar monsters.
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 2nd Oct 2005 15:44
thankyou for your help, me!

ill give it a try coding the way u described (fingers crossed) lol

Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 2nd Oct 2005 18:34
Silent Knight are you some walking billboard for matedit? Matedit has a few falts one of which is that is only works with DBC and not DBP. Anyone who leaves the old behind has no use for it. Also it is impossible to create interior levels and .x files with matedit.

Formerly known as SFLM.
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 3rd Oct 2005 02:18 Edited at: 3rd Oct 2005 02:18

well i havent been able to code my player to walk on my xfile.

im making a 3rd person game & most of my game will be indoors so i need to be able to walk up stairways,etc.

i could probablly use a matrix for outside.

anyone have a small example?
Silent Knight
19
Years of Service
User Offline
Joined: 25th Jan 2005
Location: In Your Mind
Posted: 3rd Oct 2005 02:46
@antidont
Yes you could say im a walking billboard for matedit because i think it is a great software. I do not really care that it is only for dbc, since that is the only version i have. I also like the fact that it is easy to learn unlike programs such as CShop. I know matedit is only for outdoor levels and it looks like it was top of the line in 1995 but it is free and good.

Version--DB Classic
900 mhz AMD Athlon, 128 MB RAM,
16 MB NVidia Vanta gfx card, Windows ME System software
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 3rd Oct 2005 03:18
Not on a computer with Dark Basic right now but basically,

IF INTERSECT OBJECT (OBJECT POSITION X(Object), OBJECT POSITION Y(Object)-OBJECT SIZE Y(Object)/2, OBJECT POSITION Z(Object), OBJECT POSITION X(Object), OBJECT POSITION Y(Object)-OBJECT SIZE Y(Object), OBJECT POSITION Z(Object))>0 THEN MOVE OBJECT UP Object, Speed

Replace Object with the object number of the object you want moving around on the .x file (the player). And replace Speed with the Speed you wish the user to move up the hill at.

For wall collisions there are many many mannnny ways of accomplishing it, all unfortuantely are complicated and can be hard to grasp for a newcommer. Do a search for G-Mans and Lost In Thought's colllision detection program, Kensupens collision detection program, my collision detection function (COLD, still kind of buggy), Sparky's collision .dll and Neuclear Glory Collision .dll.

Goodluck, hope it helps.


David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 3rd Oct 2005 05:53

ok,i tried your example but it didnt work.

heres my code:
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 3rd Oct 2005 11:51
all that code will do is move you upwards as long as the ground below you is at a height above zero???

height#=intersect object(1,x#,y#,z#,dx#,dy#,dz#)

should check for any ground below you up to 100 units away and place its position into the varable height# (the "ground" being part of object 1...your scene), y# must always be higher than your tallest point in the scene and dy# has to be lower than the lowest point, this will not work on scenes with overhanging edges or roofs obviously, since it will return the roof height, for that you need to make y# extend from the top of the player downwards and limit the height differences on the map to less then the players height per move (or it is possible to go through a slope since the next frame the player could be positioned forward and when the height test is done it can`t find an intersect with the object since you are already inside it so the reposition fails)

so to walk on the ground you actualy need to place the camera or your object a bit above it, since if you position it at exactly that position the middle of the camera or model would be at ground level, so for a camera you would see the ground as a line across the middle of the screen, and would be able to see below it as well as above, and for a model it would be up to its waist in the ground, so you need to position the camera/object a bit higher than the result returned to get things following the ground correctly, after that you need to compare the last height to the new one and if it returns some insane difference you know you just walked ito a wall or off a cliff, so you reposition the player at their old position to stop them moving.



why do they say Aliens are gonna be friendly?, surely the agressive ones wipe out the peaceloving ones, so all you have left out there are crazed flesh eating interstellar monsters.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 3rd Oct 2005 14:45
No because the destination point of the intersection ray is right below you, thus if the intersection value returned is anything greater than zero you will move up. I know it works.

Your signature has been erased by a mod because it's larger than 600x120...
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 3rd Oct 2005 15:02
Just as an example of what I mean:



Just change the distance below the user the system checks to fine tune it, and the speed the user moves up. Also, for gravity just throw in an else statement to check if the intersection does equal 0, and if so then follow through with the gravity process.

Use the arrow keys to move around, 1 to move up, 2 to move down.

Your signature has been erased by a mod because it's larger than 600x120...
David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 3rd Oct 2005 15:54
hi Ruccus, your code doesnt work all the time,sometimes the ball goes through the floor.

but its alot better than my code!i guess ill try to use your code,hopefully i can improve it sometime.

maybe ill email support & ask for help on this.

thanks btw!
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 3rd Oct 2005 16:16
heres some quite good collision code. I found it stickiied in the code snippets board, it was originally 1st person, but heres a 3rd person one i made to test my collision for my game




Just replace the "level.x" bit with whatever your model is called.





TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 3rd Oct 2005 17:17 Edited at: 3rd Oct 2005 17:19
I'd just like to clarify that MatEdit doesn't work with DB Pro IF you try to use the DB Classic #Include file.

When DBP came out, I made a DBP version of the include file, but it wasn't included in the early version you could download from the Showcase pages (V1.6b).

If anyone is starting to learn DBP and hasn't yet got to .X landscapes but is struggling with making matrix terrains, you can get a later version of MatEdit (V1.6g) and the DBP-compatible include file from the DB pages at:

http://www.computechtenerife.com

[Edit] Sorry forgot to mention: For anyone who didn't know, MatEdit is only a matrix editor - not a world editor.

TDK_Man

David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 3rd Oct 2005 23:00 Edited at: 4th Oct 2005 01:14

thankyou zotoaster!! works great!!

thats some complicated code,going to take me a while to make sense of it all

i like to understand all of the code i use.

thanks again!
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 5th Oct 2005 01:18
You can stop the ball from falling through the ground by changing the distance the ray is sent below the user and the speed the user moves up.

Your signature has been erased by a mod because it's larger than 600x120...
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 10th Oct 2005 04:56
Quote: "I also like the fact that it is easy to learn unlike programs such as CShop."


Whaaaaa! CShop hard to use?

I R tEh Antid0te! ROOOAAAR!
Silent Knight
19
Years of Service
User Offline
Joined: 25th Jan 2005
Location: In Your Mind
Posted: 10th Oct 2005 22:01 Edited at: 10th Oct 2005 22:04
i think so, well determining from the demo. except i havent done any online tutorials...

edit: TDK i know this is off topic but how old are you? because if you have been programming for 25 years ...

900 mhz AMD Athlon, 128 MB RAM,
16 MB NVidia Vanta gfx card, Windows ME System software
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 10th Oct 2005 22:50
It really isn't that hard to use. It's really just learning the interface but you are right. Back in my DBC days I used MatEdit a couple times but I have learned that mega-matrix master pro is the way for me. I just don't like the camera.

I R tEh Antid0te! ROOOAAAR!
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 10th Oct 2005 23:22
Silent Knight

Let's say I'm closer to 50 years old than 40 years old.

TDK_Man

David iz cool
19
Years of Service
User Offline
Joined: 21st Sep 2005
Location: somewhere lol :P
Posted: 10th Oct 2005 23:29
mega-matrix master pro????

whats that?
Antidote
19
Years of Service
User Offline
Joined: 18th Mar 2005
Location: San Francisco, CA
Posted: 12th Oct 2005 00:12
It's another matrix editing program. I like it mainly because I just think the interface suits me more but if you want it do a search for it in program anouncements.

I R tEh Antid0te! ROOOAAAR!

Login to post a reply

Server time is: 2024-09-24 05:24:05
Your offset time is: 2024-09-24 05:24:05