Golden Sun Hacking Community
13, April, 2021, 08:28:06 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: The last working version of the classic TLA Editor is Teawater's unofficial "mapeditor" draft.
 
  Home   Forum   DC Wiki Help Search Calendar Downloads Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Class Type code patch (Idea stage/no patch yet)  (Read 6855 times)
0 Members and 1 Guest are viewing this topic.
Daddy Poi's Oily Gorillas
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 1002
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2495

« on: 08, May, 2017, 01:11:36 AM »

So you know how you can never assign which PCs and which Items give you which class types?

Well, my initial thought a long time ago, was all about changing what the class type variable had in its contents....
However, recently, it has occurred to me there could be a better way.... (With a possible trade-off of pointing to free space.)
Do a separate table! (I mean, the Class Type Chart is used to calculate a class type, so why not do similar with PC/item?)
Imagine having a series of items that give you all the same classes, it would be a waste to make separate classes for each, wouldn't it?

And such a table may make it easier to expand on.... I imagine? (e.g. Like imagine having a certain class only on certain maps... like the Lighthouses and such, because of their elemental influence.... but that could require expanding on what's in the table in some way.)

Anyway, table formatting ideas: *Adds in some edits*

8-bit = Current class type
8-bit = New assigned class type
16-bit = PC (-1 for null)
16-bit = Equipped item (-1 or 0 for null.)
16-bit = Storybook Flag

Current class = new assigned class = 0 for end of list? BUT will need to see about direct class assignments... This could even end up being some type of byte code that says when to do the class type chart, even? With possible support to add a number (even different from +20) to the class type (aka: So it is not a trade off against Atrius's Class Separation Patch. Except where space is concerned.) A lot of that takes thinking, though...  so I'd like to keep it nice and simple and therefore might not go that far... and if added to the editor... and if it uses free space, it may be in the form of an Experimental feature/Use-at-your-own-risk feature. / As in no guarantee that your ROM will still work, especially depending on what happens in future editor versions.)

First entry that changes the class could also exit the list?  (Or something like that... I am not sure about everything, so ideas could be given from the Community... which is kind of the reasson why I am posting this right now instead of when the patch would be made... er.)


This should cover all the things GS1/GS2/GS3 do... except the wolf transformation. (e.g. Class: Wild Animal... unless there's an easy way to include those types as well. .. how your class is determined in that case, is based on the pc data... with the turn durations stuff. (Whether it is non-zero or not.)... and is not limited to just Sveta.)
« Last Edit: 08, May, 2017, 09:52:58 PM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)
View Profile
Rolina
The Fulminous Witch
Jupiter Clan

Template maker turned lurker

Alchemist
*

Coins: 3
Offline Offline

Gender: Female
I am: wondering if we can get our clan position changed...
Clan Position: Grand Overlady of Jupiter
Posts: 6049

« Reply #1 on: 08, May, 2017, 11:42:13 AM »

Have we been able to look up how DD handles transformation/overdrive classes yet?  Could help with finding a way to integrate it.
Logged

View Profile WWW
Daddy Poi's Oily Gorillas
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 1002
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2495

« Reply #2 on: 08, May, 2017, 06:36:19 PM »

The info I have on Dark Dawn:

02005074 = Function that does the actual class assigning after calling the function that finds the match. (Seems to set r3 to 0 or 1 based on a value in PC data... I tried changing the value in PC data un/equipping an item, and got "Wild Animal" class.
020051B8 = Find Class match function...

(Same Class Type chart stuff as before ... and then....)
if r6>0 , class_type=0x14 (r6 apparently comes from the function's argument r3 , so if "Wild Animal" is a transformation/overdrive class, then that's how it's done!)
else if class_type==7 and pc==5 , class_type=0x12
else if class_type==8 and pc==5 , class_type=0x13
else if class_type==2 and pc==6 , class_type=0xD
else if class_type==6 and pc==4 , class_type=0xE
else if pc==7 {
if class_type==1 , class_type=0x16
else if class_type==4 , class_type=0x17
}

class types 1,2,6,7 should be the pure element ones, so it is mainly class types 4 and 8 that change pattern from GS2, I guess?
I assume there are no item classes (not even unused ones?) ... despite item un/equipping refreshing one's class? - Although, if argument r2 was supposed to be an item for Item Classes, it is called with a constant of 0, and seems unused in the function.

Other than that, I'm not really sure how transformation/overdrive stuff works. (I suppose I can check out some video(s) if necessary, though...)


GS1: 080799B0 = find_matching_class(pc,pc_ram_addr) - (pc_ram_addr might be pcDjinnRamAddr?)
GS2: 080B0144 = find_matching_class(pc,pcDjinnRamAddr,item)
GS3: 020051B8 = find_matching_class(pc,pcDjinnRamAddr,item (unused and also not set / aka:0'd),transformation/overdrive flag)


--
Aahh! I forgot GS1 had a flag check along with Isaac/Garet check to assign class  0xC8 ("?")/0xC9 ("?")... and a Jenna check to assign class 0xCA ("Flame User"). (0xC8-0xCA classes and not class types!)
I assume Class Type 11 (0xB) means null... since those what those three classes use. (As in a way to keep any class type scanners from considering them as options...)
If I am going to want a universal patch for all three games, I mght as well figure out how to squeeze in a flag check.
(Was still thinking Transformation/Overdrive could be the exception... as far as GS1/GS2 is concerned. ...and that's just assuming if item classes can be easily added to GS1...)


Well... Class type may only need to be 8-bit if the class stored into pc ram is 8-bit... (For all three games).... so I can probably switch my table to that. Although, it really just depends on how I do it.
« Last Edit: 08, May, 2017, 10:17:29 PM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)
View Profile
Rolina
The Fulminous Witch
Jupiter Clan

Template maker turned lurker

Alchemist
*

Coins: 3
Offline Offline

Gender: Female
I am: wondering if we can get our clan position changed...
Clan Position: Grand Overlady of Jupiter
Posts: 6049

« Reply #3 on: 10, May, 2017, 12:14:25 AM »

Well, if it helps in your research, remember the arbitrary nature of its checks - iirc, only two class lines will scale with the class line.

Would you know how to create new flags for item classes?  Or is that limited to just the 3?
Logged

View Profile WWW
Daddy Poi's Oily Gorillas
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 1002
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2495

« Reply #4 on: 10, May, 2017, 02:44:08 AM »

Hm?
Quote

It goes like this:  Primary Secondary

 1 -  Venus Venus
 2 -  Mars Mars
 3 -  Venus Mercury , Mars Mercury
 4 -  Venus Mars , Mars Venus
 5 -  Venus Jupiter , Mars Jupiter
 6 -  Mercury Mercury
 7 -  Jupiter Jupiter
 8 -  Jupiter Venus , Mercury Venus
 9 -  Jupiter Mars , Mercury Mars
10 -  Jupiter Mercury , Mercury Jupiter
11 - (And below = Item Classes, etc.)
I think I didn't really pay attention before... but where an element is not listed by a class type, the adept of that element cannot even access it... ? As long as you don't modify starting levels... (Since the djinn are limited to 9 each, and your base level's 5.4. You need at least 12 djinn to make your base element become third place.... Maybe that is another piece of the puzzle to why there were 20 djinn slots per element. Sort of.)

So Venus / Mars each only get one class type they can access on the "Lunar" (Jupiter/Mercury) side... and vice versa... hm...  Secondary elements don't get access until 6 djinn of another element.... Hm.... Which is pretty much like saying "Keep Sol and Lunar separate until near end-game." ... However, even then the djinn reqs still divide the class types in half, sort of. I'm guessing the only time when Venus/Mars being priority matters for the same class type is in tri-classes for types 3 & 5, and everything with type 4... otherwise they could have been completely separated? (And similar with Jupiter/Mercury.))
But of course, such restrictions that would be lifted (e.g. changing the starting levels) would sort of imply a Class System overhaul....? ... Or maybe not. Since the level like tells how strongly elemental-aligned they are. (e.g. A base level of 9 or 10 would ensure that element stays primary.)

Flags for Item Classes? Not sure I understand? What "flags" are we referring to, since I don't remember any being required...
Also, 3? Pretty sure Salanewt created a simple patch for 5 item classes. (Takes up the unused item slots.)
---
Oh yes.... I forgot to mention my table idea here as well (edited): (Though I'm kinda considering it as maybe at least one way to do it/not 100% sure.)
Quote
My table idea is kinda like this:
8-bit = Command (Basically whether "Final class type" is absolute or relative. (aka: Class type = value ... or ... initial class type + value) .. But also here for any future purposes.
8-bit = PC flags
8-bit = Initial class type (Not needed for 'relative')
8-bit = Final class type
16-bit = Item
16-bit = Flag index (e.g. If an event happened or not)

At least in that case, it is 64-bits/entry. (Nice even spread) ... but is it fair enough... hm....
« Last Edit: 10, May, 2017, 07:26:44 PM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)
View Profile
Rolina
The Fulminous Witch
Jupiter Clan

Template maker turned lurker

Alchemist
*

Coins: 3
Offline Offline

Gender: Female
I am: wondering if we can get our clan position changed...
Clan Position: Grand Overlady of Jupiter
Posts: 6049

« Reply #5 on: 10, May, 2017, 11:42:59 AM »

???

Who are you replying to there in that first bit?

Anywho, as for item classes, how you do you actually assign a class to an item itself?  Saying it's a class changing item in the editor is well and good and all, but what designates what specific class it changes a character to?  If we make a new, fourth item class, how would we be able to designate the new item made for it to that fourth class?  Is there an upper limit on how many classes we can make?
« Last Edit: 10, May, 2017, 11:45:50 AM by Rolina » Logged

View Profile WWW
Salanewt
His Sexiness
Global Moderator

Oh yeah, baby!

Prodigy
*

Coins: 204
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4613

« Reply #6 on: 10, May, 2017, 03:15:38 PM »

Role: It's literally just a bit of code that goes "if item a is equipped, set class type to 15; if b, set to 16, if c, set to 17" where a-c are specific item IDs. This is also set up to overwrite any other class type that a character would use otherwise, and the minimum element counts are 0 in every element so you won't be shunted to the NPC class either.

I would imagine that you are limited to the number of class types that can exist, which depends on the size of the type value and whether it is signed or unsigned. I think it would be safe to say that it's unsigned, but I can't recall if it is read as a byte (limit of 255 types) or if it is larger. That being said, class IDs are read as a byte most of the time so our absolute maximum number of classes would be 255 without some pretty major changes to the game (even going above 243 would require some large changes), so a larger value for class type would be pointless unless you can rig the type chart to work differently.
Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW
Daddy Poi's Oily Gorillas
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 1002
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2495

« Reply #7 on: 10, May, 2017, 07:38:33 PM »

The first bit = That was just me thinking about class organization stuff.... if it ever helps come up with any other additional ideas..... Probably should have separated it better.

Since Class Type is like 32-bit. (I think).. in the class table... I'd say limits are definitely capped off elsewhere.
The limit is the number of classes  The byte in RAM for your class is 8-bit (The reason I wanted my table to have class type as an 8-bit, and also due to how unlikely you'd need more room.), but I suppose one could remove that and call this class finding function every time you need the class id. Then you would need to deal with the item limit (max 0x200(first=Nothing) with minor code edits/table repointing / and without changing the ram.) ...If one raised the item limit further, then your limits /could/ be based on ROM space available for items and classes.

@Salanewt: Exactly what Salanewt said = A simple "It is equipped check"... No additional ram needed. Although, the item type of the item might still need to be Underwear... I seem to recall something about that, but my memory is a bit hazy. However, it definitely makes sense for knowing what item to pass as an argument to the function. So yes.... - Now that makes me wonder what the Item Types in GS3 are. (If it is the same stuff or not.)
« Last Edit: 10, May, 2017, 08:08:07 PM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)
View Profile
Rolina
The Fulminous Witch
Jupiter Clan

Template maker turned lurker

Alchemist
*

Coins: 3
Offline Offline

Gender: Female
I am: wondering if we can get our clan position changed...
Clan Position: Grand Overlady of Jupiter
Posts: 6049

« Reply #8 on: 11, May, 2017, 02:12:12 AM »

Hmm... I've always been a large proponent of character separation for classes.  When you do the math, that's 31-32 classes per character, with 8 more dummy slots for organizational purposes.  We'll say 40 slots per character - *8 gives us 320 slots needed for full character separation.  Let's assume an extreme for item classes, and say that someone wants 8 item classes that overwrite a full class allotment - so we'll be generous and say 40 slots per item.  That gives us 640 slots for classes.

I think it's easy to say this would be more than enough for people to work with.  Gives room for more granular class approaches, as well as crazy experimentation with item class expansion, and likely still has a tiny bit of room left over.  Perhaps we could have the editor display up to slot 640 then?  I'd certainly be a fan of some reworked patches for party and character separation to be added to the editor as well...

@Squirtle:  Do we know how to make a 4th or 5th item class then?  How to tell the game "yo, this new item changes class when equipped to this class number"?
Logged

View Profile WWW
Daddy Poi's Oily Gorillas
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 1002
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2495

« Reply #9 on: 11, May, 2017, 05:43:14 AM »

Hmm... 320 and 640 are greater than 255 (8-bit)....
After thinking about it some... I wonder...
Quote
That being said, class IDs are read as a byte most of the time so our absolute maximum number of classes would be 255 without some pretty major changes to the game (even going above 243 would require some large changes)
-If we increase from 243+, we'll still need to make room in the text data. (I think all these references can be found by searching the number "00000B63".. since that's the text index for the very first class.... then... a person should be able to easily change everywhere that index appears to the bottom of the table (if they want to).... without need for any types of code changes outside of address/cap changes/moving the class table.... At least as far as I know....)
-If we increase to 256+, then we'd need to deal with the Class Index in the pc ram data. (For one, I assume that a work-around can be made in the function that calculates the class address? If not, then my Function Call locator can find every call to the function... and we must also note that there are only a few things in class tables... Class Type and Level reqs checked by class matching/class id calculation function... and it looks like the rest of them are pretty much... well... at the addresses listed below.)

Regardless of anything above, let's just get to the bulk of relevant data locations.... and where research and/or editing would be done....

(We already know of the class id calculation function... that uses class type and elemental levels, so I can skip that...)

(Reserved for the list of locations calling the function that calculates class address..)
080AD75E = For the stat multipliers
080AF508 = For the abilities
080B0720 = For the vulns
(That's all of them... calling the class address calculation (Aka: base_address + class_id  * entry_length , with min/max caps) function. = Yep, it is not a public function.)

(Reserved for the list of locations for the text indexes to be edited..)
0803B62C = Likely for the text command.
08043CCC = Continue/Erase/Battle/Save file menus.
08046B00 = Battle>Djinn menu
08048068 = Battle>Status menu
080F855C = Party Menus>Psynergy and Items menus
080FF79C = Party Menus>Status menu>Main
080FFCCC = Party Menus>Status menu>Psynergy
081024A0 = Party Menus>Djinn Menu>Main
0810363C = Party Menus>Djinn Menu>Standby/Trade menus

083FF4B3 = False-positive - Doesn't count.
That's all? Or did I miss anything?

(You're probably like... "How can we move the text if compression is too big of a problem to work with... and Teawater, your Editor doesn't exactly support easily moving groups of text around."... in which case I'd be like.... have you tried messing around with gstoolkit/uncompressed text/etc.)

By doing these things.... Atrius's Editor might probably lose /some/ support without changes..?  I think Atrius's Editor tries to grab the table addresses from the ROM's code. ... But I can't remember if Atrius's Editor has the classes text list index hard-coded/static or not.

@Salanewt: So can you kind of detail to me what exactly these large changes may be? (I think I get it some... but with thinking of my bullets above, I'm not sure-sure... I still need to think a little more about it, though. )


----
Quote
@Squirtle:  Do we know how to make a 4th or 5th item class then?  How to tell the game "yo, this new item changes class when equipped to this class number"?
Basically this?:
http://forum.goldensunhacking.net/index.php?action=downloads;sa=view;down=34

All you need to do is insert things like this: (If following his method.)

mov r1, 0xBC  r1 = 0xBC (Here is the item id you want to check for... but in two instructions. Since a mov command only goes from 0-255 (0xFF), you need to add another value to go further.)
add r1, 0xFF  r1 += 0xFF (0xBC + 0xFF = 0x1BB ... That is 443 in decimal, which is the item id for Mysterious Card.)
cmp r8, r1 (r8 is the Underwear item that you equipped, ... that is being compared to a specific item... Mysterious Card in this case. )
bne nextCheck if r8 (equipped item) != r1 (Mysterious Card), jump... Jump to next item check if your equipped underwear item is not a Mysterious Card. (As in this example.)
mov r6, 0xF Because if they are equal, we want to set the class type (r6) to a value of 0xF (15).
b postChecks (Jump to after all class type changing checks.)

nextCheck:

more checks here like the one above....

postChecks:

the class type scanning stuff...



He has all five item class checks done the same way... Not the most optimal in this case... since you can kind of do all five at once. :P even if the class-ids were different, you could still have a look-up table...
But the individually written out way... wel... it gets the job done... and helps others to have something to copy/paste to add more....  I hope that wasn't too confusing. :)


My patch idea... will most likely overwrite the same area his patch overwrites.... at least in the beginning, anyway....  for obvious reasons. (e.g.  You're going to be using one or the other, not both. :P)



----
And now to work on that patch?
r5 = Pointer to elemental levels data...
r6 = Class Type
r7 = Player Character
r8 = Equipped Underwear Item

Sounds like r0-r3 are free... But oh! It's not smart to use those and call functions without saving needed variables...


WIP:

ldr r4, tablePointer

label1:
ldrb r1. [r4, 0x0] //Command
cmp r1, 0xFF
beq exit

//PC check
ldrb r3, [r4, 0x1]
lsr r3, r3, r7
mov r2, 0x1
and r3, r2
cmp r3, 0x0
beq next

//Item check
ldrh r3, [r4, 0x4]
cmp r3, r8
bne next

//Event Check
ldrh r2, [r4, 0x6]
mov r1, 0xFF
lsl r1, r1, 0x8
add r1, 0xFF
cmp r2, r1
beq label2
bl 0x08016CE4 (Checks event flag)
cmp r0, 0x0
beq next

label2: //If all main checks passed...
ldrb r1, [r4, 0x0]
cmp r1, 0x0 //Class Type Check
bne label3
ldrb r2, [r4, 0x2]
cmp r2, r6
bne next
ldrb r6, [r4, 0x3]
b exit

label3:
ldrb r2, [r4, 0x3]
add r6, r6, r2
b exit

next:
add r4, 0x8
b label1
« Last Edit: 11, May, 2017, 11:56:56 AM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)
View Profile
Salanewt
His Sexiness
Global Moderator

Oh yeah, baby!

Prodigy
*

Coins: 204
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4613

« Reply #10 on: 11, May, 2017, 02:15:58 PM »

Role: Pretty much what Fox says; all it really takes is to tell the game to check for more item IDs and assign more classes, which is a very simple thing to do (and the aforementioned patch does just that if you are fine with having a five item limit).

Fox: It would still be a somewhat large overhaul given the number of things that would have to be changed or expanded for more classes to work, relatively speaking of course. Perhaps a number of the individual changes would be fairly small, but you still have to change or at least account for everything related to calculating class address (as you listed), text (which isn't too large), plus character RAM stuff and address calculation there. Which again, there isn't a whole lot there but everything that does need to be changed adds up to a large collection of changes.

I can't think of anything else that would need to be dealt with right now, aside from where to move the new class table and stuff. Plus, almost anything related to assembly is a large change to people who aren't too familiar with it. :p
Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW
Daddy Poi's Oily Gorillas
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 1002
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2495

« Reply #11 on: 11, May, 2017, 06:49:36 PM »

Mmkay... Was more or less thinking your wording was more implying towards a "it's too large that you're best off not even doing it.".... scenario. (Or at least, somewhere along those lines.) ... but was just wanting to make sure it wasn't....

~15 areas to edit (Those locations, and repointing the two tables.) sounds like a medium sized project to me, if the changes are relatively small in each area.... and can be done in a single day...  (At least for support up to class id 255.) ...

If we are to still to store the value in PC RAM (Instead of calculating directly each time...)
then wouldn't it be a good idea to just simply -1 to all those pc ram references? Since the byte before it does seem to be unused as of current for GS2. (And searching for all those addresses can PROBABLY still be done in a similar way I found the text id locations. (Pattern search?) ... If not, then we already have an idea of how many of them need editing.

Quote
02000B78 = ID in GS1, unused in GS2?
 02000B79 = Class

Oh yes, if there are any enemy areas I missed where class id is grabbed and/or set.... editing them may be optional. It's not like they're ever non-zero anyway. (And will continue to stay 0 even without editing them. I think.) - The only case in which they are not "optional" is if people want to add actual classes to them. (I assume by that time, there may be a bunch of other things the hacker may want to do as well... soo.... kinda expands the territory further than my point.)

^ As an experiment.... Maybe I look into making a "Patcher" for that later... (clean ROM assumed, but anyone can edit addresses.)... could probably be an open-sourced Console application... (Especially since to write python that I don't have prepared would take more time. e.g. I already have text decompression/compression in C#.).... but for now... I don't have any current plans to do so... so may or may not get around to it. But if I do go along with it eventually(Can't say), then I /might/ create a whole batch of these for other tables as well. Depends, though....

Speaking of de/compression... I get the feeling I should have made separate Console applications for them as well... Hmmm.... (So like.... replacing gstoolkit in its entirety... Except for some minor differences. Some which are better, like being faster, and being able to recompress.... I might have it just convert to raw binary, though...  and have other programs that encode/decode in the [ # ] ones for text editor purposes. But that's assuming if I decide to do any of this.
« Last Edit: 11, May, 2017, 09:13:09 PM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)
View Profile

Excellent Member
****

Coins: 20
Offline Offline

Gender: Male
Posts: 923

« Reply #12 on: 11, May, 2017, 08:58:34 PM »

The code is like squirtle said, but remember that items and classes are one after the another, which makes the code look like this:

if item = x
then class = y
else if item = x+1
then class = y+1
else if...

With this structure is very easy to make a much larger item/class range fit in the same space.

you just set a lowerbound and an upperbound for class changing item ID, and extract the matching class via difference from the lowerbound in a single "if then", without touching anything else.

My 2 cents.
Logged
View Profile
Daddy Poi's Oily Gorillas
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 1002
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2495

« Reply #13 on: 11, May, 2017, 09:26:34 PM »

It's still a bit long, though... Imagine:

mov r0, r8
mov r1, 0xBC
add r1, 0xFF
sub r0, r0, r1
cmp r0, 0x5
bpl nextCheck //greater than or equal, jump.... (Tried to pick an unsigned check, I hope I picked the right instruction.)
mov r6. 0xF
add r6, r0
b postChecks

I probably missed something, and it can be simplied further? But this goes into detail in Caledor's point of a single if-then... (That I did think about as well.)



Edit:
Quote
if item = x
then class_type = y
else if item = x+1
then class_type = y+1
else if...
Fixed! (Class type != class id , but not to worry, I make similar mistakes as well.)
« Last Edit: 11, May, 2017, 09:47:19 PM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)
View Profile

Excellent Member
****

Coins: 20
Offline Offline

Gender: Male
Posts: 923

« Reply #14 on: 11, May, 2017, 09:44:47 PM »

I haven't seen the code cause i don't know where it is, but shouldn't the original be longer?

In each 'if then' cycle you need (hypothetically) to:

set item id (at least 2 instructions cause it's bigger than 255)
cmp (1)
conditional branch (1)
set class id (1)
save class id (1)

that's 6*3= 18 instructions (16 if the other two just add+1 to idem id instead of recalculating from scratch)

while we need to:

set lowerbound (2)
set upperbound (1)
cmp lowerbound (1)
conditional branch (1)
cmp upperbound (1)
conditional branch (1)
subtract lowerbound from item id (1)
add to base class id (1)
save class id (1)

= 10 instructions

Again, this is all speculation, but it's what i expect to find based on what squirtle said.
Logged
View Profile
Daddy Poi's Oily Gorillas
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 1002
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2495

« Reply #15 on: 11, May, 2017, 10:32:47 PM »

Quote
I haven't seen the code cause i don't know where it is
To find the location, there are several ways...
- You could look at the data in the patch itself through a hex editor.
- You could open the patch in a program that shows the patch's data. (e.g. IPSelect)
- You could read the Download description for addresses. (He has them posted = Nice!) Listed this one last, because it's not always a guarantee to find address info in descriptions. Where-as the above will show you what is modified/where things are repointed to./etc.

Quote
but shouldn't the original be longer?
Yes... the original/written out one is longer... but is also easier to modify. (I think.) ...
More or less saying that the shorter version still looks complex... where-as sometimes shorter versions often are suppose to be simpler. (Or whatever it is I'm trying to say.)

.... and class-id is only set directly like that in GS1 prologue, but then GS1 is the only one with an event flag check as well.

Quote
= 10 instructions
Hmm... mine was about 9 instructions... actually, you could reduce it even further if the item classes were early in the table...
But anyway, I will say it is a tie.... in the end, the game's not about taking the least amount of space, but rather, to get something working efficiently. :)
« Last Edit: 11, May, 2017, 10:55:17 PM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)
View Profile

Excellent Member
****

Coins: 20
Offline Offline

Gender: Male
Posts: 923

« Reply #16 on: 12, May, 2017, 08:20:54 AM »

Quote
I haven't seen the code cause i don't know where it is
To find the location, there are several ways...
- You could look at the data in the patch itself through a hex editor.
- You could open the patch in a program that shows the patch's data. (e.g. IPSelect)
- You could read the Download description for addresses. (He has them posted = Nice!) Listed this one last, because it's not always a guarantee to find address info in descriptions. Where-as the above will show you what is modified/where things are repointed to./etc.

I know them all, i completely missed the old patch. Sorry :P
Logged
View Profile
Misery
Bad Luck

Great Member
***

Coins: 20
Offline Offline

Gender: Male
Clan Position: Mercury Hack Leader
Posts: 717

« Reply #17 on: 12, May, 2017, 11:56:38 AM »

Just so I'm understanding the idea in the OP (which I'm not sure I do), is the purpose basically to give more options for how to determine final class type by checking for more things? I get the impression it would be used to modify the class type value, or maybe even override/set it to something specific if certain conditions are met. Am I on the right track?

Anyway, for something else that has been brought up in this thread: getting more class slots to use. What complications would there be in reading the class data from different locations based on character number? For example, if PC number >= 4, use a second class data table, which could potentially double the amount of class slots available without having to rework the code to address numbers over 8 bits. Text string (class name) assignments have already been mentioned, but is that all?

(using this method, item classes should probably have a separate table as well, unless you want characters to get different classes from items)

Another idea to address the available slots issue that would be done on the editor (user) side rather than in code is to simply cut down on the amount of classes for each type. Instead of giving each class 5-6 stages with the same skill list just to have slightly different modifiers, they could have 1 or 2 stages and compensate for the lacking modifiers by making djinn give higher stat boosts.

I also think class data in GS could be stored much more efficiently. However, the work it would take to both change the code to read a different data format and to give it editor support... doesn't seem like it would be worth it, since I'm assuming there's more than enough free space scattered throughout the ROM to use the current format even for a large amount of classes (500+).
Logged
View Profile
Pages: [1]   Go Up
  Print  
 
Jump to:  

Chatbox
28, March, 2021, 06:10:33 PM
Salanewt: Tiny announcement down here that a new animation pack is now available for download! The Animation Overhaul is required; see the downloads page for more details.
03, March, 2021, 03:16:30 AM
Daddy Poi's Oily Gorillas: I'm happy ACE is possible and easy in GS1. :D Thank you Tret. Now if we can get GS2 Air's Rock to do ACE, wouldn't that be something.
18, February, 2021, 03:25:26 PM
Salanewt: The one here has everything: http://forum.goldensunhacking.net/index.php?action=downloads;sa=view;down=132
18, February, 2021, 02:03:20 PM
VardenSalad: It looks like Atrius' editor download is broken again. The only thing in the .zip is the background image
13, February, 2021, 03:15:41 PM
MaxiPower: Welcom back Charon. been a long time.
11, February, 2021, 09:40:04 PM
Daddy Poi's Oily GorillasSo how long is this site going to be "This website is still under construction, please excuse the mess." :D
04, February, 2021, 12:56:21 AM
charon the ferryman: LMAO i love 2010 tech
04, February, 2021, 12:56:07 AM
charon the ferryman: release me from my discord prison meme mortals
15, November, 2020, 03:45:26 PM
Salanewt: We're more alive than the board implies; most discussion takes place over on the Discord server.
15, November, 2020, 03:45:06 PM
Salanewt: Haha, heya!
15, November, 2020, 02:07:50 PM
Frog: Nice to see this place is still alive...ish anyway xD
30, October, 2020, 11:10:23 PM
Salanewt: ... Actually, it's almost time for me to post an update on the forum. It's been coming along really nicely overall, and it was only a couple months or so ago that I added some new status effects to the game.
30, October, 2020, 11:08:41 PM
Salanewt: I need to get it done to start making progress on the parts of the AI Overhaul I want to start working on.
30, October, 2020, 11:08:14 PM
Salanewt: It's going well! I wanted to get more of my djinn reform done this week but I've been busy with other things sadly.
30, October, 2020, 09:58:14 PM
KyleRunner: Hi guys! How are you doing?
13, October, 2020, 11:19:21 AM
MaxiPower: first chapter of my golden sun inspired webtoon is now live. be cool if yas could check it out. https://www.webtoons.com/en/challenge/legacy-of-the-lost-dragoon/the-northern-reaches/viewer?title_no=508487&episode_no=6
31, August, 2020, 08:40:32 AM
Daddy Poi's Oily Gorillas: Being able to convert IPS files to text files to also supporting commenting, and convert back to IPS after changes.... sounds like a fun strategy? 
27, August, 2020, 10:37:30 PM
Salanewt: Hey, thanks! 
25, August, 2020, 12:59:22 AM
Foreclosure: Yo! Looking forward for this AI OVerhaul patch when it's finished :) :) 
19, August, 2020, 07:00:17 PM
Salanewt: That's awesome! I'm pretty good; been working on an AI Overhaul project and have made some nice progress in the past couple weeks; the goal for tonight is to add Deadbeard to GS2 and then I can move onto something new.
19, August, 2020, 01:14:56 PM
Awec: Ye not bad, just checked back in for updates on GS Reloaded really. Although now I'm looking back through some of my old forum posts, which is fun :D how are you?
19, August, 2020, 01:43:07 AM
Salanewt: It sure is! How have you been?
16, August, 2020, 09:40:57 AM
Awec: Yo nice to see this forum is still going
14, August, 2020, 09:06:44 PM
Salanewt: Hey! How goes it?
01, August, 2020, 01:31:53 PM
KyleRunner: Hello, people!
08, July, 2020, 08:57:11 PM
Salanewt: That awkward feeling when almost a quarter of a year goes by without anyone posting a message in this chatbox.
27, April, 2020, 07:54:10 PM
Daddy Poi's Oily Gorillas: I'm having a thought. So I know Atrius's editor is slow at saving sprites.... So I've been thinking.   I am considering another console program.  This time, for importing and exporting sprites/animations. Image files (for sprites), binary files (for animation data), and maybe binary or text files for Settings. Would certainly be cool if it works out. - Console programs are fun, when you can (at least temporarily) cheat out making a full interface editor for them. =P
25, April, 2020, 10:42:07 PM
Daddy Poi's Oily Gorillas: Tried to list those in order of importance, but anyway....
25, April, 2020, 10:37:59 PM
Daddy Poi's Oily Gorillas: GSHC, GS Speedrunning, /r/Golden Sun, GS United Nations, ToK.  Sixth one is border-line I'm not sure.
25, April, 2020, 08:00:21 PM
Daddy Poi's Oily Gorillas: (low as in <100)

Affiliates
Temple of Kraden Golden Sunrise
Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.1 seconds with 22 queries.