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 / Opinions needed and a question!

Author
Message
DarrylKev
21
Years of Service
User Offline
Joined: 5th Nov 2002
Location:
Posted: 1st Dec 2002 22:33
Hello All

As I continue to learn the program (and wonder why I purchased DB1.X and didn't get DBP to begin with) I was wondering if the below control system is feasible for my long term (read a long way down the pipe) game project.

First think of a Micro-G) environment. Motion in a given direction will keep you going forever without an opposing force 180 out from the first. Note I want to put a limiter on thrust (and thus max velocity) so game play is not extremely fast jousting but (LOL) slower jousting. This type of physics would result in a combat style such that vehicles would burn towards each other take a shot, flip around fire as you seperate and try to slow down to go in the opposite direction to do it again, hopefully dodging behind any handy floating 3d obstacles as come available.

I see a combo of mouse (3 button) and keyboard with the following control setup;

Mouse: 1 "Left" Forward Thrust (Z+)
2 "Right" Reverse Thrust (Z-)
3 "Middle" Fire Weapon

Movement X/Y Plain Targeting

Keyboard: Mappable Keys (Typical Layout)
"W" Strafe Up (Y+)
"A" Strafe Left (X-)
"S" Strafe Right (X+)
"Z" Strafe Left (Y-)

"" Rotate Clock Wise

So does the above movement style and control setup (1) may sense, (2) is doable without degree a in CS and finally(3) doable in DB1.?? or DBPro.

Now if I can build this type of game engine I have friends waiting with vehicle designs (ships, fighters, mecha) to be created in the appropraite design problems.

Oh well, any comments, suggestions (or dare I ask code snippets) would be greatly appreciated.

Darrylkev
QuothTheRaven
21
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 2nd Dec 2002 00:39
oh hellz ya its perfectaly do-able. Here's the method that got me through programming my calculator:

Your movement in each direction is a variable that's NOT RELATED to your position. You movment Y would be Ymove#, x is Xmove#, z is Zmove#. In the loop it would do this to your position



if you pressed a button to make you move along the X faster, it would be

inc xmove#,1

that way, if you held down the key, Xmove# would get bigger and bigger, and you would move more units with each loop. If you wanted to slow it, just subtract from it. Same with all the other variablies. If it gets negative, you move backwards. And if you want it to reverse direction immedieately (like if you hit an object) simply
Xmove# = -Xmove#
and by reversing it, you will automatically be moving in the opposite direction. Does that help?
The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 2nd Dec 2002 01:37
1. They appear to make sense.
2. I don't have a degree in computer science (although I should get one soon) and I managed it.
3. My code is not DBPro specific I don't think.

Here's some sample code. Camera is rotated using the mouse, thrust is applied using the left and right mouse buttons to produce forward and reverse thrust respectively. There is friction applied, simply because I don't know how you want to limit the velocity. Strafe around the xy plane using wasd. Fire using the middle mouse button (button value 4), which fires spheres at a relative velocity to the camera's movement. I assumed you wanted full 3d motion, so I took ages to work out the polar velocity equations. It's commented and is a full program for your copy 'n' paste pleasure. Written in DBPro, but also works in DBv1.x. Enjoy.

DarrylKev
21
Years of Service
User Offline
Joined: 5th Nov 2002
Location:
Posted: 2nd Dec 2002 18:29
Hello Group

My God "TheDarthster" look what you did!!!!!!!!!!! Its the most incredible piece of code I have ever seen (ok I am laying it on a bit much here) but but look what you did!!!!!!!

Now all I have to do is add mecha, backdrops, guns, ships, fighters, sound, music, collision and damage, a hud, AI, yada yada yada. But the engine, "THE ENGINE" is just what I described. And you wrote it in what a few days at most.

I can't wait to start work.

Thank You, Thank You, THANK YOU!!!!

DarrylKev

The Darthster
21
Years of Service
User Offline
Joined: 25th Sep 2002
Location: United Kingdom
Posted: 2nd Dec 2002 20:48
Well, 'days' is a bit much, since both posts were made on the same day, it took 20 mins at most to make that. Best piece of code you've ever seen? Thanks! Of course if I had the media I'd write my own game from this, but I don't, so I probably won't get round to it.

Adding media is fairly easy, the hardest part now is the AI.
DarrylKev
21
Years of Service
User Offline
Joined: 5th Nov 2002
Location:
Posted: 2nd Dec 2002 21:01
Hello Group and The Darkster

Okay so I got a little (alot) excited and got a little myopic. But the code was far better than what I was able to hack together since I started fleshing out this idea. Mine you I only got back into programming (throught Darkbasic) about 2 weeks ago, but give me a couple of months and who knows.

Thanks Again TheDarkSter!!!

DarrylKev

Login to post a reply

Server time is: 2024-04-19 09:27:47
Your offset time is: 2024-04-19 09:27:47