New AI for Mobs
I vote up components system notion! Because reasons.

Reasons: I'd like to have more control over server configuration than with vanilla. For example, I'd love to have an option to make zombies use spiders (or rather cave spiders) movement strategy, so they could "storm" castles with high walls. Or, should I so desire, make skeletons which aren't shooting, just running at player and hitting him.

The way I can see it done is following:
Instead of making a bunch of classes for each mob (which I consider rather stupid on its own), we make generalized "mob" class. Then we make a bunch of "behaviour" classes, derived from some basic behaviour, which should have plenty of virtual methods such as "upon tick", "upon spawn", "upon death". Then we add a configuration file, one for server/world (latter would be awesome), which would be something like:

Code:
[Spider] ; meaning we're setting up parameters for a mob, which would be spawned using spider spawn egg, spider spawner or whenever server feels like spawning a spider, and will have a spider model
Movement=Zombie
Attack=Creeper
Ageable=0
EggSpawnable=1
SpawnerSpawnable=1
Burns=0
Hostility=Spider
Tamable=0

[ZombieHorse]
Movement=Horse
Attack=Horse
EggSpawnable=0
SpawnerSpawnable=0
Burns=0
Hostility=Horse
Tamable=apple

Now, Movement is pretty obvoiusly a movement strategy and so on, Burns declare whether or not mob will burn in daylight, and Tamable is either zero or item type used to tame it. This moment needs a bit of thinking through because of horse taming process. Also, I forgot food for health restore.

Anyway, point being: I wish to have a tool to change mobs behaviours and I want goddamn skeleton horse!
Reply
Thanks given by:
This would be awesome. Imagine a tamable creeper... Smile
Reply
Thanks given by:
Maybe not making it configureable in a config file but editable using a plugin?
Reply
Thanks given by:
I'm beginning to like this component idea more and more. I only fear that rewriting into such system would take a lot of time and the AI would never get finished that way. We're already moving forward quite fast and merging the AI changes to master will be a challenge.
Reply
Thanks given by:
Well, I'm willing to make the changes, but only if someone is willing to help out with it. How about we open a new branch on the main repo after FINALIZING how we want AI to work? Once we finalize it, then lets get it done before we make any more changes.
Reply
Thanks given by:
Is your A* pathfinder in any state good for merging? It'd be a shame to throw it out completely.
Reply
Thanks given by:
While I do think that configurability is a good idea, having too much of it can increase complexity and hurt performance.
Reply
Thanks given by:
Exactly. Although the idea of spider-zombies intrigues meBig Grin
In this case the configurability actually comes with almost zero costs in both complexity and performance.
Reply
Thanks given by:
If we're going to redo the AI again to please the masses, then I will have to rewrite it anyways. So I don't think we should bother merging it in. I'll keep it around, though. That way if we can reuse some of it we can just drag and drop it over.

Besides, I want to try reimplementing it the way you mentioned earlier, xoft.

Also, if we're going to go the route that everyone is asking, I might as well move it into its own class.

I actually like the idea of making it into a component system for one main reason:

It would make it rather simple to allow plugins to add their own AI behavior.

This would also allow us to develop both the simple Minecraft AI and the Advanced AI that I have been thinking about. This way servers can pick and choose which parts they like best.

Or, if they really want it, the way mobs act can be selected at random.
Reply
Thanks given by:
I see you got into the spirit.
I've always thought that you're encapsulating the pathfinding into a separate class, somewhat like the cLineBlockTracer (only way more complicated Smile )
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)