Welcome to the "open-source" Rustic Classics.
by Philip Hassey

0.  getting it going
--------------------
you need djgpp, allegro installed properly.  they have complete documentation
on how to do this at their websites.  (see rustic.txt for location.)
if you want to use the graphics or level editors, change the
makefile to compile them.  they are sort of ornery.  you always
need to specify a file name before loading and stuff like that, otherwise
it'll die.  if anyone wants to get these programs looking better, that
would be great.

1. terms
-------
I do not at this moment expect this to change into a large project with
millions of contributors.  So until that day comes, this is how we'll
do things.

1.  If you want to add a game to the rustics, make the game and send
it to me.  I'll likely gladly add it to the rustics.

2. If you want to make any changes to the rest of the code *ask* me first,
so I can make sure that only one person is making changes to part of the
source at a time.



2. how to make a new game
-------------------------

1.  Trying copying one of the existing rustics, and modifying it to
get what you want, that is how I always do it.

2.  A few required things must be done,
"newgame" will be the name of your newgame.

class newgame : public game

newgame(rustic *r) //you can have other parameters.
    : game (r)
    {
    gamename="NewGame";
    refresh_rate=.1f; //length of frame in seconds
    ...
    }

player data is in
top_rustic->players[p]->vars (see player.h for variables of players.)

top_rustic->max_players or MAX_PLAYERS is the max players for rustics (4).
top_rustic->total_players is the total of players.

the following methods need to be made:


void next_turn();
// called before the screen is updated each time.  

int game_resize_pictures();
// the screen is resized with game_x and game_y.  you'll need to
// refigure all your graphics to the proper size.  Also need to alert your
// code that the wohle screen needs to be redrawn.

int game_update(vid *g);
// the screen is updated with this.


3. how "vid" objects work
-------------------------
virtual void resize(int mx, int my);
        //resize a vid object, if possible - rarely used

void line(int c, int x, int y, int xx, int yy);
        //line of color c from (x,y, to xx,yy)


virtual void fillrect(unsigned char c, unsigned int x, unsigned int y, unsigned int mx, unsigned int my); 
        //fills a rectangle color c, (x,y) with width mx and height my
            
void clearvid();
        // fills vid with 0

virtual void floodfill(unsigned char c, unsigned int x, unsigned int y);
        //maynot work yet. :>

virtual void dopixel(unsigned char c, unsigned int x, unsigned int y);
virtual int getpixel(unsigned int x, unsigned int y);

virtual void doblock(unsigned char *v, unsigned int x, unsigned int y, unsigned int mx, unsigned int my);
        //raw chunks of memory

virtual void idoblock(unsigned char *v, unsigned int x, unsigned int y, unsigned int mx, unsigned int my);
        //raw chunks of memory with CLEAR_COLOR not to be drawn

virtual void getblock(unsigned char *v, unsigned int x, unsigned int y, unsigned int mx, unsigned int my);
        //gets a block.  you need to allocate memory before you call this with
        //a pointer to that memory.

void domvid(mvid *v, unsigned int x, unsigned int y);
        //you can put mvid objects onto the screen.

void idomvid(mvid *v, unsigned int x, unsigned int y);
        //with the CLEAR_COLORs not drawn.

"mvid" is a chunk of memory.
ddvid, dvidw, etc are video screens that access Allegro to draw to the screen.

mvid *game::makeimage(unsigned char *img, int px, int py)
        //will return a mvid object given an array of data with px ad py (widht/height)



4. gui stuff
------------
sorry, no docs here.  the gui used here is a pretty standard form
that i've based it all on.  add and remove objects etc etc..
all of this system is single threaded.  you prolly don't want to
use any of that in the games.


5. my thoughts
--------------
games usually take me about 3-5 hours to get going. sometimes quicker,
or longer.

i am not really trying to recreate all the games in their original glory
myself, but am mostly trying to make a collection of fun-multi-player games.

i am not too interested in getting network play working with these games,
but if anyone really wants to do it, they should talk to me, and we'll
see about that.

i would like these to work under DOS/Windows/Linux.  if anyone
wants to get the makefiles and stuff to do that automatically, or at least
produce a windows executable for us, that would be good.

the thing I most want to see is more games made.  Games are fun.

why am i doing this?  I think it is fun.  :>

my best suggestoin to you is to look in the source of other games.  start
with something easy like tron, and you'll see how these work.

some other things:
------------------
1. digger
---------
I know that digger has been remastered (www.digger.org).  Great job to them.
I have the source, but I didn't have the motivation to tackle it, so I
wrote my own edition of this game.  If someone wants to port the original
over, to work with the rustics that would be wonderful as well.  As long
as you get 4 players going at once.  We may have to had a "shoot" key
to the keyboard settings if we want to do that.

2. allegro
----------
Hey, yes.  Allegro is good as well.  I made the rustic classics in mind
that they would not be dependant on any particular system for their graphics
(other than my vid/gui stuff I wrote).
The only files that use Allegro directly are:

dvidw.cpp, ddvid.cpp, window.cpp, game.cpp, rustic.cpp

I believe that by changing those the whole rustic system could be ported
to use any other "graphics kit" out there.

3. settings.h
-------------
To compile the rustics: ESC_QUIT can't be defined, USE_MOUSE shouldn't be,
DOS can be, and SCREEN_WRITE shouldn't be.

To compile level editors/graphics editors: USE_MOUSE should be, and SCREEN_WRITE
should also be defined.

The gui i the lvledit, and grafedit is somewhat ornery.  You need to
select a filename before you load the file.  In the level editor, you need
to resize the level before the images show up on the bottom to click on.
(resize the leve to the same size it is, so it isn't erased.)


