# darrin k

Member

12

0 Neutral

• Rank
Member

• Interests
Programming

## Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

1. ## C++ c++ how to have the cpu keep choosing a play from a menu

I am trying to write a function for the CPU to keep calling a play in a do while loop (which I am assuming is correct) with a pause in between and for the menu to be brought up to the user after each selection from the playbook function that contains the playbook menu. I am not an expert with the cin operator, but my playbook function works perfectly when the user is entering the plays but the cursor hangs when it is calling the function_cpu for the cpu to make the selection. I am sure I am missing something in the code here. I put some notes in the code below.
2. ## structure of a text based football game in C++

Okay this should not be too difficult but a simple lookup table looks like the right solution. I am struggling in how to best organize the data because it seems like it would be a huge table. I have separated four tables here in the spreadsheet, where team would be the index.One table would hold the numerical ratings, one table with the distance, one table with the number of downs, and another with the playcall. To calculate every scenario between every team with each down and distance combo and playcall would be a massive table ??? Ai combo.xlsx
3. ## structure of a text based football game in C++

So, I am just trying to get on the right track, would be it just constructing an array like this below and I am not even sure if my logic is right. 1st column = 1 for Chicago Bears offense 2nd column = # of Down 3rd column = Yards to Go 4th column = team 23 --- seattle seahawks defense columns 5 through 21 would be percentages that the play would be completed based upon the bears offense ratings vs whatever defense they would face (I would have to just make up percentages?) Is this correct way to do it, I have no idea, seems inefficient with repeated values. {1,1,10,23,...................}; {1,2,10,23,...................}; {1,3,10,23,...................}; {1,4,10,23,...................}; {1,1,5,23,....................}; {1,2,5,23,....................}; {1,3,5,23,....................}; {1,4,5,23,....................}; But then yards to go could go from a theoretical range from 1-100 not discrete increments like I listed above.
4. ## structure of a text based football game in C++

1024, exactly correct...I want to first model it the way your describing to keep it simple and eventually be able to build like LorenzoGatti described on another more complex project. I am definitely not an AI expert, so I want to keep for simple for now. My main question, how do I implement a lookup table in C++. Do I have to just construct a csv excel spreadsheet with the teams and attribute ratings and percentages etc....and write a function to call it...depending on the play call??? I am trying to understand the implementation. Is there an easy way to read csv files into C++ or libraries???
5. ## structure of a text based football game in C++

With regards to data, what do you mean by that exactly? I am not following in how to implement the behavior. If I want to implement the play chosen, I figure that this will be separate from the other variables. For instance, if it is first down and 10 and I select a play action pass, how is that best implemented in the code? I figured that would remain separate from other variables such as the chances of the CPU guessing the correct play call, the chance of the actual play being completed (the longer the pass play the lower the chance of the play being completed), and the attributes/ratings for the user controlled offense and the AI controlled defense. I guess I could write functions for all this stuff or a load of switch statements, but that does seem correct like you stated and I would need to implement some randomness so it does not get too predictable.
6. ## C++ structure of a text based football game in C++

I am looking for some advice in how best to structure a text-based football game in C++. I am actually a trying to mimic an old DOS game called Armchair Quarterback but without any graphics for the time being. The original DOS game had very minimal graphics just showing a cursor moving across a static graphic (but I will leave the graphics to the end). I attached what the original game looked like below. So far, I wrote functions for the following : - for the user to select a team - for the user to select the opponent's which is always the CPU controlled - for the user to select difficulty (enum) Things left to do: Set-up one overarching team class for all the teams in the game then each specific team would inherit the attributes from the overarching team class. In the original game, each team only had four attributes that they were rated on. I would also have to construct 17 offensive plays that the user has to choose from. Would each play be a separate function??? Also, the main logic and AI would need to be constructed (would need some variables for logic and AI). -Bigger pass plays have lower % of completion than shorter pass plays -CPU is guessing what the user selects to "play" defense -The user is guessing what the CPU selects to "play" defense -This will incorporate the attribute ratings for the offense and defense per team plus randomness and the situation in the game (down and distance???) Any help would be appreciated in how the code base should be structured. Thanks! DK -
7. ## Developing 2D sports game

Ok thanks for the clarification, understood!
8. ## Developing 2D sports game

More and more people seem to be pointing to the C ++ and library approach, what is the difference between SFML and SDL??? I have only seen a couple videos using SGDK, I wish someone could make a tutorial at some point, the code is written in C? I am envious that you got your game to work in a Genesis emulator!!!!
9. ## Developing 2D sports game

Thanks Alberth for the advice and I will make a note of the polynomial equation.
10. ## Developing 2D sports game

Ok that might be a good option as well, since it would force me to code more and if I really hit a wall, I could ask for assistance. For now, I will take more C++ and then look at the libraries you mentioned. Thanks! That's what I figured when compared to sports like football/hockey/basketball, my only concern is the math involved for simulating tennis and/or golf physics. I am not sure if there is material about this somewhere on the internet or game programming books.
11. ## Developing 2D sports game

Kylotan, Thanks for your response back!!! I appreciate all the insight.
12. ## Developing 2D sports game

Hi everyone, My main goal is to eventually build an extremely simple (graphics-wise/game-physics wise) sports video game in 2D. I am a big fan of the "old-skool" Genesis sports video games. I know some Python and C# but would really like to begin learning C++ as well. Where I am now: - My original thought was to continue learning some more C# and C++ before diving into any engine. I am thinking Udemy to take additional courses. -Perhaps, a tennis or golf game since I do not have to do deal with team-based AI which I have heard is extremely tricky to replicate. -Not sure, if Unity or Unreal is suited for sports game development? If one is better than better for 2-D based games, but I definitely want to learn both C# and C++. -Is it a realistic goal, to build a simple sports game (basic graphics and physics-- think Genesis or even early 90s DOS)? This goal is just for myself, I am not looking to make money off of this game but just some self-satisfaction that I can build it. Lastly, I know enough programming to build ROM editing tools in C# but that is the extent of my programming, with the exception of some simple Python scripting. I would appreciate anyone's input and thanks for taking to time to read this and/or respond. Thanks, DK