Writing a Program for loading Maps

Forum closed. All further discussion to be discussed at https://github.com/OpenKore/

Moderator: Moderators

Message
Author
KingXs
Noob
Noob
Posts: 5
Joined: 11 Jul 2008, 09:08
Noob?: Yes

Writing a Program for loading Maps

#1 Post by KingXs »

Hi

I wanted to know how to write a Program (in c++ or delphi) for loading a Map.
I'm using Opengl and got information about the File Formats of GND RSW and GAT.

But i realy don't know how preceed.
Is somebody willing to help me?

kali
OpenKore Monk
OpenKore Monk
Posts: 457
Joined: 04 Apr 2008, 10:10

Re: Writing a Program for loading Maps

#2 Post by kali »

Are you asking for help? or asking for someone to do your work for you?

Where is your own work anyway? Exactly what kind of help do you need? Have you first helped yourself before asking help from others? It would be nice if you can show us where you're going wrong so we can focus our help in straightening you out.
Got your topic trashed by a mod?

Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.

Have a nice day.

sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Re: Writing a Program for loading Maps

#3 Post by sli »

He's asking us to write it for him and let him take credit.
cs : ee : realist

Motivus
Developers
Developers
Posts: 157
Joined: 04 Apr 2008, 13:33
Noob?: Yes

Re: Writing a Program for loading Maps

#4 Post by Motivus »

eAthena forums have documentation on some of the formats.

GAT format can be found on the main openkore site in the developer section.

memcpy(fileHandle, yourStruct, sizeof(structType)) to load a structure from a file
Oh no.

KingXs
Noob
Noob
Posts: 5
Joined: 11 Jul 2008, 09:08
Noob?: Yes

Re: Writing a Program for loading Maps

#5 Post by KingXs »

no i don't want somebody to write me the code
i want someone to explain me if possible step by step how a map should be loaded

@sli

no need to be aggressive
i can't remember saying the words "Please write me a Map Loader"

sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Re: Writing a Program for loading Maps

#6 Post by sli »

I've seen a million people ask for help with a million lines of code and everyone who has had a question like yours has expected a giant code sample doing exactly what they want it to do. If you wanna know how to proceed, then first maybe you should learn C/C++ or Delphi, OpenGL or DirectX (or any 2D-capable rendering engine), and maybe MFC, GTK, wxWidgets, or something along those lines.
cs : ee : realist

Motivus
Developers
Developers
Posts: 157
Joined: 04 Apr 2008, 13:33
Noob?: Yes

Re: Writing a Program for loading Maps

#7 Post by Motivus »

Check http://forums.openkore.com/viewtopic.php?f=37&t=1808 that thread... but don't reuse that code because it is really bad and probably won't even compile due to me copy/pasting parts of it.

It also doesn't do what you want, but if you research the format and attempt to learn C++ it at least gives you an idea of what type of things you need to learn for the map loading part alone.
Oh no.

KingXs
Noob
Noob
Posts: 5
Joined: 11 Jul 2008, 09:08
Noob?: Yes

Re: Writing a Program for loading Maps

#8 Post by KingXs »

I got another Porblem

I can't read the Number of Textures
Everytime i try and change the numbers of bytes read out it won't change
although they say that i has to be at the offset 22 and a size of 4 integer bytes

i only get huge results like 3.000 millions in that way
sometimes i get -800 million

Code: Select all

// Count
	GND.seekg(18);
	buffer=new char[4];
	GND.read(buffer,4);
	curpos += 4;
	cout<<"Count : "<<*((int*)buffer)<<endl;
	delete buffer;

	curpos=26;

	//Textures
	for (int i=0;i<count;i++){
		GND.seekg(curpos);
		buffer=new char[40];
		GND.read(buffer,40);
		curpos += 80;
		cout<<"Bitmap : "<<buffer<<endl;
		delete buffer;
	}
i tried to get this information of the payon.gnd
i used me++ to compare my results with the editor ones
and the editor says it has to be 26 not 3000 million Oo

Motivus
Developers
Developers
Posts: 157
Joined: 04 Apr 2008, 13:33
Noob?: Yes

Re: Writing a Program for loading Maps

#9 Post by Motivus »

If it's at 22 why load from 18?

0x18 would be 24 in hex, just put 22 and load from that.
Oh no.

KingXs
Noob
Noob
Posts: 5
Joined: 11 Jul 2008, 09:08
Noob?: Yes

Re: Writing a Program for loading Maps

#10 Post by KingXs »

In the GND File of Payon for Example:

how do I know on which Cell has to be which Texture?

I don't realy know at what offset I can find the Texture position and Cell Position.
From here I can't realy understand what Offset they are kept.
What do they mean by
Lightmaps (Header + Texture + Unknown + Tiles Offset )
Tiles (Header + Texture + Unknown Offset )
Cubes (Header + Texture + Unknown + Tiles + Lightmaps Offset )
And what is the Difference here between Tile and Cell?

Locked