The Mugen Fighters Guild

M.U.G.E.N Classifieds => Development Resources => Topic started by: Yoshin222 on January 03, 2022, 05:57:02 pm

Title: Marvel Data scrpt
Post by: Yoshin222 on January 03, 2022, 05:57:02 pm
------IMPORTANT!!!-----
-Only use mid fight
-"File" refers to the numbered file found in a given games ROM. Can be opened in HxD to get raw data
- Breaks if attempts to read a player who hasn't entered. Only really affects MVC, will try to fix in future
SUPPORTED GAMES
xmcota
xmvsf
mvsc
msh - Character Select timer isn't frozen though


Little bit of backstory. Been trying my hand at Lua for a while, and wanted to rip Red Earth data, but  the values wern't 1-1 with Mugen,. Thought hey, make a script that automates that
A while later, a dude asked for help romhacking X-Men: Children of the Atom, so adapted the script to work with that. Then saw the other Marvel games were handled similarly, so now the script works with them!
The script outputs the current characters position, velocity and acceleration as floats you can directly chuck in to Mugen
Explanation for those who care
Spoiler, click to toggle visibilty
It also outputs some ROM data to make life a little easier. It spits out the current address for the Anim, as well as for the Sprite being used, while also converting that raw value to where it would specifically be in what specific file. You can find these things simply by opening the corresponding numbered ROM file in a hex editor like HxD, and going to the offset specified
Images

(https://cdn.discordapp.com/attachments/569528129320910867/927597668828586074/unknown.png)
(https://cdn.discordapp.com/attachments/569528129320910867/927597854720147466/unknown.png)

Links
Spoiler, click to toggle visibilty


Title: Re: Marvel Data scrpt
Post by: Yoshin222 on January 15, 2022, 08:27:59 pm
UPDATE, CHECK FIRST POST
Due to a request by Sir Ghostler, added MSHVSF suppoort. Same rules as MVC. Also added player toggling backwards by pressing O as a quality of life thing, as well as display of FrameTime to help find raw values in the ROM
(https://cdn.discordapp.com/attachments/569528129320910867/931993618825240606/unknown.png)
Title: Re: Marvel Data scrpt
Post by: Yoshin222 on January 25, 2022, 12:19:23 am
BIG UPDATE!!!  Check first post!!
After working on a script for Samsho 3/4, decided to port over some things i learned to this script, and ended up fixing the main issues!
REV1.2
- Can now use the script whenever ya like
- Can target any player, any time
- Added TileDef output
- XCOTAs Character Select timer was wrong, now properly freezes
- A port over from the Samsho script, can display Pos/Vel Data as either converted Floats for Mugen, or Hexadecimal like the Source game
(https://cdn.discordapp.com/attachments/569528129320910867/935312589666267187/unknown.png)
Title: Re: Marvel Data scrpt
Post by: MaligeX on January 28, 2022, 09:37:23 am
This is amazing, a very usefull tool for romhacking.
I just got a question maybe quite obvious from the pictures but what emulators support or should be used with the script?
Title: Re: Marvel Data scrpt
Post by: Yoshin222 on February 13, 2022, 08:47:31 pm
Glad ya dig it! Mainly FBNeo/Mame. Though i imagine other Arcade emulators that support LUA would work too
Title: Re: Marvel Data scrpt
Post by: Yoshin222 on February 18, 2022, 09:17:52 pm
YET ANOTHER UPDATE, CHECK FIRST POST!
Mainly for XMCOTA. It handles sprites slightly differently than the other VS Games, as it uses 2 Pointers as opposed to 1. Script now accommodates it, alongside the script running adjusting based on game, and added the name of the current game for fun. These 2 screenshots didn't need the script to be disabled
(https://cdn.discordapp.com/attachments/904051695946985513/944323634393153646/unknown.png)
It SHOULD run smoothly with every VS Game now. Lemme know of anything useful i could add in future!
Title: Re: Marvel Data scrpt
Post by: DeathScythe on March 14, 2022, 05:15:49 am
Hello Yoshin222, let me first say that this is awesome! Very useful indeed.
I have one question. The values that the script displays are raw, right? Meaning we still have to apply some math for turbo speed and the CPS2 resolution when translating to MUGEN. Is that correct?
Title: Re: Marvel Data scrpt
Post by: Yoshin222 on March 17, 2022, 09:23:17 pm
Glad ya dig it! The script automatically outputs what the game sees, so i imagine turbo timings would display properly, though i admit i haven't properly looked. As for velocities and the like, they are 1.1 with the source games. The velocity values should work out the box with Mugen since the script automates the calculation of WORDS to Floats
Different script but the fundamental idea is the same


Also, New update! (The images are slightly old but still show the new things) Check first post for the link
REVISION 1.4
- Added a new mode, Address. This displays the raw Unit ID addresses for stuff like Velocity and Anim, hopefully streamlining the usage of Watchpoints and the like via MAME
- The Lua now displays the AnimElem data in real-time. Can swap the Endian by pressing Z, by default it displays the data the game sees, whereas swapping the Endian views the raw data from the program data you would see in any given Hex Editor

Images
Spoiler, click to toggle visibilty
Title: Re: Marvel Data scrpt
Post by: DeathScythe on March 18, 2022, 06:46:33 pm
So, messing a little with the script, I still think the values should use some math when converting to mugen. An example using MSHvsSF:
One of Dark Sakura's supers launches the opponent in the air, the Y accel in the script gives me a value of 0.375, however if I use this in MUGEN, the character is very "floaty" compared to the source. This is probably because it's giving me normal speed values and not turbo speed values.
Doing some research, the turbo speed in MSHvsSF is 1.25, and the horizontal resolution is 384 scaled to 320, so the math should be something like this:

X vel: value * 1.25 * (5/6)
Y vel: value * 1.25
X accel: value * 1.5625 * (5/6)
Y accel: value * 1.5625

Going back to the Y accel I mentioned, 0.375 * 1.5625 = 0.5859375, or just 0.58, using this gives me a more accurate result I think. Someone can correct me if I'm wrong.

Gonna check the updated script later, and thank you again for sharing!
Title: Re: Marvel Data scrpt
Post by: PotS on March 18, 2022, 07:16:11 pm
The script does exactly what it sets out to do, though. For Mugen conversions in Turbo, you're always going to need to pull up a calculator and some Physics.