Jump to content

Photo

Space Wars V0.8 - demo released

xb assembler cartridge

53 replies to this topic

#1 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 3,805 posts
  • Location:Denmark

Posted Tue Apr 23, 2013 3:37 AM

Demo V0.8 in post #42.

Test V0.7 in post #36.

Demo V0.6 in post #28.

XB demo V0.5 in post #21.

XB demo V0.4 in post #10.

XB demo V0.3 in post #7.

XB demo V0.2 in post #4.

XB demo V0.1 in this current post #1.

 

 
- - - - -

Drifting into outer space ...
 

The instruction set is nearly a complete ripoff of the PDP-11.

The IBM-PC team in Boca Raton seriously consider the TMS9900 for the original PC, but decided on the 8088 based on a variety of reasons including production costs.



http://en.wikipedia....ruments_TMS9900

http://en.wikipedia...._Data_Processor

http://en.wikipedia.org/wiki/PDP-1

http://en.wikipedia..../wiki/Spacewar!

http://atariage.com/...wareLabelID=469

http://videogamecrit...z.htm#Space_War

I think the spaceship graphics were reused in the later Asteroids (2600).

http://atariage.com/...areLabelID=1007

Space War was one of the earlier 2600 games with product number CX2604.

http://www.atariage.....html?LabelID=3

It was not one of the original 9 games for sale. The second last number in the product number seemed to indicate a category, 0 for action, 1 for car, 2 for sports etc., but that didnt last long.

http://en.wikipedia....tari_2600_games

Space War was released in 1978. I had one, but never played it much.

I'm going to rip the spaceship graphics and use them in a new game.



XB Demo. Instructions. Turn left or right using joystick. :)

 
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
200 CALL JOYST(1,X,Y)::C=(C+X/4) AND 15::CALL PATTERN(#1,96+C)::GOTO 200
300 DATA 101038387C,040C1C3C0C,020C3C1808,00027C383,20383F382,30387C02,08183C0C02,0C3C1C0C04
310 DATA 3E1C1C0808,303C38302,10183C304,0C1C3E4,041CFC1C04,00403E1C0C,40303C181,2030383C3

Edited by sometimes99er, Sat Mar 11, 2017 2:40 AM.


#2 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Tue Apr 23, 2013 7:32 AM

This is the graphics found in the 2600 cartridge (@ >0710). I guess the 2600 has ability to mirror graphics in hardware.

Posted Image

#3 unhuman OFFLINE  

unhuman

    Stargunner

  • 1,135 posts
  • Location:Vienna, VA

Posted Tue Apr 23, 2013 9:04 AM

Thanks for the spark.... Reminds me of a game I wanted to do... Somebody find me some time, although, shouldn't take too much!

Gonna make mr. senior falcon happy - gonna use his tools.

Edited by unhuman, Tue Apr 23, 2013 9:04 AM.


#4 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Tue Apr 23, 2013 3:10 PM

I changed the code a bit to see what would make the smallest footprint with the XB Compiler.

Line 110 has STEP 4 added. DATA lines changed from 1 to 4 characters at a time. Otherwise the same.

100 CALL SCREEN(2)::CALL CLEAR::CALL SPRITE(#1,96,9,93,125)
110 FOR I=96 TO 111 STEP 4::READ S$::CALL CHAR(I,S$)::NEXT I
200 CALL JOYST(1,X,Y)::C=(C+X/4) AND 15::CALL PATTERN(#1,96+C)::GOTO 200
300 DATA 101038387C000000040C1C3C0C000000020C3C180800000000027C383
310 DATA 20383F382000000030387C020000000008183C0C020000000C3C1C0C04
320 DATA 3E1C1C0808000000303C38302000000010183C30400000000C1C3E4
330 DATA 041CFC1C0400000000403E1C0C00000040303C18100000002030383C3

I would maybe expect the above to produce more compact code. Avoiding all of those commas.

The STEP 4 does not add anything since it was already compiled into a STEP 1 (sort of).

The DATA lines changed like this:

Posted Image

So first off I'd say that's a wrong move. And yes, the final loaded code does save 66 bytes with the first version. Overall, with attached library, that's about a 1% gain.

:)

#5 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 8,220 posts
  • Location:Cookeville, TN

Posted Tue Apr 23, 2013 3:34 PM

is this with falcon's XB Compiler 2.1? Or MLC

#6 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Tue Apr 23, 2013 3:41 PM

Ahh, yes, Falcon's XB Compiler. :)

#7 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Tue Apr 23, 2013 4:02 PM

So the 2600 Space War cart was 2K. Main attraction, apart from the big empty space, also forgetting the original with the pitiful star in the center with its pull, and all the stars in the backdrop, then I’m of course thinking about the player, specifically the spaceship. Wonderfully animated with an amazing 16 frames. This is way back in 1978.

Here’s another silly demo, if you appreciate the spaceship and the animation, - turning around, and pointing in 16 different directions, up, slightly to the right, up and right, slightly up, right, slightly down, right and down etc.

100 CALL SCREEN(2)::CALL CLEAR::CALL COLOR(1,9,1)
110 FOR I=0 TO 15::READ S$::CALL CHAR(32,S$)::NEXT I::RESTORE::GOTO 110
300 DATA 101038387C,040C1C3C0C,020C3C1808,00027C383,20383F382,30387C02,08183C0C02,0C3C1C0C04
310 DATA 3E1C1C0808,303C38302,10183C304,0C1C3E4,041CFC1C04,00403E1C0C,40303C181,2030383C3

Posted Image

:party:

#8 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 8,220 posts
  • Location:Cookeville, TN

Posted Tue Apr 23, 2013 4:21 PM

Very cool stuff... =) I remember that game fondly.

You porting it all the way over or are you working on a demo? =)

#9 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Tue Apr 23, 2013 11:43 PM

Let's just say I'm aiming at a playable demo. :-D

#10 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Wed Apr 24, 2013 3:50 AM

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.

:)

Edited by sometimes99er, Tue Sep 24, 2013 3:11 AM.


#11 lucien2 OFFLINE  

lucien2

    Moonsweeper

  • 282 posts
  • Location:Switzerland

Posted Wed Apr 24, 2013 4:09 AM

Short and elegant, as always :thumbsup:

#12 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 8,220 posts
  • Location:Cookeville, TN

Posted Wed Apr 24, 2013 4:31 AM

That's slick,man..... You've got some talent. :)

#13 senior_falcon OFFLINE  

senior_falcon

    Dragonstomper

  • 828 posts
  • Location:Lansing, NY, USA

Posted Wed Apr 24, 2013 6:11 AM

330 DATA 041CFC1C0400000000403E1C0C00000040303C18100000002030383C3
[/CODE]

I would maybe expect the above to produce more compact code. Avoiding all of those commas.

The DATA lines changed like this:

Posted Image


:)

From this you can see how the compiler handles DATA lines. There is the label which takes no memory, then the data is kept as a string. Length byte first, then the data. The column on the left shows multiple DATA strings in one line. Length byte, string characters, length byte, string characters, etc. Each comma you eliminate saves one byte, but the zeros you have to include to be able to get rid of the comma cost way more than the few bytes you saved.

#14 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Thu Apr 25, 2013 2:16 AM

Thanks.

My ideas right now are to have a big maze, dozens of screens, instant flip flop, lots of room to maneuver in, dozens of satellites that shoot at you, key to find, laser-gun to unlock and health to collect.

:)

#15 Vorticon OFFLINE  

Vorticon

    River Patroller

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

Posted Thu Apr 25, 2013 9:04 AM

Will you be adding a central star with gravitational pull? This will complicate matters a little bit.
Also, will this be a single or two player game? There is already out there a 2 player spacewar game for the TI (I have it somewhere in my files), but it would be great if a single player version is created.

#16 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Thu Apr 25, 2013 9:21 AM

No final decisions yet, but I think no central star and single player only. :)

#17 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Mon Apr 29, 2013 4:30 AM

There is already out there a 2 player spacewar game for the TI (I have it somewhere in my files), but it would be great if a single player version is created.


Took a look at some screenshots in the Gamebase starting with the word Space, and then ran each for a minute or two. You never know, you could get inspired.

One had a nice intro effect with the title exploding and debris flying around while stars were drawn as a backdrop. Otherwise I think they were all XB, with maybe one exception with ships apparently being characters and not sprites.

Posted Image

Next I’ll be looking into how to make the spaceship shoot. It works like this. Aim the nose of your starship in the direction you want to fire.

I plan to use single pixels to represent the shots fired. Let’s call them missiles. That’s the best name I can think of for now. Looked at the instructions for some early 2600 games.

Posted Image

Don’t think I’ll provide guided missiles.

:)

Edited by sometimes99er, Mon Apr 29, 2013 4:32 AM.


#18 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Fri May 3, 2013 2:24 AM

While calculating the exit (muzzle) or starting point of missiles, things just didn’t align. I tried and adjust a few things, but it continued to be off. With point being perfect most of the frames, but then also overlapping spaceship and off out into space. The animation itself and the old game didn’t really make me doubt that the spaceship etc. wasn't all good. I went and checked the 2600 version. Missiles travel in the right direction, but the starting point is a bit off. And Asteroids’ not that much better. Hmm ... I guess it’s like with XB games, you quickly get used to things being off and adjust mentally somehow.

Posted Image

Edited by sometimes99er, Fri May 3, 2013 2:26 AM.


#19 unhuman OFFLINE  

unhuman

    Stargunner

  • 1,135 posts
  • Location:Vienna, VA

Posted Fri May 3, 2013 6:53 AM

Couldn't you just create an offset table?

#20 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Fri May 3, 2013 7:19 AM

Absolutely. I just wanted to reuse the sine table already there, but since there's only 16 possible directions, a table for starting point is possibly both shorter and more efficient.

:)

#21 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Sun May 5, 2013 4:39 AM

It becomes apparent that XB is a bit slow when spaceship picks up some speed and the missile has to find starting position and maybe new direction.

Add this one if you run at overdrive or compile it. :)
 
201 CALL SOUND(1,110,30)

! Init screen
100 CALL SCREEN(2)::CALL CLEAR
! Set spaceship graphics
110 FOR I=96 TO 111::READ S$::CALL CHAR(I,S$)::NEXT I
! Set missile graphics
120 CALL CHAR(33,"8")
! Init thrust table
130 DIM TH(15)::TH(0)=-256::TH(1)=-237::TH(2)=-181::TH(3)=-98
140 FOR I=-3 TO 7::TH(I+8)=-TH(ABS(I))::NEXT I
! Init missile start table
150 DIM MS(15)::MS(0)=-3::MS(1)=-3::MS(2)=-3::MS(3)=-2
160 FOR I=-3 TO 7::MS(I+8)=-MS(ABS(I))::NEXT I
! Init sprites
170 CALL SPRITE(#1,96,9,93,125,#2,33,16,1,1)
! Main loop start
! Get joystick direction
200 CALL JOYST(1,X,Y)
! Update spaceship direction
210 FR=(FR+X/4)AND 15::CALL PATTERN(#1,96+FR)
! Skip next if no thrust
220 IF Y=0 THEN 240
! Update motion based on thrust
230 MOY=MOY+TH(FR)::MOX=MOX+TH((FR+4)AND 15)::CALL MOTION(#1,MOY/128,MOX/128)
! Get joystick fire
240 CALL KEY(1,K,S)
! Loop if no new joystick fire
250 IF K<>18 OR S<>1 THEN 200
! Update missile position and motion, both relative to spaceship
260 CALL MOTION(#2,0,0)::CALL POSITION(#1,Y,X)::CALL LOCATE(#2,((Y+MS(FR)+1)AND 255)+1,((X+MS((FR+4)AND 15)+1)AND 255)+1)
270 CALL MOTION(#2,MOY/128+TH(FR)/16,MOX/128+TH((FR+4)AND 15)/16)::GOTO 200
! Spaceship graphics
300 DATA 20207070F8,103070F03,0830F0602,00F8F0604,80E0F8E08,4060F0F8,2060F03008,30F070301
310 DATA F87070202,607870604,203078608,103078F8,0838F83808,00F878301,806078302,406070786

Edited by sometimes99er, Sat Feb 25, 2017 11:25 PM.


#22 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Mon May 6, 2013 3:10 AM

Not that I thought anyone would notice, but I actually slightly redesigned the spaceship graphics, going from the original 7:5 (horizontal vs. vertical) to a more straight 5:5. I think the original graphics were perhaps trying to compensate for aspect ratios and/or horizontal television artifacts.

Went a bit further into it. I guess quite a few of the following numbers can be debatable. I'm assuming this and that, e.g. borders and offsets not taken into account. Doing this also for future reference when comparing the two systems.

Posted Image

Ratio is how wide things are relative to the height. Also assumes that most devices of today try and have square-like pixels (screen elements). 4) Space War halves the vertical resolution. 7) The original spaceship graphics appear square-like. 10) The TI pixels appear pretty square-like. 14) My spaceship will appear about half the size of the original. Let’s just say that’s down to the "high resolution" of the TI, or me actually, for now, wanting a smaller spaceship.

:)

#23 GroovyBee OFFLINE  

GroovyBee

    Games Developer

  • 9,723 posts
  • Busy bee!
  • Location:North, England

Posted Mon May 6, 2013 6:04 AM

I think the original graphics were perhaps trying to compensate for aspect ratios and/or horizontal television artifacts.


The 2600's pixels are closer to 2:1.

#24 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Mon May 6, 2013 7:02 AM

The 2600's pixels are closer to 2:1.


Yep, agreed. And Space War, has "pixels" with double height, using two scanlines, making it closer to 1:1, like a few other early titles, Combat, Air-Sea ... The spaceship is still designed within a 7 pixels wide and 5 pixels high space.

:)

Edited by sometimes99er, Tue May 7, 2013 8:51 AM.


#25 sometimes99er OFFLINE  

sometimes99er

    River Patroller

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

Posted Sat May 11, 2013 2:32 AM

As said the spaceship was changed a little bit. 2600 on the left. Red marks new design.

:)

Posted Image





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