Re: [dcrpg-devel] DC RPG
Status: Inactive
Brought to you by:
falkkin
|
From: Miles R. <reu...@ya...> - 2002-02-04 20:55:01
|
That sounds a lot like C++ classes... maybe we should consider using C++?
So this is what I have so far for a tile:
//32bit tile structure
struct tile
{
unsigned int walkable : 1; //0 not walk, 1, walkable
unsigned int front : 1; //0 back, 1 front
unsigned int monster_info : 7; //monster id(s)
unsigned int event_id : 7; //event id *
unsigned int fg_sprite_id : 8; //foreground sprite id *
unsigned int bg_sprite_id : 8; //background sprite id *
} tile;
//* as defined in the map structure
This may be overkill... Maybe the tile structure should be nothing more
than what sprites are displayed... and the map structure more complex?
These are all just suggestions...
-Miles Raymond EML: m_r...@bi...
AIM: Killer2Ray ICQ: 13217756 IRC: Killer2
WWW: http://www.bigfoot.com/~m_rayman
----- Original Message -----
From: "Colin McMillen" <mcm...@tc...>
To: <dcr...@li...>
Sent: Monday, February 04, 2002 11:05 AM
Subject: Re: [dcrpg-devel] DC RPG
> > Well, this is as much as I know:
> > -I am assigned the map engine
> > -Colin is doing the fighting engine
> > -Dan is working on ... ? (I must have missed this)
>
> I don't know what Dan is working on either... I've not heard back from him
> recently. We have two new developers on the project (Atonkelton and
> banandgia2), and I don't know what they'd like to work on yet.
>
> > For start, are we just going to rip graphics from FF1 and use them? Or
are
> > we going to create our own?
>
> I actually have some "open-source" map tiles, donated by a guy who's done
> tiles for ZAngband... don't know what we'll do for other graphics; I don't
> feel good using ripped graphics of a copyrighted game, so we might just
use
> abstract shapes like colored rectangles to represent some things until we
get
> some real art.
>
> > And this may sound rediculous or obvious... but do we have a story plan?
>
> Not yet. RIght now I'm only interested in the engine, not the story. I
figure
> it'll be time to work on story once we have the engine in a workable
state.
>
> > Should we design the maps so that they wrap around?
>
> I think that should be a flag in the map struct itself -- some maps, like
a
> world map, should probably wrap around, while others, such as in-dungeon
or
> in-town maps, should not. Each map will probably have some global data in
it,
> in addition to the tile data, and we don't need to worry about being as
> sparse about the data for maps, as there'll only ever be one map loaded
into
> memory at a time.
>
> I'm picturing something like this (pseudo-C code):
>
> typedef struct map {
> int length, width;
> tile* tiles; // 2-d array will be filled in here
> int wraps; // 0 or 1
> char* name;
> // possibly more data as we need it
> } map;
>
> > Should we design a map size limit? If so, what should it be? (ie:
> > 512x512, 1024x1024, etc)
>
> I don't think we should build one in... the DC has 8 MB of memory (if i
> remember right) so we'd currently be unable to store anything larger than
> 1024x1024 in main memory at a time (assuming we keep to our design
criterion
> of ~64 bits/tile)... however that's no reason to build an arbitrary limit
in;
> maybe someone would rather have the map be 4096 x 128 for some reason, or
> whatever.
>
> What I'd do is make a map "constructor" that allocates a map, and a map
> "destructor" that deallocates it, something like this:
>
> map* map_new(int length, int width) {
> map* m = (map*) malloc(sizeof(map));
> m->length = length;
> m->width = width;
> m->tiles = (tile*) malloc(length * width * sizeof(tiles));
> // etc
> }
>
> void map_free(map* m) {
> free(m->tiles);
> free(m);
> m = NULL;
> }
>
> In general I'd like a "constructor" and "Destructor" like this for any
data
> structure that needs to malloc() memory; it'll make memory management much
> easier. (Memory leaks on the DC being quickly fatal, with only 8 MB of RAM
:))
>
> > Should we design the maps so that they HAVE to be a square matrix? Or a
> > matrix at all? Or maybe just a an array of arrays?
>
> I'd go with a rectangular matrix, as I don't see any need to have a
> non-rectangular, ragged map. However, any rectangle should work, not just
> squares.
>
> - Colin
|