Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / Artificial Neural Network through Memblocks (DBPro)

Author
Message
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 2nd Jan 2006 19:01 Edited at: 4th Jan 2006 18:29
Artificial Neural Network through Memblocks: ANNtM
(say "Auntie Em", like from the Wizard of Oz )

Wasn't quite sure where to post this, but the snippets forum felt most appropriate. It's a sort of Work In Progress, but it's not intended to be a full program, but rather something to use in a full program (have I defined a snippet yet?). Either way...

ANNtM is a Memblock based Artificial Neural Network. It is designed not to do anything so specific as Artificial Intelligence (on it's own), but is intended more as a tool for AI codes. Programming the base logic for AI is fairly straight forward. ANNtM handles the more complex part of the AI, mainly the learning.

ANNtM combines a genetic evolution code with a linked neural network, and uses Memblocks (about as efficiently as I can get them) to store all that data. The genetic evolution code means that it learns. The neural network means that multiple inputs can impact multiple outputs. For example:
An AI that gets hungry, then goes and eats, isn't very realistic. What if the AI is at work, sleeping, or being chased by another hungry AI? The AI should not stop what it's doing and eat, as these other factors need to be accounted for. A Neural Network handles that and weighs in all the factors before an output is generated.

The neurons are laid out in clusters of 32 neurons (0-31) and each cluster can be linked to another cluster. For those that are a bit familiar with ANNs, this means that creating input, processing, and output layers is relatively easy.

Attached is the code and a tutorial (in the Word document) and a small Excel file that shows the neuron layout. The demo is only really there to show how the neuron clusters affect each other and to test that all the functions are working properly. But it's not all that exciting.

The code in the code bracket below is the predecessor of ANNtM and gives a little more demonstration of how neurons work. This AI learns and uses only 2 neurons. This will give an idea of how poweful several clusters of 32 neurons can potentially be.



Edit: All code is DBPro 5.8


Open MMORPG: It's your game!

Attachments

Login to view attachments
the Last Programmer
18
Years of Service
User Offline
Joined: 14th Jul 2005
Location: Abilene, TX
Posted: 3rd Jan 2006 08:29
Looks really cool. I'll go over your tutorial and get back to you on that. But the code snippet works fine on my computer.

I think that this would really help me out a lot on my own AI.

Thanks for sharing.


www.fishbrosentertainment.com
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 4th Jan 2006 09:11
Thanks for the feedback the Last Programmer.

I've added in the Link Learning feature. It probably needs to be fine-tuned, but that will take time and experimentation. I also added it to the tutorial.

I see a few folks have read this thread, but only one reply so far. I really do encourage feedback, comments, questions, problems, and constructive critism on this project. Thanks in advance.


Open MMORPG: It's your game!

Attachments

Login to view attachments
dpharaoh
18
Years of Service
User Offline
Joined: 2nd Nov 2005
Location: SouthEast MA
Posted: 4th Jan 2006 14:28
This is a brilliant implementation of an AI concept! Excellent work!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 5th Jan 2006 07:38
@ dpharaoh: Thanks I only hope this will be of some use to someone.


Open MMORPG: It's your game!
zodiac
18
Years of Service
User Offline
Joined: 15th Mar 2006
Location: Arizona
Posted: 23rd Mar 2006 06:13
aww man, I have DBC... and I'm helping my friend make a multiplayer RPG, and the AI would be so useful... not to worry, my birthday is only in another 3 months, and I'm [ hopefully ] getting DBP.
But until then, I can't wait to check this out! I've already bookmarked it

2.4Ghz
512mb ram
256mb DDR video card(ATI Sapphire Radeon 9600)
3Nigma
18
Years of Service
User Offline
Joined: 23rd Apr 2006
Location: RoManiA
Posted: 23rd May 2006 19:29
this is some rather interesting stuff you'r showing here...have you researched further into AI concepts?

Knowledge belongs to the world...but not this time
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 28th May 2006 10:59
Thanks for the comments.

I worked a little bit more with this code and did some further testing. I've come to the conclusion that clusters of 32 neurons is not too practical when it comes to learning how to link one chain of neurons to another chain (the combination possibilities are staggeringly large; for a cluster of only 4 neurons linked to a cluster of 4, the possible combinations are 65536). I will be rewriting this code to only accomidate clusters of about 4 nuerons. The learning for how to link the neurons will be far more effective that way.

Quote: "have you researched further into AI concepts"


Not recently. I am working hard on an RPG project at the moment and learning a lot of coding skills as I go along. The most recent success is a very versitile skills system. I do plan on applying what I have learned from that experience to this AI in the not-to-distant future.


Open MMORPG: It's your game!
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 28th May 2006 18:03 Edited at: 28th May 2006 18:12
Here's the little 2-neuron demo. The full ANNTM does not have a demo.

The "game" is to try and get as close to the "egg" (the yellow sphere) as possible for a long as possible, without being "eaten" by the monster. If the monster get's too close to you (the camera), it is considered to be "eating" you.

You get more points the longer you stay and the closer you get to the egg, the more points you get. But if the monster is "eating" you, you lose points instead.

The monster will learn how to best defend the egg by keeping you away from it (or by eating you if you stick around). This is a great demonstration of how to use a neural net to teach an AI how to do something. At first, you will see that you can get a lot of "points", but as time goes on, you will not be able to get as many. The monster is better able to make the decision to "protect the egg" or "attack the player", which is a single neuron decision.

Of course, if you train the monster wrong (by going in and sitting around the egg, or staying far away from the egg), the monster will think it's doing the best job it can, and get stuck into that incorrect pattern, and will not learn as fast.

Enjoy.


Open MMORPG: It's your game!

Attachments

Login to view attachments
Citizen James
17
Years of Service
User Offline
Joined: 28th May 2006
Location:
Posted: 30th May 2006 01:15
WOW, that is simply amazing work! It's so innovative and clever. Im sure if you keep it up and stay dedicated, you could get some recognition in the technology/science world. Keep up the good work, I know I'll be checking on your progress!
ALPHA ZERO PRODUCTIONS
20
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Mom ! I forgot where we live !
Posted: 12th Jun 2006 06:28
wow.....i got to bookmark this!!!

RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 14th Jun 2006 10:21
Thanks for the comments. I certainly will keep it up.


Open MMORPG: It's your game!
TEH_CODERER
20
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 14th Jun 2006 18:02
Ruddy amazing! Incredible work!

[url]andrewneale2004@yahoo.com[/url]
http://www.elbsoftware.dbspot.com
Cave Man
17
Years of Service
User Offline
Joined: 22nd Aug 2006
Location: North Carolina, US
Posted: 27th Aug 2006 23:22
Cool, thats neat.

The ARRAYinator
18
Years of Service
User Offline
Joined: 13th Aug 2005
Location:
Posted: 10th Sep 2006 04:49
Very cool!



RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 10th Sep 2006 19:47
Thanks. I am going to be picking this up again soon. I have a lot of ideas on how to improve this, most of which are coming from the work on the OMMORPG project.


Open MMORPG: It's your game!
DarkMasta
18
Years of Service
User Offline
Joined: 21st Apr 2006
Location: Typed on your screen.
Posted: 26th Sep 2006 17:33
That idea is fantastic. I'll check out the ANNtM code, but I'd like to see the demo too. Unfortunately, I can't open *.rar-files. Could you post the demo version as a *.zip-file, please... somebody? ...anybody?

Wherever you plan to go,
it's the next step you never know.
RiiDii
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Inatincan
Posted: 26th Sep 2006 19:56 Edited at: 26th Sep 2006 20:04
The .rar demo is just a compiled .exe of the demo posted in the first post. You can just copy that code into DBPro and run it from there.

Or, you can also download and use Winrar for free just like Winzip.


Open MMORPG: It's your game!

Login to post a reply

Server time is: 2024-05-20 00:47:01
Your offset time is: 2024-05-20 00:47:01