FBKart demo...

User projects written in or related to FreeBASIC.
Dr_D
Posts: 2398
Joined: May 27, 2005 4:59
Contact:

FBKart demo...

Postby Dr_D » Feb 23, 2015 3:09

Here's a demo of that kart game I've been working on. The source code is terrible, but that is in the process of changing. I'm taking everything rel and I did over the years, and consolidating it into one clean, easy to use engine. Anyway, this demo has some basic culling optimizations in it, so hopefully it should run at a decent frame rate. If anyone finds any crippling bugs, please mention it here and we'll put our heads together and see if we can figure out what went wrong. ;)

I forgot to mention a few things...

When everything is loaded, a window will pop up with the title and stuff... click the button in the center of that window to start racing.

Controls:
L/R arrow keys to steer..
Up arrow key for gas
Down arrow for reverse
B key for brake
P key to toggle pause
C key to toggle gamepad, (if one is connected)
1, 2 and 3 key to switch camera types

http://users.freebasic-portal.de/dr_d/demos/FBKart.rar
BasicCoder2
Posts: 3586
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FBKart demo...

Postby BasicCoder2 » Feb 23, 2015 5:41

@Dr_D,
It ran very smoothly for me and although the engines make a pleasant sound the ear piercing squealing sound of the wheels when an arrow key was pressed to turn or accelerate became unpleasant within a short time.

What I can't understand with these games is why they don't steer like a normal car? I am very capable of driving a normal car but these games simply over react and the responses aren't in the least bit realistic. Touching the left/right arrow keys causes it to completely lock in that direction so you have to hit and release them fast.

May I suggest using the mouse as a steering wheel? Moving it left and right across the mouse pad would be like the smooth turning of the steering wheel in a real car. The two buttons could be used as a brake and accelerator as well.
Last edited by BasicCoder2 on Feb 23, 2015 9:16, edited 5 times in total.
D.J.Peters
Posts: 8169
Joined: May 28, 2005 3:28
Contact:

Re: FBKart demo...

Postby D.J.Peters » Feb 23, 2015 6:29

Looks good so far
but no sound here
and too much drifting
or the drifting comes to early.

I miss a config dialog for gamepad or joystick axis sensitive level for steering

Joshy
DeNivra
Posts: 33
Joined: Jan 23, 2015 17:25

Re: FBKart demo...

Postby DeNivra » Feb 23, 2015 11:35

Great. And here is a suggestion about gameplay. MAKE THE GAME bright PROOF. What I mean is remove the L/R arrow keys to steer..make it auto. The car always remain on the road/track. This will allow most of us to enjoy the game .
Instead use L/R arrow keys to avoid obstacles on the track or collect .Some goodies ,coins on the track. Hoping to enjoy the next version of the game.

Thanks for posting the source code. It add your knowledge the Freebasic forums.
BasicCoder2
Posts: 3586
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FBKart demo...

Postby BasicCoder2 » Feb 23, 2015 20:32

DeNivra wrote:..make it auto. The car always remain on the road/track.

No that would be taking it to the extreme. Just make it realistic. Give it the same feel you would have driving a real car. I have found holding the mouse and moving it is just as natural as holding a steering wheel and moving it.
Dr_D
Posts: 2398
Joined: May 27, 2005 4:59
Contact:

Re: FBKart demo...

Postby Dr_D » Feb 24, 2015 0:32

Thanks guys. I wouldn't object to using FBSound, Joshy. Basically, the reason I used FMod is because I had old code I just threw in there. I can add a mouse control option too. That actually sounds pretty cool. Also, it isn't that hard to drive, once you get used to it. :p Then again, I have a ton of practice on it. I am planning to add some options for steering sensitivity, tire/suspension tweaking, engine upgrades, etc... the usual racing game stuff. I don't know if I will do that before I finish the engine itself though. That will reduce the unwieldy nature of this code by about 99%. I have a lot done already. For instance, the new engine supports zPass and zfail, where this demo only properly supports zFail. It also has octree culling and I've got the stuff in the model loader fixed, where it loads the bones and morph targets properly. My goal is to create a robust, open-source, easy to use game engine, written in FreeBASIC. Mainly because I want to make games... but hopefully others will use it and make even more fun games. ;)
D.J.Peters
Posts: 8169
Joined: May 28, 2005 3:28
Contact:

Re: FBKart demo...

Postby D.J.Peters » Feb 24, 2015 6:36

@Dr_D I don't talk about FBSound vs. FMod
but your game-demo doesnt play anything here on Windows XP 32-bit
or do you disabled sound in the source code ?

Joshy
BasicCoder2
Posts: 3586
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FBKart demo...

Postby BasicCoder2 » Feb 24, 2015 10:45

@Dr_D
The number 2 view which shows the two front wheels, one on each side the view ahead, there is at the horizon level some kind of shape with redish bluish vertical bars blocking the view of the road. It seems to be the view position that you would see if you were the engine?
I used the tracer program to make a quick sketch of what it looks like,

Code: Select all

screenres 640,480,32
color rgb(0,0,0),rgb(255,255,255):cls
dim as string s
s = "BM3,153M58,176M95,213M105,234M194,237M207,249M214,276M216,290"_
& "M145,291M132,253M114,239M124,254M120,268M122,289M123,331M158,332"_
& "M162,341M162,355M151,368M260,368M315,138M167,138M18,158M1,152"_
& "BM232,175P4286348412,4278190080BM327,138M477,138M623,156M580,174"_
& "M543,213M532,234M445,236M433,244M426,269M422,290M493,289M504,256"_
& "M519,240M525,238M516,257M520,268M516,294M515,331M481,332M476,340"_
& "M479,357M487,368M381,368M326,137BM422,184P4286611584,4278190080"_
& "BM314,138M326,138M381,368M259,368M315,138BM313,262P4292861713,4278190080"_
& "BM172,126M209,84M317,137M172,126BM325,136M430,83M466,126M441,130"_
& "M325,136BM209,84M429,83BM25,137M171,125M315,137M24,137BM324,135"_
& "M617,137M465,124BM254,84M250,137BM282,84M283,137BM302,84M300,138"_
& "BM332,83M330,134BM357,83M358,134BM387,82M384,133BM442,97M441,129"_
& "BM200,93M200,127BM0,125M60,125M61,133M25,136M62,136M65,146M74,145"_
& "M73,136M96,136M96,142M116,142M116,136BM19,143BM1,125M2,152BM16,139"_
& "P4282077503,4278190080BM460,119M639,118M638,151M622,156BM623,127"_
& "P4287004795,4278190080BM319,107P4285215030,4278190080BM342,103"_
& "P4283049011,4278190080BM375,93P4285804079,4278190080BM403,88"_
& "P4281079347,4278190080BM398,114P4279831322,4278190080BM448,117"_
& "P4280883486,4278190080BM288,101P4283244578,4278190080BM289,126"_
& "P4280553232,4278190080BM262,98P4285607220,4278190080BM258,122"_
& "P4281275163,4278190080BM238,88P4281210676,4278190080BM225,111"_
& "P4279242005,4278190080BM189,116P4281211680,4278190080BM159,125"_
& "M158,137M200,129BM199,128M199,138BM474,124M472,136BM511,127M510,136"_
& "BM538,129M537,135BM552,133P4283317309,4278190080BM522,131P4287648857,4278190080"_
& "BM482,129P4283908699,4278190080BM457,130P4286269266,4278190080"_
& "BM264,136P4286657602,4278190080BM216,133P4281282106,4278190080"_
& "BM185,134P4287255392,4278190080BM170,128P4287255392,4278190080"_
& "BM374,82M402,78M504,65M586,58M639,59M639,84M634,84M635,75M612,70"_
& "M606,82M569,84M577,58M544,60M538,86M489,87M491,66M456,70M455,85"_
& "M435,90BM594,71P4280495905,4278190080BM517,71P4280495905,4278190080"_
& "BM445,75P4280495905,4278190080BM445,0M420,28M413,14M407,24M403,16"_
& "M389,43M393,49M383,57M334,82M325,82M312,65M332,65M336,60M346,56"_
& "M299,0M443,0BM347,15P4290557886,4278190080BM377,60M369,83BM362,73"_
& "P4288057235,4278190080BM1,125M1,69M14,78M46,81M24,104M54,106"_
& "M59,124BM53,105M186,109M194,101M171,78M186,78M175,66M203,67M219,70"_
& "M220,84BM12,102P4284638569,4278190080BM79,112BM197,72P4284638569,4278190080"_
& "BM49,0M37,21M53,28M29,61M56,68M46,81M19,78M1,68M1,0M48,0BM21,43"_
& "P4289702323,4278190080BM101,1M116,20M123,1M101,1BM111,6P4291085510,4278190080"_
& "BM455,85M453,110M461,119M485,119M489,84BM537,85M531,119M562,117"_
& "M569,82BM606,82M604,89M588,91M580,119BM612,104P4281872683,4278190080"_
& "BM546,88P4281872683,4278190080BM475,89P4281872683,4278190080"_
& "BM465,12P4286487647,4278190080BM191,23P4286487647,4278190080"_
& "BM528,93P4286018687,4278190080BM571,100P4286018687,4278190080"_
& "BM447,94P4286018687,4278190080BM73,133M67,104M89,105M93,131M114,129"_
& "M109,106M128,106M130,127M139,127M135,106M146,107M147,126M162,123"_
& "M160,107M170,108M170,123M177,118M176,109BM64,117P4281543461,4278190080"_
& "BM97,117P4281543461,4278190080BM97,117P4281543461,4278190080"_
& "BM133,116P4281543461,4278190080BM156,111P4281543461,4278190080"_
& "BM173,116P4281543461,4278190080BM83,114P4285559666,4278190080"_
& "BM116,116P4285559666,4278190080BM143,116P4285559666,4278190080"_
& "BM165,113P4285559666,4278190080BM611,185P4279111182,4278190080"_
& "BM554,133P5127229,4278190080BM523,131BM520,130P9458777,4278190080"_
& "BM463,129P8079186,4278190080BM125,132P4289348686,4278190080B"_
& "M386,137P8814715,4278190080BM269,135P4286066742,4278190080BM368,122"_
& "P4282128150,4278190080BM349,127P4280487697,4278190080BM305,132"_
& "P4281275674,4278190080"

draw s
sleep
Dr_D
Posts: 2398
Joined: May 27, 2005 4:59
Contact:

Re: FBKart demo...

Postby Dr_D » Feb 24, 2015 13:59

Yeah, that's actually the front bumper of the truck. I hard coded the camera for the kart model, so it doesn't look right when using the truck. This is where some scripting or at least better initialization would come in handy. I did some work on this last night... so if I have time I'll upload tonight. ;)
Dr_D
Posts: 2398
Joined: May 27, 2005 4:59
Contact:

Re: FBKart demo...

Postby Dr_D » Feb 25, 2015 4:48

Ok, I added the mouse controller. I did a bunch of other stuff to make it run better/faster also... but there is still a ton to do. I haven't done much about the excessive drifting yet. I really want that to be implemented as part of the actual game. Anyway, it's a lot of fun to work on... more so than just working on a generic engine. I might just keep plugging away until everything from the engine is in it... then it will be the first game made with itself. :p Ok then, it's the same link. Thanks again for testing it out and stuff guys. :)

Edit:
BTW, that tracer program did that in real time? That's cool!
angros47
Posts: 1673
Joined: Jun 21, 2005 19:04

Re: FBKart demo...

Postby angros47 » Feb 25, 2015 15:18

I tested it, and I have two remarks:
1) If the car fall of the world (start falling in the void), pressing the space bar produce a weird result: the car goes back to the starting point, but then it floats away, spinning in the sky.

2) Why are trees growing on the road? Do you live near this:

http://www.heraldo.es/galerias-imagenes/wp-content/uploads/2014/07/Chapuzas-en-Arag%C3%B3n4-1000x800.jpg

Nice game, btw.
Dr_D
Posts: 2398
Joined: May 27, 2005 4:59
Contact:

Re: FBKart demo...

Postby Dr_D » Feb 25, 2015 16:26

lol... the trees are randomly placed, and I quickly threw that in. I plan to make an editor, the you can place them wherever you want. About the floating thing... it does that because the leave world callback isn't implemented yet. Thanks for testing! :)
BasicCoder2
Posts: 3586
Joined: Jan 01, 2009 7:03
Location: Australia

Re: FBKart demo...

Postby BasicCoder2 » Feb 25, 2015 22:12

@Dr_D,
Downloaded the game again and the mouse controller doesn't seem to work for me just the arrow keys.
See you have fixed up the inside the car view of the track, nice work.
Dr_D
Posts: 2398
Joined: May 27, 2005 4:59
Contact:

Re: FBKart demo...

Postby Dr_D » Feb 25, 2015 22:25

Oh, you have to press c to toggle the control modes. I should probably put some kind of indicator to show you which mode you're currently on.
anonymous1337
Posts: 5494
Joined: Sep 12, 2005 20:06
Location: California

Re: FBKart demo...

Postby anonymous1337 » Feb 26, 2015 0:57

Hehe, is that a source folder I see? :)

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 1 guest