Jump to content
Gemintronic

Find the wrap around borders for the ball, missiles and sprites

Recommended Posts

Okay, the starfield idea turned out to be less than ideal. I'll use a Dragonstomper example instead.

My quest is to document the proper wrap around coordinates for different sprite sizes. I need to know the exact x/y value that allows seemless transition and and off the screen.

The code below uses my custom _ACEKNRSTU score that takes the place of score_graphics.asm

If anyone can fill in the blanks then WE ALL WIN. No more jittery bumps when moving things around the screen borders!

[b]Standard sized sprite:[/b]
When sprite reaches leftmost coordinate ___ then wrap around to x value ___ to the right
When sprite reaches rightmost coordinate ___ then wrap around to x value ___ to the left
When sprite reaches top coordinate ___ then wrap around to y value ___ to the bottom
When sprite reaches bottom coordinate ___ then wrap around to y value ___ to the top

[b]Medium sized sprite:[/b]
When sprite reaches leftmost coordinate ___ then wrap around to x value ___ to the right
When sprite reaches rightmost coordinate ___ then wrap around to x value ___ to the left
When sprite reaches top coordinate ___ then wrap around to y value ___ to the bottom
When sprite reaches bottom coordinate ___ then wrap around to y value ___ to the top

[b]Quad sized sprite:[/b]
When sprite reaches leftmost coordinate ___ then wrap around to x value ___ to the right
When sprite reaches rightmost coordinate ___ then wrap around to x value ___ to the left
When sprite reaches top coordinate ___ then wrap around to y value ___ to the bottom
When sprite reaches bottom coordinate ___ then wrap around to y value ___ to the top

Share this post


Link to post
Share on other sites
Hmmmm.... They don't look very convincing as stars to me. If they twinkled/pulsed by colour cycling through several shades of blue through to white it might work better. Giving the stars a trajectory would also help as well.

Share this post


Link to post
Share on other sites
Thanks for the feedback! By omission I can assume that the flicker in the pfscore bars to the bottom left and right was acceptable? Also, the stars skipping on the horizontal borders wasn't noticeable?

Share this post


Link to post
Share on other sites
The flicker at the bottom is a bit annoying but I was concentrating on the stars. Maybe you could work the flicker at the bottom into the title page somehow? Err... I assume its a title page anyway :ponder:.

Share this post


Link to post
Share on other sites
I'm not really convinced either. You could also try something like this. It flickers two missiles all over the screen and kind of resembles a starfield.

main
COLUBK=0
COLUP0=8
COLUP1=8

a = (rand&127)
b = (rand&63)

missile0x=a
missile0y=b
missile1x=b
missile1y=a

drawscreen

goto main

Share this post


Link to post
Share on other sites
[quote name='Cybearg' timestamp='1363186097' post='2714906']
Are the stars necessary for something, or are they for aesthetics?
[/quote]

This is using the multi sprite kernel so there is no scrolling. I was hoping stars moving in the opposite direction would simulate scrolling. I think my next move is to put back random color cycling for missile0 and 1. No one noticed the jerky effect when the stars hit the left or right border so I don't think I have to worry about that. When I add extraneous prop sprites to the screen the scrolling effect will probably be way more pronounced.

The full screen picture of the bottom of a rocket (before you press a key) is actually a glitch! Not sure if it would actually appear in a real cart.

Share this post


Link to post
Share on other sites
[quote name='Atarius Maximus' timestamp='1363187619' post='2714923']
I'm not really convinced either. You could also try something like this. It flickers two missiles all over the screen and kind of resembles a starfield.

main
COLUBK=0
COLUP0=8
COLUP1=8

a = (rand&127)
b = (rand&63)

missile0x=a
missile0y=b
missile1x=b
missile1y=a

drawscreen

goto main
[/quote]
I thought of and tried pretty much the exact same thing, though I wasn't too pleased with how it looked. It looks more like a bunch of flies buzzing around than a convincing starfield.

Share this post


Link to post
Share on other sites
[quote name='Atarius Maximus' timestamp='1363208395' post='2715135']
I'm on my iPhone at the moment so I can't easily post a link, but check jrok's Star Crusade demo for a cool moving starfield effect.
[/quote]

It is a cool first person star-field effect. Still doesn't convey much left-right-up-down movement to me. Maybe it isn't clear that the object in the middle of the screen in my game is supposed to be a top-down ship sprite.

Share this post


Link to post
Share on other sites
[quote name='theloon' timestamp='1363210627' post='2715162']
It is a cool first person star-field effect. Still doesn't convey much left-right-up-down movement to me. Maybe it isn't clear that the object in the middle of the screen in my game is supposed to be a top-down ship sprite.
[/quote]True, it's designed for first person. I didn't mention before (and I'm sorry to say it) but I don't much care for the pfscore flicker either. I know everything is a compromise, and if flickering pfscore is what's needed to put get your ideas into a finished game it's completely worth it. :)

Share this post


Link to post
Share on other sites
[quote name='Atarius Maximus' timestamp='1363214908' post='2715194']
True, it's designed for first person. I didn't mention before (and I'm sorry to say it) but I don't much care for the pfscore flicker either. I know everything is a compromise, and if flickering pfscore is what's needed to put get your ideas into a finished game it's completely worth it. :)
[/quote]

Thanks for pointing that out. I think the pfscore flicker works (i.e. no one complained) in M.M.S.B.C. II due to the closer matching background color. With straight up black it's more obvious that there's a serious color transition going on. The red pfscore bar was gonna be a LIFE meter while the green could be CASH - used to repair or upgrade your unit at shops.

If only the 6lives.asm worked on the multi sprite kernel! I'd love for someone to prove me wrong or find a compatible version.

Share this post


Link to post
Share on other sites
Not to be pessimistic, but I kind of complained about the flicker in M.M.S.B.C. II I still don't understand how that phosphor effect translates to a real television or how that is meant to disguise flickering. Edited by Cybearg

Share this post


Link to post
Share on other sites
Okay guys. I decided to partially recycle this topic. The REAL problem is finding the proper coordinates to wrap around sprites and objects. If you notice moving the ball and missiles too far left or right causes weird warping effects. Basically, if we can figure out the x/y coordinates that avoid sprite/object warping we can make better looking pseudo scrolling games like Dragonstomper!

As a gift I included my _ACEKNRSTU score font that is ideal for Final Fantasy style games in that you can spell out:

ATTACK
USE
CAST
RUN

where 0123456789 is _ACEKNRSTU

..among other things (curse, turn, taunt, status, scan, start, return, enter, eat, create, cure, cant, ask, etc..)

This works for standard and multi sprite kernels. No hacking needed as it uses the standard 10 character score_graphics.asm

Share this post


Link to post
Share on other sites
[quote name='Cybearg' timestamp='1363247955' post='2715441']
Not to be pessimistic, but I kind of complained about the flicker in M.M.S.B.C. II I still don't understand how that phosphor effect translates to a real television or how that is meant to disguise flickering.
[/quote]

At the time you were using incorrect settings in Stella (HINT: Use ALT+P). You never said if you managed to correct the issue or create a new video.

LCD monitors do not have a real refresh rate. Even worse, the actual time it takes to go from pure black to pure white varies from LCD panel to LCD panel. Unlike a TV there is no phosphor coating that retains its glow even when you turn off a pixel. The phosphor mode in Stella attempts to simulate a real TV set this way.

The challenge now is to find the best coordinates to wrap things on and off the screen. If we can find a standard set of x/y values to do this making smoothly scrolling shooters, RPGs and other games will become MUCH easier. I'd hate to think each of us is reinventing the wheel every time we start a project.

Share this post


Link to post
Share on other sites
Here's another idea for a starfield, I was playing around with it this morning. It's similar to the previous one I posted, but in this one you can move the stars with the joystick to simulate scrolling.

main
COLUBK=0
COLUP0=10
COLUP1=10

r = (rand&127)
s = (rand&127)
t = (rand&127)
u = (rand&127)

if x=1 then a=r : b=u : c=t: d=u
if x=7 then a=s : b=t : c=s: d=r
if x=14 then a=t : b=s : c=r: d=s
if x=21 then a=u : b=r : c=u: d=t

x=x+1
if x>21 then x=1

missile0x=a:missile0y=b:missile1x=c:missile1y=d

if joy0up then b=b-1:d=d-1
if joy0down then b=b+1:d=d+1
if joy0left then a=a-1:c=c-1
if joy0right then a=a+1:c=c+1

drawscreen

goto main

Share this post


Link to post
Share on other sites
That IS a very nice star field effect. You can barely notice the warping effect when "scrolling" the stars towards the left. The right hand side seems to cut itself short before reaching the rightmost portion of the screen. Hmmmn..

Share this post


Link to post
Share on other sites
You probably should have created a new thread for the border thing instead of renaming this one to keep people's brains from exploding.

Since every sprite can have a different height, you can't have a bottom number in the standard kernel that will always be the same. I use this variable testing code to find the border limits for sprites, missiles, and the ball:

[url="http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#testvariables"]www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#testvariables[/url]

Share this post


Link to post
Share on other sites
[quote name='Random Terrain' timestamp='1363274499' post='2715621']
You probably should have created a new thread for the border thing instead of renaming this one to keep people's brains from exploding.

Since every sprite can have a different height, you can't have a bottom number in the standard kernel that will always be the same. I use this variable testing code to find the border limits for sprites, missiles, and the ball:

[url="http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#testvariables"]www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#testvariables[/url]
[/quote]

Yeah. From now on I'll just break down and make a new topic. Thanks for the score/debug code. Hopefully it'll be better than my old method.

I use:
[b][font=courier new,courier,monospace]score = 0[/font][/b]
then
[b][font=courier new,courier,monospace]score = score + <var I want to debug>[/font][/b]

Which is only so helpful because once I reach 127 or so the value rolls over >:-(

Share this post


Link to post
Share on other sites
I incorporated R.T.s score debug code when you press fire. This can't be used realtime because as the debug variable reaches 200+ the for .. next loop goes over cycle.

I almost had success by doing something like this:

score = 0
score = score + debugval
if debugval > 165 then temp1 = debugval - 165 : score = score + temp1

Basically, to me it looked like the score rolls over after 165. I figured if I added the part over 165 AFTERWARDs then I'd need just two lines instead of a long for .. next loop.

Didn't work completely. :)

Share this post


Link to post
Share on other sites
[quote name='theloon' timestamp='1363274707' post='2715623']
Which is only so helpful because once I reach 127 or so the value rolls over >:-(
[/quote]
You could also use Stella's debugger to monitor the memory locations for your game.

Share this post


Link to post
Share on other sites
[quote name='theloon' timestamp='1363269118' post='2715563']
That IS a very nice star field effect. You can barely notice the warping effect when "scrolling" the stars towards the left. The right hand side seems to cut itself short before reaching the rightmost portion of the screen. Hmmmn..
[/quote]The stars won't appear on the far right because the random number generator only goes up to 127 and the X locations of the right side of the screen go up to 160 or so. A little tweaking could make it better, I wrote that in about 3 minutes. ;)

Share this post


Link to post
Share on other sites
[quote name='Cybearg' timestamp='1363304036' post='2715970']
Could one specify an & value that's not based on powers of 2? Could one have a & 159 for a value from 0 to 160?
[/quote]I assume that would work but I haven't tested it. I was looking at RT's documentation on the rand function here: [url="http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#rand"]http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#rand[/url].

Share this post


Link to post
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.

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

×
×
  • Create New...