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 / [DBP] UberZones (a zone system)

Author
Message
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 17th Oct 2008 21:27 Edited at: 9th Feb 2009 17:46
Original Post


This is a big part of UberEngine and ive decided to release it to the members and guests of this forum. I released it here because it was quite popular on my forum so im hoping that it will do just as well here.

Its a zone system which tells you when a sphere or point is inside or intersecting an box or a sphere.

Tested with: DBPro 7.0 Betas 1,4,6 and 8





Code and compiled demo to show how to use this code:

http://files.filefront.com/UberZoneTestrar/;12065701;/fileinfo.html

Xsnip3rX
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 12th Nov 2008 12:54
Tested and Compiles under 6.6b

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 12th Nov 2008 16:53
Thanks

UberZones is what gives UberEngine its really good speed. How? Its mostly used in the terrain engine to see if a Dynamic Rigid Body is near a sector, if there is a near dynamic rigid body, then the collision will be activated for that sector. Im also adding a feature for frustum culling 'UberZone_ZoneInFrustum(camera,zone)' because DBPros culling of indexbuffered objects seems to not work well (the sector objects are indexbuffered).


Games, Code, 3D Models and more! click here
RedFlames
17
Years of Service
User Offline
Joined: 25th Aug 2007
Location: Germania
Posted: 12th Nov 2008 19:01
Are you sure this:

shouldnt be this:



Other than that, nice coding style and structure
i didnt know one could write that much just to define a box/sphere in 3d space and check if a point or box is in it... i mean its only simple math after all

Oh and by the way i think matrix1utils has something similar, where you can define a zone and check a point, but i dont remember if it had spheres. I think it has just box zones with point-checks.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 28th Nov 2008 18:13
Thanks for the comment

Im now thinking about making my next code snippet, I could probly give skinned ragdolling in Dark Physics a go or make an Open Source FPS Engine. so if you have any ideas on what i sould make next, then please post them here and ill see what i can do.

revenant chaos
Valued Member
17
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 6th Feb 2009 12:57
That would be awesome if you got dark physics ragdolls to work with boned, animated models.
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 8th Feb 2009 19:10
Im quite far with it. I just need to tweak around a few things (as the limbs dont position themselves perfectly yet).

Airslide
20
Years of Service
User Offline
Joined: 18th Oct 2004
Location: California
Posted: 8th Feb 2009 21:26
Are you using Dark Physics's ragdoll commands or are you manually positioning the model's bones to the corresponding ragdoll parts? Either way, if you get it to work, many people will probably be happy

Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 9th Feb 2009 00:06
I wouldnt mind the open source fps engine especially if you could maybe do a bit of step by step guidance tutorial style


kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 9th Feb 2009 17:06 Edited at: 9th Feb 2009 17:19
The Open Source FPS Engine is mainly all my codes put together.
I think minimaps which move, rotate and zoom would also be needed (Im working on this).

For ragdolls, I will need to find a new programmer who can program an editor which will be used for adding the joints, rigid bodys and skinning it. Then export an xml format file to be loaded into the code.


As soon as its released, I will post about it on the following website: http://www.blitzwerks.co.uk/1_16_Code.html

tiresius
22
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 15th Mar 2009 03:16
From Matrix1 DLL thread:
Quote: "tiresius,
I have a zone solution that does just that.
It was built for speed and stability so it has a very long code...
[links to this post]
"

Thanks kaedroho for the link, your zone system looks nice. I like it when people post a nice code system which is pluggable into other projects without much fuss.

I'm sure your zone system is plenty fast enough for your purposes, but I'm afraid I wouldn't consider it "optimized" enough for what I need. You are still looping through ALL zones in the system when checking if something is inside a zone.

And this might make sense for your use of the system but why make actual DBPro objects out of each zone?

I need support for a couple hundred overlapping zones and I'm afraid your system might not be enough. Without some inbuilt OctTree or whatever fancy system there is for collision pruning I think the best I can do now is make a cell-based index to my master zone list. Cells are divided on the X/Z coordinates (60x60 cells for the level) and keep a list of zones which can found within those cells, then just do checks on those zones within a cell to see if the player is really inside them.

But thanks for pointing this out to me!

I'm not a real programmer but I play one with DBPro!
kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 16th Mar 2009 17:31 Edited at: 16th Mar 2009 17:36
Quote: "And this might make sense for your use of the system but why make actual DBPro objects out of each zone?"


Debugging, I needed this feature in a project I made with it. Objects only get created if you call the createzoneobject command.


Quote: "You are still looping through ALL zones in the system when checking if something is inside a zone."


Well you are looking at the wrong function. The function your looking at, makes a list of all the zones that that point is inside then returns that list to the user. Use 'UberZone_PointInZone(zone,x#,y#,z#)' for checking a single zone.

Login to post a reply

Server time is: 2024-11-22 08:01:36
Your offset time is: 2024-11-22 08:01:36