I'm wondering if anyone has any ideas how Tyrian achieves such fast
parallax scrolling in mode 13h. I'm currently writing my own game
engine and I can not for the life of me figure out how Tyrian
consistently maintains a fast framerate even when displaying huge
objects (clouds, for example) that take up half the screen. I own a
386/DX 40 so I would expect things to slow down ocasionally. I am
stumped and looking for any clues of how this kind of speed might be
accomplished. Thanks in advance...
Jason
It's probably because of Mode-X. I don't know how to do it because i'm
just starting myself... but it sets mode 13h then 'unchains' it... giving
you access to all 256k of base video ram... Ask around someone will give
you some code for it. -Vice
--
*************************
Keith Alan Weatherby II
Vi...@gconn.com
"Have a nice day!"
*************************
MODE-X???
You don't need mode-X to do fast scrolling!
Yes, mode-X works fine when you need to load a virtual screen
into video memory and then scroll around it. However, it is
limited to an image of no more than 4 screens in size (1x4, 2x2...)
I think that Tyrian has just a little bit more than 4 screens
worth... <g>
I don't know what they did for Tyrian but here are a few suggestions...
Big images can be broken up into smaller tiles!!! (please tell me
you've thought of this... :] ) This way you have to spend less time
doing clipping (if you are really clever you don't even have to do
clipping hehehe)
Instead of doing transparency 1 pixel at a time try doing it 4 at a time
(yes it can be done!) You might also want to make your tile width/height
multiples of 4 pixels (again, please tell me you've thought of these
things...)(sometimes it's advantageous to sacrifice a little memory
for a lot more speed...)
You can also set up things such that you only need to deal with
the tiles that are currently on screen... (c'mon you don't expect
me to give everything away do you..?)
Finally, you can use a certain chunk of memory to do DWORD operations
on you tiles, sprites... and then blast it onto video memory when the
time comes... (since in some cases it is preferable to send WORDs
across the bus to the video card, you know the ISA bus.)
The really neat thing about all the techniques that I have given you
is that you can apply them to programming in higher res VESA modes.
What is even kewler is that with the advent of the 32bit bus,
we can access a linear framebuffer on the video card, and with high
speed buses, it might be even possible to write directly to video
memory and altogether avoid a double-buffer...
Happy Coding!
>It's probably because of Mode-X. I don't know how to do it because i'm
>just starting myself... but it sets mode 13h then 'unchains' it... giving
>you access to all 256k of base video ram... Ask around someone will give
>you some code for it. -Vice
>--
But ModeX doesn't help with Parallax - I suppose the upper layers must
be made of Sprites or something (though when I tried it it was too
slow)
Tony Marshall | <tangerine dream.yello.gordon giltrap
Carlisle, England | neuronium.depechemode.psb's.oasis.jmj
to...@zigzag.u-net.com| ashra.stranglers.vangelis.floyd.goa >
----------------------|--------------------------------------
My Mystery Tune Page http://www.u-net.com/~zigzag/mystery.htm
>> It's probably because of Mode-X. I don't know how to do it because i'm
>> just starting myself... but it sets mode 13h then 'unchains' it... giving
>> you access to all 256k of base video ram... Ask around someone will give
>> you some code for it. -Vice
>> --
>MODE-X???
>You don't need mode-X to do fast scrolling!
>Yes, mode-X works fine when you need to load a virtual screen
>into video memory and then scroll around it. However, it is
>limited to an image of no more than 4 screens in size (1x4, 2x2...)
>
>I think that Tyrian has just a little bit more than 4 screens
>worth... <g>
>
Yes, but you can still have as many screens as you want in ModeX by
adding tiles/panning back indefinitely...It's quite fast as well, my
horizontal scroll is running at 4107fps at the moment (with no sprites
or anything of course - a few sprites soon slows it right down).
>From what i've seen, it looks like tyrian uses mode 13h for it's
graphics and not ModeX...
cheers,
Akintunde Omitowoju
om...@washington.xtn.net
> MODE-X???
> You don't need mode-X to do fast scrolling!
> Yes, mode-X works fine when you need to load a virtual screen
> into video memory and then scroll around it. However, it is
> limited to an image of no more than 4 screens in size (1x4, 2x2...)
>
> I think that Tyrian has just a little bit more than 4 screens
> worth... <g>
>
> I don't know what they did for Tyrian but here are a few suggestions...
>
> Big images can be broken up into smaller tiles!!! (please tell me
> you've thought of this... :] ) This way you have to spend less time
> doing clipping (if you are really clever you don't even have to do
> clipping hehehe)
>
> Instead of doing transparency 1 pixel at a time try doing it 4 at a time
> (yes it can be done!) You might also want to make your tile width/height
> multiples of 4 pixels (again, please tell me you've thought of these
> things...)(sometimes it's advantageous to sacrifice a little memory
> for a lot more speed...)
>
> You can also set up things such that you only need to deal with
> the tiles that are currently on screen... (c'mon you don't expect
> me to give everything away do you..?)
>
> Finally, you can use a certain chunk of memory to do DWORD operations
> on you tiles, sprites... and then blast it onto video memory when the
> time comes... (since in some cases it is preferable to send WORDs
> across the bus to the video card, you know the ISA bus.)
>
> The really neat thing about all the techniques that I have given you
> is that you can apply them to programming in higher res VESA modes.
> What is even kewler is that with the advent of the 32bit bus,
> we can access a linear framebuffer on the video card, and with high
> speed buses, it might be even possible to write directly to video
> memory and altogether avoid a double-buffer...
>
> Happy Coding!
Four screens of course but they probably did tiles like you said...
To access they still need to unchain mode 13h... and more than likely
(altho i haven't seen the game) they used a split screen for status
bar... (i.e. points, lives, health or whatever)... it would still be
using Mode-X. I mean sure they use XMS/EMS to hold all the pictures
but then they have to dump it to the vga... -Vice
Yes, I realize that, The same way that you can have more than one
screen worth under mode 13h. I thought that would have been clear
from the rest of the discussion...
I was just trying to make the point that it isn't the extra pages and
the ability to scroll through them that makes for the fast scrolling
in a game (it could but it has limitations)
Happy Coding!
anyway, parallaxing can be done 2 kinds of ways, trickily, and ideally. Trickily
means that you use hardware tricks like palette cycling (Jazz's sky), hardware
split screens or hardwired separate regions (land and sky locked to certain
screen regions for example).
ideally refers to a system which is always efficient. basically it means that you
only plot each pixel once. NOT sprites for overlapping layers, but just each pixel
plotted once. Find out how linked lists work... a mindset like them will let you
take all your original tiles, build an idea of what the scene'll be like, scanline by
scanline, then blast out runs of pixels, processing each desination pixel once only.
Parallaxing!
oh yeah, disclaimer, i've never seen Tyrian :).
- Brendan (not at my usual address, this account's free! :)
>>From what i've seen, it looks like tyrian uses mode 13h for it's
>graphics and not ModeX...
>cheers,
>Akintunde Omitowoju
>om...@washington.xtn.net
a few thoughts:
* it does look like mode-x - the pixels are square for starters.
* it's only got vertical scrolling so only 2 pages are needed for
infinite vertical scrolling...
* the other two pages could be used to store sprites & the parallax
layers (ground/clouds/rock things)
* mode-x lets you do fast video to video copies - ie from page to
page within the video memory. therefore the parallax layers could
be copied onto the actual screen really quickly...
on the other hand, if it's not mode-x or it is just a version of mode 13h
with a 320x240 resolution (ie no pages, just square pixels), it would make
a bit more sense because with fast computers you could easily do the
parallax & it would make the transparent clouds easier to do.
well, like i said, just a few thoughts :)
-Tom
t...@halls1.cc.monash.edu.au
http://yoyo.cc.monash.edu.au/~madmick
To elaborate on this:
Let your scene consist on a few planes of data. Each plane is an
an array of linked lists. Each node in the linked list contains
the data for a single run of non-blank pixels, the length of
the run, and the offset from the last run.
At run time, you have an array of lists of scan segments (the
segment table). To draw the scene, calculate the offset of the
first plane and initialize your segment table with the visible
segments.
For each remaining plane, calculate the offset, and clip the
visible segments in the plane against those in the segment table.
The clipping is done segments at a time.
Now for each scanline, traverse the appropriate list and blit
the segments to the screen. Every pixel drawn is a visible pixel.
A concern is the overhead in doing the list merging and clipping.
When scrolling, however, only a small additonal area needs to
be updated. By updating your segment table in an incremental fashion,
you avoid traversing much on any list. Also, your cursors in your
lists may also be maintained at the exposed and border segments,
making list traversal continue at exactly the right point.
I have not seen Tyrian, nor have I tried to implement parallax
scrolling before. You might find this worth trying though.
--
'Til next time, \o/ \o/
V \o/ V email: sk...@columbia.edu
<> Sam Inala <> V
You can do transparencies with 4 pixels at a time? Do you have to design
your graphics any differently? I'm not quite sure how you pull this
off? How do you do that?
dave
Tyryan uses mode 13h; beleive me.
-=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=-
NSJ no IST ** NSJ at Techical Superior Institute of Lisbon
"Vale mais um coracao que ama do que
uma inteligencia que so' sabe pensar"
Charles Dickens
My group has achieved some fairly impressive speed benefits by compiling our parallax layers much
like you would use compiled sprites. We are putting the entire thing in 320 x 400 ModeX and could probably
easily crank out 50 fps on a P-133 with a decent video card (and thats with about 8 layers stacked up). It
was a bit tricky getting it to work with our ModeX driver.
Another thing kinda off topic about parallax engines...we plan to sell this game commercially..and
while we were not expecting to make a groundbreaking profit margin. We are kinda curious as to how the
general public is going to react to such an engine. Our main concern is playability..we just want to make
it as fun for the players as possible...but hey..at least its not going to be another 3D doom clone.. =>
Jason
>Four screens of course but they probably did tiles like you said...
>To access they still need to unchain mode 13h... and more than likely
>(altho i haven't seen the game) they used a split screen for status
>bar... (i.e. points, lives, health or whatever)... it would still be
>using Mode-X. I mean sure they use XMS/EMS to hold all the pictures
>but then they have to dump it to the vga... -Vice
Well, Tyrian uses a vertical status bar on the right of the
screen, so they couldn't take advantage of the split screen (using VGA
regs). It looks 320x200 to me and I'd bet just about anything that
it's plain mode 13h (not a mode-x variant). In fact, now that I think
about it, I'm positive. Looks like about 35 fps and you get 'ghosts'
of sprites.
----
Eric
esar...@netdoor.com
http://www2.netdoor.com/~esargent
>Tom PATON - Tom (t...@halls1.cc.monash.edu.au) wrote:
>: a few thoughts:
>: * it does look like mode-x - the pixels are square for starters.
> Tyryan uses mode 13h; beleive me.
Can I get this Tyrian demo anywhere? If I could, then I could just use
my program and snatch all the VGA registers and see if he is using
Mode-X or not.
- Avery Lee (Psi...@cris.com)
Well, I don't knoow where you can find it, but you really can believe
me, Tyrian uses mode 13h.
--
NSJ
Sorry to butt in, but I believe Tyrian is a ModeX. I had to use a
capture utility that supported X-modes in order to get a screen shot.
The other capture utility I have that doesn't support X-modes (but does
provide timed captures etc.) gave me a 4-slice picture.
If it is mode13h, it's the smoothest scrolling code I've ever seen.
Check out Raptor:Call of the Shadows for a game that the developers
admitted was mode13h (CompuServe Gamedev forum).
Even on a 486DX4-100 with ATI Mach32 VLB, you'll get sprite triple-ghosts
(vs double-ghosts on Tyrian, Hocus Pocus, etc.) on side motion, and about
every second or so you'll get a pixel overlap/swim as the screen blit
meets a video timing. Usually approximately 1/3 down the screen.
Tyrian is perfectly smooth and has no swimming/overlapping, a la page
flipping.
Also, Raptor is playable on a 386SX-25MHz (although who would want to)
while Tyrian even in lowest detail mode is not (caused by all of the
plane switching OUTs). On a 386SX system, you can easily see the blit
wipes on Raptor, while Tyrian doesn't, it's frames are solid.
Nuff said.
If you're looking for some of these games, try searching the web for
Apogee or Epic Megagames.
David
>Also, Raptor is playable on a 386SX-25MHz (although who would want to)
>while Tyrian even in lowest detail mode is not (caused by all of the
>plane switching OUTs). On a 386SX system, you can easily see the blit
>wipes on Raptor, while Tyrian doesn't, it's frames are solid.
Now I'm confused. Is Tyrian a game or a psuedoname? If it's a game,
is it commercial, shareware, or public domain?
- Avery Lee (Psi...@cris.com)
>Sorry to butt in, but I believe Tyrian is a ModeX. I had to use a
>capture utility that supported X-modes in order to get a screen shot.
>The other capture utility I have that doesn't support X-modes (but does
>provide timed captures etc.) gave me a 4-slice picture.
Fair enough.
>If it is mode13h, it's the smoothest scrolling code I've ever seen.
>Check out Raptor:Call of the Shadows for a game that the developers
>admitted was mode13h (CompuServe Gamedev forum).
>Even on a 486DX4-100 with ATI Mach32 VLB, you'll get sprite triple-ghosts
>(vs double-ghosts on Tyrian, Hocus Pocus, etc.) on side motion, and about
>every second or so you'll get a pixel overlap/swim as the screen blit
>meets a video timing. Usually approximately 1/3 down the screen.
>Tyrian is perfectly smooth and has no swimming/overlapping, a la page
>flipping.
I don't see what the problem is, you CAN get nice smooth scrolling using mode
13. My shoot-em up uses mode13, and gets a BEAUTIFUL 70hz scroll, on anything
above a 48633 with vlb, without any missed frames or anything.
Just my 2 cents worth . . .
Daniel Fletcher
: >Sorry to butt in, but I believe Tyrian is a ModeX. I had to use a
: >capture utility that supported X-modes in order to get a screen shot.
: >The other capture utility I have that doesn't support X-modes (but does
: >provide timed captures etc.) gave me a 4-slice picture.
ok guys, you finally made me download this and check it out...
tyrian uses BOTH modeX and mode13. yep, so you all win. but the actual
game is MODE 13, (you should have trusted that guy)...the only part of it
which is modex is the "HOW TO ORDER" part, which I presume was already
coded for other games.
As for smooth scrolling, well, on a reasonably fast video card it is,
but on a crappy old trident piece of crap it isn't. mode13 can be smooth
as all hell if the video card is good enough.
A simple dooby that can show you a heap about how a game is working is
just a tsr that clears 64k from the start of video mem. write this and
you will see some cool stuff...check out jazz and you will see things
such as vid-vid copies etc.
a.
: jazz as in Jazz Jackrabbit? I grabbed all the VGA registers while it
: was running and found it running in non-X mode 13h. Does it change
: back and forth?
I think you should take a closer look at your prog, jazz is definately
not using straight mode13. just do the mem-clearing tsr thing, it works
really well with jazz.
a.
yep, could be the case, check out the game itself and see what you get
(if you've still got it that is).
a.
Mine's going to, also, and I ranted above about how cool it is
technically :-)
What method you using? We're looking at implementing double buffers,
possibly with dirty rectangle tracking; there's a protected mode
segment load overhead with every blit to real screen memory (QUAKE
uses the so-called FARPTR method, but that's unreliable; I'm using a
/better/ method, just it incurs a segment load. Heck, who cares :-),
so it might be faster to just dump the entire frame buffer accross the
protmode boundary.
And it'll be hooked to a virtual vertical retrace interrupt, of
course...
Regards,
ABW
>Daniel Fletcher
--
I have become... Comfortably numb...
Alaric B. Williams Internet : ala...@abwillms.demon.co.uk
<A HREF="http://www.hardcafe.co.uk/Alaric/">http://www.hardcafe.co.uk/Alaric/</A>