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 / How to get matrix walls (maybe ceiling)

Author
Message
Miraclecode
13
Years of Service
User Offline
Joined: 7th Oct 2011
Location:
Posted: 7th Oct 2011 21:23
Yeah I bet this is posted a lot or something, but I spend a couple days on and off looking for it. I finally gave up and decided to post something about it. The title explains all... Here is the code that I have. If you could maybe edit it for walls, or point me in the right direction that would be greatly appreciated. Thanks in advance
[make matrix 9,10000.0,10000.0,25,25
position matrix 9,0,0,0
load bitmap "C:\Users\Drew\Desktop\Darkbasic Projects\media\textures\icetexture.bmp",9
get image 9,0,0,256,256
delete bitmap 9
prepare matrix texture 9,9,2,2
update matrix 9]
Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 8th Oct 2011 17:42 Edited at: 8th Oct 2011 17:43
Hi, I tend not to use matrices for level development, but you could create a for loop
and call a wall creation function which produces your walls using the Make Object Box command at the given tile x & z index. How you intend to define you walls is down to you; you could use an image and extract colour codes from pixels to determine where walls should go; you could use the Data commands or perhaps use a 3D editor, which is what I do.

Perhaps someone else may have another suggestion...

Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 8th Oct 2011 19:03
You can't make walls with matrices or any ground generation method which uses a subdivided plain as the floor... wall & ceilings are additional objects.

-In.Dev.X: A unique heavy story based shoot'em ~35%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 8th Oct 2011 19:49
Actually, you can technically make walls with a matrix. Ceilings would need to be separate objects. Here is an example:


The matrix was made smaller so you can find the wall (rotate camera to the right with the arrow keys).

Miraclecode
13
Years of Service
User Offline
Joined: 7th Oct 2011
Location:
Posted: 8th Oct 2011 21:04
Thanks for all of the help! Greatly appreciate it!
Miraclecode
13
Years of Service
User Offline
Joined: 7th Oct 2011
Location:
Posted: 8th Oct 2011 21:11
I tried the code LBFN, I established that you can make a wall like that but I need a wall that you can't pass over. For example if you hit the wall you would not be able to pass it
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 10th Oct 2011 00:10
Miraclecode:

Though you can make a wall with a matrix, I would not recommend that you use walls made like this for collision purposes. It could be done, of course, but you would spend a lot more effort and time than what you would to simply create walls with boxes (or in a 3D modeling program) and place them on the matrix. I've edited the example I gave to include a wall object. The code provides proper collision with the wall.



Chris Tate
DBPro Master
16
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 10th Oct 2011 19:25
In addition, another option you have is using a single object for all of the walls, and carve out the passages.

This can be done by creating the matrix and placing a box of the same width and depth above it at the height of the walls, and as you loop through it, use the [Perform CSG Difference] command on the wall mesh, using pathway objects to carve out the pathways in the wall box.

chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 11th Oct 2011 12:54
We can force the player to collision with the matrix like a wall and even knowing that matrix is too slow, we can add several matrix to make ceiling and floor.

http://forum.thegamecreators.com/?m=forum_view&t=126897&b=6

Download a cave example.


Cheers.

I'm not a grumpy grandpa

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 11th Oct 2011 17:19
chafari:

It was hard to tell where the wall was because the matrix was randomized. I took that out and made the wall a certain height and could see where it worked almost every time. However, if I tried to get up the wall at the end, it let me. Since it is based upon the difference in the ground position of the camera, I figure that you would have to make sure the rest of the matrix does not have any significant undulations, otherwise the camera will get stuck.

chafari
Valued Member
18
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 11th Oct 2011 18:33 Edited at: 11th Oct 2011 18:34
Walls has been made randomly in the matrix, and the height too , so we can adjust the height where we want.However, it was just an example.

Cheers.

I'm not a grumpy grandpa
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 12th Oct 2011 05:07 Edited at: 12th Oct 2011 05:11
I came up with this: http://csnorwood.site40.net/dark-basic-pro/pseudo-random-3d-level-generator-dark-basic-pro-v3-1/ which did take a lot of asking questions on the TGC forums as I was between DBP and C++.

Basically the plan, and it worked, was to generate a floor of a dungeon. The rest was just added... After the floor was created I just extended the 'points' to make a 3D level.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!

Login to post a reply

Server time is: 2024-11-22 12:21:32
Your offset time is: 2024-11-22 12:21:32