# Beginning AI Tips? (C++)

**URL:** <https://forum.kirupa.com/t/beginning-ai-tips-c/219656>\
**Category:** programming\
**Created:** [March 19, 2007, 4:11am UTC](https://forum.kirupa.com/t/beginning-ai-tips-c/219656 "2007-03-19T04:11:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cedwyn](https://avatars.discourse-cdn.com/v4/letter/c/eb9ed0/32.png) [@Cedwyn](https://forum.kirupa.com/u/Cedwyn)\
**Post date:** [March 19, 2007, 4:11am UTC](https://forum.kirupa.com/t/beginning-ai-tips-c/219656/1 "2007-03-19T04:11:30Z")

</div>

Hello everyone,

I am in 1st year robotics at university and currently learning c++. I’m an avid programmer, so I started designing my own games even though I’m still learning the language.

A game in progress is a turn based strategy. Basically something like a tactical rpg, where you move units. Currently the AI is non-existant and static. But I am hoping someone might know of a resource I could make use of that lists tips and even steps to programming a simple AI.

I’m hoping to create something where the computer can move the units based on unit type and nearby units. I was thinking of using if statements and random functions to accomplish this. However, I am unsure of how to make the computer aware of the players unit locations and nearby units. Such as if there is a unit to the left, it should probably attack this unit.

Thus, I’d appreciate any advice, or thoughts on how you approached AI problems when you began programming!

Cedwyn
