Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
About
Team
Rules
Stats
Status
Sitemap
Chat
Downloads
Forum
News
Our Projects
Major Community Projects
Recent Posts
Unread Posts
Replies
Tools
SourceCoder3
Other Things...
Omnimaga Radio
TI-83 Plus ASM File Unsquisher
Z80 Conversion Tools
IES TI File Editor
Free RAM areas
Comprehensive Getkeyr table
URL Shortener
Online Axe Tilemap Editor
Help
Contact Us
Change Request
Report Issue/Bug
Team
Articles
Members
View the memberlist
Search For Members
Buddies
Login
Register
Omnimaga
»
Forum
»
Calculator Community
»
TI Calculators
»
General Calculator Help
»
AI Theory
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: AI Theory (Read 3000 times)
0 Members and 1 Guest are viewing this topic.
Darl181
«Yo buddy, you still alive?»
CoT Emeritus
LV12
Extreme Poster (Next: 5000)
Posts: 3408
Rating: +305/-13
VGhlIEdhbWU=
AI Theory
«
on:
July 25, 2011, 06:51:30 pm »
For a game I've been planning on making (platformer SHMUP), I would need a somewhat-complex AI.
What it would do in the end would be follow/home in on the player in a physics-based enviroment--jumping over holes and such.
Also I plan on making it shoot, but I haven't thought about that so much yet.
This obviously isn't code, but thoughts. Final thing will probably be in axe, but the ideas are pretty much general and could be applied to axe, asm, maybe even basic.
Anyway, what I have so far:
Spoiler
For
kind of big
:
If player is to the left of AI
If area to left is open
If there is floor to the left
Move left
Else
If there is floor two or three tiles to the left and there is no wall two or three tiles to the left
Move left and jump
Else
Check above? Maybe just jump and keep checking
End
End
Else
If area to the right is open
If there is floor to the right
Move right
Else
If there is floor two or three tiles to the left and there is no wall two or three tiles to the left
Move left and jump
Else
Check above? Maybe just jump and keep checking
End
End
Else
Jump, set something to check if area to left is open then right. If AI lands without moving left or right, then the AI must be in a pit-—idk what to do at this point
End
End
End
.next part is pretty much same as previous--just switch "left" with "right" and vice-versa =P
If player is to the right of AI
If area to right is open
If there is floor to the right
Move right
Else
If there is floor two or three tiles to the right and there is no wall two or three tiles to the right
Move right and jump
Else
Check above? Maybe just jump and keep checking
End
End
Else
If area to the left is open
If there is floor to the left
Move left
Else
If there is floor two or three tiles to the right and there is no wall two or three tiles to the right
Move right and jump
Else
Check above? Maybe just jump and keep checking
End
End
Else
Jump, set something to check if area to right is open then left. If AI lands without moving right or left, then the AI must be in a pit-—idk what to do at this point
End
End
End
It's not exactly organized, and I don't have it check for whether player is above or below (ie if it were below it would look for a hole that's not a pit), or if there's a ledge it can jump over a hole onto, but one gets the general idea.
I was wondering if this has been experimented with before in calc games, how practical it would be, and if there would be a better way to organize this stuff. Also if there's any ideas I've overlooked..
TIA
«
Last Edit: October 26, 2011, 10:42:51 am by Darl181
»
Logged
Vy'o'us pleorsdti thl'e gjaemue
Ashbad
Guest
Re: AI Theory
«
Reply #1 on:
July 25, 2011, 09:47:41 pm »
Well, it's a good start, but it's pretty simple
. All you're really doing is checking for boundaries and where the player is, without any concern for thing like complex obstacles, the player being out of sight of the enemy, the enemy's conditions (if other enemies are being slaughtered or the enemy's health gets critical and there is a chance for escape), the enemy should hide, run away, hold its ground rather than be aggressive, etc.), perhaps thinking about alternative ways to go, etc. This is a good basic framework for all AI in games that try to propose a challenge, as code that will make the player think the AI is "smart" rather than just a following system, will impress the player more, and possibly provide a much bigger challenge.
Edit: also the indenting in your pseudocode seems out of whack as well.
«
Last Edit: July 25, 2011, 09:49:37 pm by Ashbad
»
Logged
Darl181
«Yo buddy, you still alive?»
CoT Emeritus
LV12
Extreme Poster (Next: 5000)
Posts: 3408
Rating: +305/-13
VGhlIEdhbWU=
Re: AI Theory
«
Reply #2 on:
July 25, 2011, 10:42:55 pm »
As I said, I haven't put much time into it
I don't really plan on anything too complex atm, first things first (ie the engine)
I can't get too complex with this, b/c I have only ~6mhz to play around with.
I might take the health into account, tho...
«
Last Edit: July 25, 2011, 10:55:23 pm by Darl181
»
Logged
Vy'o'us pleorsdti thl'e gjaemue
Print
Pages: [
1
]
Go Up
« previous
next »
Omnimaga
»
Forum
»
Calculator Community
»
TI Calculators
»
General Calculator Help
»
AI Theory