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 / Game programming principles

Author
Message
Dis
18
Years of Service
User Offline
Joined: 7th Mar 2006
Location: Nessus
Posted: 7th Mar 2006 12:56
I know that what I'm asking here may be oldskool for many experienced programmers, but I have a few questions regarding basic game principles:

1. How do you use DBC to create a FPS-style world? One would think
to build it out of blocks, but it would require a lot of work.
How do experienced programmers approach this?

2. Another important thing to ask is: How do you create 'gravity'?
It seems fairly important to not having to float around the
world in mid-air (not to mention realism).

3. Is it possible to create a Doom-style game (A 3D world with 2D
enemies)?

I've also got some non-game related questions. For example, would it be possible to create some sort of 3D presentation with DBC? It was one of the reasons I purchased DBC - it would make my presentations for school look a lot better.

I'm hoping that someone more experienced would take time to answer these questions. It would help me a lot.

You can be a god in my world...
But it's my world, so i'm above all gods!
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 7th Mar 2006 20:43 Edited at: 7th Mar 2006 20:48
1. You use a modeling application, there are plenty of free oens on the net, check out www.wings3d.com for a good starter. Also check out the 3d Chat board on this forum for more links to other modelers.

2. Theres no one true method of programming, well, anything for that matter. So the same goes for gravity, theres lots of ways and each one suits different needs. For example, if you just wanted your objects to stay on the ground and never move upward, you could just do this every single loop:



Replacing Object with the object number, and changing 0 to be your ground level. But that would be a very very basic level of gravity, if you could even call it gravity. If you wanted to move an object downwards constantly, you could change the above code to this:



Changing Speed to be the speed the object falls at. But this could pose two problems, 1. being that the object will constantly move down and likely fall below your map, especially if you haven't figured out collision yet, and 2. being that this will interfere with any upward movement code you have such as ground collision or jumping. This could be solved by adding a simple condition check, like so:

Then you'd switch CanFall to 1 when the object can fall and 0 when the object cant. For example, if you wanted to stop the object from falling below 0 on the Y axis, you could do this:

Then calling the gravity code from before. This would move the object downwards until it reached Y position 0.

Alternatively you could change this to allow the user to fall when they're not colliding with the ground incase you have a map, or disallow the user to fall when they're jumping. They're all conciderations to be taken in.

If you wanted to add physics to the falling, you could set the speed at which the object falls at to a variable, and then increase this variable every loop the object is in the air.



Basically we define two variables, Speed# and Rate#. Speed# is the speed the object moves down at, we set it at 3 to begin with. Rate# is the rate at which speed increases at, in this case .01. Every loop we increase Rate# by Speed#. Then we check if the object can fall like before, if it can we position it at it's current y position minus speed. Since speed is constantly increasing, the object will speed up as it falls, giving a sense of realism or physics.

I think thats enough for you to bite off on gravity for now, if not just ask and Ill further explain better methods of gravity.

3. Yes its very possible to create a Doom-Style game with a 3D world with 2D characters. As with gravity, there are many ways in which you could do this. Off the top of my head however, this would be how I would do it, to begin with atleast:

Create your 3D world using your preffered modeling program
For the characters, create plain objects. Texture these plains with an image of your doom character.
Use the LOCK OBJECT TO SCREEN command to make sure the plains always face the screen. This way the characters will look 2D as no matter what you do you wont be able to see their sides or back, just their fronts.

4. As for the presentation it depends on what you're trying to present and your programming experience. The possibilities are endless so yes I suppose you could. For example, for history class you could create a program with advanced A.I that simulates World War I's Blitzkrieg or some other famous battle, for Science you could create a program that simulates cell duplication. It all really does depend on what you want to do. When it comes to programming, especially with DB, your skill and your computer's speed is your limit.

Goodluck, feel free to ask anything else if you're still confused/wondering something.

- RUC'

Image All
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: Home
Posted: 7th Mar 2006 21:41
For gravity I just have a global float called "Gravity#" and keep it at 0 when I'm on the ground. When the ground goes lower than my feet I keep incrementing Gravity# by however much looks good. At the end of every loop I decrement my Y coordinate by Gravity#, and that will make it more realistic with falling faster and faster. For jumping I just set Gravity# to a negative value. Every loop Gravity# is subtracted from the player's Y coordinate, even if Gravity#=0. So if I set it to a negative, I "fall up". Then my feet are above the ground and Gravity# starts incrementing again, causing my rate of ascention to decrease, and eventaully fall back to the ground.

FunkyStickmen: Battle of the Races (1%)
Mr X
18
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 9th Mar 2006 14:13
Of course you can create presentations in DBC, its after all a programing language. I made an 3d presentation once for an english project, and it worked very well. So dont worry about that part. The limits is, as RUCCUS said, how skilled programer you are and how good your computer is.
Dis
18
Years of Service
User Offline
Joined: 7th Mar 2006
Location: Nessus
Posted: 10th Mar 2006 19:10
Okay, so I've created my first game (I had to use a matrix instead of a level, but I'll get to that later), made some gravity and stuff.

I'm now trying to design weapons. Which brings me to my first "second post" question:

I don't know if you've ever played a game which featured the BFG (Doom, Quake II), but in one of these games, there's a particle effect which creates the blast (a semi-transparent sphere). Around this sphere there are particles which circle around the sphere at random angles. These too are transparent.

I guess it's not hard to figure out my next question: How do you do it? I've got it up to where spheres are circling around the blast, but they just follow a fixed trajectory (Around the X, Y or Z axis). What I would like to make is that the spheres change position randomly, but always at a fixed distance from the blast, so that it looks like there's little energy particles swirling around a large energy sphere.

This is a very nasty problem to me, especially since, with school and all, I haven't got time nor skills to solve this (as we don't get maths at school anymore).

My second question may be a lot simpler: I've created the matrix for my game. However, it is still possible for the player to go off the matrix. So I've got two questions:

1. Is it possible to use some siple commands to create some sort of
box around the matrix that blocks the player?
2. How do you create a SkyBox (or sphere)?

I know that these questions are different from my previous, but I do hope that someone can help me with it.

PS. Don't mind my language, I'm not very good at English.

The Eye - It enables us to see and learn...

Login to post a reply

Server time is: 2024-09-24 17:36:56
Your offset time is: 2024-09-24 17:36:56