Jump to content

Anyone think Ballblazer is possible on the 2600?


767 replies to this topic

#276  

    Stargunner

  • 1,361 posts
  • Joined: 14-September 07
  • RLA
  • Location:The Netherlands

Posted Thu Nov 13, 2008 2:45 AM

View Postatari2600land, on Thu Nov 13, 2008 5:06 AM, said:

Is this still being worked on? I'd like an update, please, this looks like the best homebrew graphics on the 2600 so far.

I'll hope to be able to post an update soon. Next updates will be real 51x21 (or whatever size) checkerboard, collision detection, brakes and deaccelleration. While doing this I hope my subconscious figures out how to map the opponent player on the checkerboard :)

What do you guys think of the following?:
Now I use a velocityX and veloctyY component for indicating speed/direction. Should I use an angle and a speed component indicating speed/direction? That would make more sense because I can freely adjust the speed (for like deaccalleration of players/ball) without affecting the direction.

With the velocityX,velocityY method, the maximum speed will be achieved when going in diagonal direction, which is strange. It would be something like 256 x √2

#277  

    Thrust, Jammed, SWOOPS!

  • 16,625 posts
  • Joined: 25-April 01
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Thu Nov 13, 2008 5:43 AM

View Postroland p, on Thu Nov 13, 2008 9:45 AM, said:

What do you guys think of the following?:
Now I use a velocityX and veloctyY component for indicating speed/direction. Should I use an angle and a speed component indicating speed/direction? That would make more sense because I can freely adjust the speed (for like deaccalleration of players/ball) without affecting the direction.

With the velocityX,velocityY method, the maximum speed will be achieved when going in diagonal direction, which is strange. It would be something like 256 x √2
i am not 100% sure about the physics of the original game. Can players and ball go diagonal. Then both should use the same algorithm.

You can limit speed by introducing friction. Maybe you calculate friction combined on both directions, so that diagonal doesn't become faster than vertical or horizontal. Else angle and speed sounds like a good idea.

#278  

    Quadrunner

  • 9,751 posts
  • Joined: 29-September 05
  • Location:Australia

Posted Thu Nov 13, 2008 5:53 AM

I'm not sure how many velocities the original has, or if it's done in an (almost) infinitely variable kind of way by using fractional integer additions.

How about a kind of 2 dimensional array which contains all possible X/Y velocity values?

Then you can hard-code it such that the resultant angles/speed correpsond such that you don't have that situation you described, where a 45 degree angle of motion would be faster than a 0 or 90 degree angle of motion.

#279  

    Stargunner

  • 1,361 posts
  • Joined: 14-September 07
  • RLA
  • Location:The Netherlands

Posted Thu Nov 13, 2008 7:09 AM

Thanks for your input.

I'm using signed 16-bit values now so speed can be +/-32768. Small errors will be unnoticable.

Imagine the ships has 4 engines for 4 directions, then the maximum diagonal speed is OK :)

The only problem is to assure that the friction is in exactly the opposite direction of the ship...

#280  

    Quadrunner

  • 9,751 posts
  • Joined: 29-September 05
  • Location:Australia

Posted Thu Nov 13, 2008 8:23 AM

For friction, couldn't you just divide the velocity for each axis by some constant, then subtract it?

e.g. shift the high byte right twice, then subtract that from the overall velocity.

#281  

    Stargunner

  • 1,361 posts
  • Joined: 14-September 07
  • RLA
  • Location:The Netherlands

Posted Thu Nov 13, 2008 9:41 AM

View PostRybags, on Thu Nov 13, 2008 3:23 PM, said:

For friction, couldn't you just divide the velocity for each axis by some constant, then subtract it?

e.g. shift the high byte right twice, then subtract that from the overall velocity.

I'll try that.

When max velocity is 8192 (high byte is 32 then, so ship moves 32 pixels every frame (one tile is 256 pixels)) and I substract it every frame with velocity/64 the ship will be fully deaccelerated within 367 frames.

#282  

    Thrust, Jammed, SWOOPS!

  • 16,625 posts
  • Joined: 25-April 01
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Thu Nov 13, 2008 11:42 AM

View PostRybags, on Thu Nov 13, 2008 3:23 PM, said:

For friction, couldn't you just divide the velocity for each axis by some constant, then subtract it?

e.g. shift the high byte right twice, then subtract that from the overall velocity.
Yup, that's exactly how I am doing in my games too. Works pretty nicely.

#283  

    River Patroller

  • 3,074 posts
  • Joined: 14-November 05
  • Coming soon to a natural satellite near you...

Posted Thu Nov 13, 2008 12:06 PM

Let me just interject that I think this work is incredible! Way to go guys! Especially you roland, and you ZylonBane for getting the music ball rolling. (Random Terrain's last version sounds damn near perfect!)

#284  

    Stargunner

  • 1,361 posts
  • Joined: 14-September 07
  • RLA
  • Location:The Netherlands

Posted Fri Nov 14, 2008 7:14 AM

View Postjbanes, on Thu Nov 13, 2008 7:06 PM, said:

Let me just interject that I think this work is incredible! Way to go guys! Especially you roland, and you ZylonBane for getting the music ball rolling. (Random Terrain's last version sounds damn near perfect!)
Thanks,

Yeah the music is really great, I had to play the original to here the differences!

@ZylonBane, Random Terrain, thegoldenband
Great work!
I forgot to thank you. Shame on me :|
As I completely suck at creating music, I really appriciate the work.

I think I first have to add some backswitching before I can include it. I still use a pathetic 4KB of ROM. Is there any assembly code for the music?

#285 ONLINE  

    River Patroller

  • 2,185 posts
  • Joined: 26-November 04
  • Location:Long Island, NY

Posted Fri Nov 14, 2008 9:25 AM

Thanks, roland! Here's the assembly code for my final version (aka "alt7"), which has all the pitches in place but doesn't include Random Terrain's changes:
Attached File  ballblazer_start_zylon_goldenband_final.asm.txt   30.06K   48 downloads
Obviously there's a great deal that can be cut -- this is just the raw output from bB. I don't have the .bas for Random Terrain's version handy, but I could compile it tonight if he doesn't upload it first.

Edited by thegoldenband, Fri Nov 14, 2008 9:29 AM.


#286  

    Visual batari Basic User

  • 20,535 posts
  • Joined: 23-April 01
  • Controlled Randomness

    Replay Value

    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Nov 14, 2008 9:34 AM

View Postthegoldenband, on Fri Nov 14, 2008 10:25 AM, said:

I don't have the .bas for Random Terrain's version handy, but I could compile it tonight if he doesn't upload it first.
I posted the .bin file and the .bas file:

http://www.atariage.com/forums/index.php?s...t&p=1615377

#287 ONLINE  

    River Patroller

  • 2,185 posts
  • Joined: 26-November 04
  • Location:Long Island, NY

Posted Fri Nov 14, 2008 11:38 AM

View PostRandom Terrain, on Fri Nov 14, 2008 10:34 AM, said:

View Postthegoldenband, on Fri Nov 14, 2008 10:25 AM, said:

I don't have the .bas for Random Terrain's version handy, but I could compile it tonight if he doesn't upload it first.
I posted the .bin file and the .bas file:

Sorry, I should've been more precise -- "I don't have the .bas for Random Terrain's version handy" really meant "I don't have time right now to find and download the .bas, coax bB (which is occasionally flaky on my system) into working, and compile and upload the .asm". I already had the .asm handy for mine, so...

Edited by thegoldenband, Fri Nov 14, 2008 11:39 AM.


#288  

    Visual batari Basic User

  • 20,535 posts
  • Joined: 23-April 01
  • Controlled Randomness

    Replay Value

    Nonlinear
  • Location:North Carolina (USA)

Posted Fri Nov 14, 2008 12:23 PM

View Postthegoldenband, on Fri Nov 14, 2008 12:38 PM, said:

View PostRandom Terrain, on Fri Nov 14, 2008 10:34 AM, said:

View Postthegoldenband, on Fri Nov 14, 2008 10:25 AM, said:

I don't have the .bas for Random Terrain's version handy, but I could compile it tonight if he doesn't upload it first.
I posted the .bin file and the .bas file:

Sorry, I should've been more precise -- "I don't have the .bas for Random Terrain's version handy" really meant "I don't have time right now to find and download the .bas, coax bB (which is occasionally flaky on my system) into working, and compile and upload the .asm". I already had the .asm handy for mine, so...
Oh, OK. Thanks. I have the .asm file for my version. I can post it right now:

Attached File  ballblazer_start_zylon_alt_2008y_11m_04d_0426t.txt   32.29K   42 downloads

#289  

    Quadrunner

  • 5,831 posts
  • Joined: 24-November 04
  • Boom bam.
  • Location:Seattle, WA

Posted Fri Nov 14, 2008 1:03 PM

I think the ball can only move in 4 directions; no diagonals.

The ships can move in any direction.

#290  

    Stargunner

  • 1,361 posts
  • Joined: 14-September 07
  • RLA
  • Location:The Netherlands

Posted Sun Nov 23, 2008 1:15 AM

Hi all,

I was working on the border-collision-detection and discovered some bad design choices that I have to fix first. It does bounce at one border, but ship stops when it bounces at low speed (while there is no friction implemented yet). Ships moves easier in the left direction then in the right direction too. That's because I treat the high byte of a signed 2 byte value as the velocity, which is wrong.

So I'm going to increase the precision of ships position so I can use the full 2-byte speed. This allows better behaviour at low speeds too.

Roland.

#291  

    Thrust, Jammed, SWOOPS!

  • 16,625 posts
  • Joined: 25-April 01
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Sun Nov 23, 2008 5:09 AM

View Postroland p, on Sun Nov 23, 2008 8:15 AM, said:

That's because I treat the high byte of a signed 2 byte value as the velocity, which is wrong.
As long as you use 16 bit signed integers and treat the high byte as 8 bit signed integer too, everthing should be fine. Even for friction you can use signed values, just make sure that you keep the highest bit constant when shifting right.

Or where is your problem?

#292  

    Stargunner

  • 1,361 posts
  • Joined: 14-September 07
  • RLA
  • Location:The Netherlands

Posted Sun Nov 23, 2008 2:06 PM

View PostThomas Jentzsch, on Sun Nov 23, 2008 12:09 PM, said:

Or where is your problem?

When speed is 0001 nothing goes on because I only use the high byte, which is 00 in that case. Ship starts moving when speed is 0100. When speed is FFFF (-0001) ship will move left because the high byte is FF. So +1 is does not do the same as -1.

But I could increase the value with 1 if it is negative. A bit ugly.

Anyway, the position of the player (posX, posZ) is now stored in 16 bit values. The high byte counts as a tile, the low byte is 1/256th of a tile. I find the lowest speed (1/256 tile per frame, so about 4 seconds to scroll 1 tile further) a bit too high.


So, increasing precision of the position (3 bytes instead of 2) whould solve both problems.

#293  

    Thrust, Jammed, SWOOPS!

  • 16,625 posts
  • Joined: 25-April 01
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Sun Nov 23, 2008 2:12 PM

View Postroland p, on Sun Nov 23, 2008 9:06 PM, said:

When speed is 0001 nothing goes on because I only use the high byte, which is 00 in that case. Ship starts moving when speed is 0100. When speed is FFFF (-0001) ship will move left because the high byte is FF. So +1 is does not do the same as -1.

But I could increase the value with 1 if it is negative. A bit ugly.
Understood. I think correct rounding would be adding $80 to the lower byte.

Quote

Anyway, the position of the player (posX, posZ) is now stored in 16 bit values. The high byte counts as a tile, the low byte is 1/256th of a tile. I find the lowest speed (1/256 tile per frame, so about 4 seconds to scroll 1 tile further) a bit too high.

So, increasing precision of the position (3 bytes instead of 2) whould solve both problems.
Or adding the speed not every frame.

#294  

    Stargunner

  • 1,361 posts
  • Joined: 14-September 07
  • RLA
  • Location:The Netherlands

Posted Mon Nov 24, 2008 8:10 AM

View PostThomas Jentzsch, on Sun Nov 23, 2008 9:12 PM, said:

View Postroland p, on Sun Nov 23, 2008 9:06 PM, said:

When speed is 0001 nothing goes on because I only use the high byte, which is 00 in that case. Ship starts moving when speed is 0100. When speed is FFFF (-0001) ship will move left because the high byte is FF. So +1 is does not do the same as -1.

But I could increase the value with 1 if it is negative. A bit ugly.
Understood. I think correct rounding would be adding $80 to the lower byte.

Ok, Nice, I'll try that!

#295  

    Stargunner

  • 1,361 posts
  • Joined: 14-September 07
  • RLA
  • Location:The Netherlands

Posted Mon Nov 24, 2008 3:23 PM

Added some collision detection now. Ship bounces back when a border is hit.
There are some glitches but it works pretty well.
Left, right and top borders are implemented now for top player.

Edited by roland p, Tue Nov 25, 2008 6:03 AM.


#296  

    Cookie Meister

  • 2,131 posts
  • Joined: 30-April 07
  • Braindead
  • Location:Hueco Mundo

Posted Mon Nov 24, 2008 3:39 PM

View Postroland p, on Mon Nov 24, 2008 10:23 PM, said:

Added some collision detection now. Ship bounces back when a border is hit.
There are some glitches but it works pretty well.
Left, right and top borders are implemented now for top player.
Something is wrong here, the .bin is only 3.5K instead of 4K and doesn't work!

#297  

    Stargunner

  • 1,361 posts
  • Joined: 14-September 07
  • RLA
  • Location:The Netherlands

Posted Tue Nov 25, 2008 6:05 AM

View PostImpaler_26, on Mon Nov 24, 2008 10:39 PM, said:

View Postroland p, on Mon Nov 24, 2008 10:23 PM, said:

Added some collision detection now. Ship bounces back when a border is hit.
There are some glitches but it works pretty well.
Left, right and top borders are implemented now for top player.
Something is wrong here, the .bin is only 3.5K instead of 4K and doesn't work!

woops!
I'll try again.

Attached Files



#298  

    River Patroller

  • 4,728 posts
  • Joined: 12-May 01

Posted Tue Nov 25, 2008 9:58 AM

It still seems like the maximum speed of your guy is too high. It really gets blindingly fast and uncontrollable.

Edited by mos6507, Tue Nov 25, 2008 9:59 AM.


#299  

    Stargunner

  • 1,361 posts
  • Joined: 14-September 07
  • RLA
  • Location:The Netherlands

Posted Tue Nov 25, 2008 10:28 AM

View Postmos6507, on Tue Nov 25, 2008 4:58 PM, said:

It still seems like the maximum speed of your guy is too high. It really gets blindingly fast and uncontrollable.

Yep, there is still a list of things to do:

- maximum speed
- friction
- brakes
- non-linear acceleration?

But I'm really getting out of ROM space. Lots of code is generated with macro's. Is it OK to change some macro's into subroutines, push some variables to the stack and call the subroutines with JSR?
Brown-border Kernel is now unrolled (the code that generates the brown border when you approach the top). I could turn it into a loop, but then I need precise entry points (the whole thing is based on clockcycles) in the checkerboard kernel.
Or just go for bankswitching... I think I have to focus on that one.

#300  

    Moonsweeper

  • 336 posts
  • Joined: 05-November 01
  • Location:Columbus, OH, USA

Posted Tue Nov 25, 2008 10:53 AM

View Postroland p, on Tue Nov 25, 2008 4:28 PM, said:

But I'm really getting out of ROM space. Lots of code is generated with macro's. Is it OK to change some macro's into subroutines, push some variables to the stack and call the subroutines with JSR?
In general there's nothing wrong with changing macros into subroutines...except that it will eat CPU cycles due to the JSR/RTSes and the pushes and pops.

Here's a document that shows how to do f8 bankswitching:

http://www.qotile.net/minidig/docs/2600_ad..._prog_guide.txt

It's not too hard...partitioning the code is really the hardest part.

Ben





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users