News:

As a consequence of the forum being updated and repaired, the chatbox has been lost.
However, you can still come say hi on our Discord server!

Main Menu

Open Golden Sun: Open source recreation of the Golden Sun engine

Started by OpenGoldenSun, 15, December, 2014, 11:46:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

OpenGoldenSun

#60
Hey Atrius,

Thanks for the reply. I finally got around to implementing the method you discussed (your instructions helped a lot). You may have seen my other video of my preliminary battle system where I use a technique called "Billboarding" to attempt to achieve the same effect. I'm basically comparing the two methods for ease of use, flexibility etc...

Here is yours:



Here is mine (note: I'm not doing animations of them at this point, it's just still images):



I have a couple questions for you, I'm hoping you can help me out (this is specific to your method):


  • As you can see in my implementation the background is scrolling slower than yours. Can you tell me how you are determining the speed of your background scrolling? Personally I just take the camera angle 0-360 degrees and translate that to an x-coordinate on the image background.

  • Your background scrolling somehow seems smoother or as if there is motion blurring. Is that the gif or did you actually put that in?

  • I've noticed in the actual game that Sheba seems a lot smaller than Felix. Is there some special consideration for their size that the game does? The current depth calculation doesn't seem to take that into account. If you look at my implementation Sheba is the same height as Jenna. If you look in this image that is not the case.

  • What camera rotation speed do you use? I go 1 degree every frame @ 60fps.

How is Sheba's height calculated?



Approximate camera angle from image above in my engine:



Pretty cool to have this implemented. Although it'll probably be a pain to make that start-up rotation and zoom the actual game does when a battle starts.

Luna_blade

"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

MaxiPower


Atrius (He/Him)

  • As you can see in my implementation the background is scrolling slower than yours. Can you tell me how you are determining the speed of your background scrolling? Personally I just take the camera angle 0-360 degrees and translate that to an x-coordinate on the image background.
As I've said, I don't have the original source used to create that demonstration any more.  As I recall I just went with my best guess at what looked good at the time scaled by the camera's relative distance, so it was basically just an arbitrary decision.


  • Your background scrolling somehow seems smoother or as if there is motion blurring. Is that the gif or did you actually put that in?
I believe I did have texture interpolation enabled while drawing the background, so there would have been some "blurring" due to trying to calculate colors between pixels at non-round number coordinates.  Yours is probably more accurate to how Golden Sun really is since the GBA hardware is not capable of interpolation.


  • I've noticed in the actual game that Sheba seems a lot smaller than Felix. Is there some special consideration for their size that the game does? The current depth calculation doesn't seem to take that into account. If you look at my implementation Sheba is the same height as Jenna. If you look in this image that is not the case.
I'll refer you back to where I mentioned a "defaultScale" value in my explanation.
Quote from: Atrius on 13, March, 2015, 05:06:16 PMNow, as for field of view and how it affects the scaling of the sprite on screen, it's all a matter of ratios.  Think of the field of view as a cone that extends out from the camera, the size of this cone increases at a fixed ratio (scaleRatio) as the distance increases.  The size a character appears to be on screen is proportional to the amount of that cone they fill, so their sprite's scale will be inverse to scaleRatio multiplied by their distance from the camera.

scale = defaultScale / (scaleRatio * distance)

When initialized defaultScale (normally 1) should be multiplied by (scaleRatio * cameraDist) replacing cameraDist with your camera's default/neutral distance if you want to make the camera distance variable.
The Golden Sun engine has an equivalent for "defaultScale" stored with the sprite data.  You can view this value in the GS:TLA Editor.

For reference:

Isaac: 0.75
Garet: 0.85
Ivan: 0.75
Mia: 0.75
Felix: 0.75
Jenna: 0.75
Sheba: 0.75
Piers: 0.75

(It's my mistake that 0.75 seems to be Golden Sun's default value for defaultScale)

The data doesn't support Sheba being intentionally drawn smaller, Garet is the only odd one out.  I suspect it has something to do with the exact positioning of the characters, and rounding due to the GBA not supporting interpolation.  Still though, looking closely at your comparison image with the Wild Wolf the size of the wolf doesn't look right for this method.  It could be that Golden Sun's battle engine is more faked than I had suspected.


  • What camera rotation speed do you use? I go 1 degree every frame @ 60fps.
I don't recall, but it wasn't based on anything from the real Golden Sun's engine.  I don't think I've stressed this yet, but I haven't actually looked into the code for how the real Golden Sun's battle engine works as far as faking the 3D effect.  Everything I've said is based on my own knowledge/research, and how I would go about creating the same effect.
[sprite=220,4,0]I'm shaking my head in general disapproval of everything[/sprite]

Rolina

One thing I noticed in the games is that the camera has different speeds it can move.  What I figure should be done is a recording of the original games in motion - find the rate of rotation for the opening of battle, the swivel between parties attacking, and the speed for "uber moves" like spark plasma and grand gaia for starters.  I'm pretty sure those are three different speeds.  From there, it should be easier to figure out simply by seeing how many frames it takes to turn the X degrees it turns.

OpenGoldenSun

#65
@Atrius, thanks for the quick reply, that all makes sense. I'm thinking that I'll have possibly 2 different scale numbers to get this as close as possible to the original. A defaultScale like you've described (starting at 1.0) and a positionalScale, based on where they are in the party position. So for example if Sheba was in position 2 (second position looking from the front) it might be 0.90 - 0.05 or something. I'll see what I come up with, getting pretty close to the battle engine being demoable.

You've mentioned that your method is not really based on the code the engine uses, but that's perfectly fine. You've done the legwork to make a simulation that is pretty damn close. I can tweak stuff to see how close it can be for this.

@Rolina, you raise a good point that I've been meaning to bring up. Does anyone have some good game saves where all characters are in the parties etc...? If anyone could help me out and provide some good ones for GS and GS:TLA that'd be perfect. I know I can recreate it using the editor but if someone already has something that's even better. If would really help for field psynergy and battle psynergy.

@Luna_blade, MaxiPower, thanks guys.

Atrius (He/Him)

Quote from: OpenGoldenSun on 03, April, 2015, 10:03:35 PMDoes anyone have some good game saves where all characters are in the parties etc...? If anyone could help me out and provide some good ones for GS and GS:TLA that'd be perfect.

For all saves in the original Golden Sun I'll refer you here, and the TLA equivalent is here.  (Megaupload link is broken, but goldensunhacking.net mirror still works)


EDIT:
Now that I really think about it, I believe the background is moving the exact same speed in both of our examples relative to the rotation speed since both of the GIF animations are only 1 rotation, and the background loops perfectly in both of them.  Maybe my background is x2 speed?  Either way the ratio has to be such that 1 rotation = a whole cycle of the background too.
[sprite=220,4,0]I'm shaking my head in general disapproval of everything[/sprite]

OpenGoldenSun

Here's where I'm at with the battle engine:



Hopefully I can make the next video an actual battle.

Rolina

For the gifs at the top of the page:

The background is faster in Atrius' rotation.
The sprites are faster in OGS' rotation.

Daddy Poi's Oily Gorillas

03000030 = Battle data stuff ==>
02030034 = Up/Down rotation
02030036 = Left/Right rotation

030000B0 = Camera destination data pointer ==>
02031090 = Left/Right rotation destination
02031094 = Frames to rotate for.

If you compare rot. against the rot. dest., you'll probably notice they're 0xF off, so it likely rotations to the +/-0xF boundary.

The left/right rotation seems to match with this:
0x4000 = During turn selections
0x2000 = Directly after turn selection
0x1500, 0x1C00, 0x2400, 0x2B00 = 1st - 4th PCs
= Actual rotation is based on PC's x/y position, and not slot. (ex: What direction would you be facing if you were looking at the PC from the center?)
*Looks at 08011EA0C function, which is for Ability Type Values 0x2 and 0xF.*
+0xFFFFE000
+0x6000 if enemy
And 0x7FFF
+0xFFFFE000
+= >>0x1F
>> 1
+0x2000

0x2400 = PC use healing psynergy.

Defend/Flee/some Summons do not altar rotation? (Stays at 0x2000)

QuoteOne thing I noticed in the games is that the camera has different speeds it can move.  What I figure should be done is a recording of the original games in motion - find the rate of rotation for the opening of battle, the swivel between parties attacking, and the speed for "uber moves" like spark plasma and grand gaia for starters.  I'm pretty sure those are three different speeds.  From there, it should be easier to figure out simply by seeing how many frames it takes to turn the X degrees it turns.
Most rotation seems to be based on 0x3C frames, I think. (60 frames)

Did not check opening of battle, though.

--
030000A8 = Opening entrance stuff (Only points to just one 32-bit.) ==>
03001380 = Frame counter for opening entrance. Edit this to 0 during the opening, and you'll see the opening entrance happen again.

The openng entrance might be based on rotation for 0x50 (80) frames, ((frame * 0x168) + 0xAF80)
The scaling should be (0xB4 - frame). 0xB4 = 180, so 180%... after the 80 frames, should be 0x64 (100%)...
and the party stats box comes down for 0x20 (32) frames, but starting at frame 0x14 (20). (03001122 changes Y location of this box, but it gets updated every frame, so don't edit & test.)
I think the black transition graphic also animates 1 frame per pixel. Loking at height....  80*2=160 might be the boundary, however, the area is 120, so the last 20 frames would not matter?

I wonder if 030000AC is camera related or not.
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! :)

OpenGoldenSun

Does anyone know where I could find all the sound effects that Golden Sun uses? Like opening the menu, cancelling the menu, using psynergy, etc...

I have the OST, but now I need the game's sound effects.

MaxiPower

Quote from: OpenGoldenSun on 08, April, 2015, 12:20:29 PM
Does anyone know where I could find all the sound effects that Golden Sun uses? Like opening the menu, cancelling the menu, using psynergy, etc...

I have the OST, but now I need the game's sound effects.

I might have them. I will have a look and if so, upload them for you!

EDIT:

https://www.sendspace.com/file/u8des4

Hope its all your looking.

OpenGoldenSun

Quote from: MaxiPower on 08, April, 2015, 12:45:42 PM
Quote from: OpenGoldenSun on 08, April, 2015, 12:20:29 PM
Does anyone know where I could find all the sound effects that Golden Sun uses? Like opening the menu, cancelling the menu, using psynergy, etc...

I have the OST, but now I need the game's sound effects.

I might have them. I will have a look and if so, upload them for you!

EDIT:

https://www.sendspace.com/file/u8des4

Hope its all your looking.

Thanks. I ended up doing it the tedious way by recording the applicable audio channels from VBA-M before seeing this.  :sad:

MaxiPower

Lol i posted 25 mins or so after you :P

Least you have them now tho man, thats the main thing... now get back to work!! ;)

OpenGoldenSun

Wasn't expecting such a quick response.

Quotenow get back to work!! ;)

I have some cool stuff to show...

OpenGoldenSun


Salanewt

Wow. Even though I haven't really been following this much, I have to say that I really like how you handled the warp spell. Been thinking of experimenting with a hacked utility for GS, and I think I'd want it to be kind of like how yours is set up.

Nice work!
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?

Daddy Poi's Oily Gorillas

Looks awesome!
2 PP? Hmm... Maybe.
I take it this works anywhere as long as the locations are visible on the screen?
Perhaps you should have tried it as an L/R shortcut as well?

Do you plan on also having the field psynergy that Alex used just outside of Venus Lighthouse on the guards...?  (Drench?/Deluge?)
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! :)

MaxiPower

That's awsome man. Some neat puzzels could be implemented with that and even could used with other pysngery or be used to add in new puzzels to past areas. It would be a neat near end game psyngry to get.

OpenGoldenSun

QuoteDo you plan on also having the field psynergy that Alex used just outside of Venus Lighthouse on the guards...?  (Drench?/Deluge?)

Shh... spoilers.  :happy: