Server Development

Content and general development discussion, including maps, quests, and server code from the development team.
Post Reply
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: 13 Apr 2004, 20:11
Location: Italy
Contact:

Server Development

Post by ElvenProgrammer » 05 Jul 2004, 12:52

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
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: 13 Apr 2004, 20:11
Location: Italy
Contact:

Post by ElvenProgrammer » 10 Jul 2004, 13:36

Ok this is the first attemp on making athena read custom maps:

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;
}
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... :arrow:
jui-feng
Peon
Peon
Posts: 26
Joined: 09 Jun 2004, 16:37

Post by jui-feng » 10 Jul 2004, 21:46

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
Last edited by jui-feng on 11 Jul 2004, 14:57, edited 1 time in total.
:> poor english i know ^^ hope you understood a half.. <:

________________________
asdf?!
come, lets talk with swords! omfg!
Ardaen
Peon
Peon
Posts: 24
Joined: 01 Jul 2004, 19:51

Post by Ardaen » 10 Jul 2004, 22:23

So your map format is essencially the .gat format (as I documented on the eAthena forum for ya ;) ) without the extra 4 floats for the 3d stuff eh?

What about doodads and thingamagigs and stuff that make the map look all pretty like different tilesets and stuff... How is that all gonna be done?
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: 13 Apr 2004, 20:11
Location: Italy
Contact:

Post by ElvenProgrammer » 10 Jul 2004, 23:58

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)
Ardaen
Peon
Peon
Posts: 24
Joined: 01 Jul 2004, 19:51

Post by Ardaen » 11 Jul 2004, 05:52

Why redesign the wheel eh? it works best when round.

So you have to convert the maps to server format instead of the server just loading what it needs from the complex format?
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: 13 Apr 2004, 20:11
Location: Italy
Contact:

Post by ElvenProgrammer » 11 Jul 2004, 09:11

What do you mean? We're only trying to get rid of thoose RO copyrighted file formats so they won't bother us for using them! :?
User avatar
Genis
Peon
Peon
Posts: 82
Joined: 29 Apr 2004, 20:43
Contact:

Post by Genis » 06 Aug 2004, 21:57

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
Last edited by Genis on 06 Aug 2004, 22:40, edited 1 time in total.
Sorry...I only speak English
User avatar
Shura
Peon
Peon
Posts: 96
Joined: 15 Jun 2004, 02:36

Post by Shura » 06 Aug 2004, 22:32

the ftp account u posted doesn't seem to work. i get the 530 login incorrect error. ^^
Don't argue with idiots. They drag you down to their level and beat you with experience.
User avatar
Genis
Peon
Peon
Posts: 82
Joined: 29 Apr 2004, 20:43
Contact:

Post by Genis » 06 Aug 2004, 22:37

lol, my bad the pass is tmwdevs
Sorry...I only speak English
User avatar
Shura
Peon
Peon
Posts: 96
Joined: 15 Jun 2004, 02:36

Post by Shura » 07 Aug 2004, 06:51

umm.... unless admin/config.inc.php really is nothing important u should remove the info from the forum. ^^
Don't argue with idiots. They drag you down to their level and beat you with experience.
Guest

Post by Guest » 07 Aug 2004, 16:02

uhh, nothing, the whole site doesnt matter, but ill probably lock the account into tmw, but whatever
User avatar
ElvenProgrammer
TMW Adviser
TMW Adviser
Posts: 2526
Joined: 13 Apr 2004, 20:11
Location: Italy
Contact:

Post by ElvenProgrammer » 08 Aug 2004, 22:28

There should be a working copy of the server on the ftp server...
User avatar
Genis
Peon
Peon
Posts: 82
Joined: 29 Apr 2004, 20:43
Contact:

Post by Genis » 09 Aug 2004, 03:33

yea, like i said in irc though, it doesnt seem to work right for me, im gunna try compiling my own
Sorry...I only speak English
Post Reply