News:

RIP GoReds

Main Menu

New RBI 3 hack in the works.... yes RBI3.

Started by brahmy, 11/26/13, 06:19:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

brahmy

QuoteUpdate Jan 5/2014: OP delivers! Check out the 2013 ROM here.

QuoteUpdate Jan 19/2014: Online RBI Editing is here! Click here for details!.

Hellooooooo from Saskatoon 8)

For the last year+ me and a group of buddies have been playing the shit out of RBI 3. Actually, we started with 1 but I think that's the gateway drug of RBI baseball; all things lead to 3. As we're playing 3, one thing leads to another and all of a sudden we're talking about updating the ROM with a 2013 roster. Several Googles later, lo and behold; there is an entire RBI enthusiast community and hacking base out there. Who knew! (not us). But as far as I can tell, most of the hacking efforts have gone into RBI 1, and there isn't much for 3.

So for the last ~3-4 weeks we've been pulling the RBI 3 ROM apart in our spare time and starting an editing framework; mad props to Nightwulf, AndyB2005 and pmeth for all the legwork that's been done decrypting ROM parameters already. Without this big previous body of knowledge we'd still be spinning our wheels. You guys (plus Gantry for building this site) are clearly the Gods Of RBI Baseball.

We want to build these things for ourselves, and share 1 & 2 with the world:

  • A 2013 RBI 3 ROM with all 30 teams
  • An interface for importing/exporting spreadsheets or .csv files of team data to and from the ROM, including future year support (ie 2014) and
  • A playable copy on an NES cartridge (I'll probably buy an EverDrive N8, unless there's a better product?).

We have a very good handle on editing:

  • All batting parameters
  • All pitching parameters (except bytes 14 & 15, apparently these are used by the CPU or something?)
  • Uniform colours
  • Team hex offsets (ie where the blocks of players are located in the ROM)
  • Available team years per team (90, 88, 86, etc - but there are some display issues on the team select screen)
  • ERA tables - another hat tip to Nightwulf
  • Team error (BOP) percentages - hat tip to AndyB2005's ROM for revealing the location & hat tip to Nightwulf revealing how they work
  • A few more text strings (opening credits etc)

There are a few parameters we DON'T have a good understanding of. I have been comparing the hex code of AndyB's 2005 30-team RBI3 ROM to the original RBI 3 ROM side-by-side and have figured a few things out, but some params are elusive. If there is anyone out there who can shed some light on the following please leave a comment. 

1) Team Initials (BA, BO, CA, TO, etc). I can change these in the team select screen (ROM range 0x9E1D to 0x9E5D), but I can't figure out how they change in the in-game box score or the scoreboard view (pause menu). If I change MT to WA, the change appears on the team select screen but not the box score/scoreboard. SOLVED, see this post.

2) Changing the default team year. For instance, in AndyB's 2005 ROM the default year is 05 instead of 90. It is not obvious how this was accomplished. I shot him an email but given that it's 8 years later I don't really expect to hear anything. Update Nov 29 - I can change the "top" team year but not the bottom:

Update Dec 8 - We are BENCHING this issue for now because we are not going to worry about getting historic/archive teams working in our first release.

Update Dec 27 - SOLVED thanks to AndyB! Modified text at 0x1482A and 0x14830 and we've got nice 13's all around.

3) Changing the pre-game national anthem. This is an insignificant detail but it will annoy me to no end if I change Montreal to Washington and have to listen to the Canadian national anthem. We are BENCHING this issue for now because we are using AndyB's fantastic 2005 ROM as our "base" ROM... and the issue is already fixed.

4) Changing what the P1/P2 cursor is allowed to select in the team select screen. Visually, I can move Houston from NL Central to AL West, but it's not selectable. For instance:

Update Dec 27 - SOLVED thanks to AndyB!

5) Determining AL/NL flags per team. Somehow the game knows which of the teams in memory are AL and NL, and will adjust the number of available starting batters accordingly.
Update Dec 27 - SOLVED thanks to AndyB!

Our project is the RibEye 3 Modifier - it's far, far away from functional right now but feel free to creep on our progress and our wiki, or give us suggestions. We both work full-time so a working interface might be a couple months out, but it's coming. If there is interest I'll keep this thread posted too.

Go Jays! (lol)
RibEye3 Modifier Project online: http://www.rbi3.ca
RibEye3 Modifier Project on Google Code: https://code.google.com/p/ribeye3-modifier/

Turd

I'm on my phone right now but I'll keep this brief...

I support this. Let me know if you need my assistance.

Also, for NES, get the powerpak. It's great for playing on real hardware.

brahmy

Quote from: Turd on 11/26/13, 06:28:15 PM
I'm on my phone right now but I'll keep this brief...

I support this. Let me know if you need my assistance.

Also, for NES, get the powerpak. It's great for playing on real hardware.
While searching these forums the past few weeks I have seen the contributions you've brought in the past and would love to hear more from you. Any insight on those parameters we're having trouble narrowing down, or a good formula/method for turning real-life pitching and batting stats into RBI parameters (I think the params are basically the same for RBI 1 & 3) would be awesome. We haven't really started building a 2013 roster because we're still ironing out these last few params.

Noted on the Powerpak!

RibEye3 Modifier Project online: http://www.rbi3.ca
RibEye3 Modifier Project on Google Code: https://code.google.com/p/ribeye3-modifier/

Gantry

Welcome brahmy!  I second the Powerpak, it's pretty damn impressive. 

I've forgotten most of the RBI hacking stuff I did back in the day, but definitely check out Tile Layer Pro for comparing the graphics between the two ROMs if you  haven't.  SHould lead to some difference in where certain characters were placed. 

Here's a comparison between a stretch of letters in RBI3 and Andy's 2005.  Quite a few changes there.  Might lead you somewhere, or you already knew this stuff. 

BeefMaster

FULLY APPROVED

The token RBI 3 fan here is very interested in all this.
"Nobody in football should be called a genius. A genius is a guy like Norman Einstein." - Joe Theismann

brahmy

#5
Little update for you...

My buddy Chet is making some good progress on the editing utility, working on a framework for importing & exporting teams with .csv files. You can watch the progress on our Google Code site. Right now a lot of the functions are built but there's no functional product yet... I'm excited to get to that point because then anyone will be able to "fork" our code and hack in features.

I made some progress on figuring out what years are available per team, and how to change the "base" years (ie, change 90, 89, 88, 87, 86, 75, 84, 83 to 13, 12, 11, 10, 09, 08, 07, 06). But these are not updating perfectly yet; see updated screenshot in the OP. I also added issue #4 in the OP - updating what the cursor is allowed to select on the team select screen.

I was using the highlighting feature in FCEUX to show areas of the RBI 3 ROM that are straight data (like the batting/pitching parameters) and what is part of the 6502 instruction set. Unfortunately (for me!) there are a lot of differences in the instruction set between the original 1990 ROM and AndyB's 2005 ROM... so I am going to have to learn about the 6502 and how to actually change the code, not just the data.

Any tips on reverse engineering 6502 code?

Edit: thanks @Gantry for the Tile Layer Pro tip, I had downloaded it but not used it much. At this point I don't think it's showing me anything that the FCEUX PPU table viewer isn't... but later on we might want to add a custom splash screen or something and that looks like an awesome utility to do that with.
RibEye3 Modifier Project online: http://www.rbi3.ca
RibEye3 Modifier Project on Google Code: https://code.google.com/p/ribeye3-modifier/

Gantry

I didn't do much for my hacks with the code outside of just jumping in and looking up what the instructions did.  Trial by fire I guess...

brahmy

OK, I'm nicely oiled with Great Western Brewhouse Pilsener and I've figured out how the two-letter team initials are stored in RBI 3. I'm crossing item #1 in the OP off the list!

For all intents and purposes, there is a limit of 30 unique teams in the game (technically 28, but in 2005 AndyB hacked in the functionality for 30), and there is capacity for 30 previous-year rosters of those same 30 teams.

First, from 0x96B0 to 0x9830, the ROM draws the team selection table that you see when you start a 1P or 2P game. Each byte in this area of memory is printed on the screen - including blank spaces, table grid lines, "PUSH B BUTTON TO SELECT YEAR", and team initials (two letters in the initials = 2 bytes of memory). The character lookup for the hex values is A=2Ah Z=43h.

Second, from 0x9E1D to 0x9E54 (56 bytes for 28 teams) (or to 0x9E58 on AndyB's 30-team 2005 ROM - he extended this table by moving some code elsewhere), the team initials are stored in a table (again, two bytes of initials = two bytes of memory). These values are used at the top of the team selection screen to tell you what team your cursor has selected. Same character lookup as the previous.

Third, the TRICKY one! The team initials that are used in the starting pitcher screen, starting batter screen, in-game box score and in-game scoreboard are stored in a table from 0x104E9 to 0x10524 - 60 bytes for 60 teams! Each byte is encoded for two letters as follows:


         First Team Letter    Second Team Letter
Hex      0123456789ABCDEF     0123456789ABCDEF
Letter   BPSACDHKLMNOTEFI     ACDHKLMNOTEFIWXY

Examples:    Team BA = 00  Team TX = CE  Team PI = 1C


Couple more details here: https://code.google.com/p/ribeye3-modifier/wiki/KeyROMHexAddresses?ts=1386288640&updated=KeyROMHexAddresses#Team_Initials_(BA,_CA,_TO,_etc)

Science marches on...
RibEye3 Modifier Project online: http://www.rbi3.ca
RibEye3 Modifier Project on Google Code: https://code.google.com/p/ribeye3-modifier/

BeefMaster

Quote from: brahmy on 12/05/13, 06:14:32 PM

         First Team Letter    Second Team Letter
Hex      0123456789ABCDEF     0123456789ABCDEF
Letter   BPSACDHKLMNOTEFI     ACDHKLMNOTEFIWXY

Examples:    Team BA = 00  Team TX = CE  Team PI = 1C


So, if I'm reading that correctly - they basically figured out that they didn't need all 26 letters, so they saved themselves the extra bytes and just made available the 16 (or fewer) that they needed?  That's insane/brilliant, although I guess it does limit the extensibility - I suppose they weren't really planning on expansion packs (or guys trying to add additional teams that might start with new letters 20 years later).

Given that list of available letters, it looks like all the letters for changed teams since '90 are available, other than that you'd have to get a "B" in the second list if you wanted the Rays to be "TB".
"Nobody in football should be called a genius. A genius is a guy like Norman Einstein." - Joe Theismann

brahmy

#9
Quote from: BeefMaster on 12/06/13, 08:07:14 AMSo, if I'm reading that correctly - they basically figured out that they didn't need all 26 letters, so they saved themselves the extra bytes and just made available the 16 (or fewer) that they needed?  That's insane/brilliant, although I guess it does limit the extensibility - I suppose they weren't really planning on expansion packs (or guys trying to add additional teams that might start with new letters 20 years later).

Given that list of available letters, it looks like all the letters for changed teams since '90 are available, other than that you'd have to get a "B" in the second list if you wanted the Rays to be "TB".

Yep, you're reading it correctly. I don't understand why they did it this way... There is plenty of space in the ROM for a full lookup table. Maybe they wanted a one-byte identifier for each team name - maybe this will help me figure out the anthem flags and the AL/NL flags.

I'm not going to back a "B" into the second list though, then I'd have to extend the table or replace a current letter. I think it would take too much effort - Tampa can be TA or TM.

Edited to add: The lookup is even more clever because they save characters in the PPU graphics table. There are 19 letters used total in the team names, and the lookups overlap to save space on graphics (maybe that was the limitation?):


BPSACDHKLMNOTEFI     
   ACDHKLMNOTEFIWXY
RibEye3 Modifier Project online: http://www.rbi3.ca
RibEye3 Modifier Project on Google Code: https://code.google.com/p/ribeye3-modifier/

VEGAS

keep up the good work fellas. RBI 3 updated will be a sweet game when it comes to completion.
And BOOM goes the Dynamite!

Turd

FOr whatever reason, the notifications system on this board is all messed up for me.  Sometimes I get reply notifications, some times I don't.  I missed all the replies here...

Anyways, I can help with converting stats into RBI values, I do it every year for my RBI1 ROM...I use it as a base and then tweak away.

A suggestion I learned along the way:
Make your CSV importer use validation.  I wasted a lot of time trying to figure out why something didn't import when it was simply just a fat-fingered piece of data or something.

Another suggestion if you have time, update the player models a little.  They currently looked like they were just banged in the pooper and are unable to scrunch down.

Turd

Also, while TLP might not show you anything the PPU can't, it'll help you edit the tiles better when you come to that point.   Another suggestion, don't worry so much about the historic rosters, just worry about getting one playable season working.  If anyone wants older seasons, they can just apply  your roster import to another ROM.  The only thing that limits you on is being able to play a team from one season vs. a team from another.  If that's not important (which I personally would deem not as important as getting a playable single season going), then yeah, focus on one season.

It'd make your import tool easier to code, and releasing ROMs is easier because you don't have apply all those old teams to the ROM with every new release. 

Just my $.02

brahmy

Quote from: Turd on 12/09/13, 09:08:08 AM
I can help with converting stats into RBI values, I do it every year for my RBI1 ROM...I use it as a base and then tweak away.
Fantastic! I'm not sure the best way to coordinate this... Any suggestions? Do you already have a spreadsheet for RBI1? If we use it as a base we'll need to expand it as there are 10 pitchers and 14 batters/team in RBI3.

I imagine we'll be ready to import data by the holidays. This weekend we started writing a .csv export feature - starting with export will make doing import easier. Should be quick because we already have all the functions to grab batter/pitcher data.

Quote from: Turd on 12/09/13, 09:08:08 AM
A suggestion I learned along the way:
Make your CSV importer use validation.  I wasted a lot of time trying to figure out why something didn't import when it was simply just a fat-fingered piece of data or something.
Good call, I think we are doing this. We're trying to make it robust because we do want to share the end result.

Quote from: Turd on 12/09/13, 09:08:08 AM
Another suggestion if you have time, update the player models a little.  They currently looked like they were just banged in the pooper and are unable to scrunch down.
lol... I don't think we'll prioritize this :) One hack on my wish list is putting some extra stats on the screen - baserunner speed, remaining pitcher stamina, etc. Not sure if that's feasible at this point. A man can dream...

Quote from: Turd on 12/09/13, 09:08:08 AM
Another suggestion, don't worry so much about the historic rosters, just worry about getting one playable season working.  If anyone wants older seasons, they can just apply  your roster import to another ROM.  The only thing that limits you on is being able to play a team from one season vs. a team from another.  If that's not important (which I personally would deem not as important as getting a playable single season going), then yeah, focus on one season.

It'd make your import tool easier to code, and releasing ROMs is easier because you don't have apply all those old teams to the ROM with every new release. 

Just my $.02
You know what, this is a REALLY good idea. Damn AndyB and his fantastic 2005 ROM... it has clouded my judgement about what we should prioritize.

It's official, we're benching the historic rosters. They'll be a follow up project, and we'll race towards getting the single season going!
RibEye3 Modifier Project online: http://www.rbi3.ca
RibEye3 Modifier Project on Google Code: https://code.google.com/p/ribeye3-modifier/

Turd

I think it's a good decision.  I get caught up in adding bells and whistles all the time and it just gets in the way of a playable product.  include necessities, then add features as you go along.

P.S. Cool that it's getting written in Python.

P.P.S.  If your hack is good enough, I'll have to look into updating the player sprites.  It's one of the things I hate about RBI2/3.  I love my pasty white fatties.

Turd

QuoteAll pitching parameters (except bytes 14 & 15, apparently these are used by the CPU or something?)

If it's anything like RBI1, those are used to determine whether or not the pitcher will curve the ball left or right (based on runners on base and other params during each pitch).

brahmy

Quote from: Turd on 12/09/13, 03:16:30 PM
QuoteAll pitching parameters (except bytes 14 & 15, apparently these are used by the CPU or something?)

If it's anything like RBI1, those are used to determine whether or not the pitcher will curve the ball left or right (based on runners on base and other params during each pitch).
Cool, I didn't know this about RBI 1 or 3 - I hadn't found a thread where a consensus was reached. Thanks.

Quote
P.S. Cool that it's getting written in Python.
It's really cool. I've never used it (my buddy has, a bit) and it seems awesome. I come from PHP and it's an easy transition. We would like to run the app on the Google App Engine once it's ready!
RibEye3 Modifier Project online: http://www.rbi3.ca
RibEye3 Modifier Project on Google Code: https://code.google.com/p/ribeye3-modifier/

Turd

I'm a PHP and C# developer, and I recently just got into Python for some geek fun.  I felt like it was time to learn it...

VEGAS

Any other hacked roms for RBI 2 or RBI 3 you'd suggest?
[/quote]
You know what, this is a REALLY good idea. Damn AndyB and his fantastic 2005 ROM... it has clouded my judgement about what we should prioritize.

It's official, we're benching the historic rosters. They'll be a follow up project, and we'll race towards getting the single season going!
[/quote]
And BOOM goes the Dynamite!

brahmy

Quote from: VEGAS on 12/09/13, 06:01:57 PM
Any other hacked roms for RBI 2 or RBI 3 you'd suggest?

I don't know of any... Just give us another month or two ;)
RibEye3 Modifier Project online: http://www.rbi3.ca
RibEye3 Modifier Project on Google Code: https://code.google.com/p/ribeye3-modifier/