Home Gallery Resources The Team Rules chat Login Register
Pages:  1 ... 15 16 17 [18] 19 20 21 ... 28
Author Topic: Let's look into Module Fíles (.rel) - Defensive Collision is now!  (Read 168879 times)
0 Members and 1 Guest are viewing this topic.
Ultraxwing
Holy Kitten
*
Offline Offline

Posts: 1599


Master of the Vault!

  • Awards Constructive Hot Topic KCMM Veteran Heart Container

  • View Profile Awards
    « Reply #255 on: April 10, 2013, 12:37:08 AM »


    That's... just... amazing...

    progress is progress; that's amazing
    Logged


    DoctorFlux(Mariodk)
    Never Gonna Give You Up
    *
    Offline Offline

    Posts: 9387


  • Awards Infinite Smash Team Heart Container KCMM 2012 Awards Winner >9000

  • View Profile Awards
    « Reply #256 on: April 10, 2013, 12:48:33 AM »


    Well, well, what have we here?



    Now before the hype bandwagon gets kicked into high gear, there's a couple of things to note:


    This is a very unstable test - a lot of what you see in the screenshot is the result of heavy modification of the game while it was running. The game also crashes when you exit the match.

    Rob must be in the match to have the laser effect.

    It is possible to load up Mario's fireball effect in place of the laser effect; this results in an odd merge between both articles. Mario shoots out a projectile that travels horizontally like a laser, but has the speed, hit effect, and damage of a fireball.

    The laser was easy to copy into Mario's article bank because wnRobotLaser.ctor and ftRobotTransactor.instantiate_robot_laser are both stored as global functions in sora_melee due to Rob's laser being copyable by Kirby. Other articles are harder to replicate as their primary functions are stored inside the owner character's module file.




    However, progress is progress, so I thought I'd report on it here. Here's hoping we can use this to generate more sophisticated custom characters.
    is it now possible to port articles?
    like having olimar´s Pikmins over Ike´s sword(i know 2 ppl here on kc-mm needing that for a PSA)
    Logged

    I Dont Take Requests & Dont Do Brawl Mods anymore Maybe Sm4sh modz later

    pikazz
    Heroic Kitten
    **
    Offline Offline

    Posts: 2286


    Machinimator!

  • Awards Renowned Hacker Good Citizen Pin Collector Helping Hand

  • View Profile Awards
    « Reply #257 on: April 10, 2013, 08:04:07 AM »


    Well, well, what have we here?



    Now before the hype bandwagon gets kicked into high gear, there's a couple of things to note:


    This is a very unstable test - a lot of what you see in the screenshot is the result of heavy modification of the game while it was running. The game also crashes when you exit the match.

    Rob must be in the match to have the laser effect.

    It is possible to load up Mario's fireball effect in place of the laser effect; this results in an odd merge between both articles. Mario shoots out a projectile that travels horizontally like a laser, but has the speed, hit effect, and damage of a fireball.

    The laser was easy to copy into Mario's article bank because wnRobotLaser.ctor and ftRobotTransactor.instantiate_robot_laser are both stored as global functions in sora_melee due to Rob's laser being copyable by Kirby. Other articles are harder to replicate as their primary functions are stored inside the owner character's module file.




    However, progress is progress, so I thought I'd report on it here. Here's hoping we can use this to generate more sophisticated custom characters.

    okay! you just smash my head with a hammer! stop being so awesome and tell me what you did Im srs here

    well, dont stop being awesome and share some information of how you did! that might help alot!
    Logged

    Stupid Tinypic :C

    DarkPikachu
    Angel Kitten
    ***
    Offline Offline

    Posts: 3069


    complexity == fun

  • Awards Super Saiyan Topic Heart Container KCMM Veteran Tutorial Writer

  • View Profile Awards
    « Reply #258 on: April 10, 2013, 02:42:27 PM »


    well... I'm impressed Smiley
    didn't think we'd get so far so fast ^_^
    Logged


    Quote: Friedslick6
    you have been through a lot of hassle. I've watched every topic you posted on this, and most of them seemed to disintegrate gradually.
    But the coolest part was that you didn't stop working on it despite that.

    Quote: Internet Explorer
    you're doing more with your life right now than probably most other people around you. You're a valuable asset to the Smash community. So yeah, you should be proud.

    quote: Greg
    You do have a gift which I've seen many developers use to their advantage. You can become a great coder, and with all of those ideas I think you can really build something great.

    PhantomWings
    Mega Kitten
    *****
    Offline Offline

    Posts: 167

  • Awards Super Saiyan Topic Featured

  • View Profile Awards
    « Reply #259 on: April 11, 2013, 04:21:00 PM »


    okay! you just smash my head with a hammer! stop being so awesome and tell me what you did Im srs here

    well, dont stop being awesome and share some information of how you did! that might help alot!

    Well, the whole process was rather lengthily, but I'll try to break it down the best I can.

    It all starts in your target character's ctor function. For my case, I used ftMario.ctor. ftMario.ctor is located at file offset 0x13C. In one of my earlier posts I discussed how ftCharacter.ctor is responsible for creating the whole character memory object as well as all the module objects associated with it. In particular, we are interested in soGenerateArticleManageModuleImpl which is responsible for generating and manipulating character articles (characters without any articles will not implement this modules). Most ftCharacter.ctor functions generally take the same shape. This means that for most module files, the part of ftCharacter.ctor that calls soGenerateArticleManageModuleImpl.ctor is usually around file offset 0x850. As it turns out, the constructor call for Mario's article module is located at file offset 0x838. Following this call we find out that the soGenerateArticleManageModuleImpl.ctor function is located at file offset 0x5A74 inside ft_mario.rel

    Before I go into the soGenerateArticleManageModuleImpl.ctor function, I want to explain how the soGenerateArticleManageModuleImpl object is stored in memory. It is difficult to describe it using memory offsets, so I'll describe it as a basic C++ definition.

    Code:

    struct soGenerateArticleManageModuleImpl
    {
        soArrayVector<wnArticle *, N> (size: 0xC + N * 0x4)
        soArrayVector<wnArticleEventObserver, N> (size: 0xC + N * 0x10)

        struct soArticleMediatorImpl
        {
             soInstancePool<...>
             soInstancePoolSub<...>[N]
        }
    }


    It may not make a whole lot of sense as it's just a definition, but try to keep it in mind when reading about the constructor function.



    For Mario, the constructor function performs the following actions at the associated file offsets:

    0x5A94 soArrayVector<wnArticle *, 5>.ctor(this)
    0x5AA4 soArrayVector<wnArticleEventObserver, 5>.ctor(this + 0x20)
    0x5AB4 [this + 0x7C] = soArticleMediatorImpl.declaration
    0x5AA8 var soArticleMediator_ptr = this + 0x7C


    Notice that the offsets 0x20 and 0x7C are equal to the summed sizes of the previous elements. That is:

    0xC + 5 * 0x4 = 0x20
    0xC + 5 * 0x10 = 0x5C

    0x20 + 0x5C = 0x7C

    This is important as you must make sure all you objects are not overlapping with other objects in memory when it comes to adding your own articles.

    After these 3 base actions have been performed, there's two ways the function can go about creating articles. The first is the most basic; the constructor function does this starting at 0x5AC4:

    0x5AC0 var soInstancePool<...>_ptr = this + 0x84
    0x5ACC [this + 0x84] = soInstancePool<...>.declaration
    // [this + 0x84] == [soArticleMediator_ptr + 0x8]

    0x5AD8 [this + 0x88] = soInstancePoolSub<wnMarioHugeFlame, ...>.declaration
    // [this + 0x88] == [soInstancePool<...>_ptr + 0x4]

    0x5ADC var wnInstanceHolder<...>_ptr = soArticleMediator + 0xC
    0x5AE8 [this + 0x90] = wnInstanceHolder<wnMarioHugeFlame, ...>.declaration
    // [this + 0x90] == [wnInstanceHolder<...>_ptr + 0x00]

    0x5B2C ftDataProvider.get_wnMarioHugeFlame_.pac_data(character_id = 0)
    0x5B40 wnMarioHugeFlame.ctor(wnInstanceHolder<...>_ptr + 0x4, ...)

    That's probably a lot of information to take in there, but suffice it to say, those 7 primary instructions are responsible for creating the wnMarioHugeFlame object - Mario's Final Smash. Whenever you want to create an article that only appears as a single instance onscreen, then this is the structure that gets used. Besides the offsets and function references, the structure mostly stays the same.

    The second method for generating articles is used for articles that appear as multiple instances onscreen - such as Mario's fireballs. They get created starting at 0x5BBC:

    // update the soInstancePool declaration with a new one containing the articles we're going to add.
    0x5BC4 [this + 0x84] = soInstancePool<...>.declaration
    0x5AC0 var temp = this + 0x20000
    // [this + 0x84] == [soArticleMediator_ptr + 0x8]
    // temp is used due to limitations in PowerPC's adding capabilities

    0x5BD4 [temp - 0x5600] = soInstancePoolSub<wnMarioFireball, ...>.declaration
    0x5BD8 var soInstancePools_ptr = temp - 0x5FFC
    0x5BE4 [temp - 0x5FFC] = soInstancePoolSub<wnMarioFireball, ...>.declaration
    0x5BF0 [temp - 0x5FF8] = soInstancePoolSub<wnMarioFireball, ...>.declaration
    0x5C00 [temp - 0x5FF4] = soInstancePoolSub<wnMarioFireball, ...>.declaration
    0x5C0C [temp - 0x5FF0] = soInstancePoolSub<wnMarioFireball, ...>.declaration
    // These are written immediately following the previously created article.

    0x5C18 Create_wnMarioFireball_holder_and_article(soInstancePools + 0xC, ...)
    0x5C24 Create_wnMarioFireball_holder_and_article(soInstancePools + 0x1F54, ...)
    0x5C30 Create_wnMarioFireball_holder_and_article(soInstancePools + 0x3EA4, ...)
    0x5C3C Create_wnMarioFireball_holder_and_article(soInstancePools + 0x5DEC, ...)
    0x5C48 Create_wnMarioFireball_holder_and_article(temp + 0x2738, ...)
    // Once again, these offsets are immediately following the soInstancePoolSubs we just created.


    The Create_wnMarioFireball_holder_and_article is another function inside ft_mario.rel - it can be found at file offset 0x7AF4. The function does exactly what it says.



    So to summarize, the first method for creating articles has you updating the instance pool; creating the instance pool sub and instance holder; obtaining the .pac data; and creating the article all in the main function. The second method involves updating the instance pool, creating the instance pool subs and then calling the helper function to actually create the instance holder, obtain the .pac data, and create the article.



    When it came to me adding ROB's laser, I replaced Create_wnMarioFireball_holder_and_article's wnMarioFireball.ctor and ftDataProvider.get_wnMarioFireball_.pac_data calls with calls to wnRobotBeam.ctor and ftDataProvider.get_wnRobotBeam_.pac_data. This wasn't a problem because both articles are Kirby-Copy articles meaning these functions were stored in sora_melee. When replacing the get .pac data function, it is also necessary to change the id being passed to it (or you can leave Mario's get .pac data function and end up with a weird mixture of both of them like I mentioned above).

    I should also mention that the actual wnInstanceHolder and soInstancePoolSub declarations don't need to be changed as they are just primitive data structures that all have exactly the same shape and functionality.

    Additionally, I removed all but the first call to Create_wnMarioFireball_holder_and_article as wnRobotBeam is actually larger in size than wnMarioFireball and - like I said ealier - you can't have objects overlapping in memory (you can find the size of wnMarioFireball by subtracting the offsets that are passed to Create_wnMarioFireball_holder_and_article).

    Finally, I had to change the article count references and the call to ftMarioTransactor.instantiate_wnMarioFireball located inside soArticleMediatorImpl. If these count values weren't changed, then the game will crash by trying to access the other 4 article instances which I removed.

    I've listed the basic details on that in one of my earlier posts, but to find everything you'll need to know the function listing of soArticleMediatorImpl:

    Code:
    soArticleMediator : soArticleGenerator, soArticleOperator

    soArticleGenerator
    Method[0][0] Finalizer
    Method[0][1] GenerateArticle(r4=id, r5=soModuleAccessor)
    soArticleOperator
    Method[1][0] Method[0][0] Thunk
    Method[1][1] Method[1][8] Thunk
    Method[1][2] ClearInstances()
    Method[1][3] ClearInstances(r4=soModuleAccessor, r5=id)
    Method[1][4] GetInstanceCount(r4=soModuleAccessor, r5=id)
    Method[1][5] GetInstanceCap(r4=id)
    Method[1][6] GetArticleCount()
    Method[1][7] SetEnabled(r4=val)
    Method[1][8] PSA_Event_1001(r4=soModuleAccessor, r5=soArticle)




    A lot of this was trial and error and there isn't really a consistent way of finding everything. Even after doing all that, there were still a couple of bugs which I had to resolve using WiiRD - and I'm not even sure what exactly was causing it.

    Anyways, make of it what you will. Hopefully you'll be able to work something out with it. Like I said before: it's pretty complicated.


    ... Long post is long.
    « Last Edit: April 11, 2013, 04:22:55 PM by PhantomWings » Logged

    pikazz
    Heroic Kitten
    **
    Offline Offline

    Posts: 2286


    Machinimator!

  • Awards Renowned Hacker Good Citizen Pin Collector Helping Hand

  • View Profile Awards
    « Reply #260 on: April 11, 2013, 04:32:03 PM »


    [censored], I thought it was more information xD

    but that looks pretty easy when you describe it so I will try to make that aswell with fireball and robs laser! will also try to find something else to do like Lucas PKFreeze or Aura Sphere

    but thank you really much to put that giant information! it will really come in handy!
    « Last Edit: April 11, 2013, 04:35:28 PM by pikazz » Logged

    Stupid Tinypic :C

    KnightMario
    Holy Kitten
    *
    Offline Offline

    Posts: 1745


    Nobody Important

  • Awards Super Saiyan Topic Good Citizen Warm Welcomer Pin Collector

  • View Profile Awards
    « Reply #261 on: April 11, 2013, 04:32:38 PM »


    ...Whoa
    Mind... blown
    Logged

    I know for a fact that the vast majority of the public here cares more about free products than actual quality.
    I mean, we're kinda modding an old Wii game after like 6 years, instead of buying new stuff. That's pretty telling. Tongue

    PhantomWings
    Mega Kitten
    *****
    Offline Offline

    Posts: 167

  • Awards Super Saiyan Topic Featured

  • View Profile Awards
    « Reply #262 on: April 25, 2013, 10:23:17 PM »


    Well, Rob's laser has been successfully ported over to Mario. It turns out I forgot to change the calls for wnMarioFireball.dtor to wnRobotLaser.dtor. There's also an oddity in the instantiation function which seems to use Mario's FLUDD charge time (viewable in BrawlBox) as a bone index for where the laser should be generated. As Mario's model doesn't contain a Bone 90, the game was crashing whenever it tried to create one.

    Aside from that, Mario's Article1 parameters are now used as parameters for Rob's laser. The laser functions as it should including its ricochet behavior - however I still haven't found a way to allow Mario to aim it when shooting it. There is also a problem in that the laser uses Rob's laser effect meaning that if Rob isn't in the match, it will only appear a white polygon trail - I think BrawlBox's latest REFT editor should be able to fix that though.

    I've learned a lot about articles and their constructors from this experiment. For the most part, articles are constructed almost identically aside from a few minor tweaks to the resulting object. Another interesting thing to note is that articles are also constructed nearly identically to actual characters - meaning it may be possible sometime in the future to use a character as an article.


    I've also been experimenting a little bit with using menu_selchar.rel and menu_selchar_access.rel to implement the custom CSS code and include localized (and extendable) character color and icon options (think Brawl Masquerade) - but I think it would be better if I found a way to load a custom extension module file instead which all main game modifications can be pooled inside.




    Anyways, here's the Laser Mario files. Right now you can only shoot one laser at a time because I only made one instance holder for it. Adding multiple instance holders - while possible - would take a substantial amount of manual hex editing that's not really necessary for the sake of this experiment.

    I've also made a couple of cosmetic changes to the laser's behavior - that was mostly just for fun.

    Laser Mario
    « Last Edit: April 25, 2013, 10:26:12 PM by PhantomWings » Logged

    Ultraxwing
    Holy Kitten
    *
    Offline Offline

    Posts: 1599


    Master of the Vault!

  • Awards Constructive Hot Topic KCMM Veteran Heart Container

  • View Profile Awards
    « Reply #263 on: April 25, 2013, 11:17:01 PM »


    Characters that could be modules in themselves? only phantomwings. only you... could even concieve of such a thought...

    this little experiment was to situate how "articles" were loaded? so in essence if enough research is done we might be able to make our own fully functional original articles
    Logged


    pikazz
    Heroic Kitten
    **
    Offline Offline

    Posts: 2286


    Machinimator!

  • Awards Renowned Hacker Good Citizen Pin Collector Helping Hand

  • View Profile Awards
    « Reply #264 on: April 25, 2013, 11:19:45 PM »


    you sure are just simply amazing! but saying you are amazing are disrespectful!

    you are phantomtastic Im srs here

    I will look into your work to save notes, this is simply just amazing! that was a huge step for future articles!
    « Last Edit: April 25, 2013, 11:22:48 PM by pikazz » Logged

    Stupid Tinypic :C

    Eternal Yoshi
    Heroic Kitten
    **
    Offline Offline

    Posts: 2425


    Boss? Is that you?

  • Awards KCMM Old Timer Super Saiyan Topic Active Contributor Former PMDT

  • View Profile Awards
    « Reply #265 on: April 25, 2013, 11:20:00 PM »


    Excellent.

    Would you err.. be able to help me gather data on adding actions/subactions to articles safely?
    Or adding special action grabs to characters like Snake?

    My movesets kinda demand it at this point.
    Logged


    Ultraxwing
    Holy Kitten
    *
    Offline Offline

    Posts: 1599


    Master of the Vault!

  • Awards Constructive Hot Topic KCMM Veteran Heart Container

  • View Profile Awards
    « Reply #266 on: April 25, 2013, 11:25:16 PM »


    Excellent.

    Would you err.. be able to help me gather data on adding actions/subactions to articles safely?
    Or adding special action grabs to characters like Snake?

    My movesets kinda demand it at this point.

    haven't seen you in a while, which i guess might be the character that has tentacles. you had problems getting him to grab.

    this sounds interesting.

    i'm just awaiting the day of true perfect .rel ports or a decent clone engine, and Phantomwings mentioned external modifications of newer .RELS the game loads. plugins? i can't wait for what's in store
    Logged


    Carnage
    God Kitten
    *******
    Offline Offline

    Posts: 7551


    (retired)

  • Awards Constructive Super Saiyan Topic Heart Container Starstormer

  • View Profile Awards
    « Reply #267 on: April 26, 2013, 02:13:44 AM »


    Now we only need a tool that would let us port articles on to the chars fitchar.pac xD i would love to be able to port chars articles around.
    Logged


    Ultraxwing
    Holy Kitten
    *
    Offline Offline

    Posts: 1599


    Master of the Vault!

  • Awards Constructive Hot Topic KCMM Veteran Heart Container

  • View Profile Awards
    « Reply #268 on: April 26, 2013, 03:46:29 AM »


    Now we only need a tool that would let us port articles on to the chars fitchar.pac xD i would love to be able to port chars articles around.

    as though this would be super omg sexy. wouldn't Brawl Modding be easy? i mean i would like it to be easy so when i finally make one of the few hacks i have planned (after model updates =/) I mean wouldn't we be too busy getting used to the idea of just having articles rather than having unique work arounds like we've been doing. though making a character truly functional in every sense including reflectable projectiles and not so funky counters might be for the best.

    i can see problems, but the positives outweigh the negatives by a large margin.

    and again Thank you again Phantomwings you are our little Savior in this realm of modification
    Logged


    Moblin
    Mega Kitten
    *****
    Offline Offline

    Posts: 112


  • Awards Featured Active Contributor Diamond in the Rough Star Hacker

  • View Profile Awards
    « Reply #269 on: April 26, 2013, 09:19:20 AM »


    I've also been experimenting a little bit with using menu_selchar.rel and menu_selchar_access.rel to implement the custom CSS code and include localized (and extendable) character color and icon options (think Brawl Masquerade)
    I would pay money for this, no joke.
    Logged

    Pages:  1 ... 15 16 17 [18] 19 20 21 ... 28
    Print
    Jump to: