Code Monkey home page Code Monkey logo

chromedino-ai's Introduction

ChromeDino-AI

Documentation about the Chrome Dino Runner AI written in Visual Basic .Net and C#


...................GERMAN/DEUTSCH...................
In der folgenden Dokumentation zeige ich den Ablauf der Vorgangsweise für den automatisierten Spielablauf des Chrome Dino Runner Spieles. Folgendes wurden verwendet:
-http://www.trex-game.skipser.com/ ........Klon des Spieles
-Visual Basic .Net & C#....................................Das Projekt wurde in beiden Programmiersprachen umgesetzt. Die Performance beider Sprachen sind gleich



-Umsetzung:
In beiden Sprachen wurde der selbe Algorithmus verwendet. Es gibt bis auf das Senden der Tasten Space und Down keinerlei Interaktionen mit der Website. Um ein Hindernis zu erkennen, liest das Programm die Pixelfarbe der gelb markierten Stelle im unten abgebildetem Bild aus:
Alt text
Hat die Farbe den Wert "[A=255, R=83, G=83, B=83]", welches der Farbe der Kakteen entspricht, wird ein Hindernis erkannt. Da die gelb markierten XY Koordinaten je nach Monitorgröße variieren, ist die Funktion des aktuellen Projektes ohne Bearbeitung auszuschließen. Um das Projekt einwandfrei benutzen zu können, müssen aber nicht nur die Koordinaten der Hindernisse, sondern auch eine Pixelkoordinate der im unteren Bild markierten Stelle im Code editiert werden.
Alt text
Diese dienen der Erkennung des "Game Overs". Sprich: Wenn das Spiel zu Ende ist, da die KI einen Fehler gemacht hat, erkennt das Programm das Spiel Ende und startet einen neuen Versuch.
In diesem Video ist ein Durchgang der C# Version zu sehen


Der C# Code ist ausführlich beschrieben.



...................ENGLISH/ENGLISCH...................
In the following documentation we show you the process of the automated gameplay of the Chrome Dino Runner game. We used:
-http://www.trex-game.skipser.com/ ........ clone of the game
-Visual Basic .Net & C# ................................... The project was written in both programming languages.



-Implementation:
Both languages are using the same algorithm. There are no interactions with the website to detect the obstacles. To detect an obstacle, the program reads the color of the yellow marked pixel: Alt text
If the color has the value "[A=255, R=83, G=83, B=83]", which is the color of the cactus, an obstacle is detected. Since the yellow XY coordinates vary depending on the monitor size, the function of the current project must be excluded without editing. In order to be able to use the project without error, the coordinates of the obstacles and a pixel coordinate in the marked area, which can be seen below, must be edited in the code. Alt text
These are used to recognize the "Game Overs". So, when the game is over, the program detects the end and starts a new attempt.
This video shows a passage of the C# version


The C# code is described in detail.

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.