Programming the 5 Senses

Started by
12 comments, last by Tutorial Doctor 10 years, 3 months ago


Yeah, the system won't scale well.

I just updated the post. It seems to work really fast with the "ghost mode" built into the engine. Of course, right now I am only seeing one object. I wonder, how would I construct the See() function so that I don't have a big switch statement for all objects that can be seen. I think i could have the cone see everything, but then it would be sensory overload (I don't think it would be enough to crash the engine though. It would just be too much to deal with to have it see everything in the game. I do understand that this is how our eyes work, but it would cause unnecessary memory use in the game.

I am sure this would have to end up being a class, but even then, how would I construct the class in the most efficient way so as to make the cone able to dynamically see things?

Doesn't seem hard, just thinking of the easiest and most efficient way at the moment.

I am using lua (which uses tables).

They call me the Tutorial Doctor.

Advertisement

After watching a few lectures on Artificial intelligence, it seems that this system can easily become an AI system. I have already thought about some cool interactions that can be done. For instance, I made my character turn to the left if it sees the box. So the character is sort of avoiding an object. In the lecture they said that if something can sense as well as produce a reaction the sense, it has artificial intelligence. Of course, adding learning and such will make it even more interesting, and I think I can create a simple system from for learning using tags or labels. I also thought of a way to get objects to anticipate a situation and react accordingly. I haven't thought of a way to do inferences but hopefully I can think of a way. ,

Edit: I was able to get my character to jump on sight of the box!

They call me the Tutorial Doctor.


Yeah, the system won't scale well.

I just updated the post. It seems to work really fast with the "ghost mode" built into the engine. Of course, right now I am only seeing one object. I wonder, how would I construct the See() function so that I don't have a big switch statement for all objects that can be seen. I think i could have the cone see everything, but then it would be sensory overload (I don't think it would be enough to crash the engine though. It would just be too much to deal with to have it see everything in the game. I do understand that this is how our eyes work, but it would cause unnecessary memory use in the game.

I am sure this would have to end up being a class, but even then, how would I construct the class in the most efficient way so as to make the cone able to dynamically see things?

Doesn't seem hard, just thinking of the easiest and most efficient way at the moment.

I am using lua (which uses tables).

To really test, you'd need to add more and more objects, and more and more agents. Depending on how you eventually want to go, this might not be a big issue. For example, the original Carnage Heart was an AI programming game, and only had six agents in a battle at once. Only having to do six vision cone checks of varying complexity and you could probably keep a decent framerate.

And your system sounds similar to view frustums. So you might look into various culling routines, even a scenegraph or octtree.

That way you could narrow down which objects you actually need to do the expensive collision checks on, and which you can trivially reject as being out of sight. Though you might also want to move to a fuzzy system, if you are modelling human sight, for instance, we have peripheral vision which is very good at sensing movement, but terrible at everything else.

Granted, those are steps I would take when you get to them, ie when you actually start having trouble with your framerate.

Thanks for the tips ferrous. I can already see possible adaptations of this system already to make it more realistic. I thought about peripheral. I might do it the same way I do the quality of sight (using transparency of the cone to represent quality of sight. I could also scrap the whole primitive thing and do some vector math as well (trying to stay away from that right now, because primitives are already mathematical shapes, I just need their volume, not their actual faces (which I think the ghost mode in this engine is for).

I have even been thinking a bit about conic sections and such. But I am trying to keep things simple and straightforward right now.

I am going to look up the terms you posted though. Thank you. I have also started a journal. I will put this idea in an entry so that I can update my findings from there.

They call me the Tutorial Doctor.

This topic is closed to new replies.

Advertisement