Would be good if each opponent had a slightly different driving ability.

That way they'd string out more, led by the best AI, followed by second and so on...

But hey I'm not going to even have opponents so your doing better than me already.

Thanks for trying it out.

Yep, thanks to no collision detection yet, they get very close I am hoping with the addition of collision detection and the resultant elastic collision will cause the AI cars to sort them selves out. If there is room i will attempt to introduce some randomness to the skills of seperate cars, but i dont think that will occur

Well i have the AI sort of done... but no physics implemented... i am not sure how i am going to shave the bytes to get it all to fit in 4k....

I have spent the last few days trying different combinations and tricks to reduce my JAR size..

So far i have removed the mini-map and reduced the car colours to only red and blue. And through many optimisations i have managed to get it down to 4106 bytes. I may yet only have one colour car as i need to impelment the following:

- collision detection- end of race condition and load next track- off-of-road detection

I may have to remove one of the track types... i dont want to but i am definitely feeling the pinch in bytes.

I have managed to gain 95 bytes by various methods and in doing so found some interesting "quirks" which i did not know about java. e.g. the first 3 numerical varibles declared in a method are cheaper (in bytes) to access than the rest of the numerical values. This saved me 20 bytes when i made sure that my index variables (i,j) were declared at the top of my method.

The rest of the savings came from heavily reusing variables and changing the embedded map data from mutliple streams into on concatinated stream.

I have also improved the AI a little.

Now i should have room to implement the remaining features and i will be able to post the complete game.

I like how the cars shy away from you if your infront of them. I spent the entire lap just racing ahead then stopping and watching them avoid me at all costs :-) Then speeding up and repeating it all over again.

Could they drive a little faster?

Looking good though. Oh and whats the deal with the tiling...is the map essentially infinite in all directions? And also I noticed some weird effect on the left of the screen when driving to the right, sort of like a swirly pattern thing going on, but only when driving at top speed.

The collision detection is still a little if-fy in that they still manage to drive over you eventually. Have to work on that. And it has the assumption that you will never have a head on collision as if you do the "bouncing" is incorrect. Also, you and the car colliding with you are faceing almost identical directions then the bouncing is almost non-existant, which probably causes them to be able to drive over you, This will need to be fixed

They drive flat out on the straight, but slow down to half speed on the long turns and quarter speed on the sharp turns, These figures are purely place holders, once i finalize the AI I will test to see what are the best values.

Also when the pseudo physics is added the type of road surface will effect their top speeds.

Thanks for the compliment, it has been a real challenge to save bytes! I am almost able to say that i will be able to fit all the functionaliy into the 4096 quota... i was not certian for a while there. I just hope i have room for multiple tracks as well!

The map is really only a maximum of 100x100 ( but the current track is nowhere near that size) if you go out of the map bounds there is nothing but grass. It is cheaper to do it that way than to have a boundry!

Yes i also notice the non-drawing of the tiles on the left edge if out side the map, the same occurs on the top edge, but I think i will leave that "feature" in as it does not detract from the game as you really should not be that far off the track

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org