Jump to content
IGNORED

Space Wars - game in development


sometimes99er

Recommended Posts

hey, sometimes.... The new design you've got going there... Is that helping the "firing missile" alignment any? It would appear that you've got better alignment now, than the original which could, theoretically, improve the look of the firing process.

  • Like 1
Link to comment
Share on other sites

Hi Owen

 

The new design you've got going there... Is that helping the "firing missile" alignment any?

Yes and no. I wanted to reuse the sine table (used for thrust), but went for an extra table (16 bytes). I might look into that again when I get to collision detection, which will probably be checking 3 points, one at each corner of the triangular ship.

 

It would appear that you've got better alignment now, than the original which could, theoretically, improve the look of the firing process.

The original is actually not that good (at having the missile come out nicely from the ship), so it will most certainly be an improvement. Not sure that anyone will notice once the game is on and the adrenaline flow.

 

:)

Edited by sometimes99er
Link to comment
Share on other sites

  • 3 years later...

So we're moving into assembly.

 

This demo is just a test of look and feel. It also demonstrates the nice paths you can take. A bit like the first demo with the game Squary. Use joystick.

 

 

 

spacewar12.gif

 

Technically we're rotating every 5 frames.

 

If you let go of pushing left or right, the frame countdown will reset, allowing you to instantly rotate the opposite way around.

 

Now with a joystick you can't really push both left and right, but - if you're using emulation and arrow keys, - well, then there's a minor problem.

 

Of course I do not intend to push both left and right arrow keys, but it may happen quite often in keyboard controlled games - going quickly from one direction to another. And it does matter for the overall feel and responsiveness. You could also press left, hold it, press right, and while holding left, letting go of the right arrow key.

 

There's no limit on speed yet. There will be. One way or another. Either you'll bump or hit something before gaining insane speeds, or I'll have to enforce a limit. The easy way is a limit on X- and Y-speed separately. This will allow you to travel somewhat faster when going diagonally. Or we could use the Pythagorean equation. When multiplying the 9900 CPU goes to a nice 32 bit result, so there's actually room for any speed limit. I will compare with a squared limit, so no need for square root to calculate "real" pixels per frame (speed).

 

Another thing that worries me, is the size of the spaceship. It's very much Atari VCS 2600, but small. Torn.

 

Thrust is distributed depending on direction to a vector (simply x and y values) using sine and cosine functions (lookup). This is the data used ...

 




			
				


	Edited  by sometimes99er
	
	

			
		
  • Like 4
Link to comment
Share on other sites

Looks reall smooth. Would love to see a full blown Spacewar with a computer AI.

TI needs more 2 player games too... I've only played 2 player games on the TI twice in my life. Once at the last PRGE, playing beyond Parsec, and then I already forgot the name of the game, but it was a few weeks ago working with ElectricLab.

 

I used to beg my sister to play 2600 games like COMBAT and Spacewar... I could never remember the name of spacewar... and always thought it was a mode in asteroids though... It was fun to be young.

 

-M@

  • Like 2
Link to comment
Share on other sites

TI needs more 2 player games too... I've only played 2 player games on the TI twice in my life. Once at the last PRGE, playing beyond Parsec, and then I already forgot the name of the game, but it was a few weeks ago working with ElectricLab.

 

I used to beg my sister to play 2600 games like COMBAT and Spacewar... I could never remember the name of spacewar... and always thought it was a mode in asteroids though... It was fun to be young.

 

-M@

 

Problem is finding an opponent... Besides, I always get a kick out of trying to create a semblance of intelligence and strategy in my computer opponenents :)

  • Like 1
Link to comment
Share on other sites

Looks reall smooth. Would love to see a full blown Spacewar with a computer AI.

 

Thanks. The smoothness of the line drawing is down to me trying to be smooth and subtle. I deliberately cut the animation when I became more loose and got jagged lines.

 

I'm sure I have the list, somewhere, of the 32 cartridges I had for the Atari VCS 2600. This lot was down payment for the TI-99/4A. Guess Space War was among them, but surely one of the least played games.

 

This mashup game I'm making will have enemies with very limited AI. At least you got me thinking, so I might do something along the lines you suggest.

 

;)

 

 

 

Link to comment
Share on other sites

TI needs more 2 player games too... I've only played 2 player games on the TI twice in my life. Once at the last PRGE, playing beyond Parsec, and then I already forgot the name of the game, but it was a few weeks ago working with ElectricLab.

 

I used to beg my sister to play 2600 games like COMBAT and Spacewar... I could never remember the name of spacewar... and always thought it was a mode in asteroids though... It was fun to be young.

 

 

Problem is finding an opponent... Besides, I always get a kick out of trying to create a semblance of intelligence and strategy in my computer opponenents :)

 

Yes. Often, being young and competitive, one player would often win a lot and the other would "loose interest". ;)

 

These days one can play with kids, and either they are actually better than you, or you just let them win most of the time. So play testers for two player games are available. :thumbsup:

  • Like 1
Link to comment
Share on other sites

So I wanted to make the starship control as smooth as possible.

 

In the case of using joysticks on real hardware, you can't really pull both left and right, so no issue there. With emulation you might press the left arrow key before letting go of the right, and vice versa. And we could consider holding left, pressing right and releasing right. If you did something crazy like that, I would have the starship turn left, then right and then left. We can relatively easy do the logic for all that.

 

Well, it turns out emulators handles joystick / arrow keys differently.

 

I tried reading 5 rows in one go using STCR (STore CRu), and also reading joystick left and right one at a time using TB (Test Bit). Same results. Here's what the emulators return when both left and right arrow keys are held ...

 

spacewar13.png

 

It's only with JS99er I can determine what user friendly action to take.

 

Here's a test cartridge. Press and hold left (or right) and then press and hold the other (effectively then holding both keys).

 

 

Edited by sometimes99er
  • Like 2
Link to comment
Share on other sites

RXB using GPL a command like CALL IO on a real TI can detect using CRU bits up to 4 keys pressed on Keyboard at same time.

Best I can get out of Emulation is 2 keys at best, 3 keys reports the same as two keys.

 

With all the hoopla about PC being so great it is funny a PC still can not do something as simple a 1978 Computer can do.

Edited by RXB
Link to comment
Share on other sites

So Atari 2600 Space War and Asteroids are reference points. Well, I throw in Asteroids, the arcade version also - named "arcade" hereafter.

Space War came in 1978 and Asteroids in 1981. Space War is 2K and Asteroids is 8K. Only to indicate that the spaceship etc. might be a bit more advanced or fine tuned in Asteroids.


Speed of spaceship


They both impose a maximum of speed. Asteroids more so. Asteroids even has the spaceship de-accelerating, like meeting friction in outer space. The arcade version has that too.

I implemented Pythagoras to have the same maximum speed in any direction, but found it difficult to change direction when at full speed. The reference games travels faster when going diagonally, so I limit vertical and horizontal speed separately too. And turning when at maximum speed seems easier.


Missile

The reference games have the missile moving relative to the spaceship. If you travel at great speeds, turn around and shoot, you'll see a slow moving missile. It might look totally out of place, but if you fix your eyes on the moving spaceship, it suddenly seems fine. Well, with Asteroids you usually do not travel very fast, so this isn't something you would see a lot.


Space Wars V0.8

Basically just the missile implemented and some other minor stuff and adjustments.

Edited by sometimes99er
  • Like 4
Link to comment
Share on other sites

Flying that around, totally reminded me of another game. It was a gravity based game on the Amiga. We called it Turbo 'Ra-Keh-Teh' but after growing up, it is possible it was named ricochet, but I seem to recall a northern europe spelling :)

 

2 players flew around in a maze larger than the screen. little triangle ships. little dot missiles, that started with your current velocity at the time they are fired. And then, slow gravity... increasing your downward velocity continuously, so you can never just sit there in ambush...

 

A buddy of mine, and I played that more than any other game I've ever played. I don't think it was a commercial release.

 

Hours and hours... I failed college classes playing that game. Man, the things you forget...

 

-M@

  • Like 1
Link to comment
Share on other sites

Flying that around, totally reminded me of another game. It was a gravity based game on the Amiga. We called it Turbo 'Ra-Keh-Teh' but after growing up, it is possible it was named ricochet, but I seem to recall a northern europe spelling :)

 

2 players flew around in a maze larger than the screen. little triangle ships. little dot missiles, that started with your current velocity at the time they are fired. And then, slow gravity... increasing your downward velocity continuously, so you can never just sit there in ambush...

 

A buddy of mine, and I played that more than any other game I've ever played. I don't think it was a commercial release.

 

Hours and hours... I failed college classes playing that game. Man, the things you forget...

 

-M@

 

Turboraketti. ;)

  • Like 1
Link to comment
Share on other sites



I wonder how much practice it takes to maneuver like that.

I’m beginning to build the maze. The spaceship will probably bounce off the walls a bit, and take damage. Don’t know about gravity or friction. Robots will be waiting for you. Don’t know about fuel, but there’ll be a few other items to pick up.

 

:)

 

 

Link to comment
Share on other sites

Okay, we want thrust. Move the joystick forward and off you go.

 

The thruster is simply on or off. If it’s on, the power is like one unit. We can control motion using vertical and horizontal values (TY and TX). Since the spaceship can point in any of 16 directions, we have to carefully distribute that one unit in vertical and horizontal values. I use a spreadsheet to help me here.

 

spacewar4.gif

 

First I list the animation frames of the spaceship. Then I note in which direction each frame points. Roughly. Then I note how I would like thrust to affect motion. Just the units I know to have a few references. Based on the frame number I calculate cosine and sine. Also I multiply the result with 256, so that the values will later be fine as integers in a XB compiled version.

 

spacewar5.gif

 

I’ll use an array (DIM) to hold the values. The array initially has values of 0. And I note there’s actually only 4 distinct values. I set these values in line 120. And I set the rest of the array in line 130, recycling the values from line 120.

 

100 CALL SCREEN(2)::CALL CLEAR::CALL SPRITE(#1,96,9,93,125)
110 FOR I=96 TO 111::READ S$::CALL CHAR(I,S$)::NEXT I
120 DIM C(15)::C(0)=-256::C(1)=-237::C(2)=-181::C(3)=-98
130 FOR I=-3 TO 7::C(I+=-C(ABS(I))::NEXT I
200 CALL JOYST(1,X,Y)::F=(F+X/4) AND 15::CALL PATTERN(#1,96+F)::IF Y<>4 THEN 200
210 TY=TY+C(F)::TX=TX+C((F+4)AND 15)::CALL MOTION(#1,TY/128,TX/128)::GOTO 200
300 DATA 101038387C,040C1C3C0C,020C3C1808,00027C383,20383F382,30387C02,08183C0C02,0C3C1C0C04
310 DATA 3E1C1C0808,303C38302,10183C304,0C1C3E4,041CFC1C04,00403E1C0C,40303C181,2030383C3
I only set the cosine array since the sine values are the same only shifted forward 4 positions. I’ll add 4 in line 210, and only allow the lower 4 bits of a value to pass through (sort of) using AND 15, always resulting in a value in the 0-15 range.

 

I wonder if anyone knows of other ways to do thrusting.

 

:)

 

 

OMG! Good. I like how you cleverly manage the character pattern via the "AND 15" operation. And the sequence of 16 character animations is really clever. THX! This is a really great template for character animation and motion management.

Edited by Airshack
  • Like 1
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...