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 Discussion / Okay ive seen all the new people threads, read all the tutorials,,, I dont get a thing,,, Help me please!

Author
Message
Foogie
18
Years of Service
User Offline
Joined: 8th Sep 2007
Location:
Posted: 9th Sep 2007 04:34
Okay... I get the whole "Hello World" thing but beyond that... Im lost... I want to make at the very most right now a floor... 3d preferably but i doubt that will happen... Can anyone help me?

Whoa... I see... a... no it cant be!!! a COOKIE!!!
demons breath
22
Years of Service
User Offline
Joined: 4th Oct 2003
Location: Surrey, UK
Posted: 9th Sep 2007 13:56 Edited at: 9th Sep 2007 14:25
You've done the 3D Monster Hunt tutorial as well? http://developer.thegamecreators.com/?f=t01/3d_tutorial_index

best thing I can think of for starting out.

Post what you're trying to do in more detail and maybe people more useful than me will be able to help.

For a floor you'd probably want to be using a matrix though... I'll try and make this basic and explain as much as I can think of but I'm a bit of an amateur at this whole coding stuff (by which I mean I'm crap )




The command Make Matrix makes a matrix (mostly used for making terrain in games).

The first parameter (the one) is the matrix number. Each matrix needs a unique number, but you probably won't need many at once anyway... I don't think I've ever used more than one, but I think the cave runner example uses one for the floor and one for the ceiling (another good thing to play around with when getting used to the commands)

The second parameter (the 500) is the size of the matrix along the x axis in world units. The third (300) is the size along the z axis.

The fourth and fifth parameter say how many squares you want the matrix divided into along the x and z axis. More squares gives you more control, but there is a limit on the amount of squares you can use overall. Using more matrix tiles probably has an effect on the running speed of your game as well.

Anyway, that lot should make a flat floor. However, it will be see-through and divided up into triangles.




Your next step will probably be to texture a matrix. Create a bitmap in any program you want or get one off the internet (there are also some textures that come with the disc). Save it in the folder where your .DBA file is saved. Now:




The load image unsurprisingly loads the image that you want to use. The first parameter is the file name (you can either use a relative path or one saying the entire destination which isn't so useful if you want to distribute whatever you make as it would rely on everyone installing your game in the same place). Don't forget to include the file ending (e.g. texture1.bmp). I don't know what file formats are supported but for this sort of thing you're probably best off sticking with bitmaps. 256x256 pixels is the maximum size.

Now to apply it to the matrix.



The Prepare Matrix Texture command allows you to use the image you just loaded to texture the matrix. The first parameter is the number of the matrix that you want to apply the texture to (if you simply used what I put earlier then it will be matrix 1, obviously you change it if you used a different matrix number). The second refers to the image which you loaded in the second line of code. The third and fourth should be the same. These split the image into however many equal segments. Here, as just one is used in both parameters, the image is not divided. However, if you had 2 as each parameter, it would be split into four sections. You should use powers of two to divide your texture up:

The tiles are numbered something like this (for a two by two division):

I think that you can divide it up that many times but no further, but thinking realistically, what are you going to need more than 65,000 different textures for. Of course, you might not be able to have that much but...

Now to texture each tile:

To texture a tile individually, use the command



Set Matrix Tile sets the image used for the tile. The first parameter(1) tells you which matrix is affected. The second and third tell you which tile is affected: the fourth along in the x-direction and the sixth in the z-direction (numbering here starts from zero). The last tells you which part of the image associated with the matrix will be used, but above I only split it into one. Otherwise you'd use the numbering system in my funky diagram above.

Obviously, texturing each tile individually like this would take ages. Therefore we use a for...next loop. This tells the program to repeat a block of code the specified number of times.



z increases each time the next z command is called, and then the program skips back to the for line. Because of this, z can be used as a variable. This loop will repeat until the z value reaches the number at the end of the for line. Because this is nested inside the x loop, the entire loop will be repeated each time through the x loop as well. Therefore you get all the tile coordinates:

0,0 0,1 0,2......1,0 1,1 1,3...... etc.


That's about all I can be bothered to do at the moment to be honest because it's taken me about an hour so far... I'm not very good at explanations.

But anyway I hope at least some of this makes sense. I'm sure that some kindly soul will correct the innumerable mistakes I probably made

http://jamesmason01.googlepages.com/index.htm
Dark Dragon
19
Years of Service
User Offline
Joined: 22nd Jun 2007
Location: In the ring, Kickin\' *donkeybutt*.
Posted: 9th Sep 2007 16:38
what demons breath said.
Insert Name Here
19
Years of Service
User Offline
Joined: 20th Mar 2007
Location: Worcester, England
Posted: 9th Sep 2007 19:16
DD, please don't fill up te forum with posts with no meaning.

Acording to Grandma, I am now enemy of the evil republic, who captured Paris Hilton and couldn't manage it.
Aarqon
18
Years of Service
User Offline
Joined: 30th Aug 2007
Location: Where else?
Posted: 11th Sep 2007 17:20
Firstly: Start small.

If you've just finished the beginner tutorials, you should stick to reading, writing, and storing data for now. You know, arrays and manipulating variables. Creating things in 3D requires a great deal of file storing and manipulation. You should also familiarize yourself with coordinating things in 3D space before you try to make anything like that. I'm a noob to 3D programming myself, and I can tell you that it's a lot easier to start small before you go onto stuff like that.

Once you have some decent bearings in 3D stuff, go on to what you and demons breath was saying.

Login to post a reply

Server time is: 2026-07-06 02:53:58
Your offset time is: 2026-07-06 02:53:58