vitor251093 / KHMelonMix

KH Melon Mix (DS Emulator)
GNU General Public License v3.0
242 stars 12 forks source link

360 degrees movement #40

Open vitor251093 opened 1 year ago

vitor251093 commented 1 year ago

Currently, Roxas can run at eight different directions only (West, Northwest, North, Northeast, East, Southeast, South and Southwest), but with some improvements, this could improve to at least 90 directions, and at best 360.

vitor251093 commented 1 year ago

Currently working on that on branch 360-directions.

It does work, but Roxas movement gets a bit frenetic. I'm afraid this may be a seizure hazard, so for now I will keep it on a separate branch.

vitor251093 commented 1 year ago

I just realized I may be able to counter the seizure issue at diagonal movement by simulating the L/R keys touch screen instead of the Left/Right keys. I will be harder to implement, but it should safe.

This doesn't solve the seizure issue at lower running speeds, but since there is no walking animation being triggered anyway, it probably will be better to just skip it for now and focus on the 360 degrees movement for now.

CpazR commented 9 months ago

Unsure if the existing work is based on this or not, but there are hacks and patches for a few games to enable analog movement through the 3ds circle pad.

Might be worth poking arond with? Not sure if there are any limitations with melonds that prevent this from being useful. https://github.com/shocoman/Analog-Controls-for-NDS-Games-on-3DS/tree/master/patches_for_other_games/kingdom_hearts_358_2_days

I've gotten them working on hardware through twilightmenu on 3ds.

sandwichwater commented 9 months ago

it seems like the only limitation for this is melonds ar codes can only be so long , i just tried with normal melon and daysmm and the game wouldnt load on either one and when split up into multiple codes that are 64 lines like with other long codes the game just crashes . i wonder if theres a way to compress the code into a smaller one

CpazR commented 9 months ago

Maybe it can hard coded in the emulator somehow? Idk

sandwichwater commented 9 months ago

maybe , definitely worth looking into , good find

vitor251093 commented 9 months ago

Definitely a much better approach than what I was doing before. I will take a deeper look into that, once I finish working on some other issues I'm looking at right now

AntiSoraX commented 1 week ago

haha-goodone-lol made a workaround to the 64 line limit problem in scratch that helps divide the code in multiple parts (in the same category) and this supposedly works with Mario Kart DS on MelonDS, but I couldn't get one of shocoman's 360 analogue movement codes to work on MelonMix's latest release, it just crashes the second the code is activated

vitor251093 commented 6 days ago

Does the same happen if you use that KH Days code in melonDS after using the workaround to split it?

AntiSoraX commented 6 days ago

I have just attemped this, and yes, the same thing happens, I think shocoman's codes need to be altered and ported to emulators because they are made for hardware and/or TWPatcher, at least according to his original gbatemp post

Source Code for most of my mods, all of them are about 95% identical (just a copy/paste). It might be useful if you want to port a mod to another platform (like an emulator or something). Then you only need the Arm9 part and a set of memory offsets (i.e. where to hook the game, etc) depending on the version of the game (and maybe the way it's all combined into one whole AR code), everything else is 3DS-TWPatcher-RTCom specific.

I probably need to find an easier and simpler AR code for KH Days that needs to be split in at least 2 parts (that isn't reliant on movement or anything directly hardware related) and see if I can execute that on MelonMix or at least melonDS as a starting point, also melonDS is a DS/DSi emulator, code that uses the cstick might crash it even if it had no line limit

edit: tried editing the USA AR code to include just the ARM9 part (everything starting at 0x02000A78 regardless of region, which I assume is at 62000A78 or the value directly below it, E2000A78) and the memory offsets, it didn't crash, but nothing happened, the original AR code needs analogue-stick data saved by the arm7 and arm11 portions of it, I don't know how it's possible to use controler inputs on PC to do the same thing, but it might be worth looking into

edit2: just realized everything I suggested looking into is probably way harder than fixing the existing 360 code :p and an RC 1.0 version of melonDS releases in less than 2 weeks, and I hear it'll have better touch screen controls so maybe it'll make it easier to develop https://melonds.kuribo64.net/comments.php?id=215