Terraria Hoiktronics: In-game Computer Programmed to Play Blackjack (with special rules)

DicemanX

Brain of Cthulhu
I succeeded in building a massive in-game computer programmed to simulate blackjack. The video showcases the blackjack simulator, and then focuses on how the key parts of the mechanism function.

Video: Blackjack!



Interface:

A15277588CA8CAFA4320B45233C53353BEA8308A


Instructions:

Teleport into the simulator, which automatically adds $50 to the bank. The objective is to amass more than $200 by playing blackjack. If the bank total ever drops to $0, the player loses the game. Each round the player places a bet between $10 and $40 (in $10 increments) and then begins the race against the house to 21. Aces are set to a value of 11. The following protocol should be followed each round:

1) Pull the NEW lever to reset the mechanism
2) Pull the BET lever 1-4 times to place a bet between $10 and $40
3) Pull the DEAL lever to deal one card randomly to the player and one to the house.
4) Pull the HIT lever to draw a card, the value of which will be added to the player tally. Repeat as desired.
5) Pull the HOLD lever to shift card drawing to the house

After HOLD is activated, the subsequent actions are fully automated. The house will keep drawing cards until the player total is matched or exceeded, or until the house busts (tally reaches 22 or more). The house always draws until the tally is at least 17 or greater. If the player's tally exceeds the house's tally, or if the house busts, the value of the bet is added to the bank total. If the house tally exceeds the player tally then the value of the bet is deducted from the bank total. If the player and house tallies are the same, then the bet is cleared and the bank total is unaffected.

Once the player is finished, it is necessary to teleport back to home base as this will reset the bank.


Special rules:

1) Due to the tally system, an ACE has a set value of 11.
2) Since the player is the only participant versus the house, the house will always continue to draw even if it reaches the minimum tally of at least 17 so long as the player's tally is 18 or more. Normally, the house always stops once at least 17 is reached.
3) Blackjack/natural 21 (21 reached on two cards) is not enabled in this version of the simulator. Normally, a natural 21/blackjack beats a 21 on three or more cards.


Key Hoiktronics Mechanisms (scaled down version):

y8JSjHZ.jpg



A8vOaa3.jpg


Explanation of the Mechanism:

For now, see the video. I'll be adding a written description here later.

Credit to inomanoms for the improved randomizer mechanism presented here:
http://forums.terraria.org/index.php?threads/hoik-randomisers.12597/#post-477633


World Download:

https://drive.google.com/file/d/0B4b_4cIU1vVBQnZZTHUtbFdibFk/view (v12.2 - enter B5 in the teleporter hub to reach the blackjack machine)
 
Last edited:
Before I continue, I just want to say: 1. This is my first time posting on any forum EVER, so I apologize if it appears sloppy and 2. I enjoy seeing all of the crazy contraptions you make. Now that's out of the way, when I watched your video I was slightly overwhelmed by all the wiring (as I usually am), but when I saw the vertical reset mechanism, I immediately saw potential for improvement. I buckled down and after 30 minutes or so of messing about in Terraria I came up with a faster mechanism that I have tested at least 50 times without any issues.
2015-06-06_00006.jpg
2015-06-06_00007.jpg


I apologize for it being so ugly, I made a new world it and wood was the easiest building block to get.The reason I have so many HOIKs above the teleporter on the left is so that regardless of where you hit the pressure plate (on the right teleporter) it is guaranteed to work 100% of the time.

Well, I hope this post helped and that you can use this design in your future builds (and if you do, make sure to credit me :p). Thanks for taking the time to read my first post, I hope it didn't suck :D.
 
Before I continue, I just want to say: 1. This is my first time posting on any forum EVER, so I apologize if it appears sloppy and 2. I enjoy seeing all of the crazy contraptions you make. Now that's out of the way, when I watched your video I was slightly overwhelmed by all the wiring (as I usually am), but when I saw the vertical reset mechanism, I immediately saw potential for improvement. I buckled down and after 30 minutes or so of messing about in Terraria I came up with a faster mechanism that I have tested at least 50 times without any issues.

You did a great job with the reset mechanism! It's a reset mechanism that works 100% with a player character, although something similar has been done before by ZeroGravitas:


Skip to the 3:40 mark - ZeroGravitas shows the reset in action, although he uses down hoiks whereas you use up hoiks. The core idea is still the same - hoik teeth pointing towards each other two tiles apart. Nevertheless, the fact that you were able to independently find the reset mechanism, and make it more compact vertically, is still pretty impressive!

With NPCs, this type of reset isn't consistent since NPCs can momentarily step to the right and out of the hoik path. For instance, this NPC is stuck because of a slight right shift at the wrong time:

35EA93DDE0FDFC549E20E6F9A6CADF657E314ECA


Still, using the player instead of the NPC isn't an issue in most cases, so your reset tower is still significant.

You should consider presenting this in the T-MEC forums in a new thread, so that your efforts are more visible to other engineers and to see if we can engineer something that works consistently with NPCs!

Welcome to the forums by the way!
 
Last edited:
Thanks for the feedback! I'm glad I could come up with a good player reset mechanism, but it was bit silly of me not to test it with NPCs:eek:. I will post it to the forums as you suggested and hopefully between me and the community this problem can be solved. Well, back to testing I go!:)
 
I did it! I got the re-setter to work with NPCs and (most) skeletons! The solution was so simple, and yet it took me so long to figure it out:sigh:.
2015-06-06_00012.jpg
2015-06-06_00013.jpg


Differences to the last design:
  • Removed some unnecessary actuated blocks.
  • Put wood blocks underneath the blocks that were removed. The blocks seem to stop mobs from moving about in the machine.
  • This part was optional. Put a teleporter on top of the re-setter to remove entities from the system. The entities get hoiked into an isolated box so they can't teleport back.
After lots of testing, I found two issues:
  • Skeletons getting stuck at night. Also strangely enough, if one of the bottom three switches is flipped, WITHOUT any of the other switches being flipped, then skeletons will get stuck 7 levels above the block that was de-actuated. This did not happen with the guide.
  • Activating the switch when the guide was already standing on the teleporter, although in any big contraptions (such as the blackjack computer) that will never be the case.
Overall, I would say this was a success! Hopefully there aren't any fatal flaws when implementing it in your builds, but we'll have to wait and see! :D
 
Last edited:
My reaction to this thread;
d1ec1ec6bc.jpg


How in the world did you even come up with this? How long did it even take to make? :red:ing hell

It was in the planning stage for a while, but once I figured out the final pieces of the puzzle (mainly a system to compare tallies) then it was easy to build at that point. In Terraria there are a limited number of ways certain things can be accomplished, and many have already been worked out, so the building part isn't as rough as it was last year when we were just getting started on hoiktronics :).

This is simply astounding man. Even for you.

/standingovation

(You need to finish that "other thing" ;) )

Thanks a lot for the kind words! I was a bit surprised myself that I managed to put it together - this was a project that I was postponing for quite a while because I didn't think I could build certain parts. I decided last week to just give it a go and see what happens - sometimes just beginning the whole process is all it takes rather than pondering if it's possible to accomplish!

(and yeah still working on the other thing ;))
 
I updated the map with Porky Minch's excellent vertical reset mechanism. I also improved the wiring - only 2 town NPCs are used to run the simulator, 1 fewer than before.

New download:

https://drive.google.com/file/d/0B4b_4cIU1vVBeXhqY2xvT29YWU0/view?usp=sharing

Additionally, there is a reward for reaching over $200. A number will light up on screen upon winning, and that number is the key to great riches...if you know where to use that number of course.
 
Last edited:
This is just too much. In such a fantastic way. Very fun that you added a reward for beating the house. :D
 
This is just too much. In such a fantastic way. Very fun that you added a reward for beating the house. :D

Thanks! Once 1.3 rolls around I'll create a casino area and have vaults with amazing prizes that can only be opened once the games are all beaten. Should make for a nice challenge! I already have blackjack and slots, roulette will be very easy to add, and I'll have to consider what other casino games to add. Poker might be possible if we get more wire colors in 1.3!
 
Back
Top Bottom