Small 3D-Racingtest

Advanced game related topics
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Tomcat.

Hi all,

you can download http://home.t-online.de/home/misztal/to ... index.html a small racing-game with one track, which I programmed
to try out 3D-Graphics. The whole thing is not really optimized, so you better
have a fast computer (can't say what the minimum-requirements are...). Controls
are explained in the readme.txt. The sourcecode is also included, but it's not
cleaned up and not really good to read (tried and changed many things there...).
Have fun :)

Bye,
Tomek

BTW: My personal best time is 0:26:38. Anyone better than me? (Of course without
changing the source :wink:
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Jose.

Very Cool and simple, I like
You are too fast for me:)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Damn, that's impressive !

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Max..

Excellent!

Max.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

:):):)!

Its a long way to the top if you wanna .....CodeGuru
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

Excellent work Tomcat, small and efficient.

Sometimes I'm wondering: "How is such a thing done?"
Now I can look at the code and try to grasp how to...
Thanks for sharing the code.


Have a nice day...

Franco
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by plouf.

it Rocks Rocks.....

Christos
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

Incredible, i don't believe my eyes :)

Regards,

Berikco

http://www.benny.zeb.be/purebasic.htm
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

When I'm going home tonight I will search for my old 'Grand Prix 2' cd and try to install it on my current computer.
IHMO race and flight simulations make much more fun in the long run as role games.
Do you remember STUNTS where you could build your own tracks?

@Tomcat
How difficult is it to change the code so you don't see the whole car in front of you, only a dashboard and the mirrors? (or without all that...)
How difficult is it to change the code for a motorcycle where the landscape is rotating clockwise or counterclockwise?

Where do you have the track data? Did you build it by your own?

Keep up the good work :)

Have a nice day...

Franco
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Franco.

Changed OpenScreen to OpenWindowedScreen:

Changed this

Code: Select all

OpenScreen(#SX,#SY,16,"MK-Test")
with that

Code: Select all

OpenWindow(1,200,200,320,240,#PB_Window_SystemMenu,"MK-Test")
ActivateWindow()
OpenWindowedScreen(WindowID(),10,10,#SX,#SY,1,10,10)
in addition to that, I didn't forget to add this

Code: Select all

;- begin of event handler
Repeat
  Event.l = WindowEvent()
  Delay(1)
and that

Code: Select all

;- end of event handler
Until KeyboardPushed(1) Or Event = #PB_Event_CloseWindow
to the event handler

I can play the game but when I quit the game it crashes... strange isn't it :)

Have a nice day...

Franco
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

the event handler isn't right:

Code: Select all

Repeat
  while : event = windowevent() : wend

Until ...
Else only one event is treated at once and the message queue will probably explode.

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Tomcat.

Wow, thanks to you all for your positive feedback. Also good to know, that it
works on all computers so far and no one is complaining about the framerate :)

So, did anybody beat my lap record yet?

@Franco: Yes, Racing-Games are one of my favourite, too. Unfortunately I don't
know many race sims on PC. When I started this, I had some kind of Mario Kart from
the SNES in mind. Ridge Racer, Sega Rally,... are also cool racer, which you
should try out (if you not already know them or if you like arcade-racer).

Changing the view should be not such a big problem in general. It's only another
viewpoint for the player, so changing some values in the calculations should do it
(same with rotating the landscape). But for this code, I changed the values and
some ugly glitches appeared. Also the collision-detection didn't work so good
anymore. This was my very first test with 3D-Graphics (not including all the
cubes :wink: where i've done some mistakes. If you ask me, I would not take this
code as a base for something more, because most parts of the calculations are done
so it actually looks fine for me...

The Track-Data is from my own trackeditor. It's just an array which stores the
type of texture and height information for the hills. It's not very user-friendly,
so I decided, not to include it. I've also set a fixed startposition, so it's
kind of useless :wink:

Bye,
Tomek
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Tomcat.
Originally posted by Franco

Changed OpenScreen to OpenWindowedScreen:

...

I can play the game but when I quit the game it crashes... strange isn't it :)

Have a nice day...

Franco

Hm, this is really strange. I've added your code and got the same error.
But if you remove everything related to movies (playback of mp3) the
program doesn't crash anymore on exit (at least on my PC/WinXP). But I
don't know, what exactly causes the crash in this case...

Many thanks for this addition. It's funny, but it runs faster in a window as
in fullscreen (with the same size). Usually i get 50 frames in fullscreen, but
in a window I get about 60 frames. I would have bet, this would be slower ...

Bye,
Tomek
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

the fastest lap (without modify the code) is driving 2 times over Start/Stop with backdriving :).

Its a long way to the top if you wanna .....CodeGuru
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Tomcat.
Originally posted by Rings

the fastest lap (without modify the code) is driving 2 times over Start/Stop with backdriving :).

Its a long way to the top if you wanna .....CodeGuru
Ahhh, you got me. It was foolish of me, to think that this bug
won't be discovered. Now I pay the bill for my laziness :wink:

Bye,
Tomek
Post Reply