• Advertisement

avision

Member
  • Content count

    9
  • Joined

  • Last visited

Community Reputation

208 Neutral

About avision

  • Rank
    Newbie
  1. Ok i think i understand how you handle it.   In my solution it worked like this: animation.play( normalized length of the clip from 0 - 1 ) And i knew the velocity of each motion and they were aligned so if one motion had the left-foot-hit-ground on 0.5 the other clips would also have left-foot-hit-ground on 0.5. Now if i have a walk clip with 1m/s (if played from 0-1) and i needed 3m/s i would simply speed up the replay of this clip (*3), then if i say a run cycle fits better cause it has a original speed of 1.5m/s i would run this clip with *2 of the normal speed and crossblend the weights of both clips (the new clip with 0 at the beginning, _not_ the speed but the weight).   You are right thought that then your animations are not aligned any more. The best solution i saw for this problem was with Rune Johansens Locomotion solution for unity. Basically each leg is analyzed on it`s own for each walk-cycle. And the main states are stored (the positions in the cycle also normalized) for each leg, foot-hit, rest-position, foot-lift.. Then if your character has to walk 45° to the left a strafe-left and walk-forward motion are mixed and aligned based on the previous analyzed data.   You probably want to look into the source code and the thesis of this: http://runevision.com/multimedia/unity/locomotion/  
  2. Neural net for game state prediction

    I want to add that you will have to do 2. also if you really would want to set up your training data..   Well, tell it when it is wrong. When is this the case?
  3. Things get mixed here i think. Actions like in cocos2d are not related to tasks like Update or Render or the like. Actions are just used to ease the change of parameters of an object over time and to chain such. Actions actually have their own Update() method wich is invoked during the usual/root Update(). So it is not a rivaling concept.
  4. Wow as you can`t see the solution i don`t see the problem ;)   Since your animations are aligned and you can play them at any speed you can play any blend-node at any speed. Only thing you have to know is the speed each walkcycle has, meaning, you have to know the distance the character would actually travel with each walkcycle. So if you blend a walk-cycle with a "speed" of 1m/s and a run cycle with 2m/s you know how far the character would travel if you mix them 0.5/0.5 so you know ...   I want to add: That might also be true. I wrote one blend-tree implementation and in the end i only needed to blend between the walk, idle and run cycles + foot alignment. The rest where overrides like for the upper body wich didn`t complicate things.
  5. 2D Terrain Random Generation

    I want to add some information to Coremaqs post,   and we do need more information. If your map changes every time why do the cities have to be in the same place? I mean the environment is not the same - does this rule then make sense? Wouldn`t it be enough to place the needed cities also with rules ( they have to be x apart from another, favorite places are at rivers or plateaus .. ) ? Just a thought.   Since you will have rules (like we always have x cities, n mines per city, mines only on hills .. ) you could look into contraint satisfaction/propagation. Here is a great paper/tutorial on the subject: http://www.cs.northwestern.edu/~ian/GDCConstraintsHowTo.pdf It is basically a set of algorithms helping you to automatically solve such problems involving rules. They were bult with respect to games. I also want to post a paid resource (a great one) because in one interview there was a pretty interessting talk about procedural map generation: http://aigamedev.com/premium/interview/sir-you-are-being-hunted
  6. But if someone have another idea, write it     Make them three component sand another entity the "nature of the beast"-entity and let it own the three with an ownage-component! Terraria the entity has a head and hands, also entites. So each could take damage and Terriaria after lossing hands and head could decide to respawn as a dog..
  7.   You probably could but i would not recommend it. If you would have many many entities which always use the same never changing tree it could be an option.   Most likely you will have entites with different and most important of all _changing_ trees, like replacable subtrees.. Then this approach won`t work. But the more i think of it the more problems i see. You probably want parallel/concurrency nodes or the like, this will be a pain to implement this way.   And most likely your BT won`t cause any performance problems if you implement them like shown on aigamedev. Atleast not compared to things like LOS-Test or the like. I would just start working with them as they are proven to work fine and wait if you really find a reason to change the paradigm.   I can also recommend "Artificial Intelligence for games", it has good chapters about BTs, Goal driven AI and other solutions.
  8. On aigamedev you will also find the behaviour tree starter kit. It is fine to learn how they actually work. But basically each entity/agent has it`s own copy of a tree. Basically you want to be able to copy each node in a tree with childs. Then you can always use a subtree in different places. So you can make different trees who share same subtrees. You could then at runtime change a subtree for one agent but not for the others who use the same big root-tree.   Having one instance of a tree working with multiple entities is a bad idea IMO. A BT represents the ai state of one entity. How would you store the state of all the enitites currently using a tree inside the tree? One would be executing a seletor "find cover" while another would be "shoot with machine gun", every node would have to store the state for each entity. The next problem would be that you could not change a subtree for one agent only. Imagine a agent gets a new kind of attack, you would inset a special subtree in an attack subtree, but you can`t cause the other entities don`t have this kind of ability.   Think of the BT as the brain of an entity. You don`t want to share a brain :)
  9. I would probably arrange things differently.. I will try to describe it with examples. I would use Entities, Components, Nodes and Systems. Ok what are they..   Entity: Could be just a UID Components: Things like a 3D-mesh component, visibility-component, location in 3d-space component, AI-component .. Nodes: below.. Systems: Render System, AI-System, Pathfinding-System   When game data is loaded there are basically a set of components describing an entity. Like a mesh-component with the filename and the like and probably an ai-component. The component is only a set of values with some sort of identifier.   Then this set of components is examined. Means all systems check if they want an entity having this _combination_ of components. If the render-system sees a entity having a mesh-component and a visibility component it creats a render-node for this entity and stores this in a list, dictionary, vector or whatever..   On each frame each systems iterates over the nodes it has and does it`s work. If an entity looses a component the systems are notified about that and check if they have to destory/remove the respetive node (Or some other piece of code does this and only notifies the systems loosing a node/entity). For example if a entity looses its visibility-component the render-system may want to remove the render-node but the resources-system may want to keep its resource-node. In pratice most system will need to share data. So the goal should be to try to group data as much as you can if the data is not shared by multiple systems, if data is shared by multiple systems, spread it in different components. The way systems will store the entites/component-sets will be different from system to system, most systems will probably use a simple list, others will use a different way cause they want to process the nodes with multithreading or have a search tree or whatever. To identify if an entity has a set of components a component could have an integer-id and the check if a entity has a set of components could be done with bit-masking. (The check which is done when an entity is created and the systems want to know if they "want" this entity).   just my .. avision
  • Advertisement