Jump to content

Photo

Space Wars V0.8 - demo released

xb assembler cartridge

53 replies to this topic

#26 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 8,246 posts
  • Location:Cookeville, TN

Posted Sat May 11, 2013 7:13 AM

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.

#27 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,868 posts
  • Location:Denmark

Posted Sat May 11, 2013 1:24 PM

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, Tue Sep 24, 2013 3:25 AM.


#28 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,868 posts
  • Location:Denmark

Posted Fri Mar 3, 2017 3:29 AM

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.
 
Attached File  spacewarsc.bin   8KB   25 downloads
 
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 ...
  
; to get cosine just add 4 to the index
sine
	data	0,3,5,7,8,7,5,3,0,-3,-5,-7,-8,-7,-5,-3,0,3,5,7

Edited by sometimes99er, Fri Mar 3, 2017 3:58 AM.


#29 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 2,681 posts
  • Location:Eagan, MN, USA

Posted Fri Mar 3, 2017 6:46 AM

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

#30 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 8,246 posts
  • Location:Cookeville, TN

Posted Fri Mar 3, 2017 10:11 AM

It is lovely, sometimes... Exceptionally done!!

The ship IS small, but depending on the 'supporting cast' of other SPRITEs on the screen, it may just be the perfect size. :)

#31 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,168 posts
  • Location:Beaverton, OR

Posted Fri Mar 3, 2017 5:46 PM

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@

#32 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 2,681 posts
  • Location:Eagan, MN, USA

Posted Fri Mar 3, 2017 10:35 PM

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 :)



#33 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,868 posts
  • Location:Denmark

Posted Sat Mar 4, 2017 1:57 AM

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.

 

;)

 

 

 



#34 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,868 posts
  • Location:Denmark

Posted Sat Mar 4, 2017 2:04 AM

It is lovely, sometimes... Exceptionally done!!

  
Thanks. Really just a demonstration of basic stuff.
  

The ship IS small, but depending on the 'supporting cast' of other SPRITEs on the screen, it may just be the perfect size. :)

 
Thanks. Yes, you're right, it has to be put into context. Excellent.

 

:thumbsup:

  



#35 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,868 posts
  • Location:Denmark

Posted Sat Mar 4, 2017 2:19 AM

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:



#36 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,868 posts
  • Location:Denmark

Posted Sun Mar 5, 2017 2:09 AM

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).

 

Attached File  spacewarsc.bin   8KB   14 downloads


Edited by sometimes99er, Sun Mar 5, 2017 12:10 PM.


#37 RXB OFFLINE  

RXB

    River Patroller

  • 2,682 posts
  • Location:Vancouver, Washington, USA

Posted Sun Mar 5, 2017 2:57 AM

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, Sun Mar 5, 2017 2:58 AM.


#38 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,168 posts
  • Location:Beaverton, OR

Posted Mon Mar 6, 2017 5:42 PM

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.


Checkout the wonderful world of NKRO

-M@

#39 --- Ω --- OFFLINE  

--- Ω ---

    .....................

  • 10,280 posts
  • TI-99/4A Fanatic
  • Location:In the den playing with my FinalGROM 99!

Posted Mon Mar 6, 2017 6:06 PM

The last update identifies as V0.7 on the FR99.  I was using the joystick on and man, that is smooooooooth movement!  :thumbsup: 

I can't wait to see how you build around it.



#40 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,868 posts
  • Location:Denmark

Posted Tue Mar 7, 2017 1:03 AM

The last update identifies as V0.7 on the FR99.  I was using the joystick on and man, that is smooooooooth movement!  :thumbsup: 

I can't wait to see how you build around it.

 

Excellent. Thanks for giving it a spin. And thanks for encouragement. :)

 



#41 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,868 posts
  • Location:Denmark

Posted Tue Mar 7, 2017 2:53 AM

When you get down into the bits, there are many differences between Atari 2600 Space War and Asteroids. There's even a few awkward moments. Here's one. I try and shoot myself.

 

1. Hit the first time.

2. Hit the second time around.

3. Not hit at all.

 

spacewar14.gif

  



#42 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,868 posts
  • Location:Denmark

Posted Sat Mar 11, 2017 2:19 AM

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.
 
Attached File  spacewarsc.bin   8KB   18 downloads


Edited by sometimes99er, Sat Mar 11, 2017 7:32 AM.


#43 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,168 posts
  • Location:Beaverton, OR

Posted Sat Mar 11, 2017 1:44 PM

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@

#44 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,868 posts
  • Location:Denmark

Posted Sat Mar 11, 2017 2:42 PM

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. ;)



#45 jedimatt42 OFFLINE  

jedimatt42

    Stargunner

  • 1,168 posts
  • Location:Beaverton, OR

Posted Sat Mar 11, 2017 7:19 PM

Turboraketti. ;)


Exactly that! YES! And, of course, by the time I was playing that, I had totally forgotten about Space War. But no wonder I was hooked.

-M@

#46 palmheads OFFLINE  

palmheads

    Chopper Commander

  • 174 posts
  • Location:Christchurch, New Zealand

Posted Sun Mar 12, 2017 1:42 PM

Those movements are also very similar to the game I've been trying to port, Thrust

 

 

The Beeb version above was the best.



#47 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,868 posts
  • Location:Denmark

Posted Sun Mar 12, 2017 11:17 PM


 
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.

 

:)

 

 



#48 --- Ω --- OFFLINE  

--- Ω ---

    .....................

  • 10,280 posts
  • TI-99/4A Fanatic
  • Location:In the den playing with my FinalGROM 99!

Posted Mon Mar 13, 2017 6:29 AM

Those movements are also very similar to the game I've been trying to port, Thrust

 

The Beeb version above was the best.

 

That game looks so fun, it would probably get me into trouble for overplaying.



#49 Airshack OFFLINE  

Airshack

    Moonsweeper

  • 455 posts
  • Location:Phoenix, AZ

Posted Mon Mar 13, 2017 8:07 PM

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+8)=-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, Tue Mar 14, 2017 7:54 AM.


#50 palmheads OFFLINE  

palmheads

    Chopper Commander

  • 174 posts
  • Location:Christchurch, New Zealand

Posted Mon Mar 13, 2017 10:35 PM

 

That game looks so fun, it would probably get me into trouble for overplaying.

 

Yeah its a pretty fun game! Infuriating so - I've been playing it off and on since 1987! (Atari 8 bit version originally, emulators since)







Also tagged with one or more of these keywords: xb, assembler, cartridge

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users