Rare Witch Roundtable Podcast
Go Back   The Rare Witch Project Forums > Gaming > Rare & Playtonic > Homebrew Games and Tools

Homebrew Games and Tools If you've created a trainer, texture editor, or a full-blown fangame we'd like to see it here. Show off your mad programming skills.

Reply
 
Thread Tools
  #46  
Old 26th April 2009, 07:56 PM
cooliscool's Avatar
cooliscool cooliscool is offline
Dingpot
 
Join Date: Aug 2007
Location: SC, USA
Total Awards: 2
You're Appreciated! INFECTED - B1K1 
If you'd like some help, feel free to send me the source.
Reply With Quote


  #47  
Old 27th April 2009, 03:55 AM
mojobojo's Avatar
mojobojo mojobojo is offline
Dingpot
 
Join Date: Oct 2008
Location: Georgia
Total Awards: 1
INFECTED - B1K1 
Quote:
Originally Posted by cooliscool View Post
If you'd like some help, feel free to send me the source.
I will probably do that. I have got all of the major funtions down, but I could use another set of hands maybe for helping with errors or just improving the program. Do you have AIM?
Reply With Quote


  #48  
Old 27th April 2009, 04:32 AM
cooliscool's Avatar
cooliscool cooliscool is offline
Dingpot
 
Join Date: Aug 2007
Location: SC, USA
Total Awards: 2
You're Appreciated! INFECTED - B1K1 
cooliscoolio

I noticed that whatever it's doing is incredibly slow - much, much slower than such simple processing should take. I assume you're not storing data in RAM (a byte array), rather reading a filestream sequentially, which is very slow and contributes to HDD wear.
Reply With Quote


  #49  
Old 27th April 2009, 05:47 AM
mojobojo's Avatar
mojobojo mojobojo is offline
Dingpot
 
Join Date: Oct 2008
Location: Georgia
Total Awards: 1
INFECTED - B1K1 
Alright, take a look at it. Im still learning some C#. Could you also help me learn how to parse image formats. Im quite interested in it. For anyone else who wants to see the source too feel free to look.

Last edited by mojobojo; 26th May 2009 at 10:15 AM.
Reply With Quote


  #50  
Old 27th April 2009, 03:56 PM
dazy4's Avatar
dazy4 dazy4 is offline
Glowbo
 
Join Date: Apr 2009
PLEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEELS
i relly wont one so if you make one i will be so happy BUT IF YOU DON`T i will kill a small toy

ok im happy...
__________________
...SNSII?...:banjo
Reply With Quote


  #51  
Old 28th April 2009, 03:36 AM
runehero123's Avatar
runehero123 runehero123 is offline
DJ Jamjars
 
Join Date: Jan 2007
Location: Look behind you...
Total Awards: 1
INFECTED - B1K1 
I made a program that parses the talking head sprites. If that's something you're looking for, I could let you borrow the source.
Reply With Quote


  #52  
Old 28th April 2009, 11:28 AM
mojobojo's Avatar
mojobojo mojobojo is offline
Dingpot
 
Join Date: Oct 2008
Location: Georgia
Total Awards: 1
INFECTED - B1K1 
Quote:
Originally Posted by runehero123 View Post
I made a program that parses the talking head sprites. If that's something you're looking for, I could let you borrow the source.
I would like that. Im trying to learn stuff like this as much as I can. That way some day I could help out a little more with the rom modding community.

Last edited by mojobojo; 28th June 2009 at 04:51 AM.
Reply With Quote


  #53  
Old 14th May 2009, 04:52 AM
mojobojo's Avatar
mojobojo mojobojo is offline
Dingpot
 
Join Date: Oct 2008
Location: Georgia
Total Awards: 1
INFECTED - B1K1 
Good News. I fixed the file isolation problem. It now dose it in 7 seconds.

Here is what did it

Code:
DirectoryInfo dirinfo = new DirectoryInfo(fbd.SelectedPath);

                    FileInfo[] fi = dirinfo.GetFiles();

                    foreach (FileInfo fri in fi)
                    {
                        FileStream fs = new FileStream(fbd.SelectedPath + "\\" + fri.Name, FileMode.Open);
                        BinaryReader br = new BinaryReader(fs);

                        int identify = br.ReadInt16();
                        int confirm = br.ReadByte();

                        if (identify == 769 || identify == 257 && confirm != 255)
                            File.Copy(fbd.SelectedPath + "\\" + fri.Name, fbd2.SelectedPath + "\\" + fri.Name.Substring(0, 6) + ".bkt");

                        br.Close();
                        fs.Close();

                        Application.DoEvents();
                    }

Last edited by mojobojo; 6th August 2009 at 10:24 AM.
Reply With Quote


  #54  
Old 23rd May 2009, 12:57 AM
Teafed's Avatar
Teafed Teafed is offline
I'M A BIG WEE WEE HEAD!!!!
 
Join Date: May 2009
Location: California
Total Awards: 3
You're Appreciated! RWP Donator INFECTED - B1K1 
Make it. Please?
__________________
"We read our Holy Books, screw like bunnies, and play Banjo-Kazooie while listening to Political talk shows." ~ TwilightVestige
Reply With Quote


  #55  
Old 23rd May 2009, 03:00 AM
Breegullbeak's Avatar
Breegullbeak Breegullbeak is offline
Rare Witch Hero
 
Join Date: Apr 2009
Location: A Light House below a city
Total Awards: 10
You're Appreciated! Bashful Imagination Game On Reminiscence 
The last time I'tried this my computer got isolated. I am not trying this again until theres no chance of that occuring.
__________________
From where you're kneeling, it must seem like an 18-carat run of bad luck. Truth is... the game was rigged from the start -Benny
Reply With Quote


  #56  
Old 23rd May 2009, 03:31 AM
mojobojo's Avatar
mojobojo mojobojo is offline
Dingpot
 
Join Date: Oct 2008
Location: Georgia
Total Awards: 1
INFECTED - B1K1 
Quote:
Originally Posted by Breegullbeak View Post
The last time I'tried this my computer got isolated. I am not trying this again until theres no chance of that occuring.
There shouldnd be a chance of this happeneing now. I tried this on 4 different computers. The previous version used a loop witch counted up through a couple thousand numbers, wich in turn caused it to take alot of time. This new loop has no history of freezing computers and is alot faster.
Reply With Quote


  #57  
Old 6th August 2009, 09:47 AM
mojobojo's Avatar
mojobojo mojobojo is offline
Dingpot
 
Join Date: Oct 2008
Location: Georgia
Total Awards: 1
INFECTED - B1K1 
Sorry I havent updated in a while. I havent forgotten about the applicaion, just been busy with some other stuff. Im hoping some other coder/researcher could help me. I have this code right here. Because the text seems to be at random positions inside the file. I have needed a way of loading them. The current code works fine but dosent seem to be proper and could result in improper loading and editing. I am currently looking for some type of data pointer to guide the reader in the right poistion. I havent had any luck in it so far but maybe soomeone could help me. Id like to keep in touch maybe AIM or MSN.

Code:
banjoFile = new FileStream(filePath, FileMode.Open);
            
            for (int i = 0; i < banjoFile.Length; i++)
            {
                banjoFile.Position = i;

                int x = banjoFile.ReadByte();
                
                if (x > 10)
                {
                    dataBlockBox.Items.Add((i + 1).ToString("X2"));

                    while (banjoFile.ReadByte() > 9)
                    {
                        i++;
                    }
                }
            }
           banjoFile.Close();
To identify weather or not the file that contains text I read an INT16 (littleEndian) and if it come out as 769 or 257 and the byte after is either 0 or 2 the file is a file that contains the character text data.

To identify that when I do isoaltion I use this code to loop through and seperate the files.

Code:
DirectoryInfo dirinfo = new DirectoryInfo(fbd.SelectedPath);

                    FileInfo[] fi = dirinfo.GetFiles();

                    foreach (FileInfo fri in fi)
                    {
                        FileStream fs = new FileStream(fbd.SelectedPath + "\\" + fri.Name, FileMode.Open);
                        BinaryReader br = new BinaryReader(fs);

                        int identify = br.ReadInt16();
                        int confirm = br.ReadByte();

                        if (identify == 769 || identify == 257 && confirm < 3)
                            File.Copy(fbd.SelectedPath + "\\" + fri.Name, fbd2.SelectedPath + "\\" + Path.GetFileNameWithoutExtension(fri.Name) + ".bkt");

                        br.Close();
                        fs.Close();
                    }
That is all of my research so far, so if anybody can help me research that would be great.
AIM: The Mojobojo
MSN: mojobojo@live.com

FYI, I perfer AIM and Im on it more.


EDIT: I figured I'd release the latest build's source for curious people and people that want to help.

http://mojobojo.webs.com/Banjo%20Kaz...Editor_SRC.rar

Last edited by mojobojo; 6th August 2009 at 10:59 AM.
Reply With Quote


  #58  
Old 6th August 2009, 12:50 PM
Breegullbeak's Avatar
Breegullbeak Breegullbeak is offline
Rare Witch Hero
 
Join Date: Apr 2009
Location: A Light House below a city
Total Awards: 10
You're Appreciated! Bashful Imagination Game On Reminiscence 
Quote:
Originally Posted by mojobojo View Post
Sorry I havent updated in a while. I havent forgotten about the applicaion, just been busy with some other stuff. Im hoping some other coder/researcher could help me. I have this code right here. Because the text seems to be at random positions inside the file. I have needed a way of loading them. The current code works fine but dosent seem to be proper and could result in improper loading and editing. I am currently looking for some type of data pointer to guide the reader in the right poistion. I havent had any luck in it so far but maybe soomeone could help me. Id like to keep in touch maybe AIM or MSN.

Code:
banjoFile = new FileStream(filePath, FileMode.Open);
            
            for (int i = 0; i < banjoFile.Length; i++)
            {
                banjoFile.Position = i;

                int x = banjoFile.ReadByte();
                
                if (x > 10)
                {
                    dataBlockBox.Items.Add((i + 1).ToString("X2"));

                    while (banjoFile.ReadByte() > 9)
                    {
                        i++;
                    }
                }
            }
           banjoFile.Close();
To identify weather or not the file that contains text I read an INT16 (littleEndian) and if it come out as 769 or 257 and the byte after is either 0 or 2 the file is a file that contains the character text data.

To identify that when I do isoaltion I use this code to loop through and seperate the files.

Code:
DirectoryInfo dirinfo = new DirectoryInfo(fbd.SelectedPath);

                    FileInfo[] fi = dirinfo.GetFiles();

                    foreach (FileInfo fri in fi)
                    {
                        FileStream fs = new FileStream(fbd.SelectedPath + "\\" + fri.Name, FileMode.Open);
                        BinaryReader br = new BinaryReader(fs);

                        int identify = br.ReadInt16();
                        int confirm = br.ReadByte();

                        if (identify == 769 || identify == 257 && confirm < 3)
                            File.Copy(fbd.SelectedPath + "\\" + fri.Name, fbd2.SelectedPath + "\\" + Path.GetFileNameWithoutExtension(fri.Name) + ".bkt");

                        br.Close();
                        fs.Close();
                    }
That is all of my research so far, so if anybody can help me research that would be great.
AIM: The Mojobojo
MSN: mojobojo@live.com

FYI, I perfer AIM and Im on it more.


EDIT: I figured I'd release the latest build's source for curious people and people that want to help.

http://mojobojo.webs.com/Banjo%20Kaz...Editor_SRC.rar
Trying it out. Since then I've had better luck with isolating files.
__________________
From where you're kneeling, it must seem like an 18-carat run of bad luck. Truth is... the game was rigged from the start -Benny
Reply With Quote


  #59  
Old 8th August 2009, 07:07 AM
cooliscool's Avatar
cooliscool cooliscool is offline
Dingpot
 
Join Date: Aug 2007
Location: SC, USA
Total Awards: 2
You're Appreciated! INFECTED - B1K1 
Rewrote some of it, still not finished identifying the bytecodes. When I am I'll upload the whole source.

Code:
        
        public struct blocks
        {
            public ArrayList pos;
            public ArrayList len;
        }
        private byte[] dataBuffer;
        private blocks blockBuff;

        private void findBlocks()
        {
            blockBuff = new blocks();
            blockBuff.pos = new ArrayList();
            blockBuff.len = new ArrayList();
            int def = 0;
            for (int i = 0; i < dataBuffer.Length-2; i+=2)
            {
                if (dataBuffer[i] == 0) // dialogue
                {
                    switch (dataBuffer[i + 1])
                    {
                        case 0x2:
                        case 0x3:
                        case 0x4:
                        case 0x5:
                        case 0x6:
                        case 0x7: 
                            if (i + 8 < dataBuffer.Length)
                            {
                                switch (dataBuffer[i + 2])
                                {
                                    case 0x0:
                                    case 0x1:
                                        def = 6;

                                        break;

                                    case 0x2:
                                    case 0x6:
                                        def = 7;

                                        break;

                                    default:
                                        def = 4;

                                        break;

                                }
                                blockBuff.pos.Add(i + def);
                                blockBuff.len.Add((int)dataBuffer[i + def - 1]);
                                dataBlockBox.Items.Add("0x" + (i + def).ToString("X2"));
                            }
                            break;
                        default:
                            break;
                    }

                }
                else // questions and answers
                {
                    if (i + 10 < dataBuffer.Length)
                    {
                        switch (dataBuffer[i + 1])
                        {
                            case 0x80: 
                                blockBuff.pos.Add(i + 3);
                                blockBuff.len.Add((int)dataBuffer[i + 2]);
                                dataBlockBox.Items.Add("0x" + (i + 3).ToString("X2"));
                                break;
                            case 0x00: 
                                blockBuff.pos.Add(i + 4);
                                blockBuff.len.Add((int)dataBuffer[i + 3]);
                                dataBlockBox.Items.Add("0x" + (i + 4).ToString("X2"));
                                break;
                        }
                    }
                }
            }
        }

        private void readFromBlock()
        {
            try
            {
                int dataPosition = (int)blockBuff.pos[dataBlockBox.SelectedIndex] + (int)fineTune.Value;

                int textSize = (int)blockBuff.len[dataBlockBox.SelectedIndex];

                byte[] tempBlock = new byte[textSize];

                for (int i = 0; i < textSize; i++)
                {
                    
                    tempBlock[i] = dataBuffer[i + dataPosition];
                    
                }

                textBox1.Text = Encoding.ASCII.GetString(tempBlock);
            }
            catch
            { fineTune.Value = 0; }
        }
Reply With Quote


  #60  
Old 8th August 2009, 08:29 AM
mojobojo's Avatar
mojobojo mojobojo is offline
Dingpot
 
Join Date: Oct 2008
Location: Georgia
Total Awards: 1
INFECTED - B1K1 
Wow, thank you a WHOLE bunch. You have all types done or just some?

Last edited by mojobojo; 8th August 2009 at 08:51 AM.
Reply With Quote


Reply

Tags
banjo kazooie, text


User Tag List

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 06:43 AM.


Forums powered by vBulletin® Copyright © Jelsoft Enterprises Ltd.
Website © 2000-∞ The RWP