ROB TOM ROE
  • Home
  • Blog
  • Projects
  • Virtex Edge
  • Contact
July 20, 2016 by rtroe

Metric Dev – Ship AI

Metric Dev – Ship AI
July 20, 2016 by rtroe

The extent of any AI I’ve ever written is mashing together macro’s in excel to streamline complicated tasks.

So when it came to developing an AI for Metric, I decided the best foot forward was too keep it simple and build on that.

Follow the Bread Crumbs

I set it up that each track will need a set of ‘nodes’, the green tennis balls in the image below. The node’s are no different than any other track/sandbox item, and can be added, edited and deleted in the same fashion as the rest of the track parts.

Once the track nodes were initialized, it was as simple passing the list of nodes as a ‘List’ collection and have each ship individually chase after the nearest node. Once it reached a certain threshold of minimum distance, it would increment up the list to the next ‘Node’. You can see the first iteration of the code below.

[gist https://gist.github.com/a294ee8815671f547855876015633550/]

As it turned out, this worked incredibly well on almost the first try. You can see it in action the video below:

I had to fiddle with the cut off of dot products and everything, and there is definitely some room for improvement, like factoring the amount of thrust more heavily on how ‘on course’ the ship is, but all and all, it’s a very effective first try at bot AI.

Related

Previous articlePixel Art - Of a Time Gone ByNext article Vertices Engine Optimizations - Camera Frustum Culling

2 comments

r4tch31 says:
September 27, 2016 at 10:19 am

Reblogged this on Virtex Edge Design and commented:
Getting AI’s Running in Metric Racer. Tom gives a quick snap shot of all of it over at his dev blog.

Reply
virtexedge says:
September 4, 2017 at 2:24 pm

Reblogged this on Virtex Edge Design and commented:
Getting AI’s Running in Metric Racer. RT gives a quick snap shot of all of it over at his dev blog.

Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

About The Blog

Nulla laoreet vestibulum turpis non finibus. Proin interdum a tortor sit amet mollis. Maecenas sollicitudin accumsan enim, ut aliquet risus.

Recent Posts

Game Jam – GatewaysApril 25, 2021
Game Jam – Frequency SyncJanuary 29, 2019
Shader Series – Screen Space ReflectionsJune 26, 2018

Categories

  • 3C – Capture Crop Create
  • 3D Laser Scanner
  • Arduino
  • Asia
  • Chrome Addins
  • Dev Blog
  • DIY
  • Game Jam
  • Metric Racer
  • MonoGame Tutorials
  • Music
  • OpenCascade
  • Programming
  • Quadcopter
  • Shader Series
  • Shaders Tutorials
  • Space Esc8bit
  • The Chaotic Workshop
  • Traveling
  • Tutorial
  • Tutorials
  • Uncategorized
  • Vertices Engine
  • Videos
  • Virtex Dev Blog
  • Virtex Edge Design

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tags

3D 8-Bit AdMOb Ads android Animation Apollo Apollo 11 Audio Audio Puzzle C# Editor Electronics featured Game Dev Game Development Game Engine Gaming Github GLSL Graphics HLSL Japan Javascript Linux Mobile MonoGame NASA OpenGL Optimizations Programming Projects Screen Space Reflections Shaders Source Code SSR Terrain Editor tools Transparency Tutorial Vertices Virtex Edge Design WebGL wxWidgets XNA

Recent Posts

Game Jam – GatewaysApril 25, 2021
Game Jam – Frequency SyncJanuary 29, 2019
Shader Series – Screen Space ReflectionsJune 26, 2018

Categories

  • 3C – Capture Crop Create
  • 3D Laser Scanner
  • Arduino
  • Asia
  • Chrome Addins
  • Dev Blog
  • DIY
  • Game Jam
  • Metric Racer
  • MonoGame Tutorials
  • Music
  • OpenCascade
  • Programming
  • Quadcopter
  • Shader Series
  • Shaders Tutorials
  • Space Esc8bit
  • The Chaotic Workshop
  • Traveling
  • Tutorial
  • Tutorials
  • Uncategorized
  • Vertices Engine
  • Videos
  • Virtex Dev Blog
  • Virtex Edge Design

Tags

3D 8-Bit AdMOb Ads android Animation Apollo Apollo 11 Audio Audio Puzzle C# Editor Electronics featured Game Dev Game Development Game Engine Gaming Github GLSL Graphics HLSL Japan Javascript Linux Mobile MonoGame NASA OpenGL Optimizations Programming Projects Screen Space Reflections Shaders Source Code SSR Terrain Editor tools Transparency Tutorial Vertices Virtex Edge Design WebGL wxWidgets XNA
Rife Wordpress Theme. Proudly Built By Apollo13

ROB TOM ROE

I’m an Entrepreneur, Software Developer and Mechanical Engineering Grad. I started out working in the Energy and Nuclear safety sector as well as Aircraft Design, Repair and Stress analysis. In 2015 I started Virtex Edge Design , a software and game development company.

Recent Posts

Game Jam – GatewaysApril 25, 2021
Game Jam – Frequency SyncJanuary 29, 2019
Shader Series – Screen Space ReflectionsJune 26, 2018

Categories

  • 3C – Capture Crop Create
  • 3D Laser Scanner
  • Arduino
  • Asia
  • Chrome Addins
  • Dev Blog
  • DIY
  • Game Jam
  • Metric Racer
  • MonoGame Tutorials
  • Music
  • OpenCascade
  • Programming
  • Quadcopter
  • Shader Series
  • Shaders Tutorials
  • Space Esc8bit
  • The Chaotic Workshop
  • Traveling
  • Tutorial
  • Tutorials
  • Uncategorized
  • Vertices Engine
  • Videos
  • Virtex Dev Blog
  • Virtex Edge Design