top of page
garrostticoborhi

An AI To Make Practical Decisions And To Play Flappy Bird: A Novel Approach to Multi-Task Learning



(In fact, deciding which types of input and feedback your agent should pay attention to is a hard problem to solve. This is known as domain selection. Algorithms that are learning how to play video games can mostly ignore this problem, since the environment is man-made and strictly limited. Thus, video games provide the sterile environment of the lab, where ideas about reinforcement learning can be tested. Domain selection requires human decisions, usually based on knowledge or theories about the problem to be solved; e.g. selecting the domain of input for an algorithm in a self-driving car might include choosing to include radar sensors in addition to cameras and GPS data.)


The exploration-exploitation trade-off is a well-known dilemma for Reinforcement Learning algorithms. Unfortunately, this problem occurs when a learning algorithm has to make a lot of decisions with an uncertain pay-off. In general, the dilemma states as follows. A learning algorithm that has incomplete knowledge of the world can either perform the same actions that have been successful so far to maximize the overall reward or it can try something new hoping to get an even greater reward. So, the algorithm either exploits or explores, but a good algorithm needs to find a balance between these two approaches which can be a non-trivial task.




An AI To Make Practical Decisions And To Play Flappy Bird




It never got much recognition on its release, which is a damn shame as Project Edenwas arguably far more involving than Tomb Raider at the time, and the four-way split of characters would make for a great online multiplayer campaign today.


Let's think for a second. Every player is gonna send his position to every player (including the Master Client of course). Now when do we want to start the round? Exactly! When every player has sent his position. To do this the actual Master Client is checking if the amount of keys in the WalkShootDictionary is equal or higher than the Player.Count and the Player.Count is higher than one (just for security). If this is the case the Master Client sends another raised event with the Code number 3 and his local WalkShootDictionary to all players to make sure everyone has the same walk and shoot locations. The cool thing here is even if the actual Master Client would disconnect all the other players still know about every position so every other player can easily become the new Master Client without loosing information.


Now this is something that can be handled in many different ways but since i'm super lazy and rex already did a great job with his plugin i'm gonna stick to the wheel he invented instead of doing it again. Every time an object arrives at it's final destination triggered by an Move To event, another event called On hit target position is called for that object. So every player will trigger this event for every object in the field that was starting to move. Again here we want every player to do this to make sure the Master Client doesn't get lost on the way and the battle stops forever.


I recommend googling "Client Prediction" cause this is (very very little) what we will do now. Players that receive event number 4 know that the Master Client decided that all the objects arrived at their position. Hopefully our local game is telling the same to us what will actually be in most cases. But in case that we have a delay or the game was lagging or any other reason we want to make sure that we still do the same as everyone else should do. That's why we first tell ourselves with a debug log that "All players arrived". And now we gonna set the Player position to it's Self.gotoX and Self.gotoY and it's angle towards the shooting position with the Set angle toward and the values Self.shootX and Self.shootY. Even if that means that the objects could jump from their actual position to their final position.


The next step is to wait at least half a second (0.5 seconds) to not fire at the same time the objects arrive this is just make up art (or how do you call that?). Now it's time to fire our bullets, weeeeeee! To do this we gonna Spawn another object from the player objects on the field. We gonna pick the Bullet object and use the first (1) (not 0 (zero)) image point that we defined in the beginning for our player objects (the nose). Finally it is important to set the Bullets instance variable id to the spawning objects variable to identify who's bullet it is.


Since we destroy our Bullet objects now we can catch the Construct 2 event for it. We wanna do this to check if all Bullets are gone from the field (either by flying out of the field or hitting another player) what means that the round came to an end. So let's add an On destroyed event for the Bullet. Pick all the bullets in the field and then Wait 0 (to the end of all calculations) to make sure that we not counting in the destroyed object. Now count the number of available Bullets in the field and if this one is 0 (zero) and the local player is the Master Client send out the event number 6 to inform anyone that the round has ended. 2ff7e9595c


1 view0 comments

Recent Posts

See All

Comments


bottom of page