Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
At first I have 5 cards by random, of course. Only one time I can change and also l have already taught [the program] the poker rules in my system. My problem is how can I choose "I don't need this card or there are cards?". I can change by myself but computer doesn't know. I think maybe it is difficult but have you guys any help to offer?
Take a look at How I Built a Working Poker Bot Series (Parts 1, 2, 3, 4, 5, 6, 7, 8) which has great information for getting started in poker botting.
Specifically take a look at Part 8 which goes into detail on how to evaluate hand value. What you'll want to do is statistically evaluate the cards in the hand and from there determine which cards have the highest probability of scoring a winning hand. You can then discard the cards you don't need.
How about getting in touch with The University of Alberta
Computer Poker Research Group?
If you are looking to simply build a poker playing program, then the above suggestions are helpful. If you are looking to build a system that learns how to play poker, then you need to make use of machine learning/inductive learning techniques such as neural networks, decision trees, genetic algorithms. Samuel's wrote an early checkers playing program that learned to improve it's performance.
http://en.wikipedia.org/wiki/Arthur_Samuel
There is also a site on machine learning and games:
http://satirist.org/learn-game/
You are going to want to research Expert Systems Design. And apply it to your problem domain.
If it seems overwhelming, start small. Create a rudimentary knowledge base of rules that make your poker bot greedily seek out pairs (and 3 or 4 of a kind). When that is doing well, add in rules to try to build straights, and rules on when to favor straight building over pair seeking, then when that works well, add in flushes. Continual, and small incrementation is the key to the process.
The things you want to study are game theory and data mining. The top programs use a large game theoretic simulation to produce tolerances for an expert system which is employed to randomize play in such a way that it makes as few systematic mistakes as possible. If you search the web well enough, you'll find full implementations of a few of these types of solutions, but they are often lacking the code that generated them. The down side to just accepting one of these solutions is that they do not take full advantage of the mistakes of opponents, which is where most of today's research is headed on the topic.
There are a number of ways to produce game theoretic solutions however, using just about every imaginable AI algorithm.
Check poker evaluator. http://www.codingthewheel.com/archives/poker-hand-evaluator-roundup
Use monte carlo analysis to find which cards to discharged in oreder to maximise expectations.
Computer Gamesmanship by David Levy
Covers stud and draw. You'll realize how hard it is by the time you're done reading.
Note that the book is over 25 years old, but it's a good start.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
[C#] Hello all, I am curious on how I can go about creating my own local server and allowing people outside to connect an return data stored on it. I am not looking for an "XNA" solution. I would like to kind of digest the bare bones of client to server. Here is an outline for what I am looking for:
My PC
[Server] -> Constantly Updates/Receives Player data so it can be obtained by other PC's. Stores data from other clients.
[Client PC] -> Writes to server (Creates new player data/updates) and obtains further information to update visuals, other players, etc.
This isn't something small that anyone can just do, especially if you are just getting into programming. I would first start out small, make a few smaller applications, play around with the .NET framework libraries and get comfortable (I would specifically look at System.Net/System.Net.Sockets as well as possibly System.Security for SSL encryption). The networking component will be huge in this as you'll need to implement a system to handle the constant communication and be able to respond quickly (any lag can be seen as dropped packets from a networking standpoint and cause client time outs). You'll also want to think about what kind of data you are serving up (saved games, player data, whether it's personal information (such as passwords, email addresses, etc)) and how you are going to store that data. There are many paid and free technologies for this (Postgres, SQL, MySQL, etc). Please do a quick google on some of thee items I have mentioned and you'll see why it takes years to develop games and the back end systems to support multiplayer.
If you are the type of learner to plug things in and learn by tearing someone else's code apart, I would take a look at some of the articles below.
http://www.codeproject.com/Articles/1415/Introduction-to-TCP-client-server-in-C
http://csharp.net-informations.com/communications/csharp-multi-threaded-server-socket.htm
Here's some MSDN articles dissecting the different classes of the System.Net namespace and functions of it.
https://msdn.microsoft.com/en-us/library/system.net(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/system.net.sockets(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/system.security.cryptography(v=vs.110).aspx
https://msdn.microsoft.com/en-us/library/system.security.cryptography.x509certificates.x509certificate(v=vs.110).aspx
You'll also want to look at using threading to make sure the server isn't only processing one request at a time. There are many approaches to this but here is some basic examples of using threads.
http://www.dotnetperls.com/thread
When to use Multithread? (Some pointers how on and when to use threads on our very own S/O site :) ).
Here's the DL on threading from MSDN
https://msdn.microsoft.com/en-us/library/system.threading.thread(v=vs.110).aspx
Not meant to discourage you but more to show you the type of effort you'll have to put in to this sort of project. What you want to do is completely doable, but will require some brain training and head scratching. Apologies if it sound condescending, just trying to coach and am unsure of your level of expertise in c#! Best of luck to you though friend, hopefully this turns into a great learning experience!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
In a project I have, I want to be able to select a range of products that a customer might want to buy. The range of products should be selected based on patterns of other customers.
I am currently thinking about neural networks, however I am not sure if that is the way to go. Since I am learning about this, I am looking for good examples/tutorials to help me on this.
So far, I was thinking that multi-layer feed-forward neural network would do the trick, but usually the articles are talking about one predicted value, while I am looking for a range of values. The idea that I got is to use the error to calculate the range. Is that the way it is done?
My other approach is more statistical by using probability.
Can anyone point me to the right direction, preferably with C# examples as it is the chosen language to work with?
I can't point you at any tutorials. However, I used to work on the peripherals of this area alongside people who were very experienced in this sort of thing and their opinion was, overwhelmingly, that a probability-based approach is the more cost-effective of the two.
Machine learning of one kind or another is undoubtedly the more powerful technique but it requires a colossal amount of comparative time and effort, and the quality of the results may not prove to be worth the additional resources.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I am looking for honest / constructive feedback.
I hear a lot of my peers who have been using .NET for a while now, say how easily they built their GUI interfaces. On closer inspection they have used 3rd party tools such as Infragistics.
As a new .NET programmer (certified I may add), I wanted to know if anyone has actually created interfaces using nothing but what ever happens to be available by default with the framework...
I am guessing it shouldn't be too difficult to create a good, aethestic looking GUI without using 3rd party addons.
Yes We've done it (windows).
Depends on where you put the emphasis in your guess. No its not TOO difficult, but it's definitely not easy, unless your requirements are truly trivial, as opposed to apparently trivial.
All depends on what you need / want to do. My advice don't tell your boss, this will be easy, well not unless you want help getting out of the door for the last time.
For instance take a straight textbox.
They want to enter currency in it.
Multiple rounding algorithms.
Enter raw value display formatted, Currency symbol, thousand
separators.
Optional pounds or pence.
Optional blank or zero
Optional treatment of negatives.
Optional display formatting of negatives.
Alignment on decimal point.
Auto change of font on resizing.
And break none of the standard behaviours.
Trust me not simple at all. Especially if you do something Infragistics did not, and go for a good developer interface as well as the end user behaviours.
Not trying to put you off. It's challenging and rewarding, but when you have the entire application stuck behind some irritating bug in the UI, bosses lose patience real quick and you haven't got that get out of jail free card in shrugging and saying that's how X works.
NB just buying a suite won't fix all these problems, you can spend a lot of time producing a totally crap UI with them as well, just you don't have to write the code...
The answer to that is a lot of hard work. :(
Can your current suite be upgraded?
If you have the source could it be fixed, if you had the source and it's been twiddled with, are those "improvements" interfering?
Needs some hard-headed realistic analysis this. Which components are broke? How much are they used? How much of the extra behaviour in the suite do you really need.
Most important, how good is your separation of concerns in the current code, and how comprehensive both unit tests and automation tests.
Would compatibility mode sort it out?
Need to get to a point where the number of questions doesn't significantly out weigh the number of answers.
I've been where you are though it was another suite in another environment. The people looking for the cheap, quick and painless way of dealing with a mess like this were hugely disappointed, but it can be attacked in parts as long as everybody takes a heavy dose of pragmatism.
As a for instance,
Someone had bought a windows component that looked like a html link, and was heavily dependent on File associations and API calls. It was very visible and all over the place, I knocked up a much better and far less fragile one in a few days, swapped it in, a lot of perceived problems disappeared, confidence increased, and the remaining problems started to look less horrible.
Think of it like going into triage mode on bugs at the end of a struggling release.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I've done some volunteer game programming in LPC for a MUD in my past and everything there was easy. If I wanted a new item I would just use a function to load (for example an NPC) as many times over as I wanted. Now I want to program my own little game I cannot for the life of me identify what I even need to do. If I get nothing more than the name of what I want to do in order to carry out my own further research, that would be enough. Having rambled on about all of that, on to my question:
I want to make on the fly instances of in-game objects (for example people), some handled by the computer, other handled by the player. A lot of the help on game programming I've found has been about making sprites move and handling collision detection. This is all great, but I want to code a strategy game and so am more interested in creating some sandbox flexibility within my game and coding the AI to provide the interest, rather than swish graphics and awesome sounds, etc. I want to setup the game with a variable number of randomly generated people for the player to interact with. So far I've created a class to handle the people, but I'm now stuck as each instance of the class needs a unique name and I programming in that would mean there was no randomness in the number.
What would I need to look up to achieve what I'm after? What would it be called? Have I even explained myself with any degree of eloquence?
Thank you in advance for any potential help that might come my way.
Matt.
What you're looking for is something like RPG name generators (google it).
Basically those sites you'll find generate their names out of a random combination and concatenation of prefixes, syllables and suffixes. I don't know where there is research on this topic, but you could start with something like that.
Edit: you could use Markov chains, they are used for text generation.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
After seeing the 13th Floor back in the day I have been obsessed to a degree with writing a simulator like that.
I have written several simulations with a human base class that have a male and female subclass. They have a routine called runYear and they interact. They date, work, die, have kids, get sad, commit suicide, divorce, etc.
It will run for thousands of "years" and depending on seed parameters grow very large or die off.
My question is: I have really maxed out what I can do with this and I am looking to rewrite this from the ground up, but I want to have a foundation going forward. Are there any good books or articles anyone can point me to that would help me better understand how I need to design this or what key foundations I should include?
On a technical point:
should I look at using a Object Oriented database to store this information?
I was planning on writing this in C#(For comfort reasons), would learning LISP be better?
Are there any other opensource simulators anyone has run across like this I can maybe get some ideas from
Any other ideas/suggestions would be be awesome.
Erik
Most complex thing about this kind of simulators is not how to implement it, but how you model your creatures, and their interactions with each other and environment.
Just use those tools that you are most comfortable with. I wouldn't most likely use any kind of database in the beginning, I would use datastructures that my programming language uses and maybe write and read the datastructures to plain files when persistance is needed.
Here are few links about this kind of simulations. Most of them are not human level, instead they work on a bit "lower" level, think of insects, bacteria and DNA.
Wikipedia: Artificial Life
Wikipedia: Life Simulation Game
Wikipedia: Multi-agent Systems
A couple of examples about existing systems:
Breve - 3d life simulator
Darwinbots
Creatures, a commercial artificial life game
Swarm
First, you need to start off with creating a World class. Your World class would encompass everything that a world can do. You will want to incorporate Gravity, Air, Ground, Walls, etc.. You will probably want to start off by giving the sky a limit, as you wouldn't want someone to just leave your world and go do his own thing in memory somewhere.
Once you got your World setup, create yourself an Abstract Human class. This class will have basic human abilities. You can specify stuff like height, weight, age, etc...
From there, you inherit the Human class, and create Woman and Man classes, each with their specialized attributes. Woman class can have BreastSize, CookingSkill, SexualPrownessLevel, Etc... The Man class will be mostly for keeping track of who is bald.
From there, you can go even further and split into ethnic classes, such as Asian, Indian, etc.. Each ethnic class would have its own traits as well.
Once you got all that out of the way, you can start working on the fun stuff. You can create objects to wreck havoc into their lives, such as Diseases, Religion, Money, Crime, Poverty, Starvation, Floods, Tornadoes etc..
I think the first step is to first be able to describe your problem in a descriptive way.
I like to think of it as a System-of-Systems problem. For that, take a look at SysML. That way, you can start at a high level, and then add more and more fidelity as your system evolves.
You should look at discrete event simulation frameworks (there's link to the list at the end). I only know SimPy for Python, but there are others, open source and commercial. Basic framework is also pretty simple, so it should be easy "programming exercise".