tonihele / OpenKeeper

Dungeon Keeper II remake
GNU General Public License v3.0
434 stars 41 forks source link

Implement creature control #16

Closed tonihele closed 8 years ago

tonihele commented 9 years ago

Implement creature control. I believe that this is how these things work. We should be able to call these walk, run, hit1, hit2 etc and the control, well, controls the creature. The data is in Creature data registry. The control could acquire this data from the creature it is attached to.

meltzow commented 8 years ago

hi, is there any concept for selecting units?

tonihele commented 8 years ago

Hi, nothing exists yet. In the original game I believe only these actions can be administered by the keeper, not really a selection, but closest to that:

For the creature animations, currently an array of ArtResources, has been separated and identified by good sir Grégory Boré. I'll implement them shortly. I have no experience on making these functional controls, so I have very little idea at the moment how to tie all these together.

meltzow commented 8 years ago

ok, in JME there is the "Custom Controls Pattern" ( see here http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:custom_controls ). Sounds like we need some CustomControls.

meltzow commented 8 years ago

and I found this nice thing: http://wiki.jmonkeyengine.org/doku.php/jme3:advanced:steer_behaviours

tonihele commented 8 years ago

Yes, controls. I have the 2 books of JME. They have quite complete examples on how to make controls & how to tie them to an AI. Hopefully helpful. Steering Behaviors I think nowadays only exist withing the MonkeyBrains. Latter being a bit problematic, there are no JAR's etc. The code needs to be forked if used.

My only major concern is how to patch a creature together really. By my simplest scenarios we just when loading, create ready instances by the level data. And clone them from there. And these instances are just made out of these multiple models that we load according to the data. However our models are quite big, especially the animated ones. And I don't really know if this is ideal. As then we would play with culling etc. to hide the nodes and only show the one with the current animation we want. Is this heavy or not?

I think the ideal structure would be:

We would have currently:

Multiple pose frames. Maybe it doesn't matter, at least at this point. Overthinking perhaps....

tonihele commented 8 years ago

Oh and I yesterday commited much of ArcDemon's code, there was some kind of handling for which way the creature should face (while moving etc.). I don't know if it is working or not, or did I understood it correctly.

meltzow commented 8 years ago

how we can find out, which kind of GameCreature/KeeperCreature (for example a imp) we have?

tonihele commented 8 years ago

It has the id, on the info field. KwdFile instance can be used to get the creature data record by the id.

meltzow commented 8 years ago

and where is mapping? which id is for the imps?

tonihele commented 8 years ago

ID 1 for the imps. Hopefully you won't really need to know that :) Meaning that it should be very generic. Imps just have IS_WORKER flag. If you convert a dwarf, it is a worker as well and should work as such.

tonihele commented 8 years ago

This goes hand-in-hand with the AI so this will be done at the same time (the initial version). I'll take it.

tonihele commented 8 years ago

Initial version done