Code Monkey home page Code Monkey logo

fo4_games's Introduction

Fallout 4 Games

Play classic games in Fallout 4.

Check out the video playlist for work in progress footage.

Features

  • Blackjack
  • Slots
  • Roulette
  • Caravan
  • Cadillac
  • Spades

Requirements

  • A computer, PC only.
  • F4SE

Installation

  • Start Fallout 4 with Games.esm enabled within your load order.
  • Enable BarstoolGames.esm for classic games implemented in the vanilla game world.

Playing

Use the in-game developer console for access to the projects testing cell. Use the console command coc GamesTestCell. To add caps, use the console command Player.AddItem F 100. If BarstoolGames.esm is enabled you may play games with certain NPCs or build game tables in settlements.

Contributing

Please read CONTRIBUTING.md for details on contributing to this project. To make a request, report a bug, or ask a question, submit an issue on the github issue tracker.

See also the list of contributors who participated in this project.

Acknowledgments

  • The White Collar Players - Creator, contact on discord TheWhiteCollarPlayers#7879
  • Scrivener07 - Scripter, contact on discord Scrivener07#4154
  • Se7enRaven - Asset Creator, created playing card assets as a resource for this project. See LICENSE.RESOURCE.md.
  • Corvalho - Asset Creator, created custom card table as a resource for this project. See LICENSE.RESOURCE.md.
  • Expired - Programmer, added F4SE papyrus functions for scaleform interoperation.
  • Reg2K - Help, counsel regarding scaleform user interface and papyrus scripting.
  • Neanka - Help, counsel regarding scaleform user interface and papyrus scripting.
  • shad0wshayd3 - Help, counsel regarding papyrus scripting.
  • ForsakenShell, E, 1000101 - Help, counsel regarding papyrus scripting.
  • Sireyn - Tester, provided excellent feedback and reported critical bugs.
  • Sarinia - Help, counsel regarding meshes, textures, and materials.
  • Jonathan Ostrus - Help, counsel regarding settlement objects in the Creation Kit and papyrus scripting.
  • Kinggath - Help, counsel regarding scripting for adding game tables to settlements.
  • Spooknik - Help, counsel regarding creation of custom material swaps.
  • Gilles, Sagittarius - This project was inspired by Sagittarius's Tavern Games - Mini Games in Skyrim. Sagittarius has also provided support and feedback during development.
  • shavkacagarikia - Help, counsel regarding papyrus scripting.

License

This project is licensed under the permissive MIT License. See the LICENSE.md file for details.

Please respect the license for each resource or asset used by this project.

fo4_games's People

Contributors

scrivener07 avatar thewhitecollarplayers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fo4_games's Issues

Cannot re-activate table

After the player first activates the table and is presented with the yes or no option, if they select No, the table cannot be re-activated to bring up the message box again.

Perks

I like the idea of perks that can be earned by completing challenges related to gambling. An idea for one of these perks went something like this.

Perk Luck of the Draw
Description You always keep a trick up your sleeve.
When you accept this perk, choose a card. You hide this card in your boot. During a card game you may either choose to draw your next card or play the card in your boot.

An example of a gambling challenge to complete in order to earn a perk might go something like this.
Challenge: Score a black jack three times in a row to earn Luck of the Draw.

Mod Title?

This issue thread should be used for suggesting and discussing mod titles. Current suggestions:

  1. Gambling

  2. Fallout 4 Gambling

  3. Commonwealth Gambling

  4. Gambling of the Commonwealth

  5. Gambling in the Commonwealth

  6. Barstool Games

Wager cannot change with insufficient caps.

Values are not resetting correctly after a match.

Problem 1

screenshot4
In this screenshot the BET is stuck on 50 and cannot be changed except for setting MINIMUM to 5. On the last hand a bet of 50 was valid because there was sufficient CAPS. When a new match starts I need to check the players CAPS and reduce the last bet if they don't have the CAPS.

Problem 2

screenshot5
Its completely stuck here. I should also check that the player can at least afford the minimum bet. For example if the minimum bet is 5 caps and the player has 4 caps.

Table vs NPC

Should we place tables around the world or an NPC to start the blackjack game? My personal vote is NPC for the following reasons:

  1. Saves space when placing him in various locations, which means more areas can allow the player to gamble.
  2. Allows for easy addition of new games, just a new dialogue option.
  3. Closely resembles the method used by the Skyrim mod "tavern games"
  4. Can easily vary the appearance of the dealer to match the environment that he/she is placed in.

There might be more pros and there might be cons I am not considering but I really think this is a great option, please feel free to disagree and challenge me on it, but I want feedback before we start working on adding the game to worldspaces.

Tester Report - Papyrus errors and broken blackjack.

Tested by E

And now I just got busted out without my card being shown to me, I have 5, 4, 3 on the table, drew another card, told I was busted but no fourth card is shown
There is a log of it...
https://pastebin.com/4V9MeVPj
^ truncated
Now after that hand it's not dealing cards
Log section when dealing next hand after aboves missing fourth card:
https://pastebin.com/dTfhaGc9
(No cards actually dealt, no player controls, no exit from blackjack, had to exit the game)

To Do: Make Gambling NPC and Place in these locations

Places to add gambling NPC's (feel free to add more to this list if you want):
Commonwealth Locations:
-Dugout Inn [x] "coc DmndDugoutInn01"
-Colonial Taphouse [x] "coc DmndStandsTaphouse01"
-Third Rail [x] "coc GoodneighborTheThirdRail"
-Vault 81 [x] "coc Vault81"
-Prydwen [x] "coc PrydwenHull01"
-Railroad HQ[x] "coc RailroadHQ01"
Far harbor Locations:
-Acadia[x] "coc DLC03Acadia"
-Church of Children of Atom (The Nucleus) [x] "coc DLC03Nucleus"
-Far Harbor Town Bar [x] "coc DLC03FarHarborLastPlank"
Nuka World Locations:
-The Pack HQ[x] "coc DLC04HubPackLair"
-The Operators HQ[x] "coc DLC04HubOperatorLair01"
-The Disciples HQ[x] "coc DLC04HubFizztopMountainInterior01"
-Market in Nuka World[x] "coc NukaTownMarket01"

A requirement to enter the casino is imposed on the player.

An introductory quest that imposes a requirement in order to gain entrance to the casino.

  • Entrance (A) Minimum caps requirement in order to gain entrance.
  • Entrance (B) Attribute requirement in order to gain entrance.
  • Entrance (C) Mission requirement in order to gain entrance.

Track the human players best stats and scores.

An idea to track the humans best stats and scores. A stat I had in mind was the highest amount of winnings you have won in a single session. A session starts the moment you sit down to play, and ends when you get up from the table. Another stat that would be cool to track is the amount of blackjack games that have been played. As always, your comments are appreciated.

Here is a list of stats.

  • The total number of games played over a career.
  • The total winnings and losses over a career.
  • The highest winnings you have ever walked away from a table with.
  • The total number of blackjacks over a career.

The blackjack table started with odd positioning.

A screenshot of the issue is included below. This happened immediately after the loading screen was finished. The wager message paused the game in this camera position which appears to be from the player still havok settling after loading into the level. Right after closing the wager message the camera corrected itself almost immediately.

I have been unable to reproduce this bug in game.
bug

A playable BlackJack

We need a playable black jack game.

  • Issue #9 Simple AI for dealer and opponent players.
  • Issue #5 How to handle game mode?
  • Issue #11 Create a bound presentation for the gambling table.
  • Issue #17 Wager a simple bet with caps.

User interface elements for blackjack

Messageboxes are okay but they are not perfect. When information is shown to the user, they can only see it while the message is open. After they close the message they either have to remember that information for the duration of the game or have the same information restated in every following message.

We can supplement messages with new user interface HUD elements that only appear while playing the game. Below is some awful art I slapped together to show the kinds of info we might display on the HUD.

ui_idea
untitled

Give material swaps in Creation Kit editor IDs

This is on my honeydew list. The material swaps in the CK have auto-assigned numbers for EditorIDs. They should have names as suggested by Sarina.

Its not a bug, or feature, or enhancement or related to anything in particular that matters.

Papyrus - Stack too deep (infinite recursion likely)

After playing blackjack for some time I get two errors in the papyrus log. The papyrus errors are Stack too deep and Assigning None to a non-object variable. When these errors occur the buttonhint script will still respond to registered key press events but the buttonhint UI HUD element will no longer be visible.

Papyrus Error - Stack Too Deep
"Stack too deep (infinite recursion likely) - aborting call and returning None"
Too many functions have been called without first returning from them. This usually happens due to infinite recursion in a script, but could also appear in highly complicated scripts that have lots of deep function calls. Try simplifying the script, removing the recursion, and making sure that any recursion has a termination condition.

[01/12/2018 - 02:03:45AM] error: Stack too deep (infinite recursion likely) - aborting call and returning None
stack:
	[Games_Script_Blackjack_PlayerHuman (08002761)].games:shared:ui:buttonhint.GetMember() - "D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\FO4_Games\Games\Shared\UI\Display.psc" Line 51
	<unknown self>.games:shared:ui:framework.DisplaySetVisible() - "D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\FO4_Games\Games\Shared\UI\Framework.psc" Line 165
	[Games_Script_Blackjack_PlayerHuman (08002761)].games:shared:ui:buttonhint.Visible() - "D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\FO4_Games\Games\Shared\UI\Display.psc" Line 113
	[Games_Script_Blackjack_PlayerHuman (08002761)].games:shared:ui:buttonhint.Shown.OnBeginState() - "D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\FO4_Games\Games\Shared\UI\ButtonHint.psc" Line 181
	
	<truncated stack>

[01/12/2018 - 02:03:45AM] warning: Assigning None to a non-object variable named "::temp9"
stack:
	[Games_Script_Blackjack_PlayerHuman (08002761)].games:shared:ui:buttonhint.GetMember() - "D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\FO4_Games\Games\Shared\UI\Display.psc" Line 51
	<unknown self>.games:shared:ui:framework.DisplaySetVisible() - "D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\FO4_Games\Games\Shared\UI\Framework.psc" Line 165
	[Games_Script_Blackjack_PlayerHuman (08002761)].games:shared:ui:buttonhint.Visible() - "D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\FO4_Games\Games\Shared\UI\Display.psc" Line 113
	[Games_Script_Blackjack_PlayerHuman (08002761)].games:shared:ui:buttonhint.Shown.OnBeginState() - "D:\Games\Steam\SteamApps\common\Fallout 4\Data\Scripts\Source\FO4_Games\Games\Shared\UI\ButtonHint.psc" Line 181
	
	<truncated stack>

This problem applies to at least commit at https://github.com/Scrivener07/FO4_Games/tree/8784776a121c8c23106cef57153b2a570d55ee51

HUD framework is still required for some HUD elements.

The rendering layer added by HUD framework is required for injected F4SE HUD elements to be visible on some areas of HUDMenu. That is also the reason why at least one hudwidget needs to be loaded in order to kickstart HUD Framework.

Simple AI for dealer and opponent players.

Compete against the dealer and opponent players in blackjack.

At this point the competitor AI is fully functional. The issue is that for every game the maximum amount of competitors will be allocated for each game. Instead the amount of competitors should be variable. The amount of competitors should be determined by how many NPC actors are seated around the in world table before a game starts. I was thinking I could make a custom stool to place around tables and the game will allocate a competitor for each chair that has an NPC sitting in it.

Idea: Workaround for message boxes

In vanilla Fo4, when you first start the game and are leaving Vault 111, items you pick up are automatically hotkeyed for you.... So, what about giving the player aid items when they are transported to the gambling cell, and assigning them to specific favorite item hotkeys, then using scripts attached to those aid items so that when the player presses the button, input is taken via that aid item press? For example: 1 = Hit, 2 = Stay, 3 = Increase Bet, 4 = Decrease Bet, etc.

Better game exit position for the player.

Exiting via settlement object needs to be moved to next to the table instead of on top of, ideally we should add some sort of visual reference on the table to indicate where the player spawns after they play so they know how to position the table.

How to handle blackjack game mode?

How do we present the game to the player and what should their experience be like?

Lets try to make a healthy case for and against each of these. Please add your thoughts or concerns and feel free to edit this post with more details as we discuss each of them.

Bound

Only one game table exists in an inaccessible cell. When entering game mode, the player is teleported to this games location. The players controls will be limited and the camera directed by relevant game actions, most likely a top down view of the game.

Summation Bound offers a satisfactory gambling experience for a reasonable development cost.

Positives

  • Tavern Games of Skyrim has proven this method to work well.
  • Bound allows for easy implementation and expandability.
  • Very clear and understandable requirements for player interaction.

Negatives

  • Player cannot observe a game in progress unless they are directly participating.
  • The gambling cell may not accurately reflect the environment of the players location.
  • A loading screen may appear briefly.

Unbound

Multiple hand placed game tables exist in the world. The player enters game mode by activating the game like you would furniture. The player is free to look around and interact with objects and competitors as the game carries onward.

Summation Unbound offers an unparalleled immersive gambling experience at a substantial development cost.

Positives

  • Player may observe and interact with competitors.
  • Preserves the environment of the players location.
  • Autonomous gameplay. Player may observe a game in progress participated only by competitor AI.

Negatives

  • The technical development cost is very high.
  • Complicated player experience. Interacting with and playing a game may require more feedback to the player due to its unguided nature.

New, 52 Card Pickup

You play 52 card pickup. A deck of 52 cards is flung around an area. The player must race the clock to pick up all the cards.

This game is certainly a classic!

Casino Location

A new casino location to showcase various games of chance added by this mod. What are some of the finer details for this goal?

Casino Details

  • An entrance requirement such as an attribute or caps check.
  • An alternate entrance quest for players' who cannot pass checks.
  • Casino patron NPCs.
  • Casino bartender NPC.
  • Casino guard NPCs.
  • Casino dealer NPC.
  • Casino pit boss NPC.
  • Casino flavor quest.

Wager a simple bet with caps.

We need basic wagering for a complete and playable game of blackjack.

Currently a message box appears offering 5 static amounts to wager or a cancel option before a game starts. Even when an option is selected, no wager is actually placed at the start of the game or awarded when the game is over.

The options are as follows.

  1. Cancel
  2. 5
  3. 10
  4. 20
  5. 50
  6. 100

The players luck affects the outcome of a blackjack game.

I have been discussing with Shadow from the Cascadia team about general ways to implement a Luck based effect on the "randomness" of dealing cards to the player. I.E. at higher luck levels you will get dealt better cards. I will copy over his suggestions, I am thinking that certain degrees of combinations of his suggestions might work best in order to achieve a more RPG feel to gambling.

Bound presentation for the blackjack table.

As a result of the conversation on issue #5, a bound style presentation and perspective need to be created.

A top down camera view of the gambling table seems like the best choice. For now I need to explore best implementation before I know what the exact presentation may look like.

  • Top down camera view of the gambling table.
  • Limited input controls for the player.
  • Increase card legibility by getting the camera closer.

capture1

Vanilla user interface for blackjack.

We need a fully featured interface that does not rely on F4SE. With HUD Framework, we can still add hud widgets without any dependency to F4SE which would allow us to support Xbox. These hud widgets do have some limitations, in particular, the widgets cannot send data back to papyrus but we can send data from papyrus to the hud widgets. To summarize that, hud widgets can only receive data without F4SE.

Something that the vanilla messagebox does is return a user selected option from a pre-made messagebox menu. Messageboxes are a bit clunkly but in the vanilla interface system for blackjack we will still need a messagebox at times we need to process input from the player within papyrus.

Even though we cant completely get rid of the messageboxes for an Xbox version we can still do quite a bit to still make it look great.

Some things a widget can display about the current player.

  • Current Score
  • Current Bid
  • Total Caps (Human Only)
  • The exact details of each card in hand (suit, rank, color, etc)
  • The number of turns taken this match. A turn is a play action (hit, stand, double, split).
  • The scoring result where the player's score is compared to the dealers.

Some things a widget can display about the current game session.

  • The current phase name
  • The current player's name. (more like a label)
  • Total Wins/Losses for this session.
  • Total number of matches played this session.
  • The status of the last turn that occurred. A turn is a play action (hit, stand, double, split).

Some things we still need a messagebox for the purpose of user input.

  • Wagering a bet amount
  • Deciding a turn action. A turn is a play action (hit, stand, double, split).
  • Yes/No for the "play again" prompt.

This is how it looked in Fallout New Vegas. Looks like a good design to start with.
capture

Wager a bet with caps, food, weapons, and ammo.

Currently a message box appears offering 5 static amounts to wager or a cancel option before a game starts. Even when an option is selected, no wager is actually placed at the start of the game or awarded when the game is over.

The options are as follows.

  1. Cancel
  2. 5
  3. 10
  4. 20
  5. 50
  6. 100

Before moving forward with completing this game element lets consider our options.

On discord, we have previously discussed a barter themed approach to wagering a bet. Let me try to make a case for this idea. Fallouts world is a post apocalypse setting and also to some degree post society. I think one could also make the case that the world would also be post currency even though fallout lore uses caps as a primary currency. Even though caps are a part of lore I feel like they really dont make a good case for themselves to realistically work.

Im not proposing to do away with caps or anything like that as we would still need a way to summarize what something is worth in numerical terms anyway. I mean to suggest we supplement the wagering process with a more realistic barter approach. I had the idea of not only being able to wager say 100 caps but also wager goods like ammo, food, water, weapons, and other valuables. I imagine that could work something like when its time to make your wager an inventory/container menu opens before the player and thats where they place items for their bets, including caps. This can be done because I can get the value of item with papyrus.

Even if this is a good idea lets also consider the goals for our first milestone. If I had to estimate, I would say the development cost for something like a wagering system supplemented with bartering would be very low. On the other hand the full cost wont be fully realized until an attempt is made and we start to run into additional special edge cases for things we didnt consider up front. The benefit of going with a set of static options is that the development cost would be next to zero with no known special cases to consider.

Let me have it!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.