Server Development
Forum rules
This forum houses many years of development, tracing back to some of the earliest posts that exist on the board.
Its current use is for the continued development of the server and game it has always served: The Mana World.
- ElvenProgrammer
- Founder
- Posts: 2526
- Joined: 13 Apr 2004, 19:11
- Location: Italy
- Contact:
Server Development
Everything refers to eathena.
Maps
You should use my or Sull's map editor to create custom maps for the server and also modify the code to read our own custom map format
Scripts
We should have some basic npcs on the first map just to test npc talk
Protocol
In the near future we should be able to modifi the protocol a bit to make athena use our own
Maps
You should use my or Sull's map editor to create custom maps for the server and also modify the code to read our own custom map format
Scripts
We should have some basic npcs on the first map just to test npc talk
Protocol
In the near future we should be able to modifi the protocol a bit to make athena use our own
- ElvenProgrammer
- Founder
- Posts: 2526
- Joined: 13 Apr 2004, 19:11
- Location: Italy
- Contact:
Ok this is the first attemp on making athena read custom maps:
This one is located in /src/map/map.c
It reads: "athena folder"/data/new_1-1.gat
This file is in my custom format which you can export from map editor v.03. (It will be online soon I hope). I need also to make some other test on how to change the name and extension of map file.
Regarding the map format is simply two ints defining width and height of a map and then a width x height matrix of char indicating walkability (0=walkable, 1=non-walkable)
That's enough for this time.
To be continued...
Code: Select all
static int map_readmap(int m,char *fn)
{
int s;
int x,y,xs,ys;
int wh;
size_t size;
FILE *file;
printf("\rmap reading [%d/%d] %-20s ",m,map_num,fn);
fflush(stdout);
file = fopen(fn, "rb");
if(file==NULL)
return -1;
fread(&xs, sizeof(int), 1, file);
fread(&ys, sizeof(int), 1, file);
map[m].xs = xs;
map[m].ys = ys;
printf("\nMap size: %i %i\n", xs, ys);
map[m].m=m;
map[m].gat = calloc(s = map[m].xs * map[m].ys, 1);
if(map[m].gat==NULL){
printf("out of memory : map_readmap gat\n");
exit(1);
}
map[m].npc_num=0;
map[m].users=0;
memset(&map[m].flag,0,sizeof(map[m].flag));
wh=map_waterheight(map[m].name);
for(y=0;y<ys;y++){
for(x=0;x<xs;x++){
fread(&map[m].gat[x+y*xs], sizeof(char), 1, file);
}
}
fclose(file);
map[m].bxs=(xs+BLOCK_SIZE-1)/BLOCK_SIZE;
map[m].bys=(ys+BLOCK_SIZE-1)/BLOCK_SIZE;
size = map[m].bxs * map[m].bys * sizeof(struct block_list*);
map[m].block = calloc(size, 1);
if(map[m].block == NULL){
printf("out of memory : map_readmap block\n");
exit(1);
}
map[m].block_mob = calloc(size, 1);
if (map[m].block_mob == NULL) {
printf("out of memory : map_readmap block_mob\n");
exit(1);
}
size = map[m].bxs*map[m].bys*sizeof(int);
map[m].block_count = calloc(size, 1);
if(map[m].block_count==NULL){
printf("out of memory : map_readmap block\n");
exit(1);
}
memset(map[m].block_count,0,size);
map[m].block_mob_count=calloc(size, 1);
if(map[m].block_mob_count==NULL){
printf("out of memory : map_readmap block_mob\n");
exit(1);
}
memset(map[m].block_mob_count,0,size);
strdb_insert(map_db,map[m].name,&map[m]);
// printf("%s read done\n",fn);
return 0;
}
It reads: "athena folder"/data/new_1-1.gat
This file is in my custom format which you can export from map editor v.03. (It will be online soon I hope). I need also to make some other test on how to change the name and extension of map file.
Regarding the map format is simply two ints defining width and height of a map and then a width x height matrix of char indicating walkability (0=walkable, 1=non-walkable)
That's enough for this time.
To be continued...
I (hopefully) changed some things to load maps from the "maps" directory (in athena folder) and let them have their ".map" ending. Of course Elvens improvements are included. =D
I also removed loading of the .grf files (hopefully this is not bad, i dont have the chance to test it .. the only thing i see, is that it loads successful). Instead, put the .txt files from an extracted data.grf into a directory called "data" in your athena folder. Configfile now is like that:
map:new_zone01.map
(change .gat to .map )
uhm.. i think thats it. ah, yes, i "cleaned" the structure of the package a bit.
note: the binarys are now "athena-login", "athena-char" and "athena-map" (to have them all at one place) - delete the old ones if you want to.
the .diff file is a patchfile to update the sourcecode of an existing eathena-installation. if you already have elvens changes added, maybe it fails.. but thats not bad i think.
download the file from: http://anime-com.info/themanaworld/athe ... 10-04.diff
save it to your "athena/src/" directory.
now, "cd" into your athena/src/ directory (using cygwin/linux). issue the command:
patch -p1 -u < tmw_athena.diff
recompile, and youre done. Don't forget to put the .txt files into a "data" folder, the new_zone01.map from TMW into a "maps" folder, and change your config.
here is a patched .tar.gz file including .txt's etc: (and a bit better structure of the athena files ~~) (will be offline when im offline)
http://ich.gotdns.com/download_tmw/eathena_tmw.tar.bz2
and, if somebody needs them, the tar.bz2'ed maps: (offline when im offline)
http://ich.gotdns.com/download_tmw/maps.tar.bz2
and, if somebody needs them, the tar.bz2'ed .txt files for the data-dir:
http://anime-com.info/themanaworld/athe ... ta.tar.bz2
Here a list of changed files and links to them:
map/atcommand.c
char/char.c
common/grfio.c
map/map.c
map/pc.c
wah ~~ such a long text for 2 little changes. xD
I also removed loading of the .grf files (hopefully this is not bad, i dont have the chance to test it .. the only thing i see, is that it loads successful). Instead, put the .txt files from an extracted data.grf into a directory called "data" in your athena folder. Configfile now is like that:
map:new_zone01.map
(change .gat to .map )
uhm.. i think thats it. ah, yes, i "cleaned" the structure of the package a bit.
note: the binarys are now "athena-login", "athena-char" and "athena-map" (to have them all at one place) - delete the old ones if you want to.
the .diff file is a patchfile to update the sourcecode of an existing eathena-installation. if you already have elvens changes added, maybe it fails.. but thats not bad i think.
download the file from: http://anime-com.info/themanaworld/athe ... 10-04.diff
save it to your "athena/src/" directory.
now, "cd" into your athena/src/ directory (using cygwin/linux). issue the command:
patch -p1 -u < tmw_athena.diff
recompile, and youre done. Don't forget to put the .txt files into a "data" folder, the new_zone01.map from TMW into a "maps" folder, and change your config.
here is a patched .tar.gz file including .txt's etc: (and a bit better structure of the athena files ~~) (will be offline when im offline)
http://ich.gotdns.com/download_tmw/eathena_tmw.tar.bz2
and, if somebody needs them, the tar.bz2'ed maps: (offline when im offline)
http://ich.gotdns.com/download_tmw/maps.tar.bz2
and, if somebody needs them, the tar.bz2'ed .txt files for the data-dir:
http://anime-com.info/themanaworld/athe ... ta.tar.bz2
Here a list of changed files and links to them:
map/atcommand.c
char/char.c
common/grfio.c
map/map.c
map/pc.c
wah ~~ such a long text for 2 little changes. xD
Last edited by jui-feng on 11 Jul 2004, 13:57, edited 1 time in total.
:> poor english i know ^^ hope you understood a half.. <:
________________________
asdf?!
come, lets talk with swords! omfg!
________________________
asdf?!
come, lets talk with swords! omfg!
- ElvenProgrammer
- Founder
- Posts: 2526
- Joined: 13 Apr 2004, 19:11
- Location: Italy
- Contact:
Weel currently TMW supports 2 map formats! One is for the client and is complete with all the infos about tiles, animations, and so on...
the other is used by the server and it has all essential infos so the server doesn't need a lot of memory -> Yeah basically is the one you suggetsed me on the forum but it's also the default map format someone can think whne developing this kind of games (this was my first map format 4-5 years ago)
the other is used by the server and it has all essential infos so the server doesn't need a lot of memory -> Yeah basically is the one you suggetsed me on the forum but it's also the default map format someone can think whne developing this kind of games (this was my first map format 4-5 years ago)
- ElvenProgrammer
- Founder
- Posts: 2526
- Joined: 13 Apr 2004, 19:11
- Location: Italy
- Contact:
Hey I was wondering if someone could please post the newest available tmw eathena server source that they are using and can successfully connect to with tmw. I tried the above stuff, but I am having issues. So if someone like jui or sull can just zip up their server directory and upload it here thatd be great. Please put it in the TMW directory. Thanks
ftp.vespersoft.net
user:u35665172tmw
pass:tmwdevs
ftp.vespersoft.net
user:u35665172tmw
pass:tmwdevs
Last edited by Genis on 06 Aug 2004, 21:40, edited 1 time in total.
Sorry...I only speak English
- ElvenProgrammer
- Founder
- Posts: 2526
- Joined: 13 Apr 2004, 19:11
- Location: Italy
- Contact: