Home Gallery Resources The Team Rules chat Login Register
Pages:  1 ... 23 24 25 [26] 27 28
Author Topic: Let's look into Module Fíles (.rel) - Defensive Collision is now!  (Read 203242 times)
0 Members and 1 Guest are viewing this topic.
BlueBrain
God Kitten
*******
Offline Offline

Posts: 8941


  • Awards Infinite Smash Team Super Saiyan Topic >9000 Heart Container

  • View Profile Awards
    « Reply #375 on: January 03, 2015, 12:34:09 PM »


    This might be dumb, but why 8 spheres for Lucario?
    to prove it's possible to edit the article's properties...
    Logged

    PhantomWings
    Mega Kitten
    *****
    Offline Offline

    Posts: 167

  • Awards Super Saiyan Topic Featured

  • View Profile Awards
    « Reply #376 on: January 03, 2015, 04:23:53 PM »


    This might be dumb, but why 8 spheres for Lucario?

    Mainly because 8 felt like a good number to me. The original request was actually only for 5.

    As for why its important: increasing the number of articles allowed on screen is by no means an easy feat. It's a lot more than just upping a number from 3 to 8 as each article needs to have memory allocated for it, and instance holder created for it, and a destructor call for that article for when the match ends. Moreover, all this needs to be added without disrupting the delicate memory organization of the existing systems already in place for the character.

    Moreover, this proves that it's not just possible to replace articles such as Mario's fireballs with Rob's laser, but it's also possible to add new articles. With this knowledge, it should be possible to develop articles for characters who don't normally have them. For example, it may become possible to give Marth the Cutter Kirby shockwave when he does his forward smash.

    Most of that's for the future though, as we still don't have enough control over the module files to make this sort of editing efficient.


    Wow! Thats great 8D Will test that out!

    Also, did you get My PM i sent to you?

    Hey Pikazz, it's good to see you still around here. I've been going through my backlog of messages, but I think I missed yours. I'll see if I can dig it up and get back to you on it.
    Logged

    Sammi Husky
    Lol Kitten
    *********
    Offline Offline

    Posts: 873


  • Awards Fiery Topic Renowned Hacker >9000 King for a Day

  • View Profile Awards
    « Reply #377 on: January 03, 2015, 06:14:53 PM »


    Hmm. This may be somewhat relevant to this thread, but now that I've programmed bbox to keep track of all branch commands, it's probably possible to do some magic and recalc hardcoded branch offsets when memory is added. This still doesn't fix some of the more intrinsically complex issues faced when editing modules, but it sure would make things easier.

    BBox is becoming more and more useful for module editing now that it displays methods, similar to Module Editor 2. And whats more, if you select a branch location, you can actually click a button to jump to the branch destination. And lastly, per Pikazz's request, I've implemented a way to see where branch offsets are without actually having one selected. Just like how a Relocation destination is painted with a red font, these are painted blue. It may also be worth noting that branch commands are painted with the background color purple.




    I mainly started these kinds of improvements to help with whatever i was doing at the time, which as of late has been with editing the item system...maybe to get some custom items loaded and working. I've not spent too too much time on it yet, but in my time messing around in dolphin (And thanks to some info from PW) I've found a few cool tidbits of information. Nothing notable to show yet, but i am starting to get a general picture as to how the items are generated. Unfortunately they are a bit more hardcoded than i had originally thought. No matter though, i never expected it to be easy Wink

    Anyways..this lucario deal is pretty amazing. Imma pop it open and see if i can find what you changed  Grin
    Logged

    pikazz
    Heroic Kitten
    **
    Offline Offline

    Posts: 2286


    Machinimator!

  • Awards Renowned Hacker Good Citizen Pin Collector Helping Hand

  • View Profile Awards
    « Reply #378 on: January 04, 2015, 03:25:24 AM »


    Hey Pikazz, it's good to see you still around here. I've been going through my backlog of messages, but I think I missed yours. I'll see if I can dig it up and get back to you on it.
    I just remembered that My PMs are kinda outdated and Old when i have got some new information so i Will update and send you one new PM this coming week

    Also, it shouldnt be that hard to give marth an article since he doesnt have Any, but it Would be really time-consuming without a completely module rebuilder to make sure all offsets and branchs are right. I though to give it a go once a module rebuilder exists

    Sammi: that awesome <3 now we can find all branches with ease!
    Logged

    Stupid Tinypic :C

    PhantomWings
    Mega Kitten
    *****
    Offline Offline

    Posts: 167

  • Awards Super Saiyan Topic Featured

  • View Profile Awards
    « Reply #379 on: January 11, 2015, 02:36:19 PM »


    Hmm. This may be somewhat relevant to this thread, but now that I've programmed bbox to keep track of all branch commands, it's probably possible to do some magic and recalc hardcoded branch offsets when memory is added. This still doesn't fix some of the more intrinsically complex issues faced when editing modules, but it sure would make things easier.

    BBox is becoming more and more useful for module editing now that it displays methods, similar to Module Editor 2. And whats more, if you select a branch location, you can actually click a button to jump to the branch destination. And lastly, per Pikazz's request, I've implemented a way to see where branch offsets are without actually having one selected. Just like how a Relocation destination is painted with a red font, these are painted blue. It may also be worth noting that branch commands are painted with the background color purple.




    I mainly started these kinds of improvements to help with whatever i was doing at the time, which as of late has been with editing the item system...maybe to get some custom items loaded and working. I've not spent too too much time on it yet, but in my time messing around in dolphin (And thanks to some info from PW) I've found a few cool tidbits of information. Nothing notable to show yet, but i am starting to get a general picture as to how the items are generated. Unfortunately they are a bit more hardcoded than i had originally thought. No matter though, i never expected it to be easy Wink

    Anyways..this lucario deal is pretty amazing. Imma pop it open and see if i can find what you changed  Grin


    That's awesome. I noticed that you guys are still using my old class crawler code from the Module Editor 2. I've since improved on it a bit.

    [Code Crawler Source.zip]

    I was originally trying to develop a code visualizer tool for the module files, but I haven't worked on it in ages. You'll probably get a lot more use out of it than me. The main part you'll probably want to salvage is the CodeCrawler class located in BrawlModule->ModuleTools->Crawler. This code crawler will establish symbolic links between all the classes, methods, and method tables in a module file. It also records all the method calls, loops, branches, and constant references inside each method. There's a small part in the CodeCrawler.cs that still needs work regarding the bctr instructions, but besides that, it's pretty complete. There's an example on how to use it in the Form1 code of the main project.

    You guys seem to have been doing a lot of work on the old code crawler too, so go ahead and use whichever one suits your needs best.



    Also, as a side note, I've updated the Lucario Aura Sphere Expansion pack with a ProjectM version of the same module.

    [Lucario Aura 8.zip]
    Logged

    pikazz
    Heroic Kitten
    **
    Offline Offline

    Posts: 2286


    Machinimator!

  • Awards Renowned Hacker Good Citizen Pin Collector Helping Hand

  • View Profile Awards
    « Reply #380 on: January 11, 2015, 03:39:39 PM »


    I sent you a new PM to you PW, I almost forgot about it!

    and awesome with the code crawler! 8D sadly its just source and not the program itself, I cant look D;
    Logged

    Stupid Tinypic :C

    Sammi Husky
    Lol Kitten
    *********
    Offline Offline

    Posts: 873


  • Awards Fiery Topic Renowned Hacker >9000 King for a Day

  • View Profile Awards
    « Reply #381 on: January 12, 2015, 03:44:04 AM »


    That's awesome. I noticed that you guys are still using my old class crawler code from the Module Editor 2. I've since improved on it a bit.

    I was originally trying to develop a code visualizer tool for the module files, but I haven't worked on it in ages. You'll probably get a lot more use out of it than me. The main part you'll probably want to salvage is the CodeCrawler class located in BrawlModule->ModuleTools->Crawler. This code crawler will establish symbolic links between all the classes, methods, and method tables in a module file. It also records all the method calls, loops, branches, and constant references inside each method. There's a small part in the CodeCrawler.cs that still needs work regarding the bctr instructions, but besides that, it's pretty complete. There's an example on how to use it in the Form1 code of the main project.

    Great stuff! Yea i restarted using the old crawler as of late, pending a rewrite to the way that BBox handles modules as a whole. This should definitely come in handy, so thanks a bunch!

    Pikazz, just wondering, but have you taken a look at the 8 aura sphere lucario that PW has uploaded? It's quite interesting. If i find anything that i can easily explain, i'll let you know over skype, but for now i was mainly asking because i just haven't had enough time to dig into it as much as i'd like to Tongue
    Logged

    pikazz
    Heroic Kitten
    **
    Offline Offline

    Posts: 2286


    Machinimator!

  • Awards Renowned Hacker Good Citizen Pin Collector Helping Hand

  • View Profile Awards
    « Reply #382 on: January 12, 2015, 05:44:11 PM »


    Great stuff! Yea i restarted using the old crawler as of late, pending a rewrite to the way that BBox handles modules as a whole. This should definitely come in handy, so thanks a bunch!

    Pikazz, just wondering, but have you taken a look at the 8 aura sphere lucario that PW has uploaded? It's quite interesting. If i find anything that i can easily explain, i'll let you know over skype, but for now i was mainly asking because i just haven't had enough time to dig into it as much as i'd like to Tongue
    I havent "yet" cause been quite busy with my own projects D: but still cant get enought with the mystery of the modules and its powers!

    also PW, are you getting my PMs? o:
    « Last Edit: January 12, 2015, 05:48:12 PM by pikazz » Logged

    Stupid Tinypic :C

    PhantomWings
    Mega Kitten
    *****
    Offline Offline

    Posts: 167

  • Awards Super Saiyan Topic Featured

  • View Profile Awards
    « Reply #383 on: January 12, 2015, 08:08:37 PM »


    I havent "yet" cause been quite busy with my own projects D: but still cant get enought with the mystery of the modules and its powers!

    also PW, are you getting my PMs? o:

    No worries, I've got them. Just give me a few minutes and I'll get back to you as soon as I can.
    Logged

    Mawootad
    Intermediate Kitten
    **
    Offline Offline

    Posts: 14

  • Awards Famous Hacker >9000

  • View Profile Awards
    « Reply #384 on: February 14, 2015, 08:57:29 AM »


    Hey PW, I've been looking over your Lucario 8 aura sphere module since I'm trying to up G&W's sausage count to 15 instead of 5.  You replaced a couple of (what I assume to be) target offsets in the main fighter constructor and destructor functions with some new offsets as well as modified the fixed offset accessor functions with a proper function that looks up the address via some well thought out multiplication and addition.  I'm not quite that clever/knowledgeable about module layouts though, and I was wondering if you'd be willing to go through the basic process you had for figuring out the numbers to use for replacing the constructor/destructor offsets as well as the multiplication/addition constants for accessing the new articles?
    Logged

    PhantomWings
    Mega Kitten
    *****
    Offline Offline

    Posts: 167

  • Awards Super Saiyan Topic Featured

  • View Profile Awards
    « Reply #385 on: February 24, 2015, 10:58:35 PM »


    Hey PW, I've been looking over your Lucario 8 aura sphere module since I'm trying to up G&W's sausage count to 15 instead of 5.  You replaced a couple of (what I assume to be) target offsets in the main fighter constructor and destructor functions with some new offsets as well as modified the fixed offset accessor functions with a proper function that looks up the address via some well thought out multiplication and addition.  I'm not quite that clever/knowledgeable about module layouts though, and I was wondering if you'd be willing to go through the basic process you had for figuring out the numbers to use for replacing the constructor/destructor offsets as well as the multiplication/addition constants for accessing the new articles?

    Hey Mawootad. It's good to hear that you're interested in this. You seem pretty dead set on figuring this out, so give me until this weekend and I'll see about compiling everything I know on the topic.


    By the way, Pikazz. I just realized that I still haven't replied to your messages yet.  Embarrassed  Give me until the weekend and I'll make sure I get back to you this time. Thanks for being so patient.
    Logged

    Sammi Husky
    Lol Kitten
    *********
    Offline Offline

    Posts: 873


  • Awards Fiery Topic Renowned Hacker >9000 King for a Day

  • View Profile Awards
    « Reply #386 on: February 25, 2015, 03:32:22 AM »


    Oh, hey Maw. Didn't know you ever posted around these parts. Tongue Im glad you brought that up, as i'm interested as well. (Also, Sorry i haven't been on Skype, i've been quite busy and don't have access to skype atm. Tell the rest of the Minus dudes for me if you get the chance.)

    Hey Mawootad. It's good to hear that you're interested in this. You seem pretty dead set on figuring this out, so give me until this weekend and I'll see about compiling everything I know on the topic.

    Good to see you PW! I did take a little time to look the Lucario module as well, but i haven't had too too much time lately. Just enough time to briefly go over the changes and some of the main logic. In any case! I'm always willing to learn something new Smiley That and anything related to articles is always quite interesting lol
    Logged

    pikazz
    Heroic Kitten
    **
    Offline Offline

    Posts: 2286


    Machinimator!

  • Awards Renowned Hacker Good Citizen Pin Collector Helping Hand

  • View Profile Awards
    « Reply #387 on: February 25, 2015, 10:13:22 AM »


    havent been looking into modules that much recently thanks by my other projects D:
    By the way, Pikazz. I just realized that I still haven't replied to your messages yet.  Embarrassed  Give me until the weekend and I'll make sure I get back to you this time. Thanks for being so patient.
    I did noticed that o: but I can wait :3 I am a patient person
    Logged

    Stupid Tinypic :C

    PhantomWings
    Mega Kitten
    *****
    Offline Offline

    Posts: 167

  • Awards Super Saiyan Topic Featured

  • View Profile Awards
    « Reply #388 on: February 28, 2015, 02:42:29 PM »


    More on adding articles:

    Our goal is fairly simple. In order to add more articles to a character, we need to expand the memory stored in the character's soGenerateArticleManageModule. Normally, this would be difficult as simply increasing its size would end up overwriting any module that comes after it. However, we can avoid this issue by adding additional memory to end of the character's allocated memory space and then moving the resized soGenerateArticleManageModule to the new space.



    The first step - increasing the character's allocated memory - is easy. The character's size is simply a constant stored in Method[0][2] of the character's ftClassInfoImpl:



    Here, the 0x8000C8B8 function call is equivalent to the C-style malloc call. The argument r3 specifies the size in bytes while the r4 argument specifies which heap to allocate the memory on. The highlighted instructions load r3 with 0x10548 - the size of the ftLucario object in memory.

    Next, we need to change the ftLucario constructor so that the soGenerateArticleManageModule is created in the new location. Immediately following the malloc call above, is the function call into the the ftLucario constructor. It takes a while to learn the layout of character constructors, but once you do, it becomes fairly easy to find the location where the different module constructors get called. In this case, Lucario's soGenerateArticleManageModule constructor gets called at section[1]+0x75C.



    Register r25 actually points to the soInstanceManagerFixedSimple shown in the top image. 0x5C24 is the offset inside of it where soGenerateArticleManageModule gets created. The function call with offset 0x8374 is the constructor for soGenerateArticleManageModule. Moving back up a ways, we can find out what value r25 gets set to:



    Here, r24 points to the beginning of the ftLucario object - the pointer we got back from our malloc call. The offset 0x194 is the position inside ftLucario where soInstanceManagerFixedSimple is stored. As a result, in order to move the soGenerateArticleManageModule to the end of the ftLucario memory, we need change the soGenerateArticleManageModule constructor offset value to:

    offset = <original ftLucario size> - <instance manager offset> = 0x103B4

    Or equivalently, at section[1]+0x75C we need to change

    addi r3, r25, 5C24

    to

    addis r3, r25, 0x0001
    addi r3, r3, 0x03B4

    This presents a problem as we now need to replace 1 assembly instruction with 2. However, this problem can be solved fairly easily using a hook function that performs the operations needed elsewhere. Looking at the 8 Aura Sphere module you can find an example of this procedure, but I'm not going to go into much more details on the topic besides that.

    Now that we have moved the soGenerateArticleManageModule, there are 3 other places where we need to change similar pointers so the new location can be properly accessed. Those 3 places are: the soModuleAccessor reference, the soGenerateArticleManageModule destructor, and the soGenerateArticleManageModule base destructor. The destructors are pretty easy to deal with as the game will crash very close to the point where they are called if their pointers aren't updated. From the crash, you can easily use the Dolphin debugger to trace back to where each pointer gets loaded.

    As for the soModuleAccessor pointer, it can be found in the ftLucario constructor as well.



    Note that the offset loaded here, (soInstanceManagerFixedSimple + 0xDC04) is not the same as the offset used to create the soGenerateArticleManageModule (soInstanceManagerFixedSimple + 0x5C24). This is because we are actually pointing at the soGenerateArticleManageModule base class which is stored inside the implemented version of the module. We aren't going to change this one yet, as the internal offset of the base class will change once we increase the size of the soGenerateArticleManageModule. However, if you did change this pointer - along with the other ones discussed so far, you could load this modified ftLucario.rel into the game and it would run perfectly fine with the new soGenerateArticleManageModule location.

    That being said, we are only half way done. We still need to increase the size of the soGenerateArticleManageModule, add new wnInstanceHolder objects to store the new articles, and refactor the soGenerateArticleManageModule's assembly to work with the new memory layout.

    Please stand by as I take a lunch break. We will resume later this evening

    « Last Edit: February 28, 2015, 02:50:48 PM by PhantomWings » Logged

    KingJigglypuff
    Meme Machine
    Brawl Vault Staff
    ****
    Offline Offline

    Posts: 7207


  • Awards RAGE!! >9000 Hyperactive Contributor Heart Container

  • View Profile Awards
    « Reply #389 on: February 28, 2015, 02:59:53 PM »




    So how are Article Floating Points handled?

    And a bit unrelated, but which part of the rel tells the character to use an animation for their DamageFace Sub Action? I'd like to get a character of mine to use a tail animation (like Charizard's tail and wings) when being thrown, but I just couldn't figure it out. So I'm assuming it's module-related.
    « Last Edit: February 28, 2015, 03:07:10 PM by KingJigglypuff » Logged

    I don't take requests.

    My PSA Thread

    Pages:  1 ... 23 24 25 [26] 27 28
    Print
    Jump to: