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 / Walk-through tutorial (With basic collision)

Author
Message
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 30th Jan 2007 03:21 Edited at: 13th Feb 2007 15:31
The following tutorial will take you through the steps of loading objects, creating objects, implementing collision and adding a simple sky. So without further ado, onto the tutorial
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
section 1:
setting up the main program settings~here we will look at how to set up a camera and get your computer ready. We will set all of the main roots of the program here.

section two:
loading the map file and setting it's position.
making the player~In this section we will look at what it takes to load an ,X file and how to create a simple box to use as the player.

section 3:
controlling the player~In this section we will look at how to control the player. There are two ways of doing this, but we will use the "standard" FPS keys W,S,A,D

section 4:
raycast collision(yes there are many ways to do this, so this is just one of those ways)
part one:
the frontal collision sphere~Here we will learn about meshes and limbs and how to make a sphere and attach it to our main player.
part two:
the ground collision sphere~This will be similar to the first part but in this case we will be making "feet" for our player
part three:
implementing the actual collision~The core of this tutorial, how to detect for walls.

section 5:
Skybox creation
loading the images .x file
creating the box
setting it's properties~Here we look at a simple way to add a sky into our program.

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003

Attachments

Login to view attachments
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 30th Jan 2007 03:29 Edited at: 20th Feb 2007 19:28
SECTION 1: ~~~~~~~~MAIN PROGRAM SETTINGS~~~~~~~~

For starters open up your DarkBASIC Pro and open a new program. Name it CollisionTest. This will then bring you to the source code page. You will see at the top a series of REM statements. You can either leave these or delete them. I choose to delete them but you don't have to. You can also change them so that it reflects more info on what your program is about.


NOTE: everything that is capitalized is a DarkBASIC command. These will turn blue when entered into DarkBASIC. This helps to separate them from the other pieces of your code. The actual code without all the explanations will be at the bottom of each section so you can see what it would look like in a normal setting.

Your first part of code is this:




That covers this part. This is pretty simple but sets up your program to make it ready to run. In the next section we start filling in the program by making the player and positioning the player with the camera so that we can walk around in a first person view.

~~~~~actual code~~~~~


LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 30th Jan 2007 03:54 Edited at: 9th Feb 2007 18:38
SECTION 2: ~~~~~~~~Loading the Map and making the Player~~~~~~~~~~


Now we will start making things happen within the program. First we need to load all the media (all files including the cm.x and temple.x files). To do this you simply go to the "MEDIA" tab on the far right corner near the bottom. Here you can click "ADD". This will bring up a box in the center of the screen. Click the folder icon to browse the folders. Go to where you extracted the media files from the first post. You will have to add each image file one by one. Before you hit the "OK" button, make sure you check the box that says "Copy the media files...". This will shorten your directory path name to just the file name rather than having to type in the whole "c:/ blah blah blah". Once you have all the image files loaded, hit the "add" button and the "browse" button again. Now click on the arrow where it says "Files of type" and choose "3D Files...". You will see the cm.x and the temple1.x files. select each of those and load them into your meda collection. Now that we have the media loaded, we can proceed with the coding.
NOTE: A neat thing about DBPro, is that you don't have to add all the images into the actual code. By using the "Add Media" it is automatically referenced into your program.





Your code should look like this now (if you take out a bunch of the comments and explanations)






LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 30th Jan 2007 14:43 Edited at: 9th Feb 2007 18:33
Section 3: ~~~~~~~~CONTROLLING THE PLAYER~~~~~~~~~~~~~

At this point we are going to look at how to move the player box. This will move with the camera so from this point on you will not see the box anymore if you walk around. We will use the standard FPS controls of keys W,S,A,D (forward,backward,left,right). To do this we use the KEYSTATE command. This command will allow us to use any key on the keyboard. You can find the list of scan codes online at several places. For now we are just interested in four.
NOTE: If you wanted to use the arrow keys then you would used the commands: UPKEY(),DOWNKEY(),LEFTKEY(),RIGHTKEY() in place of the KEYSTATE() commands. So let's take a look at this shall we








So now your code would look like this...(without the explanations)


Now when you walk around, you are moving the box as well. Next we will look at making the collision happen so you don't walk through walls. Though it may seem confusing at first, it really isn't that bad. So get ready... here it comes

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 30th Jan 2007 15:35
Quote: " The backdrop off is self-explanitory"


Not really...

Quote: "This can be anywhere from 0 to 10000"

Actually, goes up to 0x7fffffff, a little bigger than 10000

Also, you don't need to make camera 1. Just use camera 0 (and you don't even need to number it, 0 is set by default)

Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 30th Jan 2007 18:07
what I meant by self-explanitory is the fact that if you can read you can understand that the command simply states there is no backdrop. Hence "BACKDROP OFF" turns it off. I didn't want to get into explaining every little command when some commands do not need to be explained. As for the camera, you are right. But if you notice at the beginning of this whole tutorial I mentioned that there are many ways this could be done. Some may be easier, some may not be. But for the purpose of this tutorial, I chose to have them make the camera so it is simpler to explain what is going on. (For those who follow along, you don't need to make the camera as camera 1 but it is helpful to do so for trouble shooting and checking purposes sometimes.) As for the camera range, I will have to check on that one because the reference I remember seeing stated that it only goes as far as I mentioned. But if I am wrong on that I will let you all know(well all that read this anyhow hehe. Thanks Zoto...) Now back to the tutorial...

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
TEH_CODERER
20
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 30th Jan 2007 19:33
In fairness, 'hide mouse' is more self explanatory than 'backdrop off' because anyone using a computer will no that the command will do exactly what it says and no that it isn't referring to disappearing rodents or vanishing hardware.
Also, if you are going to have them make a camera then change the sync mask to just update camera 1 otherwise it is very unefficient.
But I'm being picky so forget it.

Anyway, neither me nor anyone else should discourage you from giving to the community so thank you and please continue.

Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 30th Jan 2007 19:44 Edited at: 9th Feb 2007 18:42
Section 4: ~~~~~~~~SETTING THE COLLISION~~~~~~~~~~~

Before I go any farther I wanna make mention that there are several ways to do collision testing. Sparky has a collision setup, there's Newton, Nuclear Glory, etc. Or you can write your own. For the purpose of the beginners, we will use the DBPro collision system. This will involve using what's known as Ray Casting.

RAYCASTING: To put this in simple terms, this basically is a method that draws an invisible line from the player box to another object that we will create. Anything that crosses that line will register as a collision. This will give us the ability to control what the player should or should not do. (Wall or steps). You could also use this for FPS games where you want to see if the player's gun was in line with an enemy. For the purpose of this we are only using it to check for wall/stairs collision.


For the first part, we need to make an object to place in front of us. I prefer to use a sphere at this point as it is simple and easy to see until we hide it. This way we can test how far away the player will be before the collision takes place. So, after the code where we made the player box, we will add the following code:



And that is all we have to do to set up the collision spheres. The next part will take you through setting up the actual collision checks. So up to this point, your code should look like this...



LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 30th Jan 2007 21:25 Edited at: 9th Feb 2007 18:46
SECTION 4: ~~~~~~~~IMPLEMENTING THE COLLISION~~~~~~~~

Again, there are many ways to do this but we will use the INTERSECT OBJECT command. So let's break that one down...

The INTERSECT OBJECT command is what creates our ray for the collision. It will create an invisible line between the two positions we specify. In this case, we will be using our first limb(the wall collision sphere) and of course the player box. Since these values are constantly changing, we can use DBPro commands to locate those positions for us. Those commands would be the LIMB POSITION X(), LIMB POSITION Y(), and LIMB POSITION Z(). This will give us the values of each coordinate of our limb. And we use the OBJECT POSITION X(), OBJECT POSITION Y(), and OBJECT POSITION Z() to get the current position of our player object. Now, no matter where we are or our limb is, we will always have the current positions.

The INTERSECT OBJECT command itself has 7 values to add to it. The first value is the object we want to collide with. In this case it is object 2 (our temple). The next values are broken down to XYZ coordinates. The first set is going to be the LIMB POSITION.

(LIMB POSITION has 2 values. the object number and the limb number. For now we will focus on limb 1- the wall collision sphere)

The second set of XYZ values will be the player box. So let's take a look at it in action...

IF INTERSECT OBJECT (2, LIMB POSITION X(1,1), LIMB POSITION Y(1,1), LIMB POSITION Z(1,1), OBJECT POSITION X(1),OBJECT POSITION Y(1), OBJECT POSITION Z(1))>0

MOVE OBJECT 1,-10
ENDIF

We can use the intersect object to check for collision with anything if we change that first value to 0. But for now we will keep it at 2. Then we want the limb's XYZ positions. Since this is not a constant number we just use the LIMB POSITION X(Object #, Limb #) and then the same for the Y and Z coordinates.

Now we will place in the second set of coordinates for our RAY. This time we use the Object Position X(object #) and the same for Y and Z.


To check if there is a collision we use the " > 0 " operation. This just says that if it is greater than 0 then there is a collision. If it is less then or equal to 0 then there is no collision.

Next we add what we want to do. In this case, if there is a collision we want to back the player up to a point where there was no collision. So all we do is subtract from the players position twice the amount we moved forward. This will place us before the collision occured and let the whole process start over. So now we will put this all together into our program.


This will go inside the first KEYSTATE IF block.



That is all there is to the collision. Looks like a lot but it's not too bad once you know what it does. If you need a further explanation feel free to email me and I'll do what I can So now your code will look like this.



LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 30th Jan 2007 21:40 Edited at: 7th Mar 2007 20:54
Section 5: ~~~~~~~~MAKING THE SKYBOX~~~~~~~

This is not complicated at all if you already have the .x file for the skybox.


Just below the temple setup code we will add this final piece of coding.


So now your completed code will look like this



now if we run this and walk outside we will see the landscape and sky. If you keep the walking speed slow, it looks like steps when you walk up or down them. If you speed it up, then you don't see that definition. When I get home, I will add one last piece to this to show you how to condense the collision checking by setting up a function to do the collision. But for all intents and purposes, this will do it for you now. Hope you enjoyed this.

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 31st Jan 2007 04:17
looks good but it seems your getting the same thing I got, some good constructive criticism and no replies about the tutorial even though i spent 5 hourse making the tutorial lol.

Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 31st Jan 2007 15:26
I'm not overly worried about the responses or not. I'm sure this will help somebody. And if not, it at least helped me . And it's not like this was a super massive coding project that drained me and my coffee reserves lol. So I'm satisfied with what I got out of it I think I want a penquin...

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
citybee
17
Years of Service
User Offline
Joined: 27th Jan 2007
Location:
Posted: 1st Feb 2007 03:11
I couldnt load the ".x" files. (lol x-files )but im sure it would be great. and im sure you helped plenty of people with this tutorial, so put a grin on that face.

thx
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 1st Feb 2007 19:37
Kudos for the effort, here have another penguin .
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 2nd Feb 2007 00:38
Its great that youre trying to help, but you dont explain in detail anything, you kind of give a small description of why you do something, nut no information as to what it is.

Like a mesh, you say you make one to make a limb, whats a mesh? whats a limb? why does a limb require a mesh? If this is going to be a tutorial, you should really explain in-depth all of this, for every command other than the really self explanatory ones like hide mouse. I havent read the entire thing, but Im sure if you went back and explained everything much more in-detail the tutorial would be a lot better.

Also, the indentation of your code is pretty bad, along with the style of caps/nocaps you're using (it seems almost random), and you should be putting the code in code snippet boxes for easier reference.

Im not trying to be a prick, but lately tutorials have been popping up every month for DBP, and usually they're made by people fairly new to the forums. I know forum join dates arent always a representation of experience with dbp, but your join date along with the coding structure you're using, I wouldnt say (im sure many would disagree though) you're ready to write a tutorial yet.

Maybe read over TDK's Tutorial On Making Tutorials.
- RUC'


:: Check out the new FPS Tutorial's Progress at http://www.freewebs.com/ruccus
along with code, media, and more.
Dammit Jim
17
Years of Service
User Offline
Joined: 12th Jan 2007
Location:
Posted: 4th Feb 2007 17:58
Cruise.....nice job!
Appreciate you taking time out to help noobs like myself....
.

I found this tutorial very helpful...answered a lot of questions that I had. Haven't been doing this very long, but I (after check other 3D gaming sites out) find this site to be the BEST one out there.

Cudos and thanks again!

What?....Me Worry?
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 5th Feb 2007 16:24 Edited at: 5th Feb 2007 16:28
@ Ruccus
I am not trying to be a prick either( so I appologize in advance ) As per the indentation and capitalization factors, that is all a personal preference. If you want to, you could write the code like this:


Now granted it's not that easy to read, but it could be done like that. As for not explaining everything? Before I posted this tutorial, I had a friend of mine that is very new to programming follow it. And without any extra explanations, he was able to understand it and learned from it. I am tired of tutorials that start out with a simple idea and then overload you with information. So much that you can't remember what the tutorial was supposed to teach you. This tutorial, though not perfect since you could just use a collision function and a move player function and clean it up greatly, is simply put a way to show noobs how to implement collision inside an .X file. When it comes to the actual code, it is inside a code box. But the explanation part of the code snippets is easier to read because the font isn't as small the way I did it. That's why I didn't put it inside a code box. And as for not being ready to write a tutorial? How could you dare attempt to say that? Because I don't use all capitalization and indentation? Because I don't overload you with 15,000 ideas to go so in depth of what I am teaching that you don't know which way is up and have tyo go back and re-read it 20 times to make any sence out of it? This is a very simple and easy to follow tutorial. And if the "Proper Coding Authorities" wanna yell at me, let them. I don't care. I did what I set out to do. Make a tutuorial to help the noobs understand a little bit more about collision. I did add a piece on the mesh so they can go look it up for more info if they want. Again, I don't mean to be a prick, but a simple thank you for giving back to the community would be nice. Take this for what it is, a simple tutorial designed to help. I will aslo as that if you wanna respond to this post, please email me as I would hate to overload this tutorial with sidebar comments about this. Have a good day.

@Jim

Glad I could help

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 5th Feb 2007 17:20
ADDITION: ~~~~~~ FINDING YOUR .X FILE IN DBPRO ~~~~~~~~

When adding your own .X file it may not be visible right away pending on where it is located. Even though all objects when loaded have an initial placement of 0,0,0 any object (or map) created in a different application may not be "centered" at 0,0,0. So if you load your file and don't see it, move around with the camera till you do. Usually you can just hit the back arrow key till you see it. Then, when you find it, you could create variables to hold the camera position so you can find where it is located. For example, your code would look like thismake sure you loaded your .X file and all the media for it in the "MEDIA" tab before proceding to run any .X file coding hehe.)



Now when you run this, you will automatcially print out the X and Z values of the camera. When you find out where your object is located, you can just put those values into the position object and position camera statements and then whenever you start your program you'll be where your model was loaded.

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 5th Feb 2007 18:15 Edited at: 5th Feb 2007 18:21
You can say everything is personal preference in programming, thats besides the point. It could be someone's personal preference to write out MAKE OBJECT CUBE 1,10, MAKE OBJECT CUBE 2,10 ... MAKE OBJECT CUBE 100,10 instead of using a loop, the point is it can cause debugging problems, and anything that causes a problem isnt good. Say they follow this tutorial, and a week later post questions involving the source code, the amount of programmers on the forums willing to read anything more than 5 or 10 lines of unindented code is small, so theyll get less help finding the answer.

The same goes with not explaining things, does your friend understand what a mesh is? Sure, I could find a 5 year old and tell him that 3 x 4 = 12, but does he know how multiplication works from that? No, hes just memorized the output, similar to memorizing that you need to make mesh's for limbs, but not why you need to, or how mesh's can be used elsewhere.

Im sure your friend managed to understand every bit of it, thats fine, but next month when he wants to make a small map editor for his game and doesnt understand how mesh creation allows you to join many objects together into 1 object and then save that object, he'll be lost, he'll ask on the forums, and people will tell him about the mesh commands. Then he'll wonder why he didnt know that, even though he's used meshs in the past.

While im at critisizing the tutorial so far, theres a reason you havent been getting mush response to it, that being tidyness (forgetting the indentation problem). You should put your code snippets in code tags, use bold words to seperate off sections, and stop using bbscript in your code tags, because newcommer's will assume thats part of the code, compile it, and get an error. Again, Im sure you'll think this is just me being an ass trying to point out small flaws in the tutorial, but if you're going to take the roll of teaching new users something, do it properly.

- RUC'


:: Check out the new FPS Tutorial's Progress at http://www.freewebs.com/ruccus
along with code, media, and more.
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 5th Feb 2007 23:05
@ Ruccus

Did you read the first post I made? I stated there that this tutorial will not cover and explain every little detail. If I need to explain the MAKE OBJECT BOX command, then that person is not ready to work on collision. Again, as for the mesh part... I put a link there for more information on it since it is a rather good simple explanation of meshes. As far as not putting the text in code brackets because when you do it gets harder to read as the font is smaller. So, when I am explaining the code I will leave it out of the code brackets. And if you looked at the tutorial rather than just look for simple things to nag about, you would see that at the bottom of each section is all the code from that section and the previous sections up to that point. If you are going to nag then find somewhere else. The reason I am not getting responses has nothing to do with the way I wrote the code or the tutorial. Not everyone that uses a tutorial feels compelled to leave a remark about it. It would be wrong to assume taht everyone who uses this would comment about it. So now I will end this discussion and ask that you please stop nit-picking this tutorial. I know you are trying to help, but that is taking away from what this tutorial is supposed to do. So thanks for the help and before I do another one I will make sure it conforms more to the "Proper Coding Techniques" of indentation etc. Have fun and I appologize to everyone for the rants and raves. Enjoy

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 6th Feb 2007 02:18
I'd like to make a few points if I may...

First, merely adding the word 'Tutorial' to the topic of a post gives it an air of authority. Newcomers will assume that they can be trusted to educate and inform in the correct manner.

We also want to make sure that a post marked as a tutorial really is a tutorial - not a commented code snippet.

If a tutorial is of a decent quality it can be stickied by the mods as a sort of 'certificate of quality' - basically because we want to keep the tutorials as high a quality as possible for newcomers.

Then, newcomers can see that tutorials not stickied aren't really up to scratch - however well-meaning the author - and those below par will simply disappear down the forum pages into obscurity.

I provided the guide on writing tutorials to give those wanting to write them an idea of the sort of thing mods would be looking for when deciding on whether a tutorial was worth stickying.

Feel free to disregard these guidelines, but at least you know the things we are looking for.

TDK_Man

Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 6th Feb 2007 15:16
What you should be looking for are things that help newcomers. And this does that. If you want I will go back and make all the "proper" indentations and all if that is so darn important to everyone. Obviously, that is more important than the content of the actual tutorial. And if you want, I will go back and fill it in with so much information explaining every little detail that you won't be able to understand what the heck the tutorial was about. Actually, when I get a chance, I will re-write this in that fashion. Then I want you to look over both of them and tell me which one you think is more helpful. So I will apologive to everyone else in advance for the double post of this tutorial.

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 6th Feb 2007 16:09
Quote: "And if you want, I will go back and fill it in with so much information explaining every little detail that you won't be able to understand what the heck the tutorial was about."


It's not what I want at all.

Remember, it was you that used the word 'tutorial' in the topic of your post and are complaining because some of us are merely stating what we expect of a tutorial on this forum in order to keep standards up.

That was the whole point of my post - use the word tutorial and you attract attention. Don't use the word and we won't care what you put in your post or how you present it.

Really, I just don't understand the resistance to doing something properly these days. If something's worth doing, isn't it worth doing well?...

The code boxes are much better for code than not using them (despite the font used) and indentation makes the code easier to read. So what's the problem??

Quote: "Then I want you to look over both of them and tell me which one you think is more helpful."


If the same information is in both then neither will be more helpful than the other. But the second will (hopefully) be better quality and worthy of the title 'tutorial'.

TDK_Man

white boy kyle
17
Years of Service
User Offline
Joined: 5th Feb 2007
Location:
Posted: 6th Feb 2007 18:53
Where is the .x's at?
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 9th Feb 2007 18:50
@ TDK

I just redid the whole thing. Please look over it and let me know what you think. I believe it is much more explained and of course I fixed that whole caps/indent thing. Have fun.


@ White Boy

They should be there, but I am at work right now. I will check when I get home.

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 10th Feb 2007 02:10
All of the files needed are in the first post. The x files are there with a notepad icon

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 26th Feb 2007 20:36
Hey TDK!! What do you think ?

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
Dracula
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: DBP Recreation of Castle Csejthe
Posted: 26th Feb 2007 23:42 Edited at: 26th Feb 2007 23:44
How about filling in some of the points you all feel are important, but that you feel Cruise left out. For all the space and energy you've devoted to telling him what he should have done, you could have just explained it and added to the tutorial. If you want to see an awful tutorial, look at the one that comes stock from TGC with DBP. I'm not defending Cruise (well, maybe just a little), but he is trying and it is more useful (imo) that the one that came with DBP. I didn't read the whole thing, but I appreciate brevity, since I can look up important details later. On the other hand, I appreciate the input from TDK and Rukkus, since a thoroughly explained tutorial would be a good thing.

Anyway, thanks Cruise for your attempt to help the community, and thanks Rukkus and TDK for trying to raise the bar on tutorial quality.

D
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 27th Feb 2007 00:04
Quote: "Hey TDK!! What do you think"


Sorry - I missed the post you made on the 9th. Will give it a good read through now you've re-vamped it.

Quote: "How about filling in some of the points you all feel are important, but that you feel Cruise left out."


I think that's already been done. Besides, the idea of a tutorial isn't to leave gaps for others to fill in.

I wrote a guide for people who were thinking about writing tutorials which simply listed the things that received the most complaints.

Anyone who sticks to this guide is very unlikely to receive any complaints and newcomers will benefit from much better tutorials.

Also, I'd like to repeat once again that this only applies to threads where the author has specifically used the word 'tutorial' in the topic description. Use the word 'help', 'guide' or anything else and it won't attract any attention.

TDK_Man

Dreamon Star
17
Years of Service
User Offline
Joined: 24th Feb 2007
Location: The Frozen Wasteland
Posted: 28th Feb 2007 05:11
Hey all, I don't know what's wrong with my collision detection.... but, i did try one on my own and thought that it should have worked, and didn't... then i even (just to see) copied and pasted the code in here, and i still had the same problem... no detection... the gravity would pull me right through... any ideas..?

www.soundclick.com/octoberscry ---> My Doom Metal Band
Johnathon
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: South Park
Posted: 28th Feb 2007 18:57
Hello. I'm new to DBP and coding itself! I really need help understanding all this. Thanks.
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 4th Mar 2007 17:46 Edited at: 4th Mar 2007 18:20
@Dreamon

My computer is under repairs at the moment, but when I get it up and running, please send me your code and model if you would like and I will take a look at it to see what the problem may be.


@Johnathon

What questions may I answer for you? If there is anything that you don't understand please feel free to ask


@TDK

You really think this is a poor Tutorial? Then write me one that does the exact same and show me how YOU could make it better. Otherwise, knock it off. Just because it is NOT a tutorial done in YOUR way does not mean that it is a bad tutorial. YOUR way is not always the best. I've been through some of yours and they are not as easy to follow sometimes. Is it your goal to try to confuse the newcomers? As for this tutorial...it is very informative and very helpful except for the fact that you seem to think it is better to so quickly destroy it rather than help it and accept it for what it is. Instead of shooting it down and claiming that it sucks why can't you accept that not everyone will write a tutorial to your specs because your specs are not the only specs that a tutorial should follow. So I would appreciate it if you would get off my back. And for anyone else looking to make a new tutorial... watch out, they would rather tell you that it sucks and that you don't know what you are doing rather than admitting that you are helping the community. Unless of course you are "in bed" (not literally) with the main people. Give a guy a break. If this is how you commend help and assistance than you need a lesson in manners. For this I will not respond on any other points other than anyone who has a question or comment on the actual tutorial, not on how it is put together. Your personal preferences are hurting rather tahn helping the community. And maybe nobdy else wants to say this so I have. As for this tutorial, it follows ALL CODING PRACTICE AND PROPER SPACING AND ALL!!!!! What the heck more can you ask for?????

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
XelleX
17
Years of Service
User Offline
Joined: 4th Mar 2007
Location:
Posted: 5th Mar 2007 00:23
Well i even tryed copy paste it but i still get this error:
[b]Parameter for 'Position Object' do not match Object Number, X,Y,Z' at line 105

any ideas?

DarkBasic Learner
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 5th Mar 2007 08:59 Edited at: 5th Mar 2007 09:20
Cruise McClarren, TDK is trying to help you make a better tutorial.

There is no point is challenging him to write a better tutorial, basically you set back your tutorials quite a while doing that, as well as getting it stickied to the requirements he has set.

TDK is a respected member who's multiple free programs across DBC/DBP and input should be a token of good advice to you and all future teachers of this language.

Looking at the first aspect of your tutorial I can see some dead ends.

[A]
Creating a new camera instead of using camera zero will slow down older computers


[B]
The do sync loop is not very good practice for controlling your game.
It would be better to have a condition to break out of that loop at any time.
imagine this



same as your do loop but now at any time if the escapekey is pressed you can terminate it and add content at termination.

As you can see your level of experience is showing an ignorance to some fundamentals.
There is no problem with that as we are all at different levels of programming.
However challenging the status quo as if you know better really doesnt make you look intelligent to the elder crafters.

[C]
If I was to carry on, when you load an .x object you kinda failed to mention the speed of a DBO object compared to the .x object and how the .x object is great but in terms of speed the DBO loads faster and is more native.

shall i look further? no thats enough to quantify what im referring to.
A little bit of information is great but a true understanding of the principles involved really shines through.

Now as another example we have Xellex asking you questions regarding your tutorial. A great tutorial defines the problems that surround the issues at hand without anyone asking for a question, and especially saying part of it doesnt work.

I think its great your making an effort to help other users, no argument there, but please respect those who give their free time to manage this place without any remuneration bar from the love of the product they share with you.

I have to back TDK up on this one as I think your out of line, a real coder/ teacher knows when he is wrong and corrects it. No one respects a teacher who knows it all and doesnt tow the line.

Kieran
18
Years of Service
User Offline
Joined: 6th Aug 2006
Location: Hamilton, New Zealand
Posted: 5th Mar 2007 09:04
sorry, but im behind TDK and Indi here. I learned that bad tutorials kill brain cells the hard way.

Rikimaru
19
Years of Service
User Offline
Joined: 31st Aug 2005
Location: England
Posted: 7th Mar 2007 18:01
I appreciate the effort Cruise has made, the tutorial provided me with all th basics I need, and as a newbie anything but the basics to start with would probably drown me.

Your tutorial has not only taught me many things, but has given me ideas on new and exciting things I can try, I mean I can finally walk up and down stairs!! that's like a whole "other level" if you'll excuse the pun.

Thank you! and I hope you provide more 'guides' (to apease the powers that be)

"Death is but an escape chosen by those who dare not live. I merely emancipate their souls." - Shadowblade, Master of Assassins.
Rikimaru
19
Years of Service
User Offline
Joined: 31st Aug 2005
Location: England
Posted: 7th Mar 2007 18:30
The error XelleX is mentioning is happening to me, there seems to be a missing OBJECT POSITION Z(1) on that line, once I filled it in, I managed to run the program... and fell and fell and.. you get the idea.

I managed to stop myself from falling by removing the "=" from "<=0" at the end of lines 82 and 146. however that seemed to prevent me from walking up those long awaited stairs, forward and backwards walking was fine, although turning any degree to the right or left would not affect me going forward or backward in a straight line as if I were facing the original position (if that makes any sense at all).

This to me is a step forward in my learning, any help Cruise or TDK and the other Mods could give would be really great.

(DBPro user)

"Death is but an escape chosen by those who dare not live. I merely emancipate their souls." - Shadowblade, Master of Assassins.
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 7th Mar 2007 20:52
@ Indie

The only reason I did not use that style of a setup is because this is not meant as a full length game. It was only meant to show how to implement collision etc. And because of that, the escape key already takes you out of the loop. So why code what is already there. As for the camera, it is a personal preference, just as TDK prefers spacing, capitalization etc. It's not necessary but hey, if you like it use it. I will challenge anybody who would control someone rather tahn understand that his method is not the best or the only way to do something. And maybe everyone else needs to hear that. He's a mod fine. I dont doubt his abilities as a coder and I'm sure he could write rings around me right now. But that's not the point. For what this code and tutorial is, it is a good example. As you can see, people have gotten help from it. And if this tutorial did not do that then I could see TDK's point. The majority of posts in here are unfortunately about everyone trying to say how imperfect I am. Well to heck with conventionality. I will not conform to him or anyone else's methods completely. And if that freedom will get me barred then maybe everyone should take a new look upon what is really going on here. If you can't accept that someone else might have a way of doing the same thing a little different then you really should re-evaluate your thought processes. Because the best things that were ever created were created through an INDIVIDUAL'S IMAGINATION. And some experiences that person may have gathered through time.Do you really think that all of TDK's tutorials came from someone else and he just copied them? No, he took what others taught him and what he taught himself and applied it to doing what he is doing. And I am doing the same thing. And anyone who will inhibit that should not offer any critism on the subject. Let's face it, I'm an individual and I will do things in that light. Some may be better, some may not. But the point is, that I am doing it. And since this TUTORIAL helped some people who didn't feel the need to find every fault under the sun, it served it's purpose. And I will be thoroughly reviewing other tutorials for assistance or to point out that everybody has a different style to coding. There are some uniform aspects, but DO NOT quash individuality. That is the defining characteristic of any upcoming, current good or great programmer. So in light of this Accept it or not I could care less. I don't need anyone in my corner to "back" me. What I do works and works fine. If you have a different way, make your own thread about it. Sorry if I seem a little agitated, but this is starting to look like a capital one commercial where I am the small business owner getting pushed around by the bigger people. Accept the help and leave it at that. END OF POST!!!!!!

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 7th Mar 2007 20:58
As to the error, I went back in and added that missing OBJECT POSITION tag. Sorry, I was at work when re-doing this. Glad you got some help from it.
Quote: "
@Riki
Thank you! and I hope you provide more 'guides' (to apease the powers that be)
"

When the time is right I will post more helpful "TUTORIALS" to better aide the newbies that get overloaded by too much info in some other tutorials. Have a penguin


LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 7th Mar 2007 23:56 Edited at: 7th Mar 2007 23:56
Cruise,

All of your arguments are fine, except in saying all of that, you've proven the 2 things TDK, myself and Indi have been trying to prove this entire time.

a) You've written a piece of helpful writing and have called it a tutorial, a tutorial is much more than a helpful piece of writing. But as you say, you're not going for that "entire thing". If you're not, don't call it a tutorial.

b) You're showing ignorance for no reason at all. If you don't like doing this properly and efficiently, thats perfectly fine, but keep it to yourself. When you attempt to show other people (leading back to point a) a tutorial on doing something, they assume it teaches the proper methods, not a method you use only because you'd like to "challenge" the accepted (and correct) way of doing something.

If I were to put what you were doing into an analogy, think of it like this, someone asks you how to build a house, you, in return, tell them how to build a shed, and inform them to use plastic screws instead of metal ones, because you like to go against the "norm" of house building. Then you tell them the instructions you've written are on how to build a house, and they accept that. Why? Because they dont know any better.

We're not trying to discourage you helping the community, this is a helpful contribution you've made, but it's been labelled incorrectly, has some wrong data in it, and you're attitude towards those more experienced than you makes it that much worse.

Please continue to help the community, just check the attitude at the door.

- ruc'

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 8th Mar 2007 04:30
First of all I dont see an extra "e" in my name.

The reason I mentioned another loop is that the do/loop is an infinite loop, your relying on DBP to terminate your program for you.

You didnt consider that with another loop method, this could be used in a menu scenario that keeps going after the loop has completed, or to restart a level by deleting objects after the loop etc.etc.

That my untamed tutorial jungle writer friend of the wild cyber west is why you would want to deploy that particular element.

Relying on DBP to clean up your loaded media is yet again another sloppy practice and reason why we ask you politely about making it a better tutorial.

5 points for effort but minus 6 points for the attitude.

Never mind though, you must surely know in your own mind that if it does not conform to what has been suggested, that your approach is not going to get it stickied or validated.

I can see you want to help and I fully congratulate you for that, we can always be blessed with new ideas, however if you create a tutorial with sloppy methods it can actually cause more harm with more questions down the track, so in essence your making our job harder by trying to help.

Now your completely free to follow the rules provided by you in this forum, as its an international zone setup by the company here. This is not a pepsi cola state however and you enter this area as a privilege not a given right.

Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 9th Mar 2007 15:12
ok, All points well taken, and after reading all of this I guess my idea of what a tutorial should be is different. To put it simply, a tutorial by true definition:

"a paper, book, film, or computer program that provides practical information about a specific subject"

Now does my coding not do that? Also, my tutorial is more succint than others. Take TDK's collection. The very first tutorial in his list covers info on four different programming languages and shows comands in those other languages and other information that is irrelevant to using DBC or DBPro. That is where my problem comes in. Not that his stuff isn't informative. But on the fact that I prefer to be concise and to the point and because of that I am criticized. If you look at the very first post, I made the comment that this is only one way of doing it and that there could be many other ways of doing it some of which may be better. As for what my TUTORIAL teaches, it does not challenge anything. It gives the information in a simple, understandable, and concise manner without all the extra information that is unnecessary to the point of this TUTORIAL. And I could argue that house building analogy fifty times over but I'm getting tired of this all. So until the next time, I will continue to post tutorials if I feel they have something relevant and important to teach. Otherwise, I will just slip into the silent realms of learning and practicing and getting better at all of this. I will post the code and media for this in the code base later on. And maybe one day we will all get over this and move on. I try not to have an attitude and do not wish to tick anyone off. But from my understanding of what the word TUTORIAL means, mine does just that. And until Webster changes that definition, I will contiue to use that word in its true context. Again, I do not wish to offend or tick anyone off so let's just drop this argument because everyone is right in their own defense. And we could all argue this over and over and over only to come back to the beginning and have nothing to show for it. So what's the point...?

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 9th Mar 2007 19:55
I suppose ignorance is bliss. Lets just drop it.

Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 10th Mar 2007 03:06
I agree...it is pointless to argue over this.

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 10th Mar 2007 04:37
what are you going to write next mate?

Cruise McClarren
19
Years of Service
User Offline
Joined: 23rd Aug 2005
Location:
Posted: 11th Mar 2007 00:55
Oh I have no idea... for now I am working on re-fitting my computer with much better equipment. But if I come across other things tht might be of interest to others, then I shall post again. As to if or when that will be I can't say right now.

LIFE: "That thing that happens to us when we are too young to die"
~V.J.C. 2003

Login to post a reply

Server time is: 2024-09-25 19:23:35
Your offset time is: 2024-09-25 19:23:35