Jump to content
IGNORED

Alpha Race for Atari 7800


SIO2

Recommended Posts

The easiest way to implement accurate thrust mechanics in 7800basic begins with using fixed-point numbers for the ship X,Y, and Dx,DY. Dx and DY can be thought of as velocity values, and each frame they get added to the ship's X and Y. e.g. X=X+DX:Y-Y+DY

 

If the thrust system uses the cardinal joystick directions, you adjust the DX and DY values appropriately. e.g. if joy0up then DY=DY-0.10

 

If the thrust system use angles and a thrust button, then you need a sine/cosine table to adjust DX, DY appropriately with the ship's angle.

 

Adding proper drag to a thrust system is a little more complicated. If you just subtract a constant # from DX and DY each frame, the damping will change direction weirdly when DX and DY are non-zero and DX<>DY.

 

A proper damping system will reduce DX and DY in proportion to their magnitude. Or you can punt and skip the damping system, leaving it up to the user to reduce their own thrust.

  • Like 1
Link to comment
Share on other sites

Currently the control routine uses the joystick directions left and right to step through eight positions. It then adds thrust and drag at constant rates. So the ship moves, stops and changes directions immediately. I call that responsive and I like that. If I don't want a hard stop, I don't stop. I play with my thumbs laying on the throttle and the blaster. So, I even included a brake option to stop immediately when the ship has momentum built up.

 

I can understand that people with other styles of play might want a different response from the ship especially since that system is quite common. Just having a hard time getting my mind to process the math.

Edited by SIO2
  • Like 1
Link to comment
Share on other sites

Thanks for the input guys. I am not getting the physics/math for that control method so that is not happening.

 

In fact, the game looks and plays exactly like I have wanted it to at this point.

 

I just want to test a few things and I will post the final version in the next few days.

 

If you like the result, great. If not, there are plenty of games in the world.

ar092015.a78

ar092015.bin

Link to comment
Share on other sites

I can understand that people with other styles of play might want a different response from the ship especially since that system is quite common. Just having a hard time getting my mind to process the math.

 

It would be more accurate to say that people might want a different response because that's how the arcade version controls.

Link to comment
Share on other sites

It would be more accurate to say that people might want a different response because that's how the arcade version controls.

Yes, I think that is an accurate assessment of what people are thinking.

 

I honestly had not set out to recreate Omega Race. I wanted a different game with some of the same components that played harder and faster than any version of Omega Race on a classic home console. To me, Alpha Race is a different game because it has different rules and mechanics than Omega Race.

 

I don't see a need to recreate an arcade version of Omega Race because people can play Ron Haliburton's masterpiece with MAME.

 

I think one thing that is going on is that people are really wanting Omega Race for the 7800. I agree that would be nice. Perhaps that will happen in the future. It just isn't where I intended to go with this effort.

 

Another thing that is perhaps off topic but I want to mention because I run into these sorts of situations a lot in my life where people are saying to me "Most people do...whatever". I think the human mind prefers to categorize things in order to reduce it's processing load. Rather than having to evaluate every situation, it often relys on a quick search turning up something similar then it puts the new item into the same category. So when a person runs into a cat that barks like a dog and fetches a ball, the processing load goes up and they become uncomfortable as the brain struggles to categorize this thing. Sometimes to reduce that discomfort they try to coax that thing into the box they have defined. There may be some of that involved in trying to define the relationship between Alpha Race and Omega Race.

 

I have to admit, I kind of like to present those challenges to the status quo because the universe is a big place and as we explore it we need to be more aware that things could get rather different than what we are used to or what most people do.

 

I did take a look at adding the floaty ship to Alpha Race but there are two main challenges there. First, I don't understand it yet. I know it is simple to some people but it is not simple to me. The other main challenge I have is trying to fit it into the code that I have and am perfectly happy with without breaking that existing code.

 

One thing I know though is that I could not ever make everyone happy with this project because everyone has a little different idea about what it should be and some of those ideas are incompatible with each other.

 

All I can say is, try to enjoy what is for what it is and if anyone wants for something else, please share with us the results of your creation.

Edited by SIO2
Link to comment
Share on other sites

This is way - way off topic but, please be careful naming your children.

 

My name is Brek Brixius which is an uncommon name and an unccommon spelling of that name. I also find it to be a bit of a tongue twister.

 

So many times when I introduce myself to people they get stuck trying to process my name. I hear them say, "I am sorry did you say, Rick?, Brad?, Rod?, Brick?" Then after five minutes of talking to them while they go uh huh, uh huh, they say "What nationality is that - your last name?" Then I know they are still trying to put me into a box and they have not heard a word that I said.

 

So parents, resist that urge to be different. Jim is just fine.

Link to comment
Share on other sites

Thanks guys. I plan on putting together a handful of these soon. I have a busy few days coming up and I am waiting on our local print shop to make me some labels.

 

First copy goes to Atariboy for his awesome art. After that I will contact those who say they are interested as I get some carts built.

  • Like 3
Link to comment
Share on other sites

I honestly had not set out to recreate Omega Race. I wanted a different game with some of the same components that played harder and faster than any version of Omega Race on a classic home console. To me, Alpha Race is a different game because it has different rules and mechanics than Omega Race.

 

As a hobbyist developer, you're of course free to do whatever you want with your time and effort and are under no obligation to do otherwise. So the real question is how your work is received by the community that you release it into (if you care).

 

The 7800 homebrew community is notable for a slew of arcade ports that a) have had a back-breaking amount of effort put into them to be as slavishly arcade-perfect as possible, and b) often slightly change their names to avoid copyright issues ("Beef Drop", "B*nQ", etc). So when someone sees "Alpha Race" for the 7800 and a screenshot of the gameplay, it's entirely reasonable for them to think "Aha! Someone has made an arcade-perfect port of Omega Race for the 7800!". Then when they actually play it, they won't think you've intentionally made your own twist on Omega Race, they'll think you half-assed it (like the 5200 Klax port from a few years ago).

 

Additionally, by putting this out on cart, it's within the realm of possibility that you may be poisoning the well for anyone else to come along and make their own actual Omega Race port for the 7800. Why duplicate something that's already (sort of) been done, right?

Link to comment
Share on other sites

SIO, I'm not trying to be difficult or tell you what to do. This is a pretty good game, after all, and it's good work. But I do think it would be worth the little bit of effort for 'floaty ships' not just for the number of us that want a truer-version of Omega Race, but also for you to expand your programming skills. Bob, for instance, has done this movement type for a few of his games, and I'm sure if you PMed him he would, when he can, get back to you on how to implement it.

 

Just my friendly advice. :)

Link to comment
Share on other sites

SIO, I'm not trying to be difficult or tell you what to do. This is a pretty good game, after all, and it's good work. But I do think it would be worth the little bit of effort for 'floaty ships' not just for the number of us that want a truer-version of Omega Race, but also for you to expand your programming skills. Bob, for instance, has done this movement type for a few of his games, and I'm sure if you PMed him he would, when he can, get back to you on how to implement it.Just my friendly advice. :)

Thanks. I love and admire Bob's work. I think however that he speaks 6502 assembly language and I do not (at least not much). To have Bob attempt to teach me how to do this would be akin to having Beethoven teach a gorilla to play piano.

 

(Please keep in mind as you read the following that I am not an advanced programmer and I attempt to explain things to the best of my ability and understanding at this time).

 

However, I have given the issue of the ship's movement considerably more effort than would be apparent in this thread since I was working on it before anything about it was posted here and continued work on it even after I had posted that it will not be a part of this game.

 

I built a simple model of the ship's control routines as a separate program so that I could play with it and see if I could achieve the desired result. After doing a lot of research and trying different things and getting results that ranged from about the same to considerably worse, I have decided to not attempt to put the Arcade Omega Race / Asteroids type ship movement into this game.

 

There are many reasons for this decision. First, the current control mechanism snaps the ship to one of eight angles which cause effects of momentum on trajectory while turning to be much less smooth than a system that tracks more angles. Tracking more angles of rotation would mean rewriting the shot launching and shot movement routines and may also result in the need for changes to boundary checking. Also, achieving a smoother stop is going to be a challenge. New velocity = old velocity + acceleration - decay is pretty straight forward but if decay is applied at a constant rate then the effect is the same as the hard stop whether you are using whole or fractional numbers.

 

The calculatios necessary to determine the acceleration vectors and proportional decay are not easily achieved within 7800bas. They could be achieved with additonal subroutines and or inline assembly but would still likely load the system and could potentially cause problems for display in this fast moving game.

 

It is also possible that at least the accelration vectors could be precalculated but, I hope that you see by this point that the effort would be much greater than the benefit IMHO and this is where I stop.

Link to comment
Share on other sites

SIO2, please don't assume a lack of knowledge on my part about game programming. I'm a professional, and I've been doing 'retro-game' coding since it was just 'game' coding. I haven't used 7800 bas, but I'm more than familiar with Pascal, Turbo Base, MC10 assembly, and so on, and so on, etc.

 

So what we're looking at here is a geometry problem and turning into something workable on the 7800. This sounds a lot more daunting than it is. So let me explain.

 

Let's say that STARSHIP has 16 possible angles of movement. Starting from "North", we'll number these 0 through 15. Each angle is 22.5 degrees apart. Now, to determine our vector, we're going to always assume a 'length' of one.

 

Now, evil geometry says that sin (vector) = opposite over hypotenuse. cos (vector) = adjacent over hypotenuse. Thankfully we always know that our hypotenus, at this step, is equal to one. This means that sin(vector) = opposite, which happens to be our "DY". And our cos(vector) happens to be our "DX".

 

So, to determine our DX for any given angle, DX = cos(angle). And DY = sin(angle).

 

Easy-peasy, but you're right, 7800 isn't exactly a math machine! cos and sin may not be available or fast. So we're not going to use them... not in code, anyway. Instead, since we only have 16 entries, numbered 0 through 15 as above, we'll do a quick lookup table. Using pseudocode...

 

If angle = 0 then { DX = 0; DY = -1; }

...

and so on

...

If angle = 3 then ( DX = .92; DY = .38; }

If angle = 4 then { DX = 1; DY = 0; }

 

In other words, solve them first, and hard-code the cos and sin lookups you need.

But, wait! We have decimals, and those really suck! We can't use them! And, yeah, you're right, older processors don't like decimals. But, fortunately, we can cheat here too... start by multiplying by 100.

 

If angle = 3 then ( DX = 92; DY = 38; )

 

So what you now have is the percentage of movement for X and Y for any of the 16 angles you coded. This is then multiplied by your thrust, and coverted to pixels as needed.

 

So...

 

DX = FindDX(Angle); // FindX shown above

X = X + (DX * THRUST) / 100; // Correct for the pixels used in movement

Y = Y + (DY * THRUST) / 100; // Correct for the pixels used in movement

 

Firing solutions, of course, would use the same FindX and FindY, replacing your THRUST with your ShotSpeed.

 

So before you give up, try this out first. Once you get this, we'll work on 'bouncing'.. it's really not as hard as it seems, either.

  • Like 1
Link to comment
Share on other sites

SIO2, please don't assume a lack of knowledge on my part about game programming. I'm a professional, and I've been doing 'retro-game' coding since it was just 'game' coding. I haven't used 7800 bas, but I'm more than familiar with Pascal, Turbo Base, MC10 assembly, and so on, and so on, etc.So what we're looking at here is a geometry problem and turning into something workable on the 7800. This sounds a lot more daunting than it is. So let me explain.

I didn't assume that. I assumed that you intended to imply that I was quitting too quickly to which I responded that I felt I had given it a good effort and attempted to demonstrate such via my display of ignorance which served to cause you to confess to posses exactly the kind of information I require. So, now you are on the hook. :)

 

Let me make a proposal that we let Alpha Race be what it is because I love playing it as is. I am going to make carts of it as is. If the well be poisoned then so be it. I will try to keep the level of Alpha Race carts in the well within EPA allowances.

 

There are however more letters in the Greek alphabet. If we were to take up a discussion of model for this type of ship movement in the 7800 programming forum then other programmers could participate and learn and the result could be offered as a simple demo for inclusion in future releases of 7800bas. After that I could perhaps start to work on a Beta Race.

 

What say you?

 

Oh also, sorry to hear about that professional thing. I hope you get over it soon.

Edited by SIO2
  • Like 1
Link to comment
Share on other sites

Bouncing.

 

As I said, this isn't too hard, really, once you've set up your angles. Since you're always going to be bouncing against a vertical or horizontal surface (either the walls or the ships' bounding boxes), you need only two lookup tables to make this work.

 

For a vertical bounce, you're going to mirror off of angles 0 and 8. If you bounce going in direction 0, you'll reflect at direction 8. If you come it at direction 7, you'll bounce at direction 1, and so on. You'll need fourteen entries in a quick lookup table , assuming 16 possible turning directions.

 

For the horizontal bounce, you're doing the same thing, mirroring off angles 4 and 12. If you bound in at direction 4, you'll bounce back at 12. If you bounce at 3, you'll return at 13, as so on.

 

That's all there is to that.

  • Like 1
Link to comment
Share on other sites

I didn't assume that. I assumed that you intended to imply that I was quitting too quickly to which I responded that I felt I had given it a good effort and attempted to demonstrate such via my display of ignorance which served to cause you to confess to posses exactly the kind of information I require. So, now you are on the hook. :)

I think I've given you all I can for the thrust and bouncing short of the actual code. As I said, I haven't used A7800 basic, but I'll learn it fast enough to get you going with this if the need be. Really, though, this should just be a few functions and a look-up table.

 

Let me make a proposal that we let Alpha Race be what it is because I love playing it as is. I am going to make carts of it as is. If the well be poisoned then so be it. I will try to keep the level of Alpha Race carts in the well within EPA allowances.

I'll counter-propose for you... left difficulty switch toggle? Since I don't think cart-room is an issue yet, get both movement types into the code. Check for which you're using at the start of each new life and go from there?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...