Skip to content

firstlawrobotics/rayCastingMinimap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

RayCast Minimap

Using basic raytracing functions (basically LIDAR) I added a miniMap function that identifies cleared space, dead space, and cover and implements a decay function for cleared space to force agents to reprioritize it.

Basically, it allows an AI to know where it is in relation to other things it has seen and gives them a concept of cleared space and dead space.

Long term plan is to combine this with a SLAM (https://en.wikipedia.org/wiki/Simultaneous_localization_and_mapping) algorithm and beat state of the art in any first person shooter out there.

I don't have the money to train my reinforcement learning agents so give me money please.

Heatmap Enabled Minimap with Decay Function Enabled

This shows a view across the screen of an uncleared obstruction in the bottom right.

Black indicates obstruction, and the colors gradient indicates how recently a space has been cleared, with darker colors being most recently. The map starts blank and is filled in as the agent looks around.

In game screenshot

Spin to Gain Orientation

One fast way to figure out what is going on is to spin around and determine where everything is.

In game screenshot

Map After Clearing Dead Space

After that spin we have a decent idea of what the map looks like, but there is still a ton of dead space behind obstructions.

In game screenshot

In this example, we will go and clear the obstruction in the bottom right corner of the map.

In game screenshot

After clearing the bottom right we have filled in our map and determined there is nothing else back there, but now the rest of the map isn't cleared anymore.

This decay function can be used to shape an agent's behavior towards clearing intelligently.

Behind the Scenes

In game screenshot

To Do

The raycasting engine isn't great at detecting diagonal edges in this environment, so I could either rewrite the engine or go and find a better implementation. Not sure which I'd rather do.

This concept, coupled with a basic SLAM implementation would likely be a SOTA FPS playing AI.

Resources

PyRay is a ray casting engine (http://en.wikipedia.org/wiki/Ray_casting) written in Python using the PyGame library (http://www.pygame.org/wiki/about). Code forked from https://github.com/oscr/PyRay.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages