How do I player a player count in Alexa skill flow Builder?
Select a number of players. and then
Flow Builder updates with the number of players to
Ask each player a question in the game.
where should I start going? is there a way for me to scale experience across multiple players based off of a slot?
can I change the flow of the experience dynamically based off of the number of players I received from a slot?
Of course! We have an amazing tool: the dialog.directives. You can manually trigger intents in your handlers. You can also fill the slots for the user (in case you need to). You need to simply trigger that intent n number of times, where n is the number of players you have.
You can achieve that by following different paths. Give it a try and let me know if you need any more help :)
Read more: https://developer.amazon.com/es-mx/docs/custom-skills/dialog-interface-reference.html#scenario-delegate
Related
I am beginner in this field and I am trying to implement an agent playing an adversarial game like chess. I create two agents that share the same neural network and experience buffer. In every step, the neural network will be updated by both agents (features order swapped).
Does my self-play approach make sense? And if it does, how will I reward the agent's behaviors?
More clearly, following this:
(0) state -> (1) agent0 action -> (2) reward -> (3) state -> (4) agent1 action -> (5) reward -> (6) state
Is the next state of agent0 after (1) would be (3) or (6)? And is the corresponding reward (2) or (5) or something else (for example (2) - (5))?
Here is my understanding. You start with two randomized initialized networks. Please don't share the network. Then you train one of them and only that one. When the network under training begins to show some progress, you stop this match and you make a copy of the good network to be the new opponent. Then you continue. This way you bootstrap yourself and the opponents. You don't try to learn against an expert, but rather against someone who is more or less equal to you.
Above I've described saving only one copy of a previous you, but you can of course keep the last 10 instances and play against all of those.
I am trying to program a prediction algorithmus which predicts the distribution of marbles among 4 cups based on the prevision user input. But I have no idea where to start or which techniques can be used to solve this.
Example:
There are 4 cups numbered from 0 to 3 and the user will receive x marbles which he distributes among those cups. Each round the user receives another amount of marbles (or the same amount) and before
the user distributes them, the algorithm tries to predict the distribution based on the users previous inputs. After that the user “corrects” it. The goal is that the user does not have to correct anything hence the
algorithm predicts the correct distribution. However the pattern which the user distributes the marbles can change, and the algorithm has to adapt.
This is the simplest design of the problem which already is not trivial to solve. However it get exponential more complex when the marbles have additional properties which can be used for distribution.
For example, they could have a color and a weight.
So, for example, how does the algorithm learn that the user (most of the time) put the marbles with the same color in one cup, but cup 2 is (most of the time empty) and the rest is equally distributed?
So in my head the algorithm has to do something like this:
search for a pattern after the users distribution is done. Those patterns can be the amount of marbles per cup / weight per cup or anything else.
if a pattern is found a predefined value (weight) is added to the pattern
if a previous pattern was not found a predefined value has to be subtracted from the pattern
when the algorithm has to predict, all patterns with a predefined weight have to be applied.
I am not sure if I am missing something and how I would implement something like this or in which area I have to look for answers.
First of all, bear in mind that human behavior does not always follow a pattern. If the user distributes these marbles randomly, it will be hard to predict the next move!
But if there IS a pattern in the distributions, you might create a prediction using an algorithm such as a neural network or a decision tree.
For example:
// dataset1
// the weights and colors of 10 marbles
let dataset1 = [4,3,1,1,2,3,4,5,3,4,7,6,4,4,2,4,1,6,1,2]
// cups1
// the cups distribution of the above marbles
let labels1 = [2,1,0,2,1,1,3,1,0,1]
Now you can train an algorithm, for example a neural network or a decision tree.
This isn't real code, just an example of how it could work.
let net = new NeuralNet()
net.train(dataset1, labels1)
After training with lots of data (at least hundreds of these datasets), you can give the network a new dataset and it will give you a prediction of the cups distribution
let newMarbleSet = [...]
let prediction = net.predict(newMarbleSet)
It's up to you what you want to do with this prediction.
What I am trying to achieve:
I am trying to answer differently if a get differently value for the same slot
Example:
I have made an intent with a slot having months of the year.
so when user says specific month i.e. March then i want to tell all the events happened in the March only.
What I have tried:
I have tried making an intent with a slot and on the back end i am able to get the name the month that slot got filled with.
Please help!!
A slot can carry a number of values. Amazon even has a predefined month slot type.
Here's part of an Alexa beginner tutorial that asks for your birthday. It should help you understand this.
https://developer.amazon.com/en-US/alexa/alexa-skills-kit/get-deeper/tutorials-code-samples/build-an-engaging-alexa-skill/module-4
Updating
If you're needing to understand how to return different responses based on the slot value, your best bet would be to learn how to use a switch statement.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch
I'm attempting to make a DotA drafting companion application in C++
I'll give you a little run down of how it will work. In DotA there are two teams of 5 players. No character can be picked twice in a single match, meaning teams cannot share a character. It is important to keep in mind both your team's and opponent's picks. So what this will do is suggest characters for you to pick based on your and your opponent's teams.
To clarify, the existing list is not some sort of database, just a menagerie of suggestions on various websites, forums, and videos. I would be organizing the list myself, and so my question is ultimately what format should I create this list in?
So for instance a popular character is Phatom Assassin who is strong with characters who can reduce armor, and weak against characters who can do lots of damage.
So a hero class might look like this
class DotaHero
{
Name = "Phantom Assassin";
vector<DotaHero> Counters{"Lina", "Lion"};
vector<DotaHero> Friends{"Templar Assassin", "Shadow Demon"};
CImg<unsigned char> src("PA.jpg");
}
My program would allow you to input the first few heroes and then display a list of characters as a suggestion.
Should I...
Create a class for each and every hero in the game
Stream from a text file with each hero delineated by counters/friends
Create some sort of database to store each hero's counters/friends in
Please feel free to give any suggestions!
A very difficult question.
The question of what you store and how your express relationships between characters is going to define fundamentally how your tool works and how effective it is.
Of the top of my head I would create 2 weighted graphs,
1.) friends.
2.) counters.
Each node represents a hero and each edge of the graph would correspond to how strong of a counter or how strong of a friend you consider that hero. As heros are picks, find the highest weighted neighbor node to all of the current picked hero, and this would be your highest weighted suggestion. That would be the naive approach based only on the next pick (not always the best, a good way to get into trouble). Add layers and create weightings for 2nd order neighbors and you can start doing non deterministic analysis of the data set to get more sophisticated results.
Just a jumping off point. It would be a truly fascinating problem.
Idea is simple. Function needs one argument which is the players amount. It generates the graph where each player is placed versus another one (screen included). If players are even, rounds equals to players-1 else, it equals players.
I've noticed that the best way to do the pairing is to change order of numbers (source).
I can't find any solution to make it work with uneven player's count. Any suggestions are welcomed, as I really need this algorithm to start working ASAP. It looks simple, and won't take much coding, so it's not an issue. I just need the tip.
If you have an odd number of players, add a dummy player. Whoever plays the dummy player in a certain round, doesn't compete in that round.
You can even see that in your example image where player 6 is the dummy. The left table is obtained by skipping all matches versus number 6.