Syclamoth / GamesAI6

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

Machine Learning #17

Open Syclamoth opened 11 years ago

Syclamoth commented 11 years ago

Looking through the code, there are a lot of 'magic number' constants scattered through here that might make good candidates for inheritable configuration data... I will probably completely redo the serialisation for wolf data. Bao isn't communicating with me, and I have no idea what he was intending to do with the existing setup... I'll just store the best wolf in a binary file, and save/load at runtime when nessecary (the way we discussed last week). Things like flee threshold, ferocity (which should increase the wolves' movement speed and damage, at the cost of making them die faster), the rate at which caution levels boil off, etc.

Andrew, could you please close off the maze? I keep losing wolves. Either they all pounce at once (which is pretty cool), or I never see any of them!

zchaoz commented 11 years ago

Sorry about the lack of communication. Was trying to find you yesterday but couldn't hold off the urge to go back home.

I'm doing the machine learning for wolf to target a suitable sheep. I don't know what you want to do with the respawn system either and I tried to stay away from those setup i.e. existing 'magic numbers' so that you can decide it on your own.

In summary, I'm doing the machine learning to help the wolf select a target that they can likely catch and sustain themselves. And those parts aren't related to the respawn system. It is completely different. One is decision tree and the other is evolutionary/genetic system.

About the ferocity, I'll look into your code and change it later today.

Syclamoth commented 11 years ago

I got in a bit late yesterday, but after that I was in for literally 8 hours trying to fix all the AI issues.

We discussed all of this last week! Have you forgotten entirely? The whole point of the genome system was to give the wolves variables which were passed down from successful wolves to the next generation of spawned wolves. That was the deal with the hunger thing!

zchaoz commented 11 years ago

Sorry but I'm still remembering it. We also AGREED on the machine learning of how the wolf can pick and choose it target because the re-spawning system is not enough for the learning thing.

The thing I was doing and was agreed last week is:

  1. gather the data for training
  2. train the wolf to behave like the trained data
  3. at the end, it can choose and change its behaviour in picking its target based on the target's HP, cowardLevel, distance, etc. This can happen in real-time when playing the game.

The thing we all agreed AGES ago is the genome system and this is what I could interpret from it:

  1. Get the most successful wolf based on its stat: ferocity, caution, hunger level, kill count, etc each time the game is played
  2. Save it into the memory
  3. Spawn it at the beginning and keep re-spawning it whenever a wolf dies.

They are completely different in my mind, or perhaps you want to combine those two together. For example, the Alpha Wolf is the best wolf and it knows how to pick its target effectively. If that the case then yes, i misinterpreted your idea.

Also, about the hunger thing that decreases faster whenever the wolf does some actions. I thought it would be better if you consider the hunger level as a score than a meter that decrease overtime. For example, if the wolf cant find any target, it dies. If the wolf can find a target, it will change to the hunting state and decrease a portion of its hunger level. If it catches and eat the sheep, its hunger level increase, if it can't it just lose its hunger point uselessly.

Syclamoth commented 11 years ago

The hunger level CANNOT be a 'score'. The score needs to be determined independently based on success levels. We shouldn't hack too many different functionalities into a single variable- remember what happened when you were using panic levels as HP?

Whatever it was that we agreed, you're not doing it. Just storing the stats of caught sheep is useless- the sheep are supposed to be created equal! We need to paramaterise the wolves, so that the overlord system makes sense. Otherwise, what's the point of the hunger levels killing wolves when they drop too low? Think things THROUGH, don't just put random crap in and hope that I'll come along later and stitch them all together into a coherent system!

zchaoz commented 11 years ago

I changed the way the hunger level interact with the wolf's action. It will decrease overtime based on the wolf's ferocity and action i.e. changing from roaming state the hunting state and vice versa.

About the sheep, I agree that the sheep should be equal, but to some extend. The wolves are the same just like we agreed BEFORE to make the game more dynamic. My memory might be rotten but I didn't hear anything you said about "PUT OUT THE RANDOMISATION" at all last week or the week before.

First, I did look in Andrew's code and it does nothing. I also did like Andrew suggested about the sheep behaviour to some extend and the Sheep was behaving like I intend them to. Ex: They follow player when they see him, scared because of the wolf but can still follow player to lead them from danger or run head long to the abyss, etc.

Second, I don't know what you want to do with the overlord system. I don't know which variables you need. I don't know which components you'd like to use. Therefore, I AVOID modifying anything, except the machine learning I want to implement to the wolf's targeting system. The sheep data it gathers is the sample data to do the training, it doesn't relate to anything called OVERLORD. It works independently.

I'm sorry but in this case, I misinterpreted your intention.

I will look into the randomisation of the sheep's courage level. It won't be random anymore but it will decrease and increase based on player's interaction i.e. when player looking at the sheep or fire the beacon, they increase courage level for a short time then decrease overtime to normal threshold. That way, the sheep is more consistent whenever you need it to be.

Or if you have better idea (except removing them all), just voice it so I can fix it.

Syclamoth commented 11 years ago

I like the idea of making the courage levels dependent on environmental factors- if a sheep has a near-death experience, decrease its courage levels significantly to make a 'post-traumatic stress disorder' type thing. Otherwise, slowly increase it in stress-free environments (lots of other sheep, shepherd nearby). As far as I can tell, randomising stuff like that won't result in interesting behaviour, especially since there are better things you could be doing.

The beacon should have an immediate effect, and give a temporary boost to courage. The immedate effect- snap them out of the 'nuts' state instantly, as well as forcing all wolves to go into the 'hide' mode and increasing their caution levels so that they are more wary of the player.

I may not have said 'remove the randomisation', but that's only because I didn't even know it was there! I always assumed that courage was a dynamic thing, because that would be sensible. Believe me, randomised variance on the sheep was NOT something we agreed to.

Well, of course Andrew's code does nothing if you never use it! Like all tools, it won't do anything on its own. The assumption was that you would identify key variables that modify the behaviour of the wolves, and plug them into the system, but it seems that that's not going to happen. I don't want to have to go hacking your stuff, but at this point I think I'm going to have to.

If you're going to implement a machine learning system for the wolves' targetting system (even though we never even discussed that), then DO SO! I can't just wait for you to put it in at the last minute- you need to do it NOW. As in, TODAY. If you wait too long I'm going to pull the plug on that, and remove it entirely. It's bad enought that you chose to use some external plugins to manage the serialisation (instead of just the inbuilt .NET stuff)- it makes it difficult for me to work with it if I don't know exactly what it's doing. I'm sick of having to fix your broken code- I spent all day yesterday working through the sheep and wolf code and making large swathes of it actually WORK! You need to make things that do what they're supposed to- it's no use if I have to go through and rewrite them later.

The reason I've been holding off on the learning stuff for the wolves is becuase I've been waiting for YOU to work out what variables can be changed! You say you don't know what variables I need, but the fact is neither do I! YOU wrote the wolf AI in the first place, so it's YOU who should know how to modify it! I don't have time to waste any more. It's frustrating that I feel like I'll have to do all your work over again, but if it comes to that I won't have any choice. Please, fix your shit before I have to rewrite it all.

zchaoz commented 11 years ago

Thank you Keiren. I will do as your suggestion. I think it's better now. I was waiting for you and you just waiting for me, The irony of working as a team...

The beacon and the new courage behaviour, ferocity behaviour (if I can think of any dynamic) will be put up tonight after I've done with my other assignments

And also, read the document we put up about our project before....