Syclamoth / GamesAI6

A repository for the assets folder of our GamesAI project
2 stars 0 forks source link

Report and presentation file #19

Open zchaoz opened 11 years ago

zchaoz commented 11 years ago

As we all knew, the presentation will happen on Monday (08/10).

I'm preparing the report file right now and also the presentation file. If anyone wants to prepare them, voice it in here.

Also, I need info about the genome system because I don't know anything about it nor its actual logic. What does it do? How? Its effect on the game? Any graphs? Any data? Any problem implementing it? etc

That should be all, I think.

zchaoz commented 11 years ago

anyone ?

Syclamoth commented 11 years ago

Hey, not all of us can be online all the time.

The genome system is a framework- it doesn't do anything yet, because you're not using it in anything yet!

The way it should work is, every wolf should have a Genome object attached to it. It should query this genome for its various statistics. Each chromosome is basically a string key 'name', a double value and a float 'mutation rate' (because individual values should mutate at different rates, depending on the value).

Whenever the wolf does something that is considered 'good' or 'bad', its genome has a 'fitness' value which should be increased or decreased. This is used by the gene pool to determine what genome is currently the best.

The GenePool is a central controller that knows the genomes of each individual wolf. When a wolf dies, it chooses the best one, applies a mutation to it according to the current global mutation rate, and spawns a new wolf in a random location with the new, mutated genome. And so, the generation continues.

When the game closes, the gene pool should save the current best genome to an external file, so that it can be reloaded at runtime the next time the simulation is started.

All of this is OBVIOUS. You just need to read the code! You were there when we discussed all of this two weeks ago!

zchaoz commented 11 years ago

I know not all of us can be online all the time, but did you finish the implementation for the system? I was waiting for half a week and don't tell me now that I was supposed to do it...

IIf you told me to do it right now, it would be fine but... Please, this is awful. I know you are busy, you can't come to the class (and didn't say anything to us), etc but this is not right.

Did I tell you that I will do the machine learning for the Wolves? And did John tell you that the requirement of Assignment 2 asks you to implement decision tree or neural network. I need to do the machine learning. Our genome system is not in the requirement. It's another extra component we can add into our game.

And I did ask you "Can you do the Genome system?" and you said "I can!". That's why I thought you will do the whole system and implement it into the game. Because I have no idea about the genome system nor how to implement it.

When I read the code, I can't understand anything and I don't care to try to find out because there aren't any documentation nor comments in it. No guideline, no example, no nothing. And you expect me to implement it with my hacking style to 'hack' it into the game...

What about those "magic numbers" you talked about? What are they?

If I don't need to do that, forget everything. Typical rant.

Syclamoth commented 11 years ago

Sorry. Give me an hour, I'll put the genome system in. I'll see if I can work out what things should be modified. Once it's in, I'll comment it so that you can hack on additional chromosomes if needed.

zchaoz commented 11 years ago

I'm sorry. Was so stressful because tons of things are happening around me. I haven't slept or got any meals today yet. Typical nolife.

I only need four things:

Syclamoth commented 11 years ago

The system will spawn the wolf when it receives a callback from a dying wolf. It will query the maze for an appropriate spawnpoint, and spit out a new wolf there.

The wolf genome is stored in a binary file in the root of the project folder

you can add additional chromosomes with the command 'AddChromosome' (which isn't in the current repo, I'll push it in a bit), although you shouldn't really need to do that once the chromosomes are there in the first place- it should go in the 'generateDefaultGenome' command in the wolfcontroller for generating the 'default' genome in the absence of a serialised binary one.

The genome will be stored in each wolf's memory, and can be accessed with

memory.GetValue("Genome")

and to get a chromosome out of that, use

myGenome.getGene("name of chromosome")

to get the double value of the chromosome in question.

I understand what you mean about lots of things happening- I just want to get this done, as well. Once I'm done putting the chromosomes in nicely, I'll see if I can get some prettiness in the interface- it's really unclear what you're supposed to be doing at this point.

Syclamoth commented 11 years ago

Ok I'm stuck on one thing-

What default genes should the wolves have, other than simply 'ferocity'? As it is, a single variable is simply not interesting.

As a point of interest, this is the exact same question I've been asking all week now.

zchaoz commented 11 years ago

Ugh. Do you have any idea about this? because I'm stuck on it too.

Hunger Level is affected by Ferocity i.e. higher Ferocity means higher decrease rate in Hunger level

What about Leader Level?

Or How about we add a new one called Cunning. It will affect how the Wolf hide from the Player (distance, range, etc) based on what you wrote on the WolfHide thing.

Syclamoth commented 11 years ago

I kind of like that one- something that will make the wolf quicker to hide behind the player, but faster to recover from the 'running' state, as well. Shouldn't be too difficult to implement, seeing as how the state transitions are basically determined by variable comparisons.

Would it be possible to do a 'cooperation' level? Something that determines how likely a given wolf is to obey commands from other wolves, given an existing target?

zchaoz commented 11 years ago

Thank you, Keiren V_V

The "cooperation" is good too. Was about to say but you did it first

Syclamoth commented 11 years ago

Ok, I'm giving them 'Ferocity', 'Cunning', and 'Packsense' for now, as defaults. Not doing anything with them just yet, but the system will be in place.

zchaoz commented 11 years ago

Thanks god. There is progress. This is how a group should work V_V

When you put them on, I'll get it and see if there are any bugs or need to do extra thing to fully implement it in the game.

Another REMINDER: WE HAVE PRESENTATION TOMORROW. If you are late, I can hold up for like 45mins to wait for you guys. Pass that, can't

zchaoz commented 11 years ago

I decreased the size of the maze and increase the number of the wolves. Also, decreased the number of debris too

zchaoz commented 11 years ago

Due on: Sunday October 7th, 2012 @ 23:59hrs.

Syclamoth commented 11 years ago

OH SHIT

I've pushed the genetic algorithm stuff. I'll see if I can hack it onto the AIs in the next half-hour.

zchaoz commented 11 years ago

almost choked right there @_@

You only need to put the "Cunning" and "Packsense" into the Wolfroaming. Change how you make the Wolf hide in your Wolfhide state and that should do everything.

Syclamoth commented 11 years ago

Done. It even saves the current 'best' genome to disk when it closes- problem is, I don't increase fitness when it catches things! I'll fix that...

zchaoz commented 11 years ago

I'm putting everything on here in the report file right now.

Syclamoth commented 11 years ago

Ok that was literally a 1-line fix.

zchaoz commented 11 years ago

at Memory.GetValue[Single](System.String key) [0x0001b] in D:\GamesAI6\Assets\Scripts\Mind\Memory.cs:45 ferocity UnityEngine.Debug:LogError(Object) Memory:GetValue(String) (at Assets/Scripts/Mind/Memory.cs:47)

c__Iterator2B:MoveNext() (at Assets/Scripts/Mind/Wolf/Wolf_hunting.cs:53) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) c__Iterator18:MoveNext() (at Assets/Scripts/Mind/StateMachine/Machine.cs:62) You got this error ?
Syclamoth commented 11 years ago

Oh, I know what that is. Stupid. The genes store data as doubles, but in this case it should have been a float- a simple cast will sort it out.

FIXED

Syclamoth commented 11 years ago

(I'm glad I put the stack trace in for failed memory extractions, btw)

zchaoz commented 11 years ago

Sorry to ask such a stupid question but how can I cast it? Where are they? Can't think anymore

Also, at that line: 47. You have something like "Debug.LogError (e.StackTrace + key)" is it ok ?

nvm, you fixed it. thanks

Syclamoth commented 11 years ago

I've fixed it already. Just pull the latest revision.

Syclamoth commented 11 years ago

I updated the 'WolfHide' state a little, to use Cunning to determine when it should return to normal hunting.

zchaoz commented 11 years ago

done, submitted!

Presentation tomorrow, guys.

Syclamoth commented 11 years ago

Cool. I wish we'd gotten this done last week so we could run a few hundred simulations on the genetic algorithm, but I guess beggars can't be choosers -.-

zchaoz commented 11 years ago

same...

Now, i need to get back to my other assignments, deadline tomorrow morning 5AM. FML

Just need the machine learning and this, then everything is ok.

Also, you should talk about future work in the presentation too. Just keep that in mind

Syclamoth commented 11 years ago

Good luck.