Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Game Programming > Artificial Intelligence...


Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2010, 06:12 PM
VbNerd96's Avatar
VbNerd96 VbNerd96 is offline
Newcomer
 
Join Date: Dec 2009
Posts: 24
Question Artificial Intelligence...

I have been working on an Artifficial Intelligence project and have incountered a bug... which I not sure how to fix.

First off a little backstory (if you will).------------------------------
The program has multiple types of AI with different characteristics...
One of which is just a plain ol' averge being.

Now, this AI during it's main loop will "search for danger" just to make sure that there is not any kind of hazard that it will need to avoid, or something it needs to investigate.

One thing it searches for are dead bodys.
And, if it finds one it will procede to investigate said body...
after investigating the body and looping through some random things (check cause of death, alert nearby peeps, call athoritys) it will procede to move away from the corpse..

at which point it will *again* recognise the body and go through the same loop over and over again as though it had never seen the body before.

----------------------------------------------------

Sorry for the long intro...

Anyway, My question is : is there some way I can make it so that the next time the AI encounters it it will know that it has seen it before and will leave it alone?

Thanks in advance...
__________________
Je reste fidèle à la cause... Des langue programmation de VB6!
Reply With Quote
  #2  
Old 07-16-2010, 10:32 PM
vb5prgrmr vb5prgrmr is offline
Senior Contributor

* Expert *
 
Join Date: Mar 2009
Posts: 1,093
Default

Well that really depends upon what and how you keep track of the environment. Do you have fog of war tracking AKA terrain discovery? How do you track the placement and movement of other obsticals/characters within the environment? Do you have some sort of bitmap or indicator array? If so, could you not flip a bit somewhere to indicate discovered and searched?



Good Luck
__________________
Just because I'm an expert does not mean I know it all and just because I know it all does not mean I'm an expert
Reply With Quote
  #3  
Old 07-17-2010, 10:29 AM
VbNerd96's Avatar
VbNerd96 VbNerd96 is offline
Newcomer
 
Join Date: Dec 2009
Posts: 24
Default

Well, right now there actually is no method of keeping up with the envirorment...

I do not have the envirorment gridded, so every thing is free-roam... How would one go about setting up an indicator array or something with a free-roam envirorment??
__________________
Je reste fidèle à la cause... Des langue programmation de VB6!
Reply With Quote
  #4  
Old 07-17-2010, 09:28 PM
vb5prgrmr vb5prgrmr is offline
Senior Contributor

* Expert *
 
Join Date: Mar 2009
Posts: 1,093
Default

In any way that works for you... However, I have seen bit maps (*.bmp) like fiiles in several formats. A monochrome, greyscale, true color, and with an alpha value (ARGB or is that ABGR), meaning...
Code:
11111111
10000001
10011001
10011001
10011001
10011001
10000001
11111111
in a monochrome bitmap style, each bit, either a zero or a one, denotes where a player can walk/move, or it could mean something else...

Same can be said for a 256 greyscale image where each byte, pixel, contains some sort of meaning as each byte can be a value from 0 to 255. So this could be a height map or a movement cost map, or... well let your imagination run wild with that...

Then of course, the bitmap type of file we may be more used to where each pixel has an RGB value and each byte (r,g,b) for each pixel can mean something.

Of course after that, there is the alpha channel with each pixel.

Now, these don't actually have to be *.bmp files (or *.jpg, *.png), but if you are going to let your users define game envionments, terrain, obstacles, etc. it is one way to do so. Another way, like the game of Decent, an older game, which was in 3d. They used a common 3d environment formated file that I believe most users used Autocad to design levels with.

Now, these file formats can be of your own design, or you can use an established file format and just used it for your own purposes...



Good Luck
__________________
Just because I'm an expert does not mean I know it all and just because I know it all does not mean I'm an expert
Reply With Quote
  #5  
Old 07-17-2010, 11:41 PM
VbNerd96's Avatar
VbNerd96 VbNerd96 is offline
Newcomer
 
Join Date: Dec 2009
Posts: 24
Default

Woah... I'm sorry but I've gotten a bit confused....

The example made me think Multi-demisional Array... but your talking about bitmaps... how would I incorperate a bitmap into this?
__________________
Je reste fidèle à la cause... Des langue programmation de VB6!
Reply With Quote
  #6  
Old 07-18-2010, 06:04 AM
vb5prgrmr vb5prgrmr is offline
Senior Contributor

* Expert *
 
Join Date: Mar 2009
Posts: 1,093
Default

Well think about the example I gave you and an image. Each have a width and a height, and cannot these be tracked by a multidimensional array? Via X and Y values? It is pretty much the same to say...
Code:
MyLongValue = MyLongArray(x, y)
'or
MyLongValue = GetPixel(PicBox.hdc, x, y) 'GetPixel is an API BTW

The only difference is, if you are somewhere on this terrain and you want to know what is around you, based on vision, fog of war, etc. With an array, you have to figure it out, but with a bitmap, they make API's for such things...

http://www.tek-tips.com/viewthread.cfm?qid=849985
http://www.tek-tips.com/viewthread.cfm?qid=626738
http://www.tek-tips.com/viewthread.cfm?qid=334861

http://www.tek-tips.com/viewthread.cfm?qid=270540



Good Luck
__________________
Just because I'm an expert does not mean I know it all and just because I know it all does not mean I'm an expert
Reply With Quote
  #7  
Old 07-18-2010, 11:57 AM
VbNerd96's Avatar
VbNerd96 VbNerd96 is offline
Newcomer
 
Join Date: Dec 2009
Posts: 24
Default

Wow, that was much simpler than I thought it would be. lol

But I finnally understand... lol...

Anyway, thanks a mill' for the assistance... much appreiciated.
__________________
Je reste fidèle à la cause... Des langue programmation de VB6!
Reply With Quote
Reply

Tags
artifficial, glitch, intelligence, problem


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:

Powered by liquidweb