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 / Need some help with collisions and x files

Author
Message
i lyke pineconez
15
Years of Service
User Offline
Joined: 16th Aug 2010
Location:
Posted: 17th Aug 2010 04:00
Okay, I know theres a lot of these on here, but im having trouble making a level. I'm a newb so please bear with me.

I have a .x file I would like to use for my 'level', and I only have a camera for my player, no .x file for him. However, every time i start my program the player falls thru the x file into the sky-sphere. I have downloaded and used the sparky DLL, however that did nothing for me, unless im doing something wrong.
This is how im starting my game:


After that its just key/movement handlers.

Apparently .bsp files are a lot easier to work with, if any one knows of a utility to create a .bsp file from a .x file, let me know. I've looked and looked but I've found nothing that actually works.

Any help would be appreciated! Thx in advance.
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 17th Aug 2010 05:43
Probably the easiest way to get going is to use the Sparky's sliding demo code and plug your world.x object into it in place of the level.x file (I think that is what it is called in the demo).

If your level is more than simply a box, I would suggest using SC_SETUPCOMPLEXOBJECT 2,1,2 instead of SC_setupObject 2,0,2. When you do the collision check use the SC_SPHERECASTGROUP command and check against group 1.

You will need an object to check collision against, so make a sphere, set it up and hide it and be sure to update it's position with the camera.

So many games to code.......so little time.
Omen
19
Years of Service
User Offline
Joined: 7th Nov 2006
Location: Maple Grove, MN US
Posted: 17th Aug 2010 06:01
It just so happens that I just published a little tutorial tonight on using Sparky's Sliding Collision DLL

http://omen.lakehomegames.com/project-updates/hour15-camerascontrolscollision

i lyke pineconez
15
Years of Service
User Offline
Joined: 16th Aug 2010
Location:
Posted: 17th Aug 2010 06:43
Thank you LBFN, very much, im looking at that demo now, i didnt see that x file in there the first time.

Omen your tutorial was particularly interesting, i think once i learn more about DBP, im gonna have to go back there and see what i can learn.

Once again, thanks for helping a noob out!
LBFN
19
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 17th Aug 2010 17:08
You're welcome. Good luck with it.

I lyke your forum name.

So many games to code.......so little time.
i lyke pineconez
15
Years of Service
User Offline
Joined: 16th Aug 2010
Location:
Posted: 18th Aug 2010 02:32
@LBFN: Lol thx. Pinecones FTW!

One more thing im wondering about now are the terrain files (kinda off topic in this post). I've used that example and made a sphere around my player, but when I try to place him on a terrain, he still falls thru it. However on a .x file it works perfectly. Is there something im missing/not doing right, or is it that sparkys DLL isnt focused toward terrains?

Also (lol) is it possible to load a Terragen terrain file (.ter) into a game somehow?
Omen
19
Years of Service
User Offline
Joined: 7th Nov 2006
Location: Maple Grove, MN US
Posted: 18th Aug 2010 02:41
Quote: "One more thing im wondering about now are the terrain files (kinda off topic in this post). I've used that example and made a sphere around my player, but when I try to place him on a terrain, he still falls thru it. However on a .x file it works perfectly. Is there something im missing/not doing right, or is it that sparkys DLL isnt focused toward terrains?
"

Advanced Terrain (AT) will work perfectly with Sparky's (using both together right now for OMEN). Just make sure that when you use Complex Collision for the AT object. Also, players and world object should be in different collision groups.

i lyke pineconez
15
Years of Service
User Offline
Joined: 16th Aug 2010
Location:
Posted: 19th Aug 2010 01:20
Thanks Omen, I'll see what I can do with AT.
i lyke pineconez
15
Years of Service
User Offline
Joined: 16th Aug 2010
Location:
Posted: 19th Aug 2010 01:45 Edited at: 20th Aug 2010 01:54
Sorry for double-posting, but with terrains, is it possible to make it so that its not ALL grass? Like, add dirt, roads, sand, snow, Etc., and have them be properly textured?

If I have a .x file, or even a .dbo, it seems to only show it in greyscale, even when the textures produced with it are in the same directory. Any way to fix this?

Login to post a reply

Server time is: 2026-07-25 17:49:46
Your offset time is: 2026-07-25 17:49:46