Amiga Game Info
3 messages in this thread
I could use a little "inside" info on game developement on an Amiga
platform. The questions I have are as follows:
1) After opening a Custom Screen, is it advisable to use a Backdrop Window
to render the game graphics into, or better to render the game graphics
right to the screens memory? I realize the answer to this question may
depend on the kind of game being implemented, so what would be recomended
for:
A) Arcade type games
B) D&D RPG games
C) Strategy type (Harpoon, Gettysburg) type games
D) Doom type virtual reality type games
2) What about the use of the blitter and copper in the above situations?
3) I've noticed in the source code to several Amiga and PC games, that a
file is included the is usually a full screen of various graphics, i.e.
walking characters, background "tiles", and other assorted graphics all
rolled together into one file. How is this file used, and how to you load
apaticular graphic off of this "sheet: into say a single sprite?
3) Scrolling backgrounds/foregrounds. How are they done and what exactly
istileing and how is it done.
4) I've seen numerous references to various line drawing, perspective
rendering algorithms and other "tricks of the trade" soloution to common
game programming problems, but not the algorithims or code itself. Can
anyonehelp with these?
5) Raycasting – This is a big one that I really want to learn about. I've
obtained several files the outline basically what it is, but I need more
information on how to accomplish it, and to perform the scaling required.
Especially in the rendering of ceilings and floors and using walls that
aretunnel shaped etc.
6) How do you avoid the "fisheye" effect that I've read about when
raycasting?
7) When people refer to a "viewport" when discussing raycasting, are they
reffering to the players "view" into the game world? And is this the point
where the rays are initiated from when trying to detect collisions with
walls, etc?
8) How do you determine the "depth" of view when using the raycasting
technique?
9) Again with Raycasting – How about color selection for the pixels to be
drawn, how is this usually selected while rendering from the games color
pallette?
10) Texture mapping – this also relates to raycasting and I could use more
info on how it is done and exactly what it is.
11) The use of interupts in game programming, am I correct in assuming
thatthese are used so that sound and graphics may be handled togther? If
not,
can you give me some insight into their use in this type of application?
12) Books dealing with game programming, the techniques employed,
algorithms and such, and books on programming computer graphics in
general,could I get some good suggestions here.
I have been hacking around with these machines for about eleven years now
and I'm pretty fair at coding in C. I've always wanted to develop computer
games, but books on the subject, or information on the techniques used is
hard to come by. I would really appreciate any help that anyone can offer
thathas had experience in these type of applications. Especially
proffesional
game programmers and artists.
Thanks for your time,
Gary
I hope this will be of some use:
>> 1) After opening a Custom Screen, is it advisable to use a Backdrop Window
to render the game graphics into, or better to render the game graphics
right to the screens memory?
There are several methods you could use on the Amiga, depending on how much
graphics you need to shift around. If you need to copy large images to the
screen, then a buffer of some kind will be essential, because you won't have
had time to draw all of the bitplanes before the screen is refreshed – and it
will be noticeable! When you have your complete screen in the buffer, either
a) use the blitter to copy the changes into the screen ram, or b) change the
bitplane pointers to point to your buffer, and build the next frame in the
memory that was the old screen. Method a) will only work if there is not too
much to update.
>> 2) What about the use of the blitter and copper in the above situations?
The blitter is extremely useful for copying blocks of graphics around – but it
isn't quick enough to copy the entire screen 50/60 times a second. (If anyone
thinks it is – let me know!). It is best used to move individual images
between buffers & main memory. You can in theory use the processor while the
blitter is working – it can generate an interrupt which you can use to set it
up for the next bitplane. The blitter can also shift images left or right by
up to 16 pixels – an operation which costs nothing in terms of extra time and
which allows you to place your graphics at pixel positions with ease.
You can get the copper to cause an interrupt on specific scan lines – perhaps
to change the color palette or as I do to cause an interrupt on the last scan
line to give a longer "vblank" period.
>> 3) I've noticed in the source code to several Amiga and PC games, that a
file is included that is usually a full screen of various graphics..etc..
You can't use these graphics directly as sprites, if the file is actually
arranged as a normal screen. But you can copy the data from the file into an
area of chip ram reserved by you for your sprites. I usually use a program to
chop individual images out of picture files and store them in a format that the
blitter can use directly (ie in bitplanes with a mask, and no compression). I
think time spent preparing your graphics and getting them into a form more
easily used by the program is well spent.
>> 3) (4?)Scrolling backgrounds/foregrounds. How are they done and what exactly
is tileing and how is it done.
Scrolling is much easier on an Amiga than many other machines. You need to set
up a screen that is wider than the part you can actually see, and then you can
use the hardware scroll registers to shift the screen horizontally by up to 16
pixels – thus bringing the hidden part into view. To scroll up or down, you
just change the bitplane pointers to point to the row above or below. You can
use the copper to generate interrupts to allow the bitplane pointers to be
changed when you reach the end of screen memory to wrap round to the top – thus
allowing you to scroll continuously in one direction, without running out of
ram.
Tileing is when you design your graphics so that they can be cut up into
rectangular 'tiles' which can be placed next to each other to form a complete
screen – often the same tile is used many times in one screen. You specify the
appearance of the screen by having a 'map' which is basically a table showing
which tiles go where. Using this method cuts down on the amount of drawing
that needs to be done to construct a level, and saves a lot of memory, but too
few tiles will make your screens look repetitive and blocky.
4 – 10 – sorry, these are not things I know much about. Try the various game
forums and the IBM forums for info on how Doom was done – there are many
helpful files available.
11) The use of interupts in game programming, am I correct in assuming that
these are used so that sound and graphics may be handled togther? If not, can
you give me some insight into their use in this type of application?
Interrupts allow things that need attention (like the sound, disk blitter etc)
to stop the main program and get the service they need. For example, when the
display has been completely refreshed, the electron beam is at the bottom of
the screen. The time when the beam is moving back to the start position would
be useful for drawing graphics without affecting the picture. The video system
creates an interrupt which makes the computer stop what its doing and switch to
another function called an interrupt handler or interupt service routine. This
routine could draw graphics, increment a timer, check the mouse, keyboard or
all of these things. The sound system creates interrupts to allow you to set
up the sound pointers for the next chunk of sound. Obviously it would be
difficult to regularly check whether a sound had finished – you may miss it.
The interrupt system takes these worries away and allows your program to
concentrate on its main task.
>> 12) Books dealing with game programming, the techniques employed, algorithms
and such, and books on programming computer graphics in general,could I get
some good suggestions here.
For Amiga programming, you will need two essential books:
1. Amiga Hardware reference manual – published by Addison Wesley. This tells
you how to use all the hardware – sprites, copper, blitter etc. It is very
detailed, but not difficult to understand.
2. Amiga ROM Kernel reference manual: Includes and Autodocs – also published by
Addison Wesley. This contains details of all the functions available in the
operating system for doing things like disk IO, memory allocation, device
handling etc. Its a must if you wish to use assembler for these kinds of
tasks. Its a bit tricky to get into, but using the operating system functions
not only allows you to write code that is compatible across the whole amiga
range, but it will save you time because you won't need to write so many of
your own routines. Many games programmers avoid the operating system
altogether because they think it will slow their games down. This is not true
– its an excuse not to bother learning a better way to go about things.
Finally – I would suggest you keep your posts to no more than a couple of
questions at a time. Seeing a huge pile of queries puts people off from giving
any answer at all. I only took the (considerable) time to reply because I was
stuck with a bug and wanted a break from it. If you keep your questions short,
you are more likely to get a selection of replies from people with different
experiences – much more useful!
Mal
"With writers cramp in Montreal"