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 / Where to start?

Author
Message
Midnight Raven
19
Years of Service
User Offline
Joined: 12th Aug 2005
Location: A place where the moon never sleeps
Posted: 12th Aug 2005 13:43
Ok, I am producing a 3d model of my boyfriends MR2 in Lightwave. I eventually want to produce a racing game for him using this model and producing my own environment.

The thing is I'm lost into how I make this into a game...how does Darkbasic work?

I have never even touched game programming before so please bare with me!
Immense
19
Years of Service
User Offline
Joined: 9th Aug 2005
Location: Groningen, The Netherlands
Posted: 12th Aug 2005 15:53
Hmm never done programming be4? hmm well my advice is that you begin little, like

do
print "hello Midnight raven"
loop

Coz you first need to get used to some codes.
Maybe you should read some tutorials in DB or on this site

Stupid Factory...
Where boys are made
Midnight Raven
19
Years of Service
User Offline
Joined: 12th Aug 2005
Location: A place where the moon never sleeps
Posted: 12th Aug 2005 17:13
hmmm, not sure if ur being nasty or not there....

basically what I want to know is how everything pieces together, and what darkbasic does..how it works...how can i use my models and produce a game?

do i use coding? if so how and where!? I have no idea how it works.
Satchmo
19
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 12th Aug 2005 19:32
Lesson of choice


Thats where i started

New episodes of family guy sunday!
James Morgan
19
Years of Service
User Offline
Joined: 17th Apr 2005
Location: Behind you
Posted: 12th Aug 2005 20:06 Edited at: 12th Aug 2005 20:08
Harsh FXGAMER, Harsh....

Ok, racing games can be hard to do, don't expect the next gran turismo, its going to be far from it.

Assuming this is going to be the most basic racing game there is, and im unsure of how quickly you can learn or your current progression into programming so this may either be too complicated or too basic for you;

1. Creating the enviroment - This will be easy, Either use a skybox or set backdrop to a image, such as a sky image. Wont look that good but its a start.

2. Creating the ground - Easiest way is creating a matrix but this will cause a huge slow down in your program and although it may seem fine to begin with, near the end of it you may find you cant get out of first gear (not literally). Also make it flat, this will avoid gravity and collision problems

3. Creating the player and controls - use Load object to load your car object, now you just need to create movement for it. Assume its an automatic car for now with a set speed of 60MPH, you can adjust all that later. Maybe use something like the arrow keys to move it forward and rotate to car. You should look into newxvalue and newzvalue as well as position object and yRotate object

4. Roads and Boundries - Ok so your car can now move around the ground, if you use a matrix, you can texture the ground to show a road or dirt track, otherwise it will depend on your method to how the road will show, that being said more than likely it will be made up through a texture and not a second object to the ground. Boundries may be a problem, whats going to stop the player just doing a U turn and going through the finish? Either use math collision to make sure your car can not go too far away from the road. Set up an object all the way around the course, like a barrier and set sliding collision onto that. Or set checkpoints, either visible or invisible, if you dont go through all checkpoints in order then when you cross the finish line the game we presume you are still on the same lap.

5. Other cars/AI - The hard part, you have to be able to make the computer to control other cars around the course as fast as possible, ask for more help when you get to this stage.

6. Tweaks - Change controls so you can shift gears and gradualy reach speeds depending on accerlaration/engine size. Improve graphics, add sound/music etc etc.


Its a long process, so good luck!

James

Edit:
Don't make your model look too real. Im not sure how much you know about polygons and polygon counts in a game but the more complex the MR2 will look, the slower your game will run

Hello!
Midnight Raven
19
Years of Service
User Offline
Joined: 12th Aug 2005
Location: A place where the moon never sleeps
Posted: 13th Aug 2005 01:16
Thanks very much for ur help james...the only thing is no one is telling me what software i should be using or placing the coding!? I assume its dark basic but which package...

I have plenty of time do to this project slowly and learn as I go along as we are rebuilding his car and that wont be complete for about another year!

The main problem I'm finding with the forums ive been on, everyone seems to throw things at me and expect me to know what they are talking about! lol

But ur step by step post james, is brilliant...now i need the software! lol
Sven B
19
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 13th Aug 2005 15:19
So what is your problem? You can't find the editor of DarkBasic? You did puchase it huh?

Immunity and Annihalation makes Immunihalation...
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 13th Aug 2005 15:55
the editor is the big black bit, try typing "print "Hello" in it, then press F5 and then I guess thats your first program

"Well if she dies it'll teach her not to do it again..." - Me
James Morgan
19
Years of Service
User Offline
Joined: 17th Apr 2005
Location: Behind you
Posted: 13th Aug 2005 19:02 Edited at: 13th Aug 2005 19:03
Quote: "the editor is the big black bit, try typing "print "Hello" in it, then press F5 and then I guess thats your first program"


I think you will find she is asking which package to buy, i.e. DBC, DBP or DBSDK...

I would purchase DarkBASIC Pro, its slightly different to DarkBASIC with the look - it uses a windows editor and not the black screen. It also has a lot more features and better control and speed. That being said it is more expensive. Also although DB SKD would produce better results as you can also use C++ in your code I would only recommand that for experianced users who also know C++.

You can download a trial version which will suit you fine, its a few versions behind but unless you think you are ready for the complex in depth side of DarkBasic proramming then you won't notice many differences.

Have you ever done programming before? If not, I would look at some of the tutorials around the site, get used to the feel and design of programming before starting your racing game.

You will also find, the more and more complex your able to code the more and more you may have to rewrite code. For example (assuming you are using Dark BASIC Pro) a new person may not know how to use an array so just use plenty of integers and floats. They will then rewrite there code to use an array until they finally discover user defined types (though limited in DB Pro) and re write the majority of there program to incorporate the User Defined Types (UDT). Unfortuantally, unless you can learn everything all together then you will find the same thing.

Once you can completed the tutorials or feel you have learnt enough from them - or you already know the basics. Write down on a peice of paper how your going to program your game. Or even just use notepad.

All programming languages can be generic, write in Pseudo - a fake programming language, for example



Its good to just jot down what you need without concentrating a huge amount on programming, the above can then be turning into something like this (note this is only a code snippit and wont do anything)



Once you have finished the tutorials on this site and start your actual program. More than likely you will come across MANY problems and need a lot of help and solutions. Try code base, its a link on this site that has lots of code snippits, such as camera functions and basic 3D
In both this Newbie forum and Dark Basic Pro forum, use the search function for specific posts, i.e. if you wanted help on the camera movement, keep it simple and search 'Camera'
If all else fails, ask here and we will be happy to help

As im unsure of your programming skill if any im not sure if this post is much help or not, if you have never programming before and need more specific help thats not on here, you can email me at smileitsjimmy@aol.com but I am very busy so may take a while to get back to you

J

Edit:

Christ, I think the two posts iv made here have been my longest, I really should stop rambling on...

Hello!
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 13th Aug 2005 20:07
this site has demo versions of darkbasic and darkbasic pro, you can download them and run them to try it out, write your own instructions etc, how it works is that you are given a interface that looks a lot like a text editor, you type into this and darkbasic trys to make sense of what you written, darkbasic knows several hundred words or phrases that tell it to do different things, heres a short example.

load object "MR2.x",1

this will load the file you save out from lightwave (in this case I assume you use an X plugin to save it since DB likes that format), since computers like numbers it remembers this as object number 1, so every time you mention object 1 to the computer it knows you mean MR2.x

on it`s own this isn`t much good, you told the computer to load the object and it did, but you will not see anything happen if you run this since computers stop doing what they are told when they run out of instructions, and this is just one instruction, so the computer would load the object and then close the program, you might just see the model flash up on the screen for an instant, but thats not much use to anyone.
the next thing you need to do is to make the program wait until you have finished veiwing the model, to do this add the following instruction to the code.

wait key

now the program will wait until you press a key before stopping, so you will be able to see the model just floating there and when you press a key the program will continue, find no more instructions and so stop, it doesn`t do much more, but its an improvement.

next thing is to have the program actualy do something with the model you have loaded, looking at it is ok, but you could do that in lightwave (and maybe make some realy nice renders too), we need action, lets try getting the car to turn left, heres the instruction to do that

turn object left 1,2

this tells the computer to turn the object left by two degrees, as before, the computer knows the MR2 model is object number 1, and the angle is the second value, you could read this instruction as

turn object left MR2 by 2 degrees

so now your code reads

load object "MR2.x",1
wait key
turn object left 1,2

by now you should realise the catch, when the program waits for the key you can see the object, when you press the key it turns the object 2 degrees and then instantly closes, what we need is some way to get the program to keep running, plus turning the car just two degrees is not that thrilling, we need to turn the car repeatedly so that it looks to be smoothly revolving, what we need it is some way to tell the program to keep doing things over and over from one instruction to the next until we tell it to stop.

introducing the do-loop instruction, if you place the instruction to turn the car around inside the following two instructions (like this)

do
turn object left 1,2
loop

then the program will run over and over, when it sees "do" it knows to remember this point to return to later, when it sees "loop" it knows its time to go back to the "do" location it remembered earlier, and anything inbetween those points it will do over and over, this is how programs work, for example, in a car game, you move the car, move the computers cars, move the camera, check for collisions, update the display, check for the end of the race and then loop round and keep doing that until the race finishes, so this is as far as the program has got...

load object "MR2.x",1
wait key
do
turn object left 1,2
loop

this loads the object and allows you to view it, then when you press a key it starts to revolve, now this is ok, but why not place it under user control?, more like a game would do?, well you need to have some way for the program to make decisions, so how do we do that, well lets see

IF i am thirsty THEN drink
IF i am tired THEN sleep
IF i press left arrow key THEN turn car left

seem obvious enough, and its that simple for a computer to make decisions (actualy this is the only way a computer makes decisions internaly...on and either/or basis), this line

if leftkey()=1 then turn object left 1,2

can be used to replace the old turn object left line, leftkey() is an internal function of darkbasic that detects the left key being pressed (thats the left arrow key in the cursor key cluster), the empty brackets have to be there, they reserve a space for the key to return its status, 1 for down and 0 for up, this converts into plain old english (read along the line)

if leftkey equals one then turn object left MR2 two degrees

sorta cryptic, but knowing what it means its intelligible enough, but why stop at just the left key, lets go mad

if rightkey()=1 then turn object right 1,2

you should be able to work out what that does, now we can make it all into an interactive model viewer, eg

load object "MR2.x",1
waitkey
do
if leftkey() then turn object left 1,2
if rightkey() then turn object right 1,2
loop

so thats a first simple MR2 viewing program, and thats how you code in darkbasic (other languages would take hundreds of lines just to get the computer set up to load the object), all you need to do is read the manual of instructions that DB understands, and piece them together to make the program move the object/s as you like, for example to allow you to drive the object off the screen just add the following line inside the do-loop

if upkey()=1 then move object 1,0.1

you should be able to work out what key you need to use and what will happen when you press it, try it, you can`t do any damage.

Midnight Raven
19
Years of Service
User Offline
Joined: 12th Aug 2005
Location: A place where the moon never sleeps
Posted: 15th Aug 2005 00:49
Ok well thank u James and 'ME!' for all your help, I definatly have a better understanding now.

I have NEVER done any programming before, thats why I thought coming to the newbies section was the right thing to do...although I feel a little stupid from the comments some people have made, and have found that people arent reading what I write in my posts.

It all seems very familiar to dreamweaver - giving the computer the information and it processing it on the page.

I have all the time in the world at the moment, as we rebuild the car, so I will start with the tutorials and downloads and then work my way slowly to producing the racing game..I appreciate there is alot to learn! But i'm willing to give it ago.

Thank you very much James and Me! again for all your help, and thank you for ur time.

Login to post a reply

Server time is: 2024-11-27 21:37:23
Your offset time is: 2024-11-27 21:37:23