Jump to content

Photo

bB starfield effect


25 replies to this topic

#1 RevEng OFFLINE  

RevEng

    River Patroller

  • 4,384 posts
  • Bitnik
  • Location:Canada

Posted Sat Nov 12, 2016 7:27 PM

I was able to recreate the famous starfield effect from Cosmic Ark in bB. If you're not acquainted with it, the effect exploits a TIA bug to repeatedly re-trigger one of the display objects, without any additional cycle time required in-kernel.

This is particularly cool for bB, since certain kernel options take away missile0, and this hack gives you another way to use missile0. In the demo I've enabled no_blank_lines, to demonstrate.

The demo cycles through different adjustments to "missile0x", which affects the starfield speed and direction. The starfield is a bit regular, but it's better than nothing.

Feel free to take the routines and copy or adapt to your games. Enjoy!

bbstarfield.bas_3.png

Attached Files



#2 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,384 posts
  • Bitnik
  • Location:Canada

Posted Sat Nov 12, 2016 9:48 PM

It looks like it's possible to do a very good starfield scroll in all directions!

I originally used +17/-17 for up/down, but it was a bit slow, so I substituted +34/-34. That's slightly fast, so it might be better to alternate 17 and 34.

Looks like alternating the angle directions (16, 18) is better for up and down, because the star formation matches the other directions better.

Attached File  bbstarfield.alldirections.bin   4KB   51 downloads
Attached File  bbstarfield.alldirections.bas   2.39KB   38 downloads

Not sure if this will work universally on all TIA releases. I hope it does, as it's pretty useful.

[edit]

DPC+ version attachments. These should be universal, since they don't rely on the TIA bug:
Attached File  DPCplus.Bb.starfield.all.directions.bas   7.04KB   44 downloads
Attached File  DPCplus.Bb.starfield.all.directions.bas.bin   32KB   54 downloads
Attached File  DPCplus_kernel.asm   19.14KB   41 downloads

#3 bogax OFFLINE  

bogax

    Dragonstomper

  • 693 posts

Posted Sat Nov 12, 2016 10:53 PM

or you could actually do it in bB  ;)

 

  vblank
  rem ** Enable the TIA bug that causes missile0 to be repeated
 ; asm
 ; lda #$ff
 ; sta HMM0
 ; lda #$c0
 ; sta WSYNC
 ; sta HMOVE
 ; sleep 5
 ; sta HMM0
; end
 
 HMM0 = $FF
 WSYNC = $C0 : HMOVE = $C0
 aux1 = $C0 : HMM0 = $C0
 return


#4 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,384 posts
  • Bitnik
  • Location:Canada

Posted Sat Nov 12, 2016 10:56 PM

or you could actually do it in bB   ;)


Nicely done! :thumbsup:

#5 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 8,772 posts

Posted Sun Nov 13, 2016 1:02 AM

People should consider this for "grasslands" for a Dragonstomper type game as well :)

 

Meaning, a green background turns this effect from stars in space to grass on land.



#6 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,384 posts
  • Bitnik
  • Location:Canada

Posted Sun Nov 13, 2016 6:21 AM

People should consider this for "grasslands" for a Dragonstomper type game as well :)
 
Meaning, a green background turns this effect from stars in space to grass on land.


I was thinking light blue or white on dark blue would be good for underwater action. Stay Frosty uses the effect for snow, and I think it could decently represent rain too.
 
 

Not sure if this will work universally on all TIA releases. I hope it does, as it's pretty useful.


The Cosmic Ark effect is a bit different on TIAs made in China after 1989, which means a fairly small percentage of consoles may have trouble. The effect loses some dots on these units, so you get diagonal stars instead of diamond clusters.

I think sideways scroll on these decks would be fine, albeit with stars in line formation. No idea if diagonal scroll or up+down scroll works - it might just be more flickery, or it may destroy the effect. If those directions don't work on those units, we might get it to work again doubled missle0x adjustments, though that would double the scroll speed too.

If someone with a PAL 7800 deck could test the current version, we'd have an answer.

#7 Lewis2907 OFFLINE  

Lewis2907

    Chopper Commander

  • 120 posts
  • Location:Senatobia, MS

Posted Sun Nov 13, 2016 8:11 PM

RevEng,

 

I like the program that you made. It does open up some interesting possibilities for games. I personally like to program in DPC and I was trying to convert this program over to DPC and ran into the vblank issue. Currently the program will compile and run as it, but is missing the starfield. Not sure if there is a work around to have something similar to what you created for DPC, thanks.

 

   ;***************************************************************
   ;  vblank will not work in DPC. Maybe there is another solution.
   ;
   ; Per http://www.randomter...html#dpc_vblank
   ;
   ; The DPC+ kernel itself uses vblank to do its own setup, so there
   ; would only be a few free cycles left in vblank for your program.
   ; In the the DPC+ kernel, vblank would need to go in bank 1, but
   ; improvements to the DPC+ kernel have used up almost all available
   ; space in the first bank, so there is virtually no room for vblank
   ; code. As of March of 2016, the DPC+ kernel has 524 cycles available
   ; in vblank, but that could shrink significantly as more changes are
   ; made to the kernel. In other words, if you are using the DPC+ kernel,
   ; avoid vblank.

Attached Files



#8 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,384 posts
  • Bitnik
  • Location:Canada

Posted Sun Nov 13, 2016 9:01 PM

Just took a look, but it appears this won't be a viable technique with the bB DPC+ kernel. It hits HMOVE pretty much every line as part of the virtual player positioning, and this messes up the starfield bug.

#9 Lewis2907 OFFLINE  

Lewis2907

    Chopper Commander

  • 120 posts
  • Location:Senatobia, MS

Posted Sun Nov 13, 2016 9:45 PM

Oh okay thanks. It was worth a shot.

#10 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,384 posts
  • Bitnik
  • Location:Canada

Posted Tue Nov 15, 2016 7:11 PM

Ok, I looked at the DPC+ problem from another angle. Instead of utilizing the HMOVE bug, this one just repositions missile0 every scan line, since the DPC+ kernel is already spending the cycles to hit HMOVE for other reasons.

A DPC+ version of the starfield scroll is now attached in the second post above.

I needed to very minorly tweak the bB DPC+ kernel (also in the second post) because it originally ran the user's vblank routine prior to object positioning, instead of after like the standard kernel. Other than that the DPC+ kernel didn't change and is 100% compatible with non-starfield projects.

I'll update the "reveng" bB dist with this kernel when I get a sec.

#11 Lewis2907 OFFLINE  

Lewis2907

    Chopper Commander

  • 120 posts
  • Location:Senatobia, MS

Posted Tue Nov 15, 2016 7:56 PM

RevEng,

 

Thanks. This does open up a lot of interesting ideas for people to make something.



#12 Mountain King OFFLINE  

Mountain King

    Dragonstomper

  • 603 posts
  • Location:Philadelphia, PA

Posted Mon Nov 21, 2016 10:49 PM

I was just messing around a bit. I slowed the star field down and pointed it in the downward direction and added the Gizzle Wap to make it look like he was playing in the Snow.

Attached Thumbnails

  • gizzlesnow.bas.png

Attached Files


Edited by Mountain King, Tue Nov 22, 2016 4:50 AM.


#13 Mountain King OFFLINE  

Mountain King

    Dragonstomper

  • 603 posts
  • Location:Philadelphia, PA

Posted Tue Nov 22, 2016 9:27 PM

Snow storm using a scrolling effect. Move the Gizzle Wap left or right through the storm.

Attached Thumbnails

  • gizzlesnowVer21.bas.png

Attached Files


Edited by Mountain King, Tue Nov 22, 2016 9:44 PM.


#14 Mountain King OFFLINE  

Mountain King

    Dragonstomper

  • 603 posts
  • Location:Philadelphia, PA

Posted Sat Nov 26, 2016 8:17 AM

I'm still messing around with this:

Added different tree species

Added sun movement

Varied the tree appearance

Added a position counter reflected in the score

Added the Gizzle Wap's friend the Moum Moum

Attached Thumbnails

  • gizzlesnowVer26.bas.png

Attached Files



#15 Lewis2907 OFFLINE  

Lewis2907

    Chopper Commander

  • 120 posts
  • Location:Senatobia, MS

Posted Sat Nov 26, 2016 1:08 PM

That's pretty cool. I was planning on using your info here and the use the move around rooms below as a tunnel or caves etc.

#16 Mountain King OFFLINE  

Mountain King

    Dragonstomper

  • 603 posts
  • Location:Philadelphia, PA

Posted Sat Nov 26, 2016 11:29 PM

Last one. I think I'll move this on to its own topic after this. A big thank you to RevEng for figuring this out.

The Moum Moum is more animated. He will land on the Gizzle Wap when inactive and take off when he is active.

Attached Thumbnails

  • gizzlesnowVer28.bas.png

Attached Files



#17 Lewis2907 OFFLINE  

Lewis2907

    Chopper Commander

  • 120 posts
  • Location:Senatobia, MS

Posted Sat Dec 24, 2016 3:29 PM

Bb Team,

 

I have 2 questions so far. How do you remove the "starfield effect" when moving to another screen or level. Also for the code that Mountain King has for a scrolling background. How would you know where to start it and end it? So it's not just a continuous scrolling effect? I'm thinking it could be used as something similar to Mario Bros where you have pipes / openings to explore and return to. Not sure if I am taking on more that I know so far about Bb.

 

If you step on the white opening you fall to the underground level. While in the underground level if you go all the way to the right you will return to the top level.

 

Thanks again for any help anyone can provide.

Attached Files



#18 Mountain King OFFLINE  

Mountain King

    Dragonstomper

  • 603 posts
  • Location:Philadelphia, PA

Posted Sat Dec 24, 2016 5:35 PM

Well, I can answer one of your questions. Since you are looking at my code, I am using the ball object as a marker. You may not see it since I have it match the color of the back ground. But when it hits one edge or the other it activates a counter. (variable P). As you move right it counts up and as you move left it counts down. the intention was to create unique events that could happen when P reaches a certain value.

 

As for stopping the snow, I had no intention of stopping in my game. I can get it to freeze and stop falling, but I can't get it to completely disappear.

Sorry. 


Edited by Mountain King, Sat Dec 24, 2016 7:34 PM.


#19 Mountain King OFFLINE  

Mountain King

    Dragonstomper

  • 603 posts
  • Location:Philadelphia, PA

Posted Sat Dec 24, 2016 7:32 PM

Duh, Change Missile0height=0

That gets rid of the starfield.

 

 

Attached Thumbnails

  • Gizzle Blizzard19.bas.png


#20 Lewis2907 OFFLINE  

Lewis2907

    Chopper Commander

  • 120 posts
  • Location:Senatobia, MS

Posted Sat Dec 24, 2016 8:41 PM

Ah okay. I was over thinking it for the missile. Now the counter makes sense. I removed it to see what effect it has. Now the counter sparks some ideas on object placement. Thanks for the answers to my questions.

#21 Yosikuma OFFLINE  

Yosikuma

    Space Invader

  • 26 posts
  • Location:Independent Republic of Peoria

Posted Mon Jan 2, 2017 2:52 PM

Ooooh this opens up several possibilities!! This is exciting!



#22 Lillapojkenpćön OFFLINE  

Lillapojkenpćön

    Space Invader

  • 33 posts

Posted Wed Jan 4, 2017 6:47 AM

Is it possible to decide where the object appears, to write something with it like LIVES or PAUSE?



#23 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,384 posts
  • Bitnik
  • Location:Canada

Posted Wed Jan 4, 2017 6:56 AM

Nope

#24 Lillapojkenpćön OFFLINE  

Lillapojkenpćön

    Space Invader

  • 33 posts

Posted Wed Jan 4, 2017 8:14 AM

The exact opposite of the answer I was hoping for. You will make yourself eat those words one day!



#25 RevEng OFFLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,384 posts
  • Bitnik
  • Location:Canada

Posted Wed Jan 4, 2017 8:28 AM

Nope ;)




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users