NavMesh, how do you handle MCIN menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    SwInY's Avatar Member
    Reputation
    29
    Join Date
    Jul 2009
    Posts
    97
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    NavMesh, how do you handle MCIN

    Hey Guys,

    Merry Xmas ALL!

    Been making Slow progression on my navigation system, bassed off old PPather (3.5) style source code for reading in all the mapchunks,
    im not using it to create a path, just to get Z value of a X Y,

    ok now i have overcome a fair few obsticles with this, from finding out you need to patch it, to finding out they split the files.
    now i have been stuck again trying to figure out why i cannot get a solid ground base

    ive been searching high and low, debugging my project trying to figure out why its always returning the wrong values,
    it was loading everything find exept for the ground.

    i tracked it back to this, and slowly found out the offset isnt working correct.

    whole function
    Code:
    private void ReadNewADT(string CurADT)
            {
                stream = System.IO.File.OpenRead(CurADT);
                file = new System.IO.BinaryReader(stream);
                bool done = false;
                do
                {
                    try
                    {
                        uint type = file.ReadUInt32();
                        uint size = file.ReadUInt32();
                        long curpos = file.BaseStream.Position;
    
    
                        if (type == ChunkReader.MVER)  // Original ADT
                            HandleMVER(size);
                        if (type == ChunkReader.MCIN)  // Doesnt Exist anymore but we need it
                            HandleMCIN(size);
                        else if (type == ChunkReader.MTEX) // Dont load this, will delete later.
                            HandleMTEX(size);
                        else if (type == ChunkReader.MMDX) // Obj
                            HandleMMDX(size);
                        else if (type == ChunkReader.MWMO) // OBJ
                            HandleMWMO(size);
                        else if (type == ChunkReader.MDDF) // OBJ
                            HandleMDDF(size);
                        else if (type == ChunkReader.MODF) // oBJ
                            HandleMODF(size);
                        else if (type == ChunkReader.MH2O) // Water Original
                            HandleMH2O(size);
                        else
                        {
                            //System.Logging.DebugLog("MapTile Unknown " + type);
                            //done = true; 
                        }
                        file.BaseStream.Seek(curpos + size, System.IO.SeekOrigin.Begin);
                    }
                    catch (System.IO.EndOfStreamException)
                    {
                        done = true;
                    }
                } while (!done);
    
    
                for (int j = 0; j < 16; j++)
                {
                    for (int i = 0; i < 16; i++)
                    {
                        int off = mcnk_offsets[j * 16 + i];
                        file.BaseStream.Seek(off, System.IO.SeekOrigin.Begin);
                        MapChunk chunk = new MapChunk();
                        ReadMapChunk(chunk);
    
                        Logging.DebugLog("Chunk " + i + " " + j + " at off " + off); 
    
                        if (LiquidDataChunk != null) //not null means an MH2O chunk was found
                        {
                            //set liquid info from the MH2O chunk since the old MCLQ is no more
                            chunk.haswater = (LiquidDataChunk[j * 16 + i].used & 1) == 1;
                            if (LiquidDataChunk[j * 16 + i].data1 != null)
                            {
                                chunk.water_height1 = LiquidDataChunk[j * 16 + i].data1.heightLevel1;
                                chunk.water_height2 = LiquidDataChunk[j * 16 + i].data1.heightLevel2;
                            }
    
                            //TODO: set height map and flags, very important
                            chunk.water_height = LiquidDataChunk[j * 16 + i].water_height;
                            chunk.water_flags = LiquidDataChunk[j * 16 + i].water_flags;
                        }
                        tile.chunks[j, i] = chunk;
                    }
                }
    
                //file.Close();
                //stream.Close();
            }
    int off = mcnk_offsets[j * 16 + i];
    My Issue now

    Code:
            int[] mcnk_offsets = new int[256];
            int[] mcnk_sizes = new int[256];
    
            private void HandleMCIN(uint size)
            {
                for (int i = 0; i < 256; i++)
                {
                    mcnk_offsets[i] = file.ReadInt32();
                    mcnk_sizes[i] = file.ReadInt32();
                    file.ReadInt32(); // crap
                    file.ReadInt32();// crap
                }
            }
    i was reading the WoW Dev Wiki only to find out that they have removed MCIN
    3.x to 4.x adt : schema. Most of the data inside the chunks seems to be close to identical to what it was before Cataclysm. MCIN is gone, and chunk sizes now have to be right.
    now the code above relys heavly on MCIN.


    so the question is,

    how is every one handling the change from MCIN to nothing ?
    how should i go by handling this change ?
    Last edited by SwInY; 12-25-2011 at 09:34 PM.

    NavMesh, how do you handle MCIN
  2. #2
    MaiN's Avatar Elite User
    Reputation
    335
    Join Date
    Sep 2006
    Posts
    1,047
    Thanks G/R
    0/10
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Each chunks are prefixed with a string with their names (this is how you find the MCIN chunk, for example). To identify chunks, just use this string (it's your ChunkReader.MXXX constants).
    [16:15:41] Cypher: caus the CPU is a dick
    [16:16:07] kynox: CPU is mad
    [16:16:15] Cypher: CPU is all like
    [16:16:16] Cypher: whatever, i do what i want

  3. #3
    SwInY's Avatar Member
    Reputation
    29
    Join Date
    Jul 2009
    Posts
    97
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey MaiN,

    thank you for replying.
    i do appreiciate your help but not really getting it,

    i was looking into other MXXX's for a while but im still not getting the concept of this whole change.

    please confirm im looking in the right spot, if not please guide me a bit further into the correct

    i started off in MCNK as each part is a chunk, knowing its 256 size, and has a header of all the stuff in it.
    but what you said completly threw me off the idea i was going by.

    but then i have been looking at MHDR chunk
    which contains MCIN* mcin;

    if its in that, how would i go by reading that, but it doesnt seem logical to be in that one? Does it ?



    Cataclysm - WoWDev

  4. #4
    matamore's Avatar Member
    Reputation
    6
    Join Date
    Dec 2008
    Posts
    13
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
                        bool done = false;
                        int mcnk_i = 0;
                        do
                        {
                            try
                            {
                                uint type = file.ReadUInt32();
                                uint size = file.ReadUInt32();
                                long curpos = file.BaseStream.Position;
    
                                if (type == ChunkReader.MVER)
                                {
                                    HandleMVER(file, size);
                                }
                                else if (type == ChunkReader.MCIN)
                                {
                                    HandleMCIN(file, size);
                                }
                                else if (type == ChunkReader.MTEX)
                                {
                                    HandleMTEX(file, size);
                                }
                                else if (type == ChunkReader.MMDX)
                                {
                                    HandleMMDX(file, size);
                                }
                                else if (type == ChunkReader.MWMO)
                                {
                                    HandleMWMO(file, size);
                                }
                                else if (type == ChunkReader.MDDF)
                                {
                                    HandleMDDF(file, size);
                                }
                                else if (type == ChunkReader.MODF)
                                {
                                    HandleMODF(file, size);
                                }
                                else if (type == ChunkReader.MH2O)
                                {
                                    HandleMH2O(file, size);
                                }
                                else if (type == ChunkReader.MCNK)
                                {
                                    //HandleMCNK(file, size);
                                    mcnk_offsets[mcnk_i] = (int)(curpos - 8);
                                    mcnk_i++;
                                }
                                else if (type == ChunkReader.MFBO)
                                {
                                    HandleMFBO(file, size);
                                }
                                else
                                {
                                    //System.Console.WriteLine("ChunkReader.MVER " + ChunkReader.MVER.ToString("x8"));
                                    //string str = Encoding.ASCII.GetString(BitConverter.GetBytes(type));
                                    //System.Console.WriteLine("MapTile Unknown " + str + " " + type.ToString("x8"));
                                    //done = true; 
                                }
                                if (type != ChunkReader.MCNK)
                                {
                                    string str = Encoding.ASCII.GetString(BitConverter.GetBytes(type));
                                    System.Console.WriteLine("MapTile " + str + " " + type.ToString("x8") + ", size: " + size);
                                }
                                file.BaseStream.Seek(curpos + size, System.IO.SeekOrigin.Begin);
                            }
                            catch (System.IO.EndOfStreamException)
                            {
                                done = true;
                            }
                        } while (!done);
    have a look at MCNK
    keep the
    Code:
    HandleMCIN(file, size);
    for backward compatibility

  5. #5
    SwInY's Avatar Member
    Reputation
    29
    Join Date
    Jul 2009
    Posts
    97
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    matamore,

    got it working
    rep ++

Similar Threads

  1. How would you handle this? (getting a sold account back)
    By BenjaminLinus in forum World of Warcraft General
    Replies: 6
    Last Post: 03-29-2009, 05:00 PM
  2. How'd you come up with your name?
    By idusy-org in forum Community Chat
    Replies: 233
    Last Post: 08-18-2007, 12:31 PM
  3. How do you find memory offsets in the game?
    By koalaz2004 in forum World of Warcraft General
    Replies: 0
    Last Post: 08-18-2006, 09:40 PM
  4. How do you change your IP adress
    By wicked_joe in forum Community Chat
    Replies: 4
    Last Post: 08-15-2006, 02:45 AM
  5. 10g/hour (Can be more, depends how long you want to spend)
    By Cush in forum World of Warcraft Guides
    Replies: 3
    Last Post: 05-20-2006, 08:41 PM
All times are GMT -5. The time now is 03:20 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search