Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: ben_g on June 15, 2012, 07:16:44 pm

Title: Racing game (revived)
Post by: ben_g on June 15, 2012, 07:16:44 pm
WARNING: THIS POST IS OUTDATED!

This is the project I've been working on since the start of the contest. I haven't done much yet because I'm busy with exams lately.

It is going to be a racing game in which you race against AI, and there will be some items you can use to go faster or to slow down other players (similar to mario kart).
It uses the 3D engine of my other game (Alien invasion), but this one is improved and supports textures, solid triangles and wireframe, instead of only textures.
This is what I have so far:
(http://picturestack.com/790/237/jNUtrackukr.gif)
This is the track, which already works graphics-wise, but it hasn't got any collision checking yet. The track is fully wireframe (and will probably stay like that). The track is fully 3 dimensional, which means it can go left, right, up and down, but models for up and down haven't been created yet. The cube in the center of the screen is the placeholder for the car. The car will probably be mostly wireframe, to fit in the simulation-like theme of the track (of which the current name, 'cyber racer', comes).

Right now the graphics are quite bad, but I might add some models to the sides of the track as illustrations, if the speed will allow it when AI and items are added). Right now, it runs in 15MHz mode, and has 18 fps. But it still looks smooth.

I guess that's all I can say about it now.
For this project I can't include the source because of the rules of the contest. If you want to use the 3D engine in your own project, I can give you the engine of my previous project.
Title: Re: [contest] Racing game
Post by: TIfanx1999 on June 16, 2012, 07:41:43 am
Looks pretty interesting. I'm looking forward to seeing it once the graphics have matured a bit more. ;)
Title: Re: [contest] Racing game
Post by: parserp on June 16, 2012, 09:59:31 am
A 3d racing game that will be finished? O.O/me pokes calc84
Title: Re: [contest] Racing game
Post by: aeTIos on June 16, 2012, 10:09:45 am
Wait, wha- You can't include the source in your entry? You sure can and afaik it's even required.
Title: Re: [contest] Racing game
Post by: lkj on June 16, 2012, 10:34:31 am
I think he wanted to say he can't post the source right now because of the contest rules.
Title: Re: [contest] Racing game
Post by: Nick on June 16, 2012, 10:59:55 am
looks good, but what's that polygon that has a different perspective than the rest of the image? the one that is starts at the same width as the track in the middle of the image, and gets wider to the top
Title: Re: [contest] Racing game
Post by: MGOS on June 16, 2012, 11:14:58 am
looks good, but what's that polygon that has a different perspective than the rest of the image? the one that is starts at the same width as the track in the middle of the image, and gets wider to the top
I think that is the bridge with the checkered start/finish flag thingy.
Title: Re: [contest] Racing game
Post by: ben_g on June 16, 2012, 03:11:59 pm
Wait, wha- You can't include the source in your entry? You sure can and afaik it's even required.
I mean right now. At the end of the contest I'll have to include the source, and if the 3D engine works well enough and maybe becomes a bit more user-friendly, I might even include a tutorial on how you can use it in an other project.

looks good, but what's that polygon that has a different perspective than the rest of the image? the one that is starts at the same width as the track in the middle of the image, and gets wider to the top
That's the start/finish. It has a different perspective than the track because it's vertical. It gets wider because the top is closer to the camera. But I might have to add a texture to it to make it easyer to recognise.
Title: Re: [contest] Racing game
Post by: ben_g on June 21, 2012, 03:07:05 pm
I finished the routines that make the rendered area of the track shift when you move. Here's a screenshot showing that in action:
(http://picturestack.com/305/529/KK7testMovingqy3.gif)
EDIT: as you can see from the screenshot, I still have to code in the part that renders the segment behind the car.
Title: Re: [contest] Racing game
Post by: aeTIos on June 21, 2012, 03:08:21 pm
WOOOO. I'm impressed O.O
Title: Re: [contest] Racing game
Post by: Keoni29 on June 21, 2012, 03:09:36 pm
I'd love to see this with textures! Nice job!
Title: Re: [contest] Racing game
Post by: ben_g on June 21, 2012, 03:13:31 pm
The track will keep being wireframe. Texturing all of that would be way to slow, so I'm only going to use textures for objects (item boxes, turbos, decorative items next to the track) and for a part of the car, so you can easily see which one is yours when the ai comes in.

I'm sorry, but a fully textured 3D track isn't within possibilities of my 3D engine. It could handle it, but with probably around 5fps. Even with a lot of optimisation, you can't make it fast enough.
Title: Re: [contest] Racing game
Post by: DJ Omnimaga on June 21, 2012, 04:35:08 pm
Wow this is nice, this reminds me of Glasscars. You should make the car masked, though.
Title: Re: [contest] Racing game
Post by: aeTIos on June 22, 2012, 04:38:13 am
I said that to ben_g on IRC yesterday and he said he will probably make the car just a sprite since the camera angle is fixed.
Title: Re: [contest] Racing game
Post by: DJ Omnimaga on June 22, 2012, 09:46:49 am
Ah ok, I guess it might be better.

Also now that I think about it, wouldn't it be better to move the car closer to the bottom of the screen and move the horizon down, so we can see further ahead?
Title: Re: [contest] Racing game
Post by: aeTIos on June 22, 2012, 10:45:16 am
Hmm, I think it's fine this way. Maybe add different cameras? :)
Title: Re: [contest] Racing game
Post by: ben_g on June 22, 2012, 11:41:17 am
DJ, you mean like this?
(http://picturestack.com/379/632/B5dtrackQq5.gif)
Title: Re: [contest] Racing game
Post by: aeTIos on June 22, 2012, 11:44:12 am
Woah does it even have elevation? cool <3
Title: Re: [contest] Racing game
Post by: Hayleia on June 22, 2012, 03:54:30 pm
This is awesome, and, now that I think of it, this is only the beginning O.O
I have a useless thought (as usual).
Will you make the camera turn at the same time as the player ?
I mean will we always see the back of the player or will we see his sides a bit when he turns ?
Title: Re: [contest] Racing game
Post by: ben_g on June 22, 2012, 04:16:16 pm
I might make the player a sprite, so then it should be possible to show a different sprite when an arrow is pressed
Title: Re: [contest] Racing game
Post by: Hayleia on June 22, 2012, 04:21:31 pm
Ok. I was wondering if you would use a 3D rendering for the player, as the screenshot shows for now, but a sprite would indeed be a lot easier (and faster) :)
Title: Re: [contest] Racing game
Post by: Stefan Bauwens on June 23, 2012, 05:46:56 am
I'm impressed. O.O
Title: Re: [contest] Racing game
Post by: Sorunome on June 23, 2012, 06:11:25 am
Wha, that is pretty awesome!
Title: Re: [contest] Racing game
Post by: cyanophycean314 on June 23, 2012, 10:50:33 am
This is looking amazing.  ;D
Title: Re: [contest] Racing game
Post by: ben_g on June 24, 2012, 10:17:23 am
I added collision checking (only on the straight sections for now) and now the car actually goes up or down with the road.
It is a bit glitchy however, so you sometimes fall trough the road on bends, and it can draw lines where it isn't supposed to when falling.
(http://picturestack.com/547/321/lA9trackcolligP8.gif)
Title: Re: [contest] Racing game
Post by: TIfanx1999 on June 24, 2012, 11:27:15 am
Wow, this is coming along quite nicely, very impressive looking. It looks like this engine could work quite well for a roller coaster sim as well. =)
Title: Re: [contest] Racing game
Post by: DJ Omnimaga on July 01, 2012, 01:43:57 am
DJ, you mean like this?
(http://picturestack.com/379/632/B5dtrackQq5.gif)
I meant making the car so absolutely nothing shows up inside it. Currently you see the race track inside the car. A sprite would actually be better I think since even Nintendo 64 games used sprites for Mario Kart and the like.
Title: Re: [contest] Racing game
Post by: aeTIos on July 01, 2012, 06:18:41 am
ben, I go with DJ that you should just change the car to a sprite.
Title: Re: [contest] Racing game
Post by: Hayleia on July 01, 2012, 06:29:15 am
A sprite would actually be better I think since even Nintendo 64 games used sprites for Mario Kart and the like.
ben, I go with DJ that you should just change the car to a sprite.

I might make the player a sprite, so then it should be possible to show a different sprite when an arrow is pressed
Title: Re: [contest] Racing game
Post by: aeTIos on July 01, 2012, 06:58:39 am
Well, just remembering of it. Also it's not that hard I think.
Oh wait. He's using ASM so he has to write a routine for it x.x
Title: Re: [contest] Racing game
Post by: DJ Omnimaga on July 02, 2012, 01:16:19 am
Yeah I wasn't sure if he was officially switching to a sprite, since the most recent gif still showed a 3D car. I brought it back up in case.
Title: Re: [contest] Racing game
Post by: Hayleia on July 02, 2012, 01:58:41 am
Yeah I wasn't sure if he was officially switching to a sprite, since the most recent gif still showed a 3D car. I brought it back up in case.
I think that he first works on the hardest parts of his game (making the 3D engine work perfectly) before working on easy parts (make the player a sprite). This would be why the player is still a cube :)
Title: Re: [(probably not for the) contest] Racing game
Post by: ben_g on July 07, 2012, 04:01:04 pm
new screenshot showing the bad and glitchy AI:
(http://picturestack.com/690/855/V0vUntitledX17.gif)

It isn't finished yet, and I probably won't be able to even create an enjoyable demo in such a short time. What this means is that I probably am not going to participate in the contest, and when I'm sure of that, I'll make this project open-source, but will still continue working on it.

I just didn't have enough time with the exams in june, and my work in july. Too bad, because I really wanted to know how my programming skills compare to the rest here on omnimaga, and more importantely, if I could do better than last place.
Title: Racing game
Post by: ben_g on July 07, 2012, 07:23:53 pm
I made my desision: I won't be participating in the contest.

Here's the source code and executable, enjoy.
Title: Re: Racing game
Post by: linuxgeek96 on July 07, 2012, 07:25:46 pm
sorry to hear that. Hope you keep developing it tho, it seems really good!
Title: Re: Racing game
Post by: ben_g on July 07, 2012, 07:28:06 pm
I will keep working on it, but progress will be a bit slower because I'll also work on my java game again.
Title: Re: Racing game
Post by: linuxgeek96 on July 07, 2012, 07:46:07 pm
cool java game. Did you do your own engine and/or textures?
Title: Re: Racing game
Post by: ben_g on July 07, 2012, 07:48:29 pm
I did make the textures myself, but I downloaded the engine (it's jMonkeyEngine).
Title: Re: Racing game
Post by: thepenguin77 on July 07, 2012, 11:46:41 pm
I don't know whether you're aware or not, but bcall(_dispHL) is really slow. If you want to see some numbers for debugging, you should definitely write your own routine to display the numbers (bcall(_putS) is OK in this situation, but eliminating that would be even better)
Title: Re: Racing game
Post by: ben_g on July 08, 2012, 11:04:32 am
For displaying stuff in the final version (like laps, position etc), I will write my own routine, and probably use sprites for it instaed of the standard numbers. However for debugging purposes, I did it the easy way. And with dispHL, I also know for sure that it's working. But it does cause a noticable slowdown.
Title: Re: Racing game
Post by: Builderboy on July 08, 2012, 03:31:01 pm
Yeah i don't think there is any issue with using dispHL simply for debugging ^^ Also I'm glad this is still being worked on even if it didn't ake the contest entry :D
Title: Re: 3D racing game (revived)
Post by: ben_g on January 16, 2014, 03:46:12 pm
I know this is a necropost, but I just wanted to let you guys know that I'm working on this again.
It's a complete recode, and now it uses axe and GLib, instead of assembly and my own engine. Because of this reason, it is now again in a very early stage, but I'll give you guys a screenshot anyway:
(http://img.ourl.ca/map%20renderer%20test.gif)
As you see in the screenshot, I've let out the diagonal lines and used simpeler, clearer models. And I think it actually looks better that way. And the models are smaller and faster this way too.

There is still a lot of work to do, but the speed is good (20fps at 6MHz, the previous version ran at 18fps at 15MHz in it's final stage), which should enable me to put some more stuff.

Spoiler For Some technical details:
The visible area supported by the current map renderer is 16 by 16 tiles, and tiles are 32 by 32 units. This makes the visible area 512 units large, or (since the tilemap will be centered around the player to prevent overflows) 256 units in every direction. In the screenshots, the road used there is 16 units wide.
The tilemap contains models as tiles, and each tile can be elevated between 0 and 255 units (based on a heightmap). Overlapping roads will be done by having a special tile that represents a bridge.
At the start (and in the future: when the tilemap is moved/updated), the tilemap is converted to one big model that represents the entire visible area. Because of this, models can have a different, smaller format (only 3 bytes per vertex, instead of 6) witouth slowing down the rendering. The code that generates that big model is still rather fast, and it still gets 17fps when it's generated every frame. This will be slower in future versions, though, but it also won't run evrey frame.
The rest is still only planned, and thus lickely to change.
Title: Re: Racing game (revived)
Post by: Matrefeytontias on January 16, 2014, 04:19:08 pm
Very glad that you took it back :D hopefully you can get it done this time !
Title: Re: Racing game (revived)
Post by: Sorunome on January 16, 2014, 04:20:14 pm
That is like 1.5 yrs necro O.O

Anyways, looking awesome so far, good seing that GLib is been used :)
Title: Re: Re: Re: Racing game (revived)
Post by: DJ Omnimaga on January 16, 2014, 07:45:02 pm
That is like 1.5 yrs necro O.O

Anyways, looking awesome so far, good seing that GLib is been used :)
that's nothing: See my 3 years revival with Supersonic Ball :P.

Anyway this looks very promising. I hope you can make it better and faster graphically than GlassCars on ticalc.org.
Title: Re: Re: Re: Racing game (revived)
Post by: dreamdragon on January 16, 2014, 09:14:40 pm
That is like 1.5 yrs necro O.O

Anyways, looking awesome so far, good seing that GLib is been used :)
that's nothing: See my 3 years revival with Supersonic Ball :P.

Anyway this looks very promising. I hope you can make it better and faster graphically than GlassCars on ticalc.org.

?

OI!
WTH DID U PUT THIS AS A THUMBS DOWN?!?!?
COMEON I WAS JUST CONFUSED AN WHAT THE TOPIC WAS!!!!
Title: Re: Racing game (revived)
Post by: ben_g on January 17, 2014, 10:43:36 am
I hope you can make it better and faster graphically than GlassCars on ticalc.org.
I'll try to make it as good as I can, but I don't know how good and fast GlassCars is because it doesn't seem to work on an 84+ and I can't find an annimated screenshot.
Title: Re: Racing game (revived)
Post by: TheMachine02 on January 19, 2014, 08:35:55 am
wow it's look good  :D It is always great to see GLib used

Anyway, here a screenshot of glasscar :

(http://i.imgur.com/PWaX0QP.gif)
Title: Re: Racing game (revived)
Post by: DJ Omnimaga on January 23, 2014, 09:15:25 pm
Wow I haven't played this in a while. I remember the controls were quite akward but I didn't remember line clipping being so weird. I'm sure Ben_g would be able to do much better, especially with every doc available compared to back in 1999-2000. GlassCars was really the first 3D racing game for calcs I think, though.
Title: Re: Racing game (revived)
Post by: TheCoder1998 on January 24, 2014, 01:53:32 am

?

OI!
WTH DID U PUT THIS AS A THUMBS DOWN?!?!?
COMEON I WAS JUST CONFUSED AN WHAT THE TOPIC WAS!!!!

dude, please relax

your post rating doesn't mean anything, just don't make any more potentially stupid mistakes, don't necropost, and just don't post anything irrelevant on a topic anymore okay?

oh and "?" just doesn't make any sense
Title: Re: Racing game (revived)
Post by: Hayleia on January 24, 2014, 01:59:25 am
And I guess the reason why you were downrated (I was not the one who downrated you) is because "?" is just wasting a post. If you had said "hey folks, I haven't understood that precise part of the topic", people could have helped you. But "?" doesn't help us help you so you wasted one post.
Title: Re: Racing game (revived)
Post by: ben_g on January 24, 2014, 11:35:13 am
Wow I haven't played this in a while. I remember the controls were quite akward but I didn't remember line clipping being so weird. I'm sure Ben_g would be able to do much better, especially with every doc available compared to back in 1999-2000. GlassCars was really the first 3D racing game for calcs I think, though.
The line clipping is already much better (thank TheMachine for that), and it seems that - while the glasscars engine does support a bit of elevation - glasscars doesn't support full 3D tracks with bridges etc. (But I've never played it since my calc can't run it, so correct me if I'm wrong) And I'm now working a lot on a new format that allows full 3D tracks.
The controls will probably be similar to the previous version (but with acceleration/decelleration). And I also have some plans to make it a bit more fun, but those remain secret for now because I don't know yet if the game will run at a good enough speed to implement them.
Title: Re: Racing game (revived)
Post by: TheCoder1998 on January 24, 2014, 12:07:07 pm
i'ts looking great :D

i'm looking forward to a completed version of this game :)
Title: Re: Racing game (revived)
Post by: DJ Omnimaga on January 24, 2014, 12:21:15 pm
I think GlassCars has some bridges, but the graphics were really rudimentary. It seemed more like a proof of concept to show that wireframe 3D was actually possible on a 6 MHz calculator.
Title: Re: Racing game (revived)
Post by: TheMachine02 on January 28, 2014, 06:18:10 am
I think GlassCars has some bridges, but the graphics were really rudimentary.

Yes there is some sort of height where you can jump of (and some sort of a rudimentary physic engine) .

Speaking of line cliping, it's *look* like it clip everything in 3D too, but in a very agressive way and with a far plane. That can be understanded, seing that with this method, point are always on screen, and thus no need for a 2D cliping. However, it's true that it look weird.

Anyway, can't wait to see progress. It sound very promising  :D