Golden Sun Hacking Community

Golden Sun Resources => Misc. GS Hacking => Topic started by: Caledor on 25, April, 2017, 05:39:08 PM

Title: Minor graphical issues and improvements
Post by: Caledor on 25, April, 2017, 05:39:08 PM
Hello guys

This is about the minor graphic issue i told earlier today in the chatbox.

As you can see in the first image there are text spillover issues in the character stat box (class line) cause the box isn't symmetrical around the arrow: the first class always fits but the arrow takes a character's space from the second one.

What i want to do: increase the width of the character's box by one character, and while i'm at it, reorganize the other box as well to make the whole thing look even better.

Also, by comparing the "1" and "3" pics you can notice that the djinn icon is not aligned to the box at its right like the psynergy menu one is (as well as the others from ALL other menus).

From a superficial first look I managed to tweak the djinn box (pic 2) but i couldn't find the values for the other box nor the ones for the djinn icon.

The function i studied starts at 0804868C (= Djinn menu), the values i edited to tweak the djinn box are at 080486F4, reduced the first 2 movs by 1 byte and increased the next 2 by one. The pics show my work on the italian version but the addresses here are about the ENG one.

So... does anybody want to investigate this thing with me? :P
Title: Re: Djinn menu boxes and spillover text
Post by: Salanewt on 25, April, 2017, 06:40:15 PM
Well, for the djinn icon it looks like they moved it over a bit to fit the "[R]: Psynergy Gained" text line in the other window for the English translation, but with your planned changes it could probably be lined up with the other window and not be an issue now.

I can take a quick look soon, there's a pretty good chance that one or both of those things are handled in their own functions. 
Title: Re: Djinn menu boxes and spillover text
Post by: Caledor on 26, April, 2017, 02:16:04 AM
Quick update: I found the other box coords, width and height. They're at 08046518.

I also want to rearrange better the stats so i found the current stats (before the up or down arrow) x pos, starting at 08046654.

Now all that's left to find is the djinn menu icon position, the up down arrow x coord and the stat after the djinn change (after the arrow) x pos. Will look later today.

Edit: found the arrow coord and the new stat x pos too! All that's left is the djinn menu icon position!
Image attached. it's starting to look good!
Title: Re: Djinn menu boxes and spillover text
Post by: Daddy Poi's Oily Gorillas on 26, April, 2017, 06:17:41 AM
@Djinn icon

02035E1C = Battle menu RAM
02035E20 = Should be where the icon's coords are... (etc.)

0804C19C = Y (8-bit)

0804C7BC = X (9-bit)

Well, the final values, anyway. (They are set to 0,0, and then x to 0x80(? Based on SDL-H) or 0x60 (Based on what I quickly looked at in Disassembler.)... or whatever (Only through brief viewing... so didn't figure out what was going on.) ... etc. before being assigned their final value, it seems....)
Title: Re: Djinn menu boxes and spillover text
Post by: Caledor on 26, April, 2017, 06:35:05 AM
Thanks Fox!

I'll edit this post later to show the final result.

Edit: Pics attached! I can't quite decide between v1 and v2 so tell me which one you guys like more.
Title: Re: Djinn menu boxes and spillover text
Post by: Daddy Poi's Oily Gorillas on 26, April, 2017, 07:22:55 AM
Looking good! Good job...


@V1/V2: That may be a hard pick..... but I vote V2.


--
You are welcome!
Title: Re: Djinn menu boxes and spillover text
Post by: Salanewt on 26, April, 2017, 10:51:27 AM
I remember having a similar discussion with some of the others a few years ago about the character naming/pre-text crawl screens. I'm more inclined to vote for V1 but with the box height reduced so it's even with the stat window, because it looks weird having that tiny bit of open space being surrounded by boxes. The downside is the icon placement.

Now I'm wondering how it would look if you could fit six djinn entries per window instead of five.
Title: Re: Djinn menu boxes and spillover text
Post by: Caledor on 26, April, 2017, 11:24:10 AM
Quote from: Lord Squirtle on 26, April, 2017, 10:51:27 AM
I'm more inclined to vote for V1 but with the box height reduced so it's even with the stat window

So basically v2's box moved up by one. I briefly considered that but then i thought it'd be the only menu that doesn't start at the bottom of the screen.

QuoteNow I'm wondering how it would look if you could fit six djinn entries per window instead of five.
We have to reduce the space between lines for that to happen, and i honestly have no clue. And I already think i kinda lucked out by finding almost everything so easily with this one lol :P
Title: Re: Djinn menu boxes and spillover text
Post by: Salanewt on 26, April, 2017, 12:23:40 PM
Lol, makes sense. I'm actually really curious about the line spacing myself, so I'm taking a quick look right now because I'm stumped on the Intellect buff text bugs and want to take a break from that. Nothing yet but I somehow managed to let characters use djinn that they don't have!
Title: Re: Djinn menu boxes and spillover text
Post by: Daddy Poi's Oily Gorillas on 26, April, 2017, 05:39:07 PM
If you can make six spaces, I'd be interested in knowing if seven slots can be done simply because that's how many each PC has in GS1. So yes, if it is doable, I see a possible patch in your near future?
Title: Re: Djinn menu boxes and spillover text
Post by: Salanewt on 26, April, 2017, 05:44:27 PM
Well, this is what I have so far:

(http://i.imgur.com/auWVb2S.png)
Torch for reference.



I still need to figure out exactly where line spacing happens of course. Based on what I have done so far 7 should be doable at the very least, although I can't say for sure if it will look good or not.

Edit: Actually, I might even be able to fit 10 in here...
Title: Re: Djinn menu boxes and spillover text
Post by: Caledor on 27, April, 2017, 12:17:20 PM
I was thinking... since I'm already at it I might as well fix the item box as well.

The in battle box for the item menu is smaller than the one shown in the field menu and places a constraint on name length for items.

I've already found all the values i need but one: the coords, width and height for the box that contains the item you're trying to use. See image attached for reference.

Do you guys know where those values are?
Title: Re: Djinn menu boxes and spillover text
Post by: Daddy Poi's Oily Gorillas on 27, April, 2017, 01:09:25 PM
The panel call at 0804CA98?
createPanel(x=9,y=17,width=16,height=3,flags=0x6)

(P.S. Found it quickly by using SDL-H, and setting a breakpoint on the 08039260 function...)
Title: Re: Djinn menu boxes and spillover text
Post by: Caledor on 27, April, 2017, 02:11:39 PM
Thanks again Fox!

PS. You know... I really don't like using SDL-H... I don't have the saves there and i always feel like it takes me forever to find something. Still, you gave me a very nice tip that i immediately used to find the psynergy menu version of the box i asked you.

I realized that i can do the same in standard VBA since i've been using a trick to replicate a breakpoint for as long as i can remember. Don't know why it didn't occur to me before :P
Title: Re: Djinn menu boxes and spillover text
Post by: Daddy Poi's Oily Gorillas on 27, April, 2017, 02:38:17 PM
If I recall, I think .sav files work fine.... but there can be incompatibilities with savestates....(If saving from normal VBA and loading through SDL-H.)

You could also try using no$gba debugger as another alternative. (Which is probably easier to use.) In scenarios where it doesn't work, it can be worth making sure you have the bios files. There's a wonderful paradise where those are at. *hint*hint* if you ever need them.

Trick? Let me guessing? Something with having an unconditional branch point to itself? I don't do that myself, but sounds like a neat idea!
Sometimes just looking in the stack for pointers is enough....
Title: Re: Djinn menu boxes and spillover text
Post by: Caledor on 27, April, 2017, 03:32:24 PM
Quote from: Fox on 27, April, 2017, 02:38:17 PM
Trick? Let me guessing? Something with having an unconditional branch point to itself?

Yep lol. Write DEFE in the memory viewer and you have a breakpoint. The rest is probably the same as you did, one look at the link registry and i found the panel call.

I always used this trick when i needed to test the functions i changed.
Title: Re: Djinn menu boxes and spillover text
Post by: Daddy Poi's Oily Gorillas on 27, April, 2017, 04:33:48 PM
Okay. Cool. And yeah, I check what is in r14/lr.

Problem though.... Even when you do use that method.... you don't always see the results you want. (Sometimes you do, and then you don't..... it's like the register values can still change... )

It seems to be correct when on mode 0x1F, but I sometimes see mode 0x1B ... (I assume each of the major modes have their own pc/program counter address... (As well as other registers / kinda been knowing something like that-ish, but wasn't really sure how that all worked out.... outside of what I saw as the boot code stuff.)... and that's why.
Title: Re: Djinn menu boxes and spillover text
Post by: Caledor on 27, April, 2017, 04:38:50 PM
Quote from: Fox on 27, April, 2017, 04:33:48 PM
Okay. Cool. And yeah, I check what is in r14/lr.

Problem though.... Even when you do use that method.... you don't always see the results you want. (Sometimes you do, and then you don't..... it's like the register values can still change... )

Don't know much about modes but i know that when i break that way and go to the disassembler, sometimes the instructions are in the 03xxxxxx range and sometimes in the 00/08xxxxxx range (might actually be this lol) If by pressing next i see the 03 range i click the emulator and try again. if i'm in the 00/08 range i hit next till i return to the breakpoint: this way i'm positive that the registries contains the values i'm looking for.

BTW, everything's done for English TLA: Djinn menu, Item menu and selected item panels are larger; moreover, all selected command/item/psy/summon panels are now centered (as much as possible). I'll release a separate patch for this soon.
Title: Re: Djinn menu boxes and spillover text
Post by: Daddy Poi's Oily Gorillas on 27, April, 2017, 04:50:47 PM
Just looked again... Oh wait... mode 0x1F does the 03 section too... probably Interrupts (whatever that is?), but I will have to check to make sure.
(I think Mode 0x1B was in the BIOS section? - But then, that is just from quick testing, so....)

And awesome! Sounds like a plan.
Title: Re: Djinn menu boxes and spillover text
Post by: Caledor on 27, April, 2017, 05:45:04 PM
Patch for TLA is up!
Title: Re: Djinn menu boxes and spillover text
Post by: Caledor on 29, April, 2017, 06:00:13 AM
Spotted another menu discrepancy between GS and TLA.

Does anybody know how the light blue effect behind the selected item's name is generated? Is there a function call for it?
Title: Re: Djinn menu boxes and spillover text
Post by: Daddy Poi's Oily Gorillas on 29, April, 2017, 08:03:43 AM
081000A8 = Width of light blue effect

08100024 = Width of the darker blue effect (when clearing the light blue box.)
Title: Re: Djinn menu boxes and spillover text
Post by: Caledor on 29, April, 2017, 10:03:20 AM
Done!

It took me a few minutes to figure out that every line had its own parameters (+ the code used branches to avoid some redundancy) but I did it. Thanks again Fox!
Title: Re: Minor graphical issues and improvements
Post by: Caledor on 14, May, 2017, 04:22:11 PM
I changed the title to make this one a multi-purpose thread where one can report minor graphical issues and or suggest improvements (that maybe someone will fix/implement):

I'll start with a bug I spotted in the english version of TLA:

The text "(A) Item (L)(R) Switch character" in the status menu, psynergy section, appears briefly and vanishes as soon as the rest of the data appears.

And an improvement that i'm implementing right now in Reloaded:

Show how much criticals are increased in the item info panel (rather than the generic "increased criticals" line).

EDIT: The "show criticals bonus value" has been implemented in reloaded. Anyone can do the same by changing
in TBS: 080A4A80 to 4A94 (little endian)
in TLA: 080FBA18 to BA2C (little endian)
Title: Re: Minor graphical issues and improvements
Post by: Salanewt on 16, May, 2017, 04:59:50 PM
Oh good, you figured out the critical/unleash increase stuff! I was going to tell you about the Intellect patch when I originally saw your post but I haven't been able to sign on lately (because I fixed it in there too but couldn't remember exactly how I did that); would you consider a change that adds the counterattack rate modifier a general aesthetic fix?


Right now, I can think of a few other oddities in GS2:
- Certain utility effects aren't aligned perfectly, so they will be off-centre (Magnet and Arrow for example, but also some others);
- Certain battle animations aren't positioned correctly, like Volcano;
- The battle menu (debug portion at least) has issues with displaying enemy or other sprites that are small or double width;
- Clipping issues with the player avatar on the world map (mainly involving trees, which has a simple explanation) and certain tiles in various maps;
- And a couple other things that aren't coming to mind right now.

This is also a personal opinion thing, but I feel like battle animation palettes lean towards red and purple more often than other colours. This is even represented in the large number of elemental palettes, and especially red and purple palettes compared to colours like green or pink. The animation overhaul allows people to customize several of the 101 animations with ease but aside from that current options are limited.
Title: Re: Minor graphical issues and improvements
Post by: Caledor on 16, May, 2017, 07:56:38 PM
The counterstrike rate bonus has amazing potential... i was thinking of making a bonus to ailment infliction rate out of it. Too bad the value of the bonus isn't stored anywhere in the PC data.

To answer your question about it... as things are now i wouldn't consider a fix. Actually i'd be against it, cause the counterstrike rate line in the info panel would be misleading info.
Title: Re: Minor graphical issues and improvements
Post by: Rolina on 16, May, 2017, 08:32:10 PM
Do y'all know of a way to boost critical rate separately from unleash rate?
Title: Re: Minor graphical issues and improvements
Post by: Salanewt on 16, May, 2017, 09:37:59 PM
Counterstrike rate: That's true. I'm planning to turn it into an actual effect in the AI overhaul and the Intellect patch even adds it to the effect listing and makes it partially functional, but so far it isn't a finished one. All it does is write a bonus total to the same place that the Reflux buff is written, but I have plans!

[spoiler=Plans]My plan for that is to change the Reflux/counterstrike buff RAM value and double it with an equipment bonus, with a related change to enemy data to add a counterattack rate that people can customize. The bonus will go up to 100 for player characters and 255 for enemies; 100 = 100% counterattack rate, but higher values will correspond to different buff values which can either be enabled through ability effects or on a case by case basis for specific enemies to differentiate between things like Reflux or other effects.

This will be available as a standalone patch as well as part of the AI overhaul, and with it a functional Reflect buff of some sort.[/spoiler]

Ailment infliction rate bonus: Funny thing, but I made an ailment resistance bonus as part of the Intellect patch; the downside is that you can't use it through the editor but it's probably for the best given my plans. :p

It has been a while since I released that patch, so I can't really say much about the coding particulars but I would take a look at the bonus in the Intellect patch because it's very close to what you were thinking of doing for infliction rate stuff.


Critical rate: Wasn't it always an unleash rate bonus or am I just mistaken? I was under the assumption that the "critical" part was a bit of a misnomer for it and that a critical rate bonus doesn't actually exist. If that's the case then I'll likely include a critical rate bonus of some kind in the AI overhaul!
Title: Re: Minor graphical issues and improvements
Post by: Daddy Poi's Oily Gorillas on 16, May, 2017, 09:52:03 PM
QuoteCritical rate: Wasn't it always an unleash rate bonus or am I just mistaken? I was under the assumption that the "critical" part was a bit of a misnomer for it and that a critical rate bonus doesn't actually exist. If that's the case then I'll likely include a critical rate bonus of some kind in the AI overhaul!
If I recall... I'm pretty sure it exists... one is calculated with the unleash rate, and the other is not... but I may need to look this up again.

(I think it was at a different multiplier too... based on which. ... E.g. like either doubled or halved or something... but I can't remember at the moment.... so looking it up. http://forum.goldensunhacking.net/index.php?topic=2448.0)
I really need to get back to that, and document which of those were priority. (Unleash, Crit, Miss)
Title: Re: Minor graphical issues and improvements
Post by: Salanewt on 16, May, 2017, 10:41:33 PM
I recall unleashes having priority over everything else but I can't remember of criticals or misses came next, unless I'm mistaken.

Rate: Double or halved? I'm very interested in how that works!



Something else that has always bugged me are field object and character shadows, especially for inanimate objects. A distant goal of mine is to make them translucent and to remove inanimate object shadows, although I need to plan this one out more.

Title: Re: Minor graphical issues and improvements
Post by: Daddy Poi's Oily Gorillas on 16, May, 2017, 11:03:11 PM
QuoteRate: Double or halved? I'm very interested in how that works!
It was the /200 and /100 in the topic.... Sorry if it was bad wording.

When I write out the priority stuff... I'm hoping to do pseudo-code for it... So it is a bit more detailed. (That, and I can double check if I had everything correct the first time. Never hurts to check things multiple times.)

Ah... that code is in a really long function. (Start/execute a turn function.) ... Now I see why I didn't fully document it properly...