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 / Get Object Height Like Terrain

Author
Message
punkyb
7
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 22nd Oct 2016 01:06
I was wondering if there's an updated solution to this problem. I found some old ones but there's lack of proper simulation with the terrain counterpart.

Hope someone can shed some light into this.
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 22nd Oct 2016 01:33
A lot of people like to use Sparky's collision .dll... i've attached it if interested. It comes with examples.

Otherwise, INTERSECT OBJECT can be used for accurate terrain-like collision detection on objects.
Send your parents to noisy sprite demo hell... enter the D-Zone

Attachments

Login to view attachments
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 22nd Oct 2016 02:05
I use sparkys for object collision and highly recommend it. It's fast, can handle sliding collision, can return bounce vectors, surface normals, good stuff.


A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
punkyb
7
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 22nd Oct 2016 12:03
Thanks Derek Darkly and Ortu! I did notice that this is the "Go-to" collision library for DBP. I'll give this a try.

I'm still working my way with basic DBP maybe there's already an example done where you can simulate a terrain mesh?


punkyb
7
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 22nd Oct 2016 15:24
I also found out that there's a command like this in Advanced Terrain Plugin



So I guess there are equivalent functions that are similar with matrix terrain?
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 22nd Oct 2016 15:28 Edited at: 22nd Oct 2016 15:35
This is not a full working example but the Advanced Terrain commands look something like this:
(You should be able to use "SAVE OBJECT" on these terrains.)

Send your parents to noisy sprite demo hell... enter the D-Zone
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 22nd Oct 2016 15:33

I have successfully used matrixes as terrains, although they are limited in the way you can texture them.
Send your parents to noisy sprite demo hell... enter the D-Zone
punkyb
7
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 22nd Oct 2016 16:53 Edited at: 22nd Oct 2016 16:53
Thanks! So it looks like this could be my option. Good example btw, maybe you can add up the INTERSECT OBJECT to sample the height/collision checking?

I was looking into the SparkyDLL examples but I cannot find the command set being used there.
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 22nd Oct 2016 18:33 Edited at: 22nd Oct 2016 18:35
Just open up the file "SC_Collision.ini" to see all the commands.

And as per the ReadMe:

Place the 'SC_Collision.dll' file in your 'Dark Basic Professional\Compiler\plugins-user' folder
If you want key words highlighted in the IDE place the 'Help\Keywords\SC_Collision.ini" in your "Dark Basic Professional\Editor\Keywords' folder


Each time you add a plugin you'll have to restart the editor.
Send your parents to noisy sprite demo hell... enter the D-Zone
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 22nd Oct 2016 18:39

BTW, if I were going to make a 3D terrain I would consider using texture splatting.
There is a nice thread on it here.
Send your parents to noisy sprite demo hell... enter the D-Zone
punkyb
7
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 23rd Oct 2016 03:31
Thanks Derek Darkly, finally I got to test on your last example above and it works like a charm!

So this is in particular what I'm after all along:



Yes noted that's a great resource but I already covered that part with the splat mapping.

Quick question though, what does terrain update do? I removed it but it doesn't change anything?
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 26th Oct 2016 00:41

Quote: "Quick question though, what does terrain update do? I removed it but it doesn't change anything?"


Well, I thought it was necessary but if your terrain shows up without it then that should be fine.
Send your parents to noisy sprite demo hell... enter the D-Zone
punkyb
7
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 26th Oct 2016 01:12
Quote: "Well, I thought it was necessary but if your terrain shows up without it then that should be fine. "


Ok thanks!
Scorpyo
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: italy
Posted: 26th Oct 2016 09:51
If I remember correctly - terrain update - occludes the chunks invisible to the camera for better performance.
punkyb
7
Years of Service
User Offline
Joined: 8th Sep 2016
Playing: PC and Android Games
Posted: 26th Oct 2016 11:50
Hey, that's good to know!
Derek Darkly
12
Years of Service
User Offline
Joined: 22nd Sep 2011
Location: Whats Our Vector, Victor?
Posted: 28th Oct 2016 01:33
LoL... I figured there had to be a good reason for that command to exist!
Send your parents to noisy sprite demo hell... enter the D-Zone

Login to post a reply

Server time is: 2024-04-18 12:38:32
Your offset time is: 2024-04-18 12:38:32