The Trade A.I. of NES Monopoly - Behind the Code

Поділитися
Вставка
  • Опубліковано 26 гру 2024

КОМЕНТАРІ • 385

  • @DisplacedGamers
    @DisplacedGamers  3 роки тому +153

    I broke one of Monopoly's rules in this video! Did you catch it?

    • @ivoramirez6996
      @ivoramirez6996 3 роки тому +28

      I haven't even watched it yet

    • @Kippykip
      @Kippykip 3 роки тому +43

      I'm still watching it and I'm friggin impressed with how you decompiled it so well

    • @izzieb
      @izzieb 3 роки тому +62

      I don't know what rule you broke, but for that - Go to Jail! Go directly to jail. Do not pass go. Do not collect $200.

    • @MobCat_
      @MobCat_ 3 роки тому +30

      I mean I didn't even know you could trade in Monopoly till today.... so no...

    • @BradCorrupts
      @BradCorrupts 3 роки тому +160

      You rolled doubles and only took one turn. :)

  • @Ehal256
    @Ehal256 3 роки тому +96

    Sim city on the nes would be another fascinating game to investigate.

  • @jaysonl
    @jaysonl 3 роки тому +64

    You know you've been watching too many videos on assembly language when you see "Player cash: $3500" and your first thought is "Why are you throwing hexidecimal at me? Why not just say they have ... oh wait. DOLLAR SIGN 3500, not 0x3500"

    • @VinsCool
      @VinsCool 3 роки тому +9

      Lol I had the exact same thought, mainly because I had spent a lot of my free time learning how to code lately.

    • @DisplacedGamers
      @DisplacedGamers  3 роки тому +15

      ... same.

  • @pigs18
    @pigs18 3 роки тому +136

    This game taught me a trick that I use against human opponents to this day. The AI in the game weighs obtaining a Monopoly with far more importance than it probably should. Similarly, obtaining a Monopoly is a carrot you can dangle in front of a human player. But I do so with one caveat. I'm just going to need some money to sweeten this deal. Then, if I obtain the remaining property in a color group I need (which, oh so coincidentally, happened to be exactly seven spaces away when I made the deal), I can instantly load up on houses while at the same time leaving my opponent too cash strapped to purchase much in the way of their houses. (Particularly if I just unloaded the greens on them.)

    • @Mr.Sparks.173
      @Mr.Sparks.173 3 місяці тому +3

      Also, if playing correctly and not adding to the house supply, you can also use this strategy to starve the game of houses.
      Meaning if the other player does, by some chance, get enough money to develop their monopoly they can't anyway cause you control all the houses. In doing so, you become the only player to get much more valuable developed priorities.
      The secret second monopoly.

  • @dchardin1
    @dchardin1 3 роки тому +184

    This game was AWESOME on NES. I have wondered about some of the programming and rules that must have gone into this. I still play it often. The AI was very smart (and sometimes Verrrrry ruthless!!!). Sadly, I think the masterful developer who designed it is no longer with us.

    • @DisplacedGamers
      @DisplacedGamers  3 роки тому +96

      Agree with you on all points. I intentionally wanted to mention Bill Williams in this video. Was sad to discover he was no longer with us while I was doing research. I would have loved to e-mail him and pick his brain! I am thankful for his hard work.

    • @hicknopunk
      @hicknopunk 3 роки тому +4

      @@DisplacedGamers oh dang. I didn't know he had passed.

    • @BrainSlugs83
      @BrainSlugs83 3 роки тому +13

      It's honestly the best digital version of the game.

    • @anonamatron
      @anonamatron 3 роки тому +7

      I think it's the easiest one. It lets you trade cash for monopolies, and most other versions refuse unless you trade a lot of important properties.
      On the NES version you can just buy up one of each color right as the computer players buy them, (I mean I wait for them to land on one, then trade as little cash as possible to get it, which they usually accept since nobody else owns the others) and get your fingers in every monopoly, so everyone will depend on you for trades later. You'll need to pay a lot to get a monopoly, but the computers will accept it given enough cash.
      I usually try to get one monopoly, like Baltic/Mediterranean (while getting at least one from every other color of course) and build up some funds with that before trading for another monopoly or two. Everyone will be bankrupt shortly after that.

    • @jumpman8282
      @jumpman8282 3 роки тому

      @@anonamatron Usually I sell Mediterranean/Baltic early on to whoever gets the second purple (unless I get it myself, of course).
      You can almost always get at least $1,000 for it. Then I use that cash to get a better monopoly.
      Since you always pass Go right before you land on a purple you will effectively never pay more than $250 rent, so don't worry about going bankrupt.
      As long as you keep the other monopolies to yourself (maybe apart from the utilities) you should be able to kill the game rather quickly.

  • @johnray527
    @johnray527 2 роки тому +18

    I'm not a programmer, though I've picked up limited ability to read/understand/follow code over the years. Not really a "math guy" either, though I'm not put off by math.
    I love this channel.

  • @bnasty267
    @bnasty267 3 роки тому +39

    It's interesting to see the real meat of the trade algorithm: the lookup table of property values. It generally lines up with how I remember the game, with the orange properties (St James) being my favorite. Cheap to buy and build, but had some decent rents. The reds and yellows were also highly desired in my family when we played, and given high scores here. I am shocked, however, with the high value on the light blue properties. In my hundreds of plays with my family, I don't remember anyone winning by developing these properties exclusively.
    Anyway, thinking about this brought back some fond memories of time playing a game with some family members that are no longer here. Thanks for the vid.

    • @AGMS00
      @AGMS00 3 роки тому +21

      I wonder if it is based on the table of return on investment on page 48 of "Winning Monopoly" by Kaz Darzinskis ISBN 0060961279. Still have a bookmark there from when I did the AI for Electronic Arts 2008 (or 2010?) version of Hasbro's Monopoly. The idea was to base the algorithm on the book, then dumb it down for the various AI personalities (Railroad Magnate had overvalued railways, for example).
      By the way, I also did the 1997 Star Wars Monopoly rules engine (also used in 2000), and one of our younger programmers at Artech (not sure if he was co-op or recent grad) did the AI. We had a scanned in 2D board version as a plain Windows app that could run the game really fast, about 7 seconds per game. Found lots of AI bugs that way! The rules engine was message based, so you could plug it into the fancy 3D user interface or just have a 2D board with dialog boxes and buttons. Messaging also made remote play easy, as well as switching slots between Human players and AI (in case a network connection dropped). It had a stack based architecture, so you could interrupt a trade to do a mortgage and so on to however many nested levels you wanted. Some other Monopoly engines don't do that :-)

    • @SgvSth
      @SgvSth 3 роки тому

      @@AGMS00 I will say it is a good thing you were able to check for AI bugs as Ubisoft's Monopoly version was unfortunately not tested enough upon its release.
      ua-cam.com/video/yktgqc423hg/v-deo.html

    • @AGMS00
      @AGMS00 3 роки тому

      @@SgvSth Yes, that sort of infinite loop would be picked up easily in the automated game testing we were using. Also back in the day we had a very good (best one ever actually) producer at Hasbro keeping an eye on the game development. Not sure if they still do that (hire a studio to make the game) or just outsource everything for a license fee. That choice would affect decisions about quality too.

    • @ieatvirgins
      @ieatvirgins 3 роки тому +2

      @@AGMS00 I swear the computer cheated at Star Wars Monopoly. 8 year old me certainly thought so!

    • @AGMS00
      @AGMS00 3 роки тому +3

      @@ieatvirgins Ha! That was the number one bug report we kept on getting.

  • @aner_bda
    @aner_bda 3 роки тому +64

    I remember playing Monopoly on the NES. I think it was the first time that I actually learned the rules because everyone I played with up to that point seemed to have their own house rules.

    • @ridespirals
      @ridespirals 2 роки тому +10

      Monopoly is a horrible board game, but the house rules make it so much worse. they always make the game drag on for way too long in one way or another, and this game isn't supposed to go on for 6 hours. I hate Monopoly, ever since I learned about "good" board games I refuse to play Monopoly at all.

    • @shipped_my_pants_3000
      @shipped_my_pants_3000 Рік тому

      Everybody who wants to get into monopoly should be required to put in a minimum of 4 hours into this game

    • @tezcanaslan2877
      @tezcanaslan2877 11 місяців тому

      @@ridespiralsmonopoly is actually really good if you play the editions that doesn’t allow trading

    • @damiencouturee6240
      @damiencouturee6240 10 місяців тому

      Id played monopoly a few times over my life, never very well. I didnt even know what the little houses were for until I was like 25. Last time I played was with my ex and her brothers, I think we played for about an hour before we were all annoyed and just put it away lmao.
      Its drfinitely not a game for everyone, but thats what makes it nice its not trying to be as bland as possible to try and appeal to every single person, its Monopoly and thats it, if you like it cool, if not theres other games, you arent required to play it. Wish more things could be like that nowadays, if you dont like it just dont interact with it.

  • @musickid43
    @musickid43 3 роки тому +35

    This version I'd still my preferred electronic version to play mostly because of its speed and not having to watch a slow animation of the tokens advancing.

    • @rougelazer8278
      @rougelazer8278 3 роки тому +1

      I agree, was looking around and it seems to the fasted version

    • @DoomRater
      @DoomRater 3 роки тому +1

      Beats (lol,Breasts) the ever loving pants off the C64 version which doesn't even automate rent collection. The rules of the game force players to ask for rent, it's actually not supposed to be automated, but dear Lord that's slow

    • @bmartin427
      @bmartin427 Місяць тому +1

      The SNES version is virtually identical to the NES version, except they went way overboard with adding shiny graphics and sounds which really slow down gameplay. Still prefer the NES version for this reason.

  • @thomashorine9198
    @thomashorine9198 3 роки тому +93

    The orange monopoly has additional value as its lower rent is offset by its 3 spaces versus dark blue's 2. This doesn't account for the full discrepancy, however. I would surmise that they used a Monte Carlo simulation to also determine most likely places to land. The fact that people can skip along via cards and get sent to jail makes it a non-trivial problem. People leaving jail and landing on orange is likely the other key factor.

    • @bnasty267
      @bnasty267 3 роки тому +15

      They probably also factored in the cost of developing (i.e. house cost) vs the rent with various house levels/hotels. The orange properties (ranked highest in code) were always my favorite: $100 houses (not the yellow/red $150 or green/blue $200), but could still put a hurtin' on your opponent if they hit on a hotel.

    • @pigs18
      @pigs18 3 роки тому +20

      Two of the orange properties are six and eight spaces from jail making them two of the most oft landed on properties on the board, either by players rolling doubles to get out of jail and players rolling after paying. (The more common 7 roll lands one on Community Chest instead.) Illinois is the most often landed on property on the board, but it's placement around a corner means that it's more expensive to build on those properties. (M$150/building vs M$100/building.)

    • @TheRationalPi
      @TheRationalPi 3 роки тому +16

      You don't need to do Monte Carlo on this. I had a class assignment once to set up a full state transition matrix for the monopoly board (including cards and triple-double rolls to jail), and you can use that to find the average percentage of occupancy for each space for any given turn in the game. You could also determine the average occupancy of each square "in the long run" using eigenvalue decomposition.
      If you do this, you do indeed find that the Orange properties are much much more likely to be landed on than Dark Blue.

    • @thomashorine9198
      @thomashorine9198 3 роки тому +4

      I have also used (a much simpler) such project for my linear algebra students, but I figured a Monopoly programmer, who had access to a working model, would probably just use Monte Carlo.

    • @RichardCraig
      @RichardCraig 3 роки тому

      Jail is absolutely the factor. Even in a two player game it seems like we're in jail every third turn!

  • @aegisofhonor
    @aegisofhonor 3 роки тому +2

    Monopoly is my favorite Nintendo game of all time. It is the only Nintendo game I saved my own money and bought the game new at full price back in 1992. I have played many versions of Monopoly and it is my favorite video game version of Monopoly even to this day. It has so much character and great sounds and fun, it can't be matched by newer versions.

  • @jonc5152
    @jonc5152 3 роки тому +31

    " Don't be coming back now..."
    and the sound of the cash register eating the bills
    I will never forget

  • @donskiver
    @donskiver 3 роки тому +18

    The reason why the orange monopoly is valued so highly is because the jail space on the board. Between chance cards and rolling doubles 3 times, you are highly likely to land in jail at least once in a game, if not multiple times. To get out of jail you have to roll doubles, use a get of jail free card, or fail to roll doubles 3 times and pay your fine. You'll very likely end up on an orange space afterwards, and if you've loaded them up with houses/hotels (which is relatively inexpensive to do because of their position on the board) you'll make a HUGE dent in a players assets, if not bankrupt them entirely.

  • @joshmyer9
    @joshmyer9 3 роки тому +10

    I opened up UA-cam to watch during lunch, and found this. It was an excellent lunch break: thanks for doing the incredible amount of work required to tease this whole mess apart!

  • @WhoIsRyanFox
    @WhoIsRyanFox 3 роки тому +13

    "How would you design this algorithm?"
    Me: Hm, maybe some kind of 4-player variant of expectiminimax?
    NES Dev: LOL, nope. Lookup tables!

    • @TheRationalPi
      @TheRationalPi 3 роки тому

      In the dev's defense, math is hard.

    • @Chronosv2
      @Chronosv2 3 роки тому +2

      The problem with computations like that is that the NES only has 2KB of RAM.
      256 bytes for the Zero Page (RAM that's faster to access because it requires 1 less instruction lookup), up to 256 bytes for the processor's stack to store the program counter, accumulator, x and y registers before subroutine and IRQ jumps, and 1.5KB for use on anything else including sprite locations/info to copy to the PPU, sound/music-related information, etc.
      An algorithm like that would take a long time on the NES' simple 1.79MHz processor, and would take up a fair amount of RAM to store all the information needed to complete a cycle. While using such an algorithm would make sense for some games, I think 3 players sitting around a TV would get rather upset with Monopoly taking a long time to figure out its best deal for a fourth CPU player. Add multiple CPU players to the mix and that time spent could get stupid.
      On 8-bit computers, *most* complex calculations were done in lookup tables.
      Need a sine wave?
      Need non-power-of-two multiplication and division?
      The fastest way to go about those tasks is typically a lookup table.

    • @williamdrum9899
      @williamdrum9899 3 роки тому

      Why do the work at runtime (especially on a machine that can't multiply or divide in hardware) when the results are always the same?

    • @ZipplyZane
      @ZipplyZane 3 роки тому

      Also, the game allows up to 8 players. I remember it being the only 8 player NES game I'd ever heard of back when I was a kid. You just all play with the same controller.

  • @TheVideogamemaster9
    @TheVideogamemaster9 10 місяців тому +2

    I recently developed my own monopoly game in JavaScript, and I was surprised at how much code and logic goes into all the interconnected systems. After 3,000 lines, I was starting to regret my decision lmao

  • @verve1858
    @verve1858 3 роки тому +49

    It would be cool to compare code from different versions of Monopoly and see how the algorithm has changed

    • @samuelthecamel
      @samuelthecamel 3 роки тому +4

      The AI is still not very smart even in modern Monopoly games. Sure, it is smarter, but there are always ways to exploit the AI.

    • @RichardCraig
      @RichardCraig 3 роки тому +3

      Specifically I wonder about the other ports of this specific version... It was on Genesis, SNES, Gameboy, and GameGear (not Master System, it was completely different). The best part is they threw a wig on poor old Isaac and renamed him Betty Sue for the SNES version, lol! Early transgender video game character perhaps?

    • @BagOfMagicFood
      @BagOfMagicFood 3 роки тому +2

      I wonder if anyone ever ripped the code from the standalone talking LCD handheld Monopoly game I used to have!

    • @CarbonRollerCaco
      @CarbonRollerCaco 3 роки тому

      @@RichardCraig I think they changed ALL the CPU characters. There was a Jeeves from what I remember.

  • @Phoboskomboa
    @Phoboskomboa 3 роки тому +24

    It's been forever since I played this, but I remember noting how obsessed the computer was about completing monopolies, even on lesser properties. You could often get them to give you all of their cash and several other properties for one of the lowest valued monopolies, and then they wouldn't even be able to afford to put houses up.

    • @FEARitself100
      @FEARitself100 2 роки тому +1

      This is how I would play, especially if I aimed the 2 giants lol my goal was always 'buy 2 properties, and 1 goal property' then
      Offer a trade with a computer my random property to get them to bite, and it's insane how fast I win cause their desperation always made them overspend

  • @xotmatrix
    @xotmatrix 3 роки тому +21

    Thanks for this analysis. NES Monopoly doesn't get enough love.

  • @nicrule4424
    @nicrule4424 3 роки тому +81

    I recently started picking apart Galaga on the NES in an attempt to hack in simultaneous co-op. I keep getting lost in subroutines I can't find a purpose for, but I am so lucky it doesn't have anything nearly this complex going on. I don't know how you do this with so much abstract code that doesn't have any clear output to the game. This must have taken forever. Anyway, thanks for another interesting video.

    • @NesrocksGamingVideos
      @NesrocksGamingVideos 3 роки тому +7

      Hack the soubroutine call replacing it with EA EA EA and play the game to see if anything changes! Sometimes even this fails to give you a clue since it can be subtle.

    • @recompile
      @recompile 3 роки тому +5

      It's really just a matter of spending enough time with it. A good debugger makes a huge difference, but it's mostly going to come down to careful note-taking, time, and intuition. Also, try not to get 'stuck' on one thing. You'll find that, sometimes, the code your looking at is just nonsense, either doing nothing or purposefully wasting time. I show some of that in the 'fixing e.t.' article. Assembly programmers weren't gods, after all, and they did stupid things just like programmers today.

  • @1mariomaniac
    @1mariomaniac 3 місяці тому +1

    Honestly, yeah sure the AI for this game is pretty primitive, but its just facinating that its advanced enough that it can examine the board and ask another computer or human opponent "Hey, I'm interested in this, what would you like in return?" And then be able to not only examine the offer once a property is selected, but give a counteroffer if the terms aren't to their favor. The fact that this was all built in assembly is incredible!

  • @VinsCool
    @VinsCool 3 роки тому +10

    That was great to watch develop as the code was being explained, I could mostly follow along without too much trouble understanding, and that was the best part for sure.
    I have been digging the rabbit hole of 6502 ASM programming for some time now, and it really makes me smile to realise how much thinking outside of the box is required to work around the limitations to get things to work at all.
    It's a lot of fun, a painful journey for sure, but for someone who is stubborn about what they want to achieve just to prove a point, it's incredibly satisfying to get through the code, read the comments, and think, damn, that took a lot of fucking around to get this working at all, and man does it feel satisfying when things do work as expected after hours if not days of trial and error.
    Sometime, it's the dumbest approach that could be the solution, so I always think about this situation where the code makes no sense, and remember, maybe that's why it works, it doesn't try to be logical, but simply accomplish what you want it to do, 1 instruction at the time :D

  • @Twenty_Six_Hundred
    @Twenty_Six_Hundred 3 роки тому +8

    Love your videos. Fun fact: The NES version is one of the fastest flowing ports of Monopoly

    • @DisplacedGamers
      @DisplacedGamers  3 роки тому +5

      I've played this one more than any of the other versions I have played (although my sample size is not *that* large). The "hurry" mode that cuts the fluff (charming fluff... but fluff) is awesome.

    • @Twenty_Six_Hundred
      @Twenty_Six_Hundred 3 роки тому +1

      @@DisplacedGamers Yeah it's my favorite version because of how fast the game plays. Many others leave the player waiting though long winded cutscenes and extended A.I decision times

    • @RichardCraig
      @RichardCraig 3 роки тому +1

      Same here, I can fly through a game with 7 CPU opponents in like 20-30 minutes.

  • @LegendBegins
    @LegendBegins 3 роки тому +6

    I always look forward to this series! Thanks for diving into the code so we don’t have to!

    • @DisplacedGamers
      @DisplacedGamers  3 роки тому +5

      There was definitely a moment with Monopoly trade code where I had to decide IF I wanted to see the thing through or not.

  • @Chronosv2
    @Chronosv2 3 роки тому +1

    These videos are always a fun watch. As someone who's trying to get into 8-bit computer/console game development, this information is always absolutely fascinating to watch and learn from. Thank you for taking the time to put these together!

  • @jansenart0
    @jansenart0 2 роки тому +1

    This is such an underrated video. NES Monopoly ought to blow any programmer's mind.

  • @tomsko863
    @tomsko863 3 роки тому +2

    YAY, Babylon 5 Reference! You have my eternal subscription now.
    "I see a great hand, reaching out of the sky"

    • @DisplacedGamers
      @DisplacedGamers  3 роки тому +1

      Yes! I am glad you caught that!

    • @tomsko863
      @tomsko863 3 роки тому

      ​@@DisplacedGamers I see it in places it usually doesn't exist. FYI, Mira Furlan died recently :(

  • @homestar92
    @homestar92 3 роки тому +1

    Always a treat when your channel pops up in my notifications. As a programmer, gamer, and monopoly apologist, this video ticks a lot of boxes for me!

  • @PJ_McPhizzle
    @PJ_McPhizzle 3 роки тому +9

    Great video! I would someday like you to do the SNES version of SimCity, and why the traffic is broken on roads. I remember as a child needing to remove every road and replace them with rails, which wasn't very realistic. It's always bothered me, and I've been hoping for an explanation or a patch to fix it for many years.

  • @Acoha7
    @Acoha7 3 роки тому +1

    I really love this series. You keep blowing my mind with such novel ideas for analysis content! I can’t fathom the amount of work you must’ve put into it.
    The game genie easter egg was an excellent idea. Good stuff.

  • @coreybarnett2158
    @coreybarnett2158 3 роки тому +3

    Loved this game growing up. I really appreciate the game more knowing the lengths the developer went to programming the AI.

  • @Sixfortyfive
    @Sixfortyfive 3 роки тому +2

    11:53 It's common knowledge among Monopoly players that the orange color group is the most valuable one in the game, mainly for two reasons:
    1) It's the most commonly landed on group (prime distance from jail), so it collects rent more than any other.
    2) It's cheap to build on ($100 per house), so you can more easily develop it to a point where it cripples other players.
    I'm not shocked to see the light blue group rated highly for similar reasons, as it's the cheapest group to develop on and a good stepping stone toward the "housing shortage" strategy of buying up all the houses.

  • @Paul-qg3iw
    @Paul-qg3iw Рік тому

    As Gen Xer who in lock down went back to my childhood tech, I am so full of admiration for the programmers and designers whose creativity and brilliance gave me and many of my cohorts a childhood which simply had no parallel with that which what before...oh and I love that break this down on programming too!

  • @arthurhenriqued.a.ribeiro2078
    @arthurhenriqued.a.ribeiro2078 3 роки тому +1

    First time I picked up what an LSR is; saw that on a Zelda Wrong Warp video but never got an in-depth look into it. Props to you!

  • @NTSTS0
    @NTSTS0 2 роки тому

    This is one of the coolest NES code dive videos I've seen.

  • @trippe2k
    @trippe2k 2 роки тому

    I apprecaite you making these videos. I know you may not always get millions of views but I really enjoy these videos and like the deep analytics your provide on each topic.

  • @Greatfox54
    @Greatfox54 3 роки тому

    I didn't know NES monopoly speedrunning did it that way. I grew up with genesis monopoly and while abusing the ai trade behavior with utilities, I'd mortgage the utility I had to get the $75 and then trade it to the ai for $490. They added a check for that exact scenario NES monopoly speedrunning takes advantage of and even if the ai accepts the trade and wouldn't be able to afford the 10%, it automatically declines the deal on the ai's behalf so that exact bankrupt can never happen. Makes me wonder what else is different between the NES version and Genesis version. Great code walking for this video.

  • @RobertDunn310
    @RobertDunn310 2 роки тому

    As someone whose programming experience doesn't go beyond simple Python apps, this was an amazing and fascinating video that really satisfies my inner geek in a way few UA-cam videos have ever managed to do.

  • @skins4thewin
    @skins4thewin 3 роки тому +2

    Lol it's funny that you bring this video out now, considering I've just started playing the NES & SNES versions of Monopoly regularly. I also found it funny that the NES version seems to be MUCH better than the SNES one, w much cleaner & easier to use menu's and the game just runs much better & faster. You can complete a full game of Monopoly much faster on the NES version.

  • @Fender178
    @Fender178 3 роки тому +1

    My favorite version of video game Monopoly. I played the hell out this on my NES back in the day. That trade exploit is funny as hell make the CPU player go bankrupt because he couldn't pay the 10% interest on the mortgage. Also the rule you broke is that you rolled doubles there for you skipped your extra turn. Speed runners have a good sense or humor.

  • @Webmage101
    @Webmage101 2 роки тому +1

    4:19 'Mobile viewers may require a microscope' Hahaha that's gold

  • @fbodirector7464
    @fbodirector7464 3 роки тому

    This channel should have so many more subscribers than it does I can't think of a better way to make reverse engineering code fun than to dissect classic video games.

  • @philcooper9225
    @philcooper9225 3 роки тому

    I've spent a decade in IT but I never wanted to learn about code until I found your channel

  • @RichardCraig
    @RichardCraig 3 роки тому +3

    I've been playing this specific version regularly since it came out! I love when the AI gets into trade fights. Please PLEASE do a video explaining any (if there are any) difference between the AI opponents. That's always been something I've wondered about!

    • @ZipplyZane
      @ZipplyZane 3 роки тому +2

      Seeing as Ollie is specifically needed for the speedrun, it would suggest that the difference in CPU players do matter. And, assuming he didn't skip over anything else, it would seem the differences must be in the "what to offer in trade" logic.
      This is interesting to me, as it makes me wonder why they choose Ollie. Is it just because he will actually offer a trade at the beginning? Because the above paragraph suggests all the CPU players would accept the final trade.

    • @knurlgnar24
      @knurlgnar24 3 роки тому

      I don't know the programming details but the AI players all have different trading styles. Some refuse nearly all trades, others like Ollie accept terrible deals. I think they simply put a multiplier on the value calculations or some similar thing. Other than that they play mostly the same.

  • @GrayBlood1331
    @GrayBlood1331 3 роки тому

    I really love these code walks, which is good news for you since it means you'll have an endless supply of content!

  • @SpockvsEgon
    @SpockvsEgon 3 роки тому +2

    I discovered that if the AI proposes a trade, as long as you don't remove the item they asked for or request another property in that same family or a property that has been built on, you can request that the AI give you all the rest of their money and assets, and they will always accept the trade.
    For instance, the AI requests one of your green properties to go with its green properties.
    You counter offer by requesting all their money and all their properties except the green ones, and the AI will always accept.
    This works on the NES and Genesis versions.

  • @alexanderyoung5785
    @alexanderyoung5785 3 роки тому

    I grew up on this exact game, glad to hear so many others cherish it as well

  • @Dinnye01
    @Dinnye01 3 роки тому

    Daaamn. You got recommended under an MVG video. I am glad I clicked. Instant subscribe!

  • @kri249
    @kri249 3 роки тому +4

    This was totally worth the wait. I'm curious about one thing though, do each of the computer players have different codes that determine their decisions in the game? I wondered this because of the choice of Ollie to achieve the speedrun. Would any of the other players have made the same mistake? Are some more cautious while others are more confident?
    Because if I were to code a monopoly game I'd do this to simulate the diversity of players you'd face in real life. Including players like Ollie. Which makes me wonder if there's more treasures amongst the mountain of code you already dug through.
    Either way this was a great video. I can never get enough of these.

    • @pilotcritic
      @pilotcritic 3 роки тому

      When I was 10 I somehow concluded that Ollie was the dumbest player in the game. I don't remember how I reached that conclusion but I don't think it's a coincidence

    • @RichardCraig
      @RichardCraig 3 роки тому +1

      @@pilotcritic I always assumed they're arranged in order of difficulty with the fancy pants rich people being tough while Ollie looking like Golgo 13's homeless cousin doesn't look like much of a threat.

    • @adamengelhart5159
      @adamengelhart5159 3 роки тому +1

      If you look at the video around 0:50, you can see the text "Top Four" on the right with arrows pointing to the left, and the text "Bottom Four" on the left with arrows pointing to the right. Ollie's position in the lower right corner is right where I'd expect the worst AI to be.
      Also @Richard Craig's "looking like Golgo 13's homeless cousin" comment: congratulation; a winner of the internet is you. :-D

  • @ItsHyomoto
    @ItsHyomoto Рік тому

    This is what I learned when writing a chess program. Implementing Chess is trivial right up until the win condition: determining checkmate is where most of the code lies. That sounds like this part of Monopoly: all of the rules and mechanics are fairly trivial to implement except trades.

  • @TroyFullwood
    @TroyFullwood 3 роки тому

    this is wanna my fav ports! really well put together

  • @sagacious03
    @sagacious03 2 роки тому

    Neat analysis video! Thanks for uploading!

  • @lolKbgTgm6621what
    @lolKbgTgm6621what Рік тому

    11:15 - not sure if this comment was meant facetiously, but just in case you were really wondering, there's plenty beyond board location that factors into Monopoly property value - namely, probabilities. All the hotels in the world won't help if people don't actually land on them, so two-property groups (Blue, Dark Purple, and Utilities) are slightly less valuable than otherwise-equivalent three-property groups. Additionally, because players may be sent to Jail or directly to Go, and because dice rolls are clustered around 7, *and* because the Jailbreak mechanics favor the 2nd, 4th, 6th, 8th, 10th, and 12th spaces from Jail, the left and top sides of the board (i.e., between Jail and Go to Jail corners) receive more traffic than the right or bottom.
    I'll spare the full breakdown, but short version is that the Blue properties are for suckers and the CPU sort of knows it.

  • @Controllerhead
    @Controllerhead 3 роки тому

    Intense video! Loved it. ASM routines are fun to design, but, i have a much greater appreciation for higher level languages now =)

  • @RogueBagel
    @RogueBagel 3 роки тому

    This video turned out to be WAY more interesting than I thought it would! The part I was hoping you'd get into was the differences in logic/parameters between the AI players. Would love to know who is the smartest/greediest/stingiest, etc.

  • @sanderbos4243
    @sanderbos4243 3 роки тому

    This was an awesome explanation, thank you for putting so much effort into the presentation!

  • @_digitalcoffee
    @_digitalcoffee 2 роки тому

    This is the video which earned you my subscription. Bravo Zulu.

  • @GHKuinli
    @GHKuinli 3 роки тому +14

    A glitch in this game is that if you hold "down" on the d-pad while your turn is active you would skip the pay screen when landing on the opponents properties and thus avoid losing any money and breaking the game as you would be literally invincible.

    • @renakunisaki
      @renakunisaki 3 роки тому +1

      Is it a glitch or a leftover debug function?

    • @GHKuinli
      @GHKuinli 3 роки тому

      @@renakunisaki I think it is in fact a glitch, as it doesn't need any previous inputs or setup to activate it and how easy it is to take advantage of it at any point in the game, and without any visual or sound indication that it has happened, it can easily deceive human players who are not paying attention to their money.

    • @FlashDrive356
      @FlashDrive356 6 місяців тому +1

      I pulled up monopoly on my GBC and decided to try it, not only does it skip payment but it causes me to skip around the board (i.e. from a red tile to a pink in 1 turn and getting the money from passing go), definitely a glitch

  • @PlasticCogLiquid
    @PlasticCogLiquid 3 роки тому +3

    Bill Williams is the genius that made Alley Cat

  • @rolen47
    @rolen47 3 роки тому

    I loved this game, beat it several times and always remembered that the computers were really terrible at keeping good properties. All they wanted was just cold hard cash and it was very important to make sure that they never get the ability to place houses/hotels. Trading early and making sure you had at least 1 property of each color would almost always guarantee you'd win eventually. Even if you have to mortgage your properties to secure 1 of every color it was worth it.

  • @SaberKittyZero
    @SaberKittyZero 2 роки тому

    OMG I actually remember this game. Played quite a bit of it when I was a kid.

  • @DyrianLightbringer
    @DyrianLightbringer 3 роки тому

    Out of all property groups on the Monopoly board, the orange group is possibly the most valuable. This is because the first orange is 6 spaces from jail, the second is 8 spaces, and the third is 9. On two six-sided dice, a bell curve puts a result of 7 as the most likely outcome, with 6 and 8 being tied for second most likely. Couple that with the Go To Jail space, the fact that 3 doubles can send you to jail, there is a chance card that can send you to jail, and there is a card that can send you to St Charles Place (which puts you 7 and 8 spaces from the second and third orange properties), and you can see why the orange group is landed on more than any other group on the board. Counter-intuitively, the green and dark blue properties, despite being most expensive, are landed on the least for these same reasons.

  • @kingawsume
    @kingawsume 3 роки тому

    Methinks the monopoly score calculation is also weighted by the likelyhood of landing on a particular space. The Red group of properties are the most landed on spaces on the board, followed by the Orange group.

  • @niagargoyle
    @niagargoyle 2 роки тому

    To answer the question posed just before the 12-minute mark (why does orange have a higher value than dark blue), it is important to remember that the value of a property is not just how much it costs but also how much money can be made off of it from rent. Monopoly has so many "go to such-and-such location" cards that nobody ever hits Boardwalk or Park Place. By the same principle, there are several ways to go to jail; and from jail there is a 53% chance that the next square you land on will be orange. Light blue also has a similarly high rating because it has a 53% chance of being hit from Go.

  • @5371W
    @5371W 3 роки тому

    I know nothing about coding and am even less about math, but all these videos are so interesting to me.

  • @DoomRater
    @DoomRater 3 роки тому +1

    If someone told you updated NES Monopoly code is niche, they should go and play both the Commodore 64 versions and the SNES versions, both of which cut a seriously slow pace overall. In fact the Commodore 64 version does not automate rent collection, forcing players to call each other out to collect it! For this reason I had a serious itch to try porting concepts of the NES version of Monopoly to the C64.

  • @jorgelotr3752
    @jorgelotr3752 3 роки тому +2

    11:58 I'm pretty sure that the score for monopolies is based on the likelyhood of stepping on them. I mean, going by my own experience in the game, the ones rated higher are also the ones that gave me more money or made me lose the most (as well as the places I instinctively want to make my own). Dark Blue is quite expensive, but it's quite difficult to reach them (although you are screwed no matter where you step in that part of the board).

    • @Sixfortyfive
      @Sixfortyfive 3 роки тому

      The only thing that the dark blue group really has going for it is the "Advance to Boardwalk" card. So at least there's a *chance* of hitting that space on any given roll. Otherwise the price to develop on it would never justify itself. The green group is abysmal because of that.

    • @SvendleBerries
      @SvendleBerries 2 роки тому

      I personally liked going for the orange properties first, because anytime someone got out of jail, there was a good chance they would land on my properties. And once you got hotels on them, things get pretty easy.

  • @christopherschumacher2649
    @christopherschumacher2649 3 роки тому +1

    At 21:34 when you roll a six it's via double 3's. The six would need to be rolled via five and one or four and two as doubles give you an extra turn.

  • @theraven1120
    @theraven1120 Рік тому +1

    Just found this series a few weeks ago. Love it! After reaching and watching this video, a question popped into my head. There are 8 Characters that can be used as CPU opponents. Do they ALL think the same when it comes to this? Or do they each have different "personalities"? Say, example, would CPU A favor a certain property group more than CPU B? Maybe CPU C would be in it for the money game and not necessarily the property game(having the most money over having the best valued property)?

  • @PotbellyPunch
    @PotbellyPunch 7 місяців тому

    the game boy port was one of my favorite travel games. It felt like magic having CPU to play monopoly with on the go like that.

  • @fromthegamethrone
    @fromthegamethrone 3 роки тому +1

    What a video. It's a so weird seeing none UK names on a monopoly board.

    • @DisplacedGamers
      @DisplacedGamers  3 роки тому +1

      I never really thought about the names being different until I started doing some research on Monopoly in general, and I almost considered including a little note about names being different.

    • @fromthegamethrone
      @fromthegamethrone 3 роки тому

      @@DisplacedGamers That was exactly my thinking. More like "Oh, I never thought about there being anything on blue other than May Fair and Pall Mall" yet at the same time, I knew that Monopoly was localised. Either way man, great video - I'll just pretend I understood most of what was going on.
      I get it on a pseudo code level, it's just logic - but my brain cant understand how those numbers equate to a programming language! Clever stuff, keep it up.

  • @joshd2538
    @joshd2538 2 роки тому

    Orange and red are, by far, the most valuable monopolies. If you have even one of those you can proably win. Reason: People get stuck in Jail near the end of the game and when they get out they're almost always going straight to orange or red.

  • @TheBlueArcher
    @TheBlueArcher 3 роки тому

    Nice video. I have never played any "official" or "licensed" version of video game monopoly on ANY console, where the computer won't get fleeced into a bad situation. There are many different situations for every version, but One VERY common one is that the orange and red property groups are SEVERELY undervalued by the AI for how often they get landed on due to the many ways people can end up in jail...

  • @Nomadnetic3
    @Nomadnetic3 3 роки тому

    This is excellent, great job on your analysis!

  • @catholiccontriversy
    @catholiccontriversy 3 роки тому

    In N64 monopoly there must be some kind of "don't shift power too much" check for human to human trades, because I remember one time my brother wanted to quit while playing with me and some computers but I wanted to continue, so the plan was that he trade everything to me for $1 and then go bankrupt on the next turn, but the game wouldn't let us, and I think I kept doing "favorable to me trades" until it said "no, can't do any more" with him still having a decent amount of properties and money, and at that point I think we just turned the game off.
    Pretty neat to see some of the back end as while the programming of the N64 was probably more advanced than the N8 (nintendo 8-bit, play on the bit counting), it probably had a lot of the same "how do I calculate a fair trade" logic.

  • @robertrocheville7769
    @robertrocheville7769 2 роки тому

    I saw a video about what the best properties were and I don't remember the details, but that's why the lookup table is the way it is.
    Part of it is related to the math of the rolls, and the other part is related to that dag-on "go to jail" space.

  • @wknight8111
    @wknight8111 3 роки тому +3

    If you're going to be looking at AI, it would be awesome to try and dissect the diplomacy AI for Civilization 2. Even ignoring the "Ghandi is a genocidal maniac who loves to launch nukes" bug, it's still interesting to see what deals different civs will make.

  • @breathstealer5486
    @breathstealer5486 2 роки тому

    Seeing the monopoly scores just help vindicate that I've been playing monopoly correctly all these years. Orange properties must be acquired

  • @anon_y_mousse
    @anon_y_mousse 2 роки тому

    I haven't played that game in years. I even have a copy for the PC that came with a box of Cheerios back in the 90's. Will definitely have to find it when I finish moving. I think I know which box it's in.

  • @marscaleb
    @marscaleb 3 роки тому +1

    16:44 "Maybe Nintendo developed a few in-house functions"
    Actually Nintendo didn't do a lot of their programming in-house at all. I don't have the exact numbers nor can I even comment about those specific examples, but I have seen from stories about the development from these NES games that they would often contract with other companies to do the actual programming work for a number of their titles, including some of their really big titles.

  • @bloodykenshiro8218
    @bloodykenshiro8218 2 роки тому

    The high valuation of the orange group is probably a bias programmed into the game because it is mathematically the most landed property in the game.
    Your videos inspired me to try and dig in games with debuggers (though I'm messing with a SNES game). I'm not a programmer or anything, but your videos have been helpful.
    I hope you can talk about debuggers sometime.

    • @DisplacedGamers
      @DisplacedGamers  2 роки тому +2

      I would like to talk about debuggers at some point. What would you like to hear/discuss?

    • @bloodykenshiro8218
      @bloodykenshiro8218 2 роки тому +1

      @@DisplacedGamers mostly how they display information. I'm trying learn Snes asm on my own after watching your videos (trying to lower the encounter rate in a game). I have the RAM address but I can't find the routine yet. Mesen -S does a lot of syntax highlighting that could be clues, but I can't really say.

  • @Manabender
    @Manabender 3 роки тому

    21:32 Just for fun, I wanted to find the probability of this happening.
    You need a 6, then an 8, then a 3. And, in order not to waste any time, you need to *not* roll doubles.
    There are 4 non-doubles rolls of 6.
    There are 4 non-doubles rolls of 8.
    There are 2 rolls of 3.
    So the overall probability comes out to 4*4*2/6^6, or approximately 0.0686%. Or, put differently, 1 in 1458.

    • @Tergaim
      @Tergaim 2 роки тому +1

      It depends on whether you need to buy the third light blue as in, the "most-left one", or as in "the not owned light-blue". In the second case, 6-9-2 is also a working combination.
      In that case, the probability goes up to 0.103%, or 1 in 972 !

  • @overture2112
    @overture2112 Рік тому +1

    Great breakdown.
    Question: Which version of monopoly do people think has the best AI?

  • @michaeldew7904
    @michaeldew7904 2 роки тому

    I actually learned a Monopoly rule from this video. The part @22:33. I didn't know you had to pay mortgage interest if you don't unmortgage the property.

  • @Medinaxz
    @Medinaxz 2 роки тому

    I know it's old, but some of the properties (orange, light blue) tend to have higher value scores due to simple probability. Over the course of many dice rolls, the player is most likely to hit specific spots on the board. These tend to favor the noted properties above.
    To me it's interesting that the values of properties are also coded around probability. Even though the later properties tend to rake in the most money, players will often find themselves hitting those two with the most frequency, and a monopoly/houses on them will very often be a solid investment.

  • @michaelstevenson5044
    @michaelstevenson5044 2 місяці тому

    The lfsr function on legend of zelda and tetris mimics the way that lfsr is done in hardware.

  • @TheDeelunatic
    @TheDeelunatic 3 роки тому +1

    For St Japes place, Tennessee Ave, and New York Ave, the reason for the max weight on the monopoly for that property set has to do with how far it is from the jail, because the dice roller is more than just a random number generator where it is actually simulating two dice so it's more like a random number between 1 and 6 ran twice instead of a 1-12. This results in rolls that are typically around the 6 7 and 8 range. so what properties are that far from the jail? That's right...6 spaces away is st James place, 8 is Tennessee Ave, and 9 is New York Ave with 7 being the community chest and 10 being free Parking.
    Worth noting this is basically the best way to win the late game (in video game and in real world) since going to Jail is so common (rolling doubles, go to jail card, the space on the board) Avoiding these properties is damn near impossible.

  • @murpium
    @murpium 10 місяців тому +1

    21:11 I wish you could have shown why it has to be Ollie in particular and why it has to be in “hurry” mode.

  • @ZipplyZane
    @ZipplyZane 3 роки тому +3

    The fact that you have to pick Ollie for the speedrun very much suggests that there is a difference in the different AI, yet at no point as you stepped through did you mention that.
    Does that mean that the different CPU player logic is implemented entirely in the "what to offer in trade" aspect that you didn't go into?

    • @andrewsprojectsinnovations6352
      @andrewsprojectsinnovations6352 2 роки тому +1

      It could be RNG manipulation as well. There was little that could be done to make it truly random in those days so the player was often used as the primary "wildcard." Make the same decisions at the same time, and you could often expect the same results.

  • @dudenoway1267
    @dudenoway1267 Рік тому

    Holy cow! About 10 years ago I attempted to clone this game for direct play on PC(window, apple, & Linux OSs) and had the graphix, sound, & menus all done up to the AI logic, and hit a brick wall. Couldn't figure out just how the trade logic was done. so the project stalled. Couldn't find any kind of resource on it at the time either. So this is almost like a god send! Only thing I wish you had taken a stab at is how they tweaked each AI so that they would play a little different. Hence why Ollie is used in the speed run(would any of the other AI go for that instant loose trade just based on the underlining trade logic?)

  • @denzal689
    @denzal689 Рік тому +3

    Sometimes, I'd be winning the game with lots of money and properties, and I would try to give the CPUs cash to keep the game going, and they reject it.

  • @xdonthave1xx
    @xdonthave1xx 2 роки тому

    One of my aunts had this game. Sometimes when I would visit, I would set it up to all AI and just watch.

  • @1up20x6
    @1up20x6 3 роки тому +1

    Loved this video - I've always wondered how board game AI works in video games, so I was really happy to see this in my subscriptions.
    Any reason the speedrun specifically has to choose Ollie for that exploit?

    • @guillermomolina3107
      @guillermomolina3107 3 роки тому +1

      The manual for the game contains some descriptions on the CPU opponents, letting you know in advance what their possible behavior will be during gameplay, as well as dropping some clues on it. In the case of Ollie, it describes him as "a good natured man who just can't seem to hold onto his money. There's always someone who needs it more than he does, and he just can't say no (...)" This might explain why the AI algorithm for Ollie seems to favor other players' trades but his own, making him the ideal CPU for exploit in a speedrun.

  • @JamesLewis2
    @JamesLewis2 3 роки тому +2

    I wonder how similar the AI is in the Master System version of Monopoly; I know that the data structure for each property would need to be different, because the game supports up to 10 players.

  • @retrogamestudios7649
    @retrogamestudios7649 2 роки тому

    I used to love setting it to play 8 cpu players when I was a kid. It's even better if u manipulate the properties beforehand. Give 1 cou all the cash and no deeds....also the fact the I'm from Beverly mass on the title trademark screen I literally could go across the street and ask for the definitive rules book which I still got to this day it's like the size of a bible....damn that Gertrude was ruthless

  • @Chubby_Bub
    @Chubby_Bub 2 роки тому

    The way the speedrun technique tricks Ollie is pretty funny. I wonder how difficult it would be to change the AI so that it also took into account its own money.

  • @TetrisMaster512
    @TetrisMaster512 3 роки тому +3

    If you have any interest in doing more videos on game AI, I think an interesting one might be Chessmaster on the NES. Ever since I wrote my own simple chess engine several years back I've been curious about how they implemented this stuff on such a primitive system. Could be an opportunity to cover stuff like game trees and the minimax family of search algorithms.

  • @ferceron8992
    @ferceron8992 3 роки тому +1

    This video is so informative, but first, we need to talk about parallel properties...

  • @palaceofwisdom9448
    @palaceofwisdom9448 2 роки тому

    The AI that I really want to see analyzed is Monopoly Streets for PS3. Every single game the AI opponents would conspire and make a monopoly of the railroads, which rendered it unplayable unless I managed to buy at least one of them.

  • @aurathedraak7909
    @aurathedraak7909 3 роки тому +2

    i can imagine, how tedious and hand cramping on a keyboard this was when a programmer had to this, even for me this is waaaaay too much and how they fit this in into a cart, is amazing.