Rally 4k (title to be confrimed)

I’m abit confused, why are you adding the transparency once the image is loaded?
What is wrong with having the transparency defined in the palette for the image itself?

Wait a sec!

Why are you trying to set the transparent colour AFTER rotating the image? Shouldn’t you do that to the car image once after loading it, then make rotated copies of the image that has the transparency already set?

Also note that when you make an image on Mac that you get a TRANSLUCENT image not a BITMASK image, if you don’t specify, simply specifying the type of transparency that you expect may fix it.

I think somehow the check you have for the transparent colour using “==” fails near the edges because of this.

For some reason i am getting a black/grey bar at the top of the rotated images if i set the transparency before rotating… I know it is stupid but if i change the transparency after the rotatiing this bar is not present.

however since i now create an image from embedded data instead of loading an external gif this problem of the bar appearing on the rotated images may no longer occur.

I am specifiing a BITMASK image on this line:

images[i]=new BufferedImage(65, 65, 2);

the 2 represents a bitmasked image.

Hmm… img1 returned from the ImageIO.read() will be 32 bit probably. The way the Mac graphics pipeline does the rotated blit it will likely get anti-aliasing. I did test on Mac with Sun’s graphics pipeline (only possible with recent developer previews) and the halo went away.

good to know… but not really helpful for this competition due to the 1.4.2 restriction.

Cheers tho,

New Update:

Now using both embedded graphics and embedded maps for tracks

I am now able to use pre-generated transparency making the code foot print for the car graphic generation smaller. This should also get rid of the haloing for Mac users… i hope.

The embedded tracks are stored in a stream format rather than as a bit map. This was done for two reasons:

  1. it is likely that track tiles which are connected to each other will be identical and so it helps compression to keep them together.
  2. the tile stream is stored in order of the track should be completed when racing. This will help keep the AI opponents going the correct direction.

However I am currently running low on bytes with the current version when kzipped gives 3924 bytes giving only 172 bytes to code in AI opponents and some crappy physic model for sliding around corners… It is going to be interesting :-\ I may have to remove some graphics.

I have uploaded the new JARs and source code. Can some one suggest an area or a trick where i might be able to save some bytes for the AI code?

Cheers

I can confirm that the halo effect on Mac OS has been fixed.

Great! thats a relief!

I am going to see whether i can make some simple AI for opponent vehicles with in the next few days.

I think i will need to get creative to get it to all fit in 4096 btyes.

OMG! Nice one moogie.

This game is almost exactly like what i’ve been working on.

Though I started with the physics first and your car looks a lot better than mine.

A very old (i.e. 5+ weeks ago) version is avaliable at http://stephencarmody.wikispaces.com/Racer4k

I’m very interested to see where both our games end up.

As your’ve mentioned, your current control setup is only for development. You’ll find when the physics are in, using one hand to accelerate, brake and turn is a little too hard.

Now i’m cursing myself I didn’t pull my finger out early and actually post something before you.

What you see posted on my wiki is very out of date now, since that version i’ve been completely redoing to graphics. My screen now pans and zooms in and out a little depending on the speed of the car.

Good luck on trying to get opponents implemented. I gave up early on that.

Anyway, now I’ve got some extremely close competition to bet. Goodluck!

LOL!

great minds think alike 8)

My game is tile based so panning and zooming is out of the question (tho would be nice!)

I think i will no longer go with a “proper” physics for the car and instead go with a heuristic psuedo-realistic physics model for the car so you version will probably be better in that aspect :slight_smile:

My game will definetly have opponnents (I have a very simple AI semi-working at the moment) tho whether they will be a challenge is to be seen.

The car graphic takes quite a bit of room, but I think it really adds to the game so I am trying desperately to keep it in.

I cannot access your game at work so I will fire it up at home.

I look forward to your completed racing game, you are correct: it will be interesting to see where both games end up. :slight_smile:

OMG!!!

Your from Australia!

I thought i recognised the name moogie. When you said your still at work, I though oh ok similar timezones to me. Peter posted his buggy game not 4 or so days ago. He sits like across from me at work. I remembered someone answer south australia to his anyone from australia question.

Ok this is officially freaky now.

Shit!!! I’m competing with a similar game to someone else in australia on a little know international java games comp.

I’m going to kick your butt!!!

Heh, it is a little odd :slight_smile:

In the nature of friendly competition I say let the best man win!

Mind due, I really am not entering the competition for the sake of winning, i just want to see what i could program into 4k and be of reasonable quality in both graphics and gameplay.

Added Opponents

I have created a very simple AI to control opponent cars, It needs some fine tuning as it seems very conservative in the sharp corners.

I have not bothered compressing the JAR yet as i want to finalise my AI first.

There is no collisions or physical effects yet.

I have included a mini-map, however this may be dropped if i need the bytes :slight_smile:

Cool, I gave it a try.

They seems to stick rather closely together though.

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 :wink: 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 :frowning:

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 would love to see how your project has progressed.

It sounds like you get a lot more time than me to work on your game.

I’ve tried harder the last few days, but I still don’t seem to be getting anywhere.

The view panning is becoming a real headache.

I’ll have another go tonight and post an update, no matter if its working or not.

for the moment yes, I have just started a new job and they dont know what to do with me yet while my clearance is transferred.

Lucky bastard!

Ok it still doesn’t work properly, but I had a small break through with the panning code tonight.

So as I said I’d do, i’ve updated it at http://stephencarmody.wikispaces.com/Racer4k

Don’t laugh. In my mind it will all make sense in the end.

Oh yeah and the way in which that wiki returns the jnlp, it doesn’t report an updated codebase. So either clear your webstart cache or just run the jar from the download link.

The panning does defintely add to the game. Pity my tile-based game means that I cannot easily perform zooming…

hmm… i wonder if i might be able to make a pseudo-panning mechanisme by generating discrete levels of zoom for all the graphics… It will probably blow out the byte cost imeplementing it…

It’ll kill the fps (unless you are using the ogl pipeline), but you could just AffineTransform.scale everything?

If i am going to go own that road i would pre-generate all the graphics… sure it may increase the memory use… but there was no limit on that was there? :wink: