Register - Login
Views: 87365484
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - JCS - Stats - Latest Posts - Color Chart - Smilies
11-20-17 04:20:37 AM

Jul - Fortune Street / Itadaki Street crap - Renewed intrest in destroying Fortune Street Wii New poll - New thread - New reply
Next newer thread | Next older thread
Kaito Sinclaire
Hacking reality since 20̶?͝>̨ )̧̢~͠|̡͠T̴̡<͏̀́#͟͠)̸̡̛̕͟_̢҉M̨̛͢͠͠@̴̷(̧̕01 ERROR.





Joined 09.06.2011

Last posted 49 days ago
Last active 4 hours ago

Posted on 12-03-16 09:25:36 AM (last edited by Inuyasha at 12-09-16 08:01:02 PM) Link | Quote
I'm sick of staring at this stupid game's bugginess with no idea what's causing all of its problems. I want to at least make an attempt to fix shit so modding is finally worthwhile.

Here's everything I know that crashes right now:


  • Moving ten or more squares, then trying to reverse course.
    Either this happens by rolling a 10 to begin with (which the game doesn't support), or by rolling a 9, 8, or 7 (which the game does and going through one, two, or three one-way doors. This gets the game confused about what square you landed on, and saying No to "Stop here?" causes an instant freeze on hardware. Dolphin somehow survives, but if you try to go back one more square it crashes too.
      Theories:
    • I'm pretty sure the game stores info about every square you pass as you go along, as well as ready cash and assets every step of the way; but in an array with nine entries maximum or something, so things go haywire past that.


  • Too many intersections?
    If you have too many path splits, the game explodes when you try to roll. If you have way too many path splits, the game explodes if you even try to scroll the map. Dolphin survives all these but it freezes for anywhere from a second to over two minutes depending on the circumstances.
    I'm not entirely sure these are the exact circumstances. I've seen some maps crash in similar manners despite looking like they should work fine, and crashes that only happen when you're given a free warp to any square by a venture card or arcade or whatever.

    This is basically the biggest thing stopping custom maps from being worthwhile.
      Cause:
    • AI calculations are horribly unoptimized, and they run even on player-controlled characters. They're also recursive functions; the likely reason it crashes on hardware and not Dolphin is because it's overflowing the stack.


  • Nine shops in a row in Easy rules.
    Self explanatory. Shop price and Max. Capital dive to 0 as soon as the 9th is bought, and when the camera would adjust to focus on the row of shops, the game freezes.
      Theories:
    • The game uses a table to store multipliers, and runs out of bounds past 8.


  • Districts having more than seven shops.
    The game normally runs, well, "alright" with this (although if I recall, the prices and max. capital might become total garbage, like above), but the stock menu in particular makes the game freeze for whatever reason if this happens.
      Theories:
    • Trying to stuff seven or more elements into a fixed 6-length array? I don't know, this happens during drawing as far as I'm aware, which just makes it stupid.


  • Trying to warp to a tile that doesn't exist.
    Warping out animation plays just fine, but freezes after it finishes. Why this happens is pretty obvious, but the issue is that we currently don't have a clue how to stop it from happening. This almost always happens due to venture cards, and nobody has a damn clue how they're set up.
      Theories:
    • A list of venture cards per board is stored somewhere in the game, and that somewhere isn't in the board file themselves? We've found nothing about where it would be though...


Xkeeper






Posted on 12-03-16 04:33:50 PM Link | Quote

Renewed intrest in destroying Fortune Street


perhaps a hammer is in order?
Drag
2630
Level: 94


Posts: 2622/2635
EXP: 8330359
For next: 26298

Since: 07-03-07


Since last post: 107 days
Last activity: 16 hours

Posted on 12-03-16 06:51:38 PM Link | Quote
Sounds like exhausting lookup tables and arrays for most of this stuff. Moving ten spaces or more makes sense since stuff happens to you as you pass by spaces, and the game would need to know how to "undo" that stuff if you decide not to move a particular way and start backtracking.

I wonder if the intersection thing is due to some kind of lookahead feature the game tries to do when you roll. For example, if you roll a 5, and have 3 ways you can go, there are three outcomes. If there are 12 ways you can go, the game might be running out of memory. Beats me why it would have a lookahead feature.

The rest of the problems sound like out of bounds indices into lookup tables. If you look at games like Monopoly, the cost of things doesn't follow a clear mathematical formula, as much as just arbitrarily decided prices based on what made the game playable.
Kaito Sinclaire
Hacking reality since 20̶?͝>̨ )̧̢~͠|̡͠T̴̡<͏̀́#͟͠)̸̡̛̕͟_̢҉M̨̛͢͠͠@̴̷(̧̕01 ERROR.





Joined 09.06.2011

Last posted 49 days ago
Last active 4 hours ago

Posted on 12-04-16 01:10:42 AM Link | Quote
Originally posted by Drag

I wonder if the intersection thing is due to some kind of lookahead feature the game tries to do when you roll. For example, if you roll a 5, and have 3 ways you can go, there are three outcomes. If there are 12 ways you can go, the game might be running out of memory. Beats me why it would have a lookahead feature.


That's the thing, that might make a bit of sense for just regular movement, but selecting a space to warp to also hangs/freezes in the exact same manner and there would be no sane reason to look ahead when you can freely choose any tile and paths are irrelevant.
Drag
2630
Level: 94


Posts: 2623/2635
EXP: 8330359
For next: 26298

Since: 07-03-07


Since last post: 107 days
Last activity: 16 hours

Posted on 12-04-16 12:01:12 PM Link | Quote
It might also have to do with AI. For example, when you land on a spot, the AI might need to calculate the probability of you landing on certain other spots so that it can make a more informed decision on what to do on its next turn. A 4 human player game ought to debunk that pretty quickly if it isn't the case though, unless the game is still making AI calculations even with none present.
Raspberry
All dreams are but another reality.
Never forget...
Level: 80


Posts: 1794/1797
EXP: 4688768
For next: 94201

Since: 07-07-07


Since last post: 93 days
Last activity: 46 min.

Posted on 12-04-16 06:51:05 PM Link | Quote
Don't forget, too, that there are other things that don't necessarily crash the game, but make it unplayable:

  • AI movement can bug out, leaving the AI thinking it's finished moving but with squares left to move (softlock)
  • AI menuing, especially when attempting to trade or renovate vacant lots, can leave the AI think it's finished but with menus still open (softlock)
  • Using the trade menu can crash the game (hardlock on hardware; haven't reproduced on Dolphin yet)

AI movement and menuing being broken also makes custom maps painful to edit, because even if you make a map that seems like it should work, it might not work at all with AI.
Kaito Sinclaire
Hacking reality since 20̶?͝>̨ )̧̢~͠|̡͠T̴̡<͏̀́#͟͠)̸̡̛̕͟_̢҉M̨̛͢͠͠@̴̷(̧̕01 ERROR.





Joined 09.06.2011

Last posted 49 days ago
Last active 4 hours ago

Posted on 12-05-16 07:45:53 AM (last edited by Inuyasha at 12-05-16 07:47:29 AM) Link | Quote
Originally posted by Inuyasha
Too many intersections?

It's the AI. It recursively searches for moves and the function it uses to do so appears to be so hideously unoptimized that it freezes for a bit due to the amount of time it takes.

As for why it crashes on hardware? The AI function in question is recursive; it's probably a stack overflow.


And yes, it is running ALL. THE. TIME. Even in 4p games with no AI players.


Sigh... What am I going to do about this?
Kaito Sinclaire
Hacking reality since 20̶?͝>̨ )̧̢~͠|̡͠T̴̡<͏̀́#͟͠)̸̡̛̕͟_̢҉M̨̛͢͠͠@̴̷(̧̕01 ERROR.





Joined 09.06.2011

Last posted 49 days ago
Last active 4 hours ago

Posted on 12-06-16 09:29:33 AM (last edited by Inuyasha at 12-06-16 10:08:19 AM) Link | Quote
Originally posted by Inuyasha
Trying to warp to a tile that doesn't exist.
...
This almost always happens due to venture cards, and nobody has a damn clue how they're set up.


804104C0 in main.dol. Each map has a 130 byte array, a 0x01 means the venture card is allowed to show up, 0x00 means it isn't.

Yes, 130 byte array. There's only 128 venture cards. 129 and 130 are set to 0x00 in every table.



Also, courtesy of Ninji:


Ninji "Moist Lobe", [06.12.16 04:35]
bleh

Ninji "Moist Lobe", [06.12.16 04:35]
I just compared the Boomstreet .dol file against NSMBW and I think I know why now

Ninji "Moist Lobe", [06.12.16 04:35]
it appears that all the debug functions in the Wii SDK are simply blanked out in Boomstreet

Ninji "Moist Lobe", [06.12.16 04:35]
fuck if I know why

Ninji "Moist Lobe", [06.12.16 04:35]
so OSReport exists but it's just a no-op
Kaito Sinclaire
Hacking reality since 20̶?͝>̨ )̧̢~͠|̡͠T̴̡<͏̀́#͟͠)̸̡̛̕͟_̢҉M̨̛͢͠͠@̴̷(̧̕01 ERROR.





Joined 09.06.2011

Last posted 49 days ago
Last active 4 hours ago

Posted on 12-08-16 08:34:36 AM (last edited by Inuyasha at 12-08-16 09:56:02 AM) Link | Quote
Round the Blocks technical info.


.data5:80416800 # DATA XREF: Game::Slot::GenerateSetting((Game::Slot::Setting *,int))+10
.data5:80416800 # Game::Slot::GenerateSetting((Game::Slot::Setting *,int))+14
.data5:80416800 game_slot_faces:.long 0, 3, 1, 2, 4, 0, 1, 2, 3 # standard mode, faces set 0
.data5:80416824 .long 0, 4, 1, 3, 2, 0, 0, 1, 0 # standard mode, faces set 1
.data5:80416848 .long 1, 2, 3, 1, 0, 4, 1, 0, 1 # standard mode, faces set 2
.data5:8041686C .long 2, 0, 1, 3, 2, 4, 2, 2, 0 # standard mode, faces set 3
.data5:80416890 .long 3, 0, 2, 4, 1, 3, 0, 3, 3 # standard mode, faces set 4
.data5:804168B4 .long 4, 0, 2, 0, 1, 3, 0, 0, 4 # standard mode, faces set 5
.data5:804168D8 .long 4, 1, 3, 2, 1, 0, 1, 1, 4 # standard mode, faces set 6
.data5:804168FC .long 4, 2, 1, 2, 3, 0, 2, 2, 4 # standard mode, faces set 7
.data5:80416920 .long 4, 3, 1, 3, 2, 0, 3, 3, 4 # standard mode, faces set 8
.data5:80416944 .long 4, 0, 4, 1, 3, 2, 4, 0, 4 # standard mode, faces set 9
.data5:80416968 .long 0, 3, 1, 0, 4, 1, 0, 3, 4 # easy mode, faces set 0
.data5:8041698C .long 0, 4, 0, 1, 0, 3, 0, 1, 0 # easy mode, faces set 1
.data5:804169B0 .long 1, 3, 1, 4, 1, 0, 1, 0, 1 # easy mode, faces set 2
.data5:804169D4 .long 3, 0, 1, 3, 4, 1, 3, 1, 4 # easy mode, faces set 3
.data5:804169F8 .long 3, 0, 3, 4, 1, 3, 0, 3, 3 # easy mode, faces set 4
.data5:80416A1C .long 4, 0, 3, 0, 1, 0, 0, 0, 4 # easy mode, faces set 5
.data5:80416A40 .long 4, 1, 1, 3, 1, 0, 1, 1, 4 # easy mode, faces set 6
.data5:80416A64 .long 4, 1, 1, 4, 3, 0, 1, 3, 4 # easy mode, faces set 7
.data5:80416A88 .long 4, 3, 1, 3, 0, 3, 3, 3, 4 # easy mode, faces set 8
.data5:80416AAC .long 4, 0, 4, 1, 3, 4, 4, 0, 4 # easy mode, faces set 9

.data5:80416AD0 .long 1, 0, 1, 1, 1, 1, 1, 0, 1 # standard mode ptrn.0
.data5:80416AF4 .long 1, 0, 1, 2, 1, 3, 1, 0, 1 # standard mode ptrn.1
.data5:80416B18 .long 6, 7, 8, 6, 7, 8, 2, 3, 4 # standard mode ptrn.2
.data5:80416B3C .long 7, 6, 8, 7, 6, 8, 3, 6, 9 # standard mode ptrn.3
.data5:80416B60 .long 1, 0, 1, 1, 1, 1, 1, 0, 1 # easy mode ptrn.0
.data5:80416B84 .long 1, 2, 1, 2, 1, 4, 4, 0, 1 # easy mode ptrn.1
.data5:80416BA8 .long 8, 6, 1, 7, 7, 1, 8, 6, 1 # easy mode ptrn.2
.data5:80416BCC .long 6, 9, 8, 7, 9, 7, 8, 3, 6 # easy mode ptrn.3



To start off, the pattern of blocks you get directly corresponds to how well you're doing in the game. If you're in first, you get pattern 0, second gets pattern 1, and so on.

Each number within the pattern determines which set of faces each block has, starting from top-left and working right. Face number 0 is a slime/mushroom, number 1 is a Suit Yourself card, number 2 is stocks (and hence isn't seen anywhere in Easy mode), number 3 is a warp, and number 4 is a 7. As you can probably tell, you get garbage odds if you're in the lead, and not much better if you're in second.

Yes, there are NINE faces on a six-sided block. Just like the game's die, if you roll one of the last three faces, the texture will suddenly switch to show the last three faces in place of the first three.

The game is 100% determined the moment you enter it. What time you actually stop the blocks does not matter; they will always spin around to land on the same faces.


As a side note, I don't think faces set 5 is used in either Easy or Standard rules. TCRF time?
Xkeeper






Posted on 12-09-16 05:53:14 AM Link | Quote
If you're using IDA, you can set up some enums to give those friendlier names. I forget how to do it without looking at the UI, though
Kaito Sinclaire
Hacking reality since 20̶?͝>̨ )̧̢~͠|̡͠T̴̡<͏̀́#͟͠)̸̡̛̕͟_̢҉M̨̛͢͠͠@̴̷(̧̕01 ERROR.





Joined 09.06.2011

Last posted 49 days ago
Last active 4 hours ago

Posted on 12-23-16 12:36:44 AM Link | Quote
Stock info. I know for a while I thought it was this big stupid overly complex system... no, it really isn't. It's incredibly simple.

As a little primer, all of the info related to the board class is stored in the memory location 0x8054CE18. The area class is contained within the board class, and stored at an offset of +0x2A00. (In other words, 0x8054F818.) It's an array with 12 entries, each taking up 0x78 bytes worth of space.

Yes, 12 entries. This is why the "unused" District L works, but M, N, O, and P all cause unusual effects; trying to use them just clobbers other parts of the board class.



The very first variable in that class is a fixed point (16.16) number, that serves as a multiplier for the base stock value. This multiplier starts at 0x00000B00, and every time someone buys ten or more stocks, that number is multiplied by exactly 1.07x. Selling ten or more stocks multiplies it by exactly 0.93x. Venture cards that specifically affect stock price and only stock price affect this multiplier as well, in exactly the way you'd expect them to. This value is constrained to a range of 0x00100000 to 0x0000000F, to keep the numbers from going totally insane (I'd imagine), and to keep the multiplier from hitting zero (which you can probably already tell is a Very Bad Idea™)

So what's the base stock value for an area? The average shop value of shops in that area. That's it. No other shenanigans, just that.



You can see all these behaviors in action pretty easily by opening up Dolphin in debugger mode; setting any of the areas' multipliers to 0x00010000 will cause the area's stock price to match the average shop value, and setting them to 0x186A0 (decimal 100000) and causing the stock value to change without changing shop values will show the multipliers. Keep in mind the range limits though if you go fiddling with values though.

For reference, here's the addresses of every area (and since the stock multiplier is the first variable in the area class, it's also the address of that as well):

District A: 0x8054F818
District B: 0x8054F890
District C: 0x8054F908
District D: 0x8054F980
District E: 0x8054F9F8
District F: 0x8054FA70
District G: 0x8054FAE8
District H: 0x8054FB60
District I: 0x8054FBD8
District J: 0x8054FC50
District K: 0x8054FCC8
District L: 0x8054FD40

Kaito Sinclaire
Hacking reality since 20̶?͝>̨ )̧̢~͠|̡͠T̴̡<͏̀́#͟͠)̸̡̛̕͟_̢҉M̨̛͢͠͠@̴̷(̧̕01 ERROR.





Joined 09.06.2011

Last posted 49 days ago
Last active 4 hours ago

Posted on 12-29-16 01:12:07 AM (last edited by Inuyasha at 12-29-16 01:48:35 AM) Link | Quote
Shop prices table. Stored starting at 80412B00, fixed point shorts (8.8). Easy mode has its own table, stored at 80412A98.


.data5:80412B00 .short 0,0x100,0x200,0x3C0, 0, 0, 0, 0, 0
.data5:80412B12 .short 0,0x100,0x140,0x280,0x500, 0, 0, 0, 0
.data5:80412B24 .short 0,0x100,0x140,0x200,0x340,0x600, 0, 0, 0
.data5:80412B36 .short 0,0x100,0x140,0x200,0x2C0,0x440,0x6C0, 0, 0
.data5:80412B48 .short 0,0x100,0x140,0x1C0,0x2C0,0x3C0,0x540,0x780, 0
.data5:80412B5A .short 0,0x100,0x140,0x1C0,0x280,0x380,0x480,0x600,0x800

.data5:80412A98 .short 0x100,0x100,0x200,0x400,0x600,0x800,0xA00,0xC00,0xE00, 0


Or, in other words, with # of shops you own from left to right, and # of shops in the district total from top to bottom:

12345678
31.00x2.00x3.75x-----
41.00x1.25x2.50x5.00x----
51.00x1.25x2.00x3.25x6.00x---
61.00x1.25x2.00x2.75x4.25x6.75x--
71.00x1.25x1.75x2.75x3.75x5.25x7.50x-
81.00x1.25x1.75x2.50x3.50x4.50x6.00x8.00x
EM1.00x2.00x4.00x6.00x8.00x10.00x12.00x14.00x


I'm still trying to figure out what exactly determines the base shop price, though. Without investing, the shop price is exactly the original shop price multiplied by this value. But once you start investing, this changes and that no longer matches...

---

Max capital multiplier table. Stored starting at 80412B6C, also fixed point shorts (8.8). Again, Easy mode has its own table at 80412AAC.


.data5:80412B6C .short 0, 0x200, 0x300, 0x600, 0, 0, 0, 0, 0
.data5:80412B7E .short 0, 0x180, 0x200, 0x400, 0xA00, 0, 0, 0, 0
.data5:80412B90 .short 0, 0x180, 0x200, 0x400, 0xA00, 0xC00, 0, 0, 0
.data5:80412BA2 .short 0, 0x180, 0x200, 0x400, 0xA00, 0xC00 ,0xE00, 0, 0
.data5:80412BB4 .short 0, 0x180, 0x200, 0x400, 0xA00, 0xC00, 0xE00,0x1000, 0
.data5:80412BC6 .short 0, 0x180, 0x200, 0x400, 0xA00, 0xC00, 0xE00,0x1000,0x1300

.data5:80412AAC .short 0, 0x300, 0x500, 0x700, 0x900, 0xB00, 0xD00, 0xF00,0x1100, 0


Again, a table for that:

12345678
32.00x3.00x6.00x-----
41.50x2.00x4.00x10.00x----
51.50x2.00x4.00x10.00x12.00x---
61.50x2.00x4.00x10.00x12.00x14.00x--
71.50x2.00x4.00x10.00x12.00x14.00x16.00x-
81.50x2.00x4.00x10.00x12.00x14.00x16.00x19.00x
EM3.00x5.00x7.00x9.00x11.00x13.00x15.00x17.00x


The base for these multipliers is just the initial shop value, nothing fancy.

---

As you may notice, there's tables for districts with 7 or 8 shops. Except, that isn't possible because the game crashes in the stock menu if there's more than 6 shops. Go freaking figure.

I'm not sure how this correlates to Easy rules yet. I think it uses a completely separate table, as none of these values match up with how Easy rules acts.

Easy mode uses its own tables. I've thrown them in above.
Kaito Sinclaire
Hacking reality since 20̶?͝>̨ )̧̢~͠|̡͠T̴̡<͏̀́#͟͠)̸̡̛̕͟_̢҉M̨̛͢͠͠@̴̷(̧̕01 ERROR.





Joined 09.06.2011

Last posted 49 days ago
Last active 4 hours ago

Posted on 12-29-16 03:17:18 AM (last edited by Inuyasha at 12-29-16 03:17:26 AM) Link | Quote
Funny how the things I thought were simple are the sorta complex things.

Shop price formula: (((v * 2) - bv) * bp * m) / bv ... where:
v is the shop's current value,
bv is the shop's base (original) value,
bp is the shop's base (original) price, and
m is the multiplier for having more than one shop in the district.



This is exactly as the game does it (not simplified)

  1. Current shop value * 2
  2. (1.) - Base shop value
  3. (2.) * Base shop price
  4. Raw price multiplier >> 6
  5. (3.) * (4.)
  6. (5.) >> 2
  7. (6.) / Base shop value
  8. If (7.) < 0, return 1, else return (7.)

So, yeah... if you try to make the multiplier end in something that isn't .00, .25, .50, or .75, the game bugs out. Oh well.

And there's a pretty obvious bug in the game's formula too.
Kaito Sinclaire
Hacking reality since 20̶?͝>̨ )̧̢~͠|̡͠T̴̡<͏̀́#͟͠)̸̡̛̕͟_̢҉M̨̛͢͠͠@̴̷(̧̕01 ERROR.





Joined 09.06.2011

Last posted 49 days ago
Last active 4 hours ago

Posted on 12-29-16 04:45:51 AM (last edited by Inuyasha at 12-29-16 04:46:33 AM) Link | Quote
Things you probably already knew in some shape or form:


.data6:80453998 RankTable__Q22Gm5Place:.long 0x32,0x64,0x12C,0x3E8,0xBB8,0x1388

Nothing special here, just the table for shop ranks. That's 50g for 2 star, 100g for 3 star, 300g for 4 star, 1000g for 5 star, 3000g for 6 star, and 5000g for gold star. 1 star shops are just anything below 50g.
Xkeeper






Posted on 12-29-16 08:27:45 PM (last edited by Xkeeper at 12-29-16 08:27:57 PM) Link | Quote
Do you mind if I move this to a public forum? I'll probably rename the arts/etc forum to something like "Projects and Creations".

E: Either that or the ROM hacking one, I guess.
Kaito Sinclaire
Hacking reality since 20̶?͝>̨ )̧̢~͠|̡͠T̴̡<͏̀́#͟͠)̸̡̛̕͟_̢҉M̨̛͢͠͠@̴̷(̧̕01 ERROR.





Joined 09.06.2011

Last posted 49 days ago
Last active 4 hours ago

Posted on 12-29-16 08:59:42 PM Link | Quote
Sure, I don't really mind.
Xkeeper






Posted on 12-29-16 09:36:11 PM Link | Quote
Okay
Drag
2630
Level: 94


Posts: 2625/2635
EXP: 8330359
For next: 26298

Since: 07-03-07


Since last post: 107 days
Last activity: 16 hours

Posted on 12-29-16 10:03:32 PM Link | Quote
I'm really interested in what you uncover, because I'd like to know how to make a game based on cost, value, and resources too at some point, and this gives a little insight on how to balance a game like that.
Kaito Sinclaire
Hacking reality since 20̶?͝>̨ )̧̢~͠|̡͠T̴̡<͏̀́#͟͠)̸̡̛̕͟_̢҉M̨̛͢͠͠@̴̷(̧̕01 ERROR.





Joined 09.06.2011

Last posted 49 days ago
Last active 4 hours ago

Posted on 01-02-17 04:15:31 AM Link | Quote
Spent the majority of today building a webpage to simulate a single district given all the info we now know, including shop prices and max capital calculation, investing, and showing the simulated area's stocks. It also supports rolling a completely random set of shop values and prices, though no guarantees on how balanced it would be ingame.

You can see it in action here.
Next newer thread | Next older thread
Jul - Fortune Street / Itadaki Street crap - Renewed intrest in destroying Fortune Street Wii New poll - New thread - New reply




Rusted Logic

Acmlmboard - commit 2f1bc75 [2017-08-27]
©2000-2017 Acmlm, Xkeeper, Inuyasha, et al.

25 database queries.
Query execution time: 0.162009 seconds
Script execution time: 0.056993 seconds
Total render time: 0.219001 seconds