Jump to content
IGNORED

Smooth scrolling


Asmusr

Recommended Posts

I just checked, and I think I did all the settings right on Classic99. It's in NTSC mode. However, I'm running Classic99 version QI342 which may be a bit outdated by now. However, I just tried it in MESS 0.135, and there it runs at the same speed as on Klaus's TI-99... 20 fps on a NTSC machine and 25 fps on a PAL machine (but Klaus's is NTSC due to the F18A chip).

Link to comment
Share on other sites

WOW.. just ran this in mess.. wow..

 

Greg

 

 

Indeed it does... I downloaded the current version of WinAsm99 (actually, the suite it belongs to) and reassembled with this version, and it now works.

However, I've now added some music. Rasmus, I hope you don't mind that I've copied your music player from "Titanium" and inserted it here... but the music is quite different to that in Titanium. ;-)

The filename to run would be VERTICAL2C. Use the LOAD AND RUN option in Editor/Assembler (Option 3).

Yes, I know the source code isn't as clean as it could be...

attachicon.gifMarble2_13_11_10.zip

Link to comment
Share on other sites

Just curious... how did you create the maps for this one? It looks like there are certain "building blocks" on the map which repeat over and over.

 

In Magellan, using 24 patterns in total. The technique is basically the same as for the other scrolling routines, but in isometric scrolling you scroll 2 pixels horizontally for each 1 pixel vertically, so a transition depends on 6 tiles instead of 2 as in vertical or horizontal scrolling. E.g. if you want to move from F to T it passes through both A, B, C and D:

 

-------------

| A | B | T |

-------------

| F | C | D |

-------------

 

I made some code in Magellan to identify and export the unique transitions. Since a transition depends on 6 tiles the 256 patterns are used very quickly, so in order to reduce transitions I copied the same blocks a few times. I haven't got a visual tool yet to assist me, and it's possible that the number of transitions could be reduced if you could see what was going on.

 

Since I'm using almost the full character set I cannot store all pattern frames in VDP RAM, so I'm pushing them from CPU RAM for each frame. Without music it could run at 30 FPS but the music reduces this to 20 FPS.

 

The map itself is a diagonal strip, but you can save memory by skewing it so it aligns horizontally, e.g.:

 

0000004444

0000333300

0022220000

1111000000

 

You can store as:

 

11223344??

??11223344

 

So there's nothing actual 3D in this, it's just an illusion. But in a game you *would* have to maintain a map of the 3D locations of each block to make collision detection etc. I wonder how they did this in some of the amazing games that was made for the ZX Spectrum (Gunfright is my favourite):

 

 

Any ideas how to do this with very limited memory?

 

Edit: The bass notes in the music are made using periodic noise, but because the MOD2PSG tracker is designed for the SN76489 sound chip I had to lower the frequency by 15/16. What I did was simply to transpose each bass note down 1/2 note which explains why it's slightly off key.

Link to comment
Share on other sites

So there's nothing actual 3D in this, it's just an illusion. But in a game you *would* have to maintain a map of the 3D locations of each block to make collision detection etc. I wonder how they did this in some of the amazing games that was made for the ZX Spectrum (Gunfright is my favourite):

 

Any ideas how to do this with very limited memory?

Well, in this video I can see basically two types of isometric games... some, like Gunfright, are smoothly scrolling, but actually, the framerate isn't that high. ALso keep in mind that the Spectrum has a bitmap based display with no character mode, so you have no choice but to rewrite the entire playfield for each frame. As on how to store it? Well...

 

In Ant Attack, actually each square only has got a height, and your character is at a given height depending on the surface it's on, or higher if it jumps. The ants tyipcally are only on the ground, they don't ever appear higher than that. So you just have to check if the player is higher than the surface on his square, in which case it falls, or not. You can keep the height of the player's shots (if there are any), and if too high, they don't hit any ants. And the ants check for blocks that are above ground, which are treated as obstacles. Other than that it's not much more difficult than 2D.

 

In games like Gunfright and Night Shade, it's even more 2D in that there's nothing higher than the ground which the player would be able to run on. All other objects, normally, only have a fixed level above, or mostly, on the ground. The 3D is mostly just there for looks. And the map only consists of whole rooms with single objects placed in them. There's a 16x16 grid of rooms in Gunfright, for instance.

 

Then there are the games where the map consists of rooms and doesn't scroll. Those rooms are more complex, say, 8x8 squares, but even there, as in Ant Attack, I haven't seen anything above a given surface height for each of the 8x8 squares. So you just have to keep track of the surface height of each of the 8x8 squares and act on the square the player's currently on.

 

Just for the record, in my XBasic clone of Marble Madness, I only faked the 3D... there are different sprite motion routines for each of the represented slopes, and each defined tile is assigned one of the slopes, even if it actually displays multiple of them. The program stores the velocity the ball would have on level ground and translates it to sprite motion depending on the current slope. Also depending on the slope, some constants get added to or subtracted from the X and Y motion values. But I think I've read that Mark Cerny's implementation on the original arcade machine differs from this... here a X, Y and Z value and probably according motion values get kept track of, though I don't know how that version internally represents the surfaces and their boundaries and checks which one each marble is running on.

 

BTW, the original 8-bit, Atari ST and MS-DOS versions of Marble Madness, as well as "Gyroscope" and "Marble Madness Construction Kit" by Melbourne house, even took an easier stance on this one... the ball only gets moved in 2D, and the visible 3D slopes only cause some constants to be added to the motion values in order so simulate some rolling down a slope, but it's not even physically correct.

Link to comment
Share on other sites

I now thought about some more about the representation of Marble Madness in memory, concerning the areas...

 

This picture is taken out of a presentation Mark Cerny did on the creation of Marble Madness, which you can watch here:

http://www.gamasutra.com/view/news/184925/Video_The_making_of_1984s_Marble_Madness.php

 

post-8393-0-45619700-1385218582_thumb.jpg

 

Now the picture on the right is a representation of a 8-pixel wide strip of the map. The interesting thing is that you actually only have to give the numeric values for each "zig" and "zag" out of the zig-zag line that makes out each strip, and these values also give the proper slope values, like this:

 

First you have to change it a bit so that the values represent the difference between one point and the next, so the row of values -10, -6, 4, 8, 12 would become 4, 10, 4, 4. That way you can represent the value in a smaller field, 4 or at most 8 bits for each "zig" or "zag". Now the representatoin of the 3D would run as follows:

 

A value of 4 means that the surface is straight in that direction, a value smaller than that means it's tilted to the back, and a bigger value means it's tilted to the front. Now there are 2 directions it can be tilted in...

The first "zig" in the picture goes from left to right, so the "4" means it's straight in the front-right direction. The "zag" below it goes from right to left, so the "10" means it's tilted to the front in the front-left direction. And so on...

 

Now it remains to be seen which one of the values is valid. That's actually quite easy... The value of a "zig" is always valid between the two "zags" preceeding and following it, and the value of a "zag" is always valid between the two "zigs" preceeding and following it.

 

Now to exactly determine the slope values of the point the marble is on, you'd have to do the following:

- Find the "zig" or "zag" area the marble is on. One area is always the horizontal strip between two of the points shown, but extending across the whole 8-pixel strip.

- Find out if the marble is above or below the line (by determining the pixel row of the line for the pixel column the marble is on and comparing that with the actual pixel row of the marble).

- Now there are four possibilities:

- For a "zig" area, the "zig" value (tilt to the front-right) is always the value of the current "zig", while the "zag" value (tilt to the front-left) is the value of the next area above is the marble is above the line, or the value of the next area below if the marble is below the line.

- For a "zag" area, the "zag" value is always the value of the current "zag", while the "zig" value is the value of the next area above is the marble is above the line, or the value of the next area below if the marble is below the line.

 

I hope some of you were able to follow me... ;-)

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