Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > AI on C64
2009-09-29 18:25
Hermit

Registered: May 2008
Posts: 208
AI on C64

Were there any Artifical Intelligence experiments on C64?

-A neuron is not really more than a body which sums more weighted inputs into an output..(in real life sigma-sum)
-A neural network appears when these are connected to each other, in most cases by careful arrangement.
-The neurons can learn by modifying their (originally randomized) input-weights to reach the wished (reference) value at their output.
-The learning process takes some iterations depending on the strength (multiplier) of the feedback of actual error delta (wished reference for actual inputs -minus- the actual output). The optimal multiplier seems between 0.2..0.3 from my experiments.

A neuron's pins, datas (weights) and connections can be modelled in assembly easily. A byte can be a value of input-weight, and the weighted inputs can be added (and divided) together to a byte, which will represent the output of the neuron when the neuron was simulated once in a step. Then a connection list can route this output to other neuron's input.

See my example on my homepage (neuron-DAC2.xls).

http://hermitsoft.uw.hu/pcprog/pcprog.html

It's an Excel file that shows iterations and learning curve of a Neuron. We teach it to be a special Neuron - be it a DAC (Digital-to-Analog converter).
After several iterations the error gets smaller-and-smaller, then our Neuron learns to be a DAC, the needed information is 'stored' in its weights.

No concept yet, but C64 may be able to simulate simple neural networks at 1MHz, which could be useful in games, and even in demos, or who knows, even in 'random' composing for music editors..

Maybe you're interested..maybe not.
Have a good exploration.

Hermit Software Hungary
2009-09-29 21:39
AlexC

Registered: Jan 2008
Posts: 299
Well, never really thought about it before but I guess that the use on c64 is somehow limited. First of all all action games with sprite multiplexing, msx and chains of irq routines can leave no space for advance AI or allow AI to be invoked only in certain screen lines. A lot of games have some spare time but it all comes to design.

The only use in terms of games I can imagine right away are chess-like games and strategy ones. Actually it would be interesting to look into Final Chesscard because this could be the game which uses similar approach. After all the additional CPU must have some use...
2009-09-29 21:44
Zyron

Registered: Jan 2002
Posts: 2381
I believe Eliza was supposed to have some sort of AI, not a total success though.
2009-09-29 23:03
Kickback

Registered: Apr 2004
Posts: 97
Quote: I believe Eliza was supposed to have some sort of AI, not a total success though.

LOL!!!! Eliza.... "How do you feel today.." Man that brings back some memories!
2009-09-30 07:57
Spinball

Registered: Sep 2002
Posts: 88
the coder of this game at least says it is using AI:

http://noname.c64.org/csdb/search/?seinsel=all&search=kitron&Go..
2009-10-01 07:45
Frantic

Registered: Mar 2003
Posts: 1648
I have done some stuff using GP ("Genetic Programming") on the C64. All of it unreleased so far though. One of those productions may actually be finished in a not too distant future (or not).

(A not very important sidenote: Brain activity is not completely reducible to firing patterns, to be precise. You also have, according to some, gamma-waves, and stuff like that.. Anyway, this is not of high relevance for the issue of implementing some sort of AI on the C64 of course... :)
2009-10-01 07:59
enthusi

Registered: May 2004
Posts: 677
Actually I think most (all?) C64 games do well with pseudo AI.
As in a set of rules that interact which each other to create complexity.
Not Even Human - Inhumane Edition
Does that and despite the fact that it had to be rather limited due to rastertime I was quite happy with the result.
A few more extra functions and it would be better than any real, theoretically satisfying AI I think...
2009-10-01 08:21
Hermit

Registered: May 2008
Posts: 208
Hi Mates

I tried Eliza, it seems a cleverly programmed thing.

Though in my opinion, the good approach to AI is the Neuron-based AI.

The difference between the 'pre-programmed' and Neuron-based
AI is the learning power. And the Neurons are working truly paralell not in serial after each other..so with today's serially working computers the Neuron models aren't working as fast as the ones realized on e.g. paralell-working FPGAs..

The researches which try modelling AI with Neurons is to be improved a lot as the laboratories couldn't reach that much number of neurons (on FPGAs, etc) with that much connections as even the simplest brains..they reached the complexity of worms or bugs (do not laugh, please :)

So I'm far from trying to modell AI on brain's level, that programs try (as e.g. Eliza). Instead the well constructed neural networks could solve a lot of problems after learning. The learning is what 'programmed' AI solutions are mainly missing, and I think they'll be less used in the future.

Some good examples can be found on net about what today's neural networks can solve..e.g. speech recognition, finding out the language-type from source code, decide if an applicant is good for a job, etc..

On C64 at 1MHz processor speed only limited numbers of neurons can be modelled, but if there's a good construction in their connection, they can solve problems after learning phase, that none of the 'pre-programmed' AI programs can solve..and this need much less system resources than using predefined values for decisions..

To make my (maybe complicated) explanation clearer, I'll show some links that could point what I'm saying with preferring neural networks.

http://en.wikipedia.org/wiki/Neural_network

http://portal.acm.org/citation.cfm?id=206913.206999

http://cslu.cse.ogi.edu/tutordemos/nnet_recog/recog.html

http://www.neuralnetworks.it/neuralsignature.asp

http://www.advancedsourcecode.com/netassembler.asp

etc,etc, I think the Neural modelling of biology is the future in AI..

Hermit Software Hungary
2009-10-01 09:43
Wile Coyote
Account closed

Registered: Mar 2004
Posts: 646
I have always assumed Chess games have a level of AI, as they take some time to make their moves, at least on 8-bit machines.

The whole AI thing is interesting.
2009-10-01 10:30
enthusi

Registered: May 2004
Posts: 677
"AI" is very ill defined, at least not used very precisely.
Chess games usually dont have AI as it was mentioned here.
Same with practically all games so far.
Not 'learning' the proper way.
Check out connect-4-games. You will never win against a good one, yet it has ONE rule how to play only.
I remember this whole discussion when Command&Conquer came out. I friend of mine wrote part of his thesis about the 'AI' of the Harvester, hehe.
2009-10-01 10:54
Martin Piper

Registered: Nov 2007
Posts: 722
Regarding AI and learning. The robots in Berzerk Redux have a little bit of AI, they try to avoid walking into walls and will look for a direction around a wall if they are blocked.
Simple enough of course.

Regarding learning:
One idea I did have was to note which areas of the screen robots were killed. Then the remaining robots would prefer to avoid those areas. I never did put it in though as there are not that many robots on each screen to make it a worthwhile check.
2009-10-01 12:12
Hermit

Registered: May 2008
Posts: 208
Yeah, here is a good reason to model AI with neurons: If you equip the robots with (simulated) neural networked brain, you don't have to program their behaviour, they'll realize the danger themselves on the dangerous areas after a while if their life is in danger. That is the true learning. We can say the teaching is a 'programming', but more universal and maybe easier than writing a code for every behaviour.

Just imagine: every living entity in the world was born without any knowledge, with a pure brain, with randomized weights in their neurons, clear synaptic connections. Like a formatted winchester...
There are physical circumstances, like energy, food, health, perceptions, that the entity have to keep above a level to stay alive. The nervous system & receptors are designed (maybe into DNS through evolution), but the other informations come during the real life, and not stored in the brain by default.. (excepted instincts, which are maybe also programmed by DNS).
I've read in a medical book that babies even can't see at the time they are born (only just some shades, but not edges, details)..
I also heard that from a scientist, only 3 connected neurons are enough to keep a body in balance, and only 6 neurons were enough in an experiment that were connected to photo-sensors, and they could keep a stick balanced with electromagnetic field...after they were taught for it.

The robots in games could be taught by showing them what output to do for what input (e.g. seeing, noise, etc), which is right or wrong step.. Then their information after teaching them beforehand could be stored into virtual pre-taught brains, and they would be ready to fight when the game is released.

You can make experiments with tools:
http://www.mathworks.com/products/neuralnet/
http://download.cnet.com/Neural-Network-Designer/3000-2069_4-10..
etc..

Some knowledge base..
http://hagan.okstate.edu/nnd.html
http://ai-depot.com/articles/evolutionary-neural-networks-desig..

Hermit Software Hungary
2009-10-01 13:59
Wile Coyote
Account closed

Registered: Mar 2004
Posts: 646
Can you imagine if Chess games had proper AI. It would pose a number of advantages / disadvantages for the player. For every game played, the computer should become better, as being a Chess game, its soul purpose would be to learn and progress. Not having any emotions, it wouldn’t care it if won or lost, just so long as it got better. This could pose issues, from a game play perspective. One solution might be to throw in some pre-generated emotions: (that the player is not made aware of)

Example emotion: You feel ill
Effect: Reduces ability by 10%

Example emotion: You feel on top of the world
Effect: Increases ability by 15%

Example emotion: Your cat has been run over by a car
Effect: 100% - Shuts down, refuses to play ;D


2009-10-01 14:08
Martin Piper

Registered: Nov 2007
Posts: 722
While I agree with you the field of neural networks and learning AI is fascinating here is a story from my dim distant past. :)

I was once coding an entirely different game, 3D on the PSX. It involved aliens, face-huggers and space marines. :)

The design document specced mega intelligent aliens that would work in groups, hide from the player and then attack the player without any warning. The aliens should use AI to make use of walls and ceiling to evade detection. This was to be scary and tension building, just like the Aliens films.

This was implemented but the player feedback was that they couldn't really see the aliens to shoot them. They didn't like how the aliens would sneak up from behind and gore the player to death without any warning. :)

The problem is the aliens were too sneaky and it just wasn't fun to play against.

So all the AI was dropped in favour of scripted events where aliens would use animations to jump out of the door to the left when walking down the dark spooky corridor. Or they use animations to run as a pack along the wall then the ceiling in plain view of the player. Lots of scripted events when the player walked somewhere, or opened a door, or flipped a switch on the wall. Then once the scripted event was finished the aliens would fall onto the floor and run head first at the player.
This unintelligent system using very minimal logic was much better to play because as it turns out most players wanted to blast aliens to tiny bits with the array of weapons they had. :)
2009-10-01 14:22
chatGPZ

Registered: Dec 2001
Posts: 11386
Quote:
Can you imagine if Chess games had proper AI. It would pose a number of advantages / disadvantages for the player. For every game played, the computer should become better, as being a Chess game, its soul purpose would be to learn and progress. Not having any emotions, it wouldn’t care it if won or lost, just so long as it got better. This could pose issues, from a game play perspective.


at some point in history, chess engines used to work like this infact .... but it turned out that simple brute force table lookups work better =P you dont want to wait years until your chess engine is able to play like a 5 year old =D

and what martin said - in reality AI based on neural networks is fascinating indeed - but it isn't very useful for games.

what i would like to see however, would be a converter for pictures which is based on neural networks. there was one for the gameboy color, and it produced really great results. (unfortunately it was closed source commercial software, cant find any example pictures online)
2009-10-02 13:21
PopMilo

Registered: Mar 2004
Posts: 146
I messed around with AI before, and in one of my projects it turned out to be much simpler to define rules for each type of object in game... Lot of conditions and actions... Nothing inteligent but it did seem like that ingame :)

I do like the idea to use AI for graphic converter ...
I think genetic algorithms would be of much use...
Raw power of modern PCs can do miracle.
2009-10-02 18:32
Wile Coyote
Account closed

Registered: Mar 2004
Posts: 646
Of the many ideas I’ve had for games (some good, some not so good, some in need of extra work ;) reading this thread made be take one idea further. I don’t want to explain the idea in miniscule detail, but rather list a few bullet points. AI is key to the whole game experience.

Period: Based in the future
Location: Set a sky scrapper
Level Graphics: X-Ray (each level has the look of an X-Ray)
Imagine cutting a sky scrapper horizontally, and taking a top down view of an office layout. That’s how each level would look, in X-Ray form.

Game Play: One on one action. Think Alien vs. Predator.
The Player character remains outside the sky scrapper, not able to enter, only shoot inwards through the windows. The Computer character remains inside the sky scrapper, not able to exit, for fear of the Player, and only able to shoot outwards, though the windows.

Game Over happens once the Player looses all lives.
Game Completion never happens, as the AI increases level by level.
A level limit could be imposed, but that would remove the ultimate challenge (You vs. It)

Player Character: Future Cop, armed with big gun, complete with jetpack. Hovers to the left, right, top, bottom, of the screen, always facing inwards (to wards the (square shaped) sky scrapper).

Computer Character: Futuristic Reptile, armed with big gun, can walk, run, stop, think, hide, and obviously shoot.

Story: At present, there isn’t one, other than: The Futuristic Reptile is obviously some sort of terrorist, a threat, and needs to be wiped out.

Levels: Either predefined, or computer generated. Each level consists of an arrangement of walls.

Level Progression:
Lv.1 Computer Character AI level 1
On the elimination of Character AI level 1, the Futuristic Reptile drops its weapon, and spits out an egg. The egg hatches into a fully formed Futuristic Reptile that picks up the weapon, and heads up a Level in terms of both AI and Floor Level.

With each level progression, there’s an AI progression. The Futuristic Reptile level of AI learnt from the Player it is vs.

2009-10-03 13:20
Trash

Registered: Jan 2002
Posts: 122
@popmilo:
Genetic algorithms and AI is already in use, check out the info about NEAT ( http://nn.cs.utexas.edu/?neat ), a new way of ordering the neurons resulting in a NN ( Neural Network ) that is harder to overlearn and never have an overhead ( auto adjusting ) of the number of neurons within the middlelayers. I use it for OCR and some other projects of mine and it is way better than traditional NN's in several cases.
2009-10-03 15:24
Hermit

Registered: May 2008
Posts: 208
This is a great webpage, Trash...
The experiments are the most advanced that I have seen until now.

Recently I saw a similar method, which also tries to reach the development evolutionally: Polyworld.

http://www.youtube.com/watch?v=nWH64f8rc64

http://en.wikipedia.org/wiki/Polyworld

In details:
http://www.youtube.com/watch?v=_m97_kL4ox0

And the Polyworld software is downloadable from Yaeger's page:
http://www.beanblossom.in.us/larryy/PolyWorld.html

Using evolution model seems a great method in searching secrets of AI, and the best thing is that we can fasten the process that has taken millions of years for nature... We are like a virtual God :)

(Other thing: What if neural AI can be used to calculate square-root, prime numbers, etc..?)

Hermit Software Hungary
2009-10-03 18:26
Hermit

Registered: May 2008
Posts: 208
Hmm, who has known about this?

A BASIC program from 1987 with pattern recognition,
neural network simulation for C64 by John Walker :)

http://www.fourmilab.ch/documents/c64neural.html

Hermit Software Hungary
2009-10-03 20:39
Trash

Registered: Jan 2002
Posts: 122
@Hermit:
The method described in polyworld (really interesting link btw) is far from being the same or in any way similar to the NEAT-method, the only thing they have in common is the use of gentic algorithm's, they differ widely in the way they use it. In polyworld they use the genetic algorithm to combine the DNA of different species making the AI evolve with an natural selection, in NEAT you evolve the neurons layers to be as fit to the selected problem as possible. The resulting main difference can be seen in the leraningcurves, when polyworlds learningcurve peaks there can be no fitter animals within the world, a similar problem solved by NEAT would not peak it would just get smarter the further you let it run since the worlds parameters dont stop it from peaking.

This is why we see more and more implmentations of NEAT aimed at CUDA and similar interfaces pop up around the internet. Now i am missing a cuda-card but I would sure be interested in making my softwares take advantage of it.

From a C64 POV I'd love to try implement a fully trained NEAT-network and make somekind of realtime logodrawer around it, imagine a greetingspart drawing up other groups logos based on their common style (this is pretrained) and name (the input to the NN). That is ofcourse a hard task but far from impossible.
2009-10-11 05:35
PopMilo

Registered: Mar 2004
Posts: 146
Thank you all for links!
Good stuff... lot to read :)

I am interested in something like this:

http://rogeralsing.com/2008/12/07/genetic-programming-evolution..

I wonder if something like this could be done for converter of images to one of those new graphic modes like NUFLI, MSCU and such (sprite overlays, but maybe not uniform but what is best for specific image)...
2010-01-03 16:50
Jak T Rip

Registered: Feb 2002
Posts: 39
You might also be interested in Centric. It remembers what the player(s) do and the CPU players get more clever based on that.
Centric
2010-01-04 12:30
Stingray
Account closed

Registered: Feb 2003
Posts: 117
Be very carefull Hermit, if C64s ever get the power of AI they would surley take over the world!

After the C64 AI has learnt enough information I wonder what it would destroy first?

Some ppl have there C64 connected to the internet, the C64 would reign supreme!
2010-01-04 16:52
Hermit

Registered: May 2008
Posts: 208
That's a great idea.
When I make my universal neuron-network routine this year, x86 systems should be afraid afterwards.

C64's revenge is coming soon :) Final countdown started :)....

Happy New Year

Hermit Software Hungary
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Mike
MWR/Visdom
Alakran_64
bexxx
Slajerek/Samar
Andy/AEG
E$G/HF ⭐ 7
lotus_skylight
iceout/Avatar/HF
Naufr4g0
iAN CooG/HVSC
REBEL 1/HF
Guests online: 117
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 Tim  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.068 sec.