Jump to content

Road Kill Kenny

Members
  • Posts

    667
  • Joined

  • Last visited

Posts posted by Road Kill Kenny

  1. Have you set the entity type of the mesh and have you set the collisions so that the raycast type and mesh type result in a registered collision?

     

    Also if the character is animated the pick will only work on the original mesh of the character and not the resultant skinning deformation you see.

  2. To answer your question I will first explain how the animation works.

     

    In a single frame you call animate on a model or mesh, now the mesh itself is not "animated perse" but rather the bones of the mesh are. The mesh then is deformed to those bones via the use of the skin shader.

     

    To do this the Animate() function actually sets the animation for the specified entity and all of its children. This is how all the bones are animated even though you only animate the model or mesh. So basically the Animate() function animates the entity specified and all of its children. Now if you think of it bones have a hierarchy as well so if you call Animate() on a single bone entity, only that bone and its children will be animated. Therefore, you need to use split animations and call Animate() on different bones separately in the hierarchy.

     

    Now what you do, say if you want to animate someone running and shooting and running and reloading then you need to do a few things.

     

    1. Animate the whole model in the run animation,

    2. Use FindChild() to get the hip bone (or what ever bone's children are the upper body) <- You'll want to do this on initialize instead of every frame and store the bone in an LE::TEntity.

    3. Call animate on the hip bone (or whatever it is), except animate it for aiming.

     

    ----- most of the time you can end here but it can be much more detailed if you want as continues ----

     

    4. Use FindChilde() to get the forearm bone <-- once again done at initialize instead of every update

    5. Call animate on the forearm bones except animate for reloading... or shooting or whatever instead of running.

     

    This method will combine the animations and it's pretty much how it is done in all games.

     

    Therefore, you can get a tonne of animations from actually just animating a few:

    eg. Your base animations are:

    - Idle

    - Running

    - Walking

    - Aiming

    - Reloading

    - Shooting

    - Bashing

     

    and you simply combine those in the code to make more eg.

    Idle

    Idle + aiming

    Idle + aiming + shooting

    Idle + aiming + reloading

    run

    run + aiming

    run + aiming + reloading

    etc.etc.etc.

     

    Hope that makes sense

  3. Try something like assassins creed. A kind of one button does it all system. (Obviously not as complicated with beams and things.)

     

    This is still very complex. The fact that it is a one button does it all = more computations to determine exactly what to do when that button is pressed.

  4. Super Meat Boy - 2D Game - 2 year development - 2 people full time

    FEZ - 5 year development - 2 people full time

    Braid - Simple 2D Game - 2 year development - 1 person full time (the guy had 10 years of game programming experience)

     

    All these games were very simple but took plenty of time to create. They also all made millions on steam and XBLA.

     

    The planned development period for my game is 2 years maybe 3 and I have another person working on it with me and we both work full time in other jobs and work on the game in spare time. The game is relatively simple as well. You will be surprised how long and hard this process is.

     

    Not trying to de-motivate you but trying to save you some long term heartbreak. Try something simple but smart first and build up towards bigger things. I've made the mistake of being over-ambitious myself and it really sucks when you decide what you are doing is just never going to finish.

     

    Took me about a year of flapping in the wind until I realized my ideas were way 2 ambitious for the resources and time I had. Then came up with a concept for a simple game that would still be fun and I've never been so close to finishing a game before.

     

    I would recommend to anyone that wants do develop games independently to watch "Indie Game The Movie" first. Although those games are all 2D, the overall concept behind the movie is the same fore any independent game development.

    • Upvote 1
  5. ......wall running.....

     

    Aiming for something mixed between Mirrors Edge ....

     

    This just seems a bit un-realistic and over ambitious to me.... Wall running and mechanics like those in Mirror's Edge are very very complex mechanics and ones that must not just be done but done well if they are going to work...

    • Upvote 2
  6. With animations for characters I always make an "animator" class.

     

    This is generally how I do it. Like it or not it works for me wink.png

     

    The animator class lives within any character class in a "Has a" relationship. The animator class is given a pointer or reference to the mesh to be animated and stores each animation in an animation struct as shown below:

    struct Animation {
      float start;
      float end;
      float speed;
      int SEQ;                    //sequence
      std::string type;         //name of the animation
      bool loop;
      float currentFrame;
      float blendVal;
    };
    

     

    These structs are then stored in a std::map<std::string, struct Animation> STL map where the std::string is the name of the animation and the struct is... well the struct.

     

    The class has a number of functions to register animations, play animations, stop animations etc. and all that the character class has to do is 1. update the animator each frame and 2. initialize new animations based on what is happening.

     

    Anyway... This animator class I'm showing here is kinda suited to DDD but you could easily use it without, you'll just have to register each animation separately in hard code.

     

    Below is the class declaration. I'll let y'all figure out how to make the implementation.

     

    class Animator {
    public:
      Animator::Animator(LE::TEntity *pModel);
      Animator::~Animator();
      void Update();
      void RegisterAnimation(std::string type, float start, float end, float speed, int SEQ);
      void PlayAnimation(std::string type, bool loop);
      void StopAnimation();
      void BlendAnimation(std::string type, float blendRate, bool loop);
      void PlayEmote(int);
    
    private:
      void LoopAnimation(struct Animation*);
      LE::TEntity *pModel;
      float blendRate;
      std::vector<int> AnimDelete;
      std::map<std::string, struct Animation> AnimBank;
      std::vector<struct Animation> EmoteBank;
      std::vector<struct Animation*> AnimActive;
      struct Animation *anim;
    };
    

     

    - Update() - plays any animation that is active including animations that still have a blend value greater than 0. If the animation structs loop variable is true it will loop expired animations otherwise it will erase them from the AnimActive list. If the blend value of an active animation reaches 0 it will also be removed from the AnimActive list. If there are registered emotes and the "idle" animation is active this function will roll a dice for playing an emote.

     

    - RegisterAnimation() - creates a new animation struct based on the given data and inserts it at the end of AnimBank.

     

    - PlayAnimation() - plays the requested animation either looped or not... This will remove all other active animations prior to the call whether blended or full on.

     

    - StopAnimation() - Clears AnimActive which effectively stops all animation

     

    - BlendAnimation() - Adds a new animation to AnimActive with a low blend value. The blend value of this animation will continue to rise until it reaches 1.0f and all others in AnimActive are 0 and then removed. If BlendAnimation is called before the last BlendAnimation() anim finishes then the last one will be blended out from where ever it was.

     

    - PlayEmote() - plays a single emote at random.

     

    - LoopAnimation() - Edits the data in the Animation struct passed to it so that it will loop and not end. It is called only if an animation reaches its end and the loop boolean parameter is true.

     

    NOTE: This class was made specifically with my game in mind... Therefore, while idle, it will randomly play random emote animations (if registered). Therefore, some of the functions like PlayEmote(int) may not make sense to you. However, the way it works in my code is, if the animation called "idle" is playing then it rolls a dice (1 in 7 chance) and if it hits 7 it plays a random emote animation labeled "emote" from the EmoteBank (std::vector<struct Animation> all emotes are labelled "emote" while all other animations must be unique.

  7. Does this mean when LE3 comes out everyone will have to re-buy the leadwerks engine? cause you said to existing users at a refused price.

     

    LE3 is a completely new engine to LE2 not an upgrade per se... you don't have to buy LE3 to continue using LE2 if you already own it. However, if you wish to buy LE3 it will be a reduced price if you already own LE2 and cheaper than buying LE3 straight up..... or so we've been told.

  8. A deer that farts rainbows that is chased by a teapot....

     

    LOL.. I think that should be the LE example game.

     

    Interesting to see that the majority of people so far want to make an FPS. In my mind that is the most saturated market requiring a high level of quality to even be considered by consumers. Also with my experience with FPS games on the mobile platform, the genre doesn't seem to suite the touch technology very well.

     

    Though thats just my opinion, each to their own I guess. What is everyone elses opinion on the matter?

    • Upvote 1
  9. I know for terrain slopes I create a plane that has many segments that I paint the texture on and then I loop through each vertex location and get the height of the terrain directly below that x,z and move the vertex y like .001 above the terrain height. Performance is a balance between how many segments the plane has which comes down to how hilly your terrain is to give a nice look. Could probably do the same for models if you can get the y value of the x,z position on a model.

     

    If the performance hit is smaller than the current decal system then why not

  10. To project a texture you paint a light with a TTexture. i.e LE::PaintEntity(light, texture)

     

    In my game I simply have a texture with alpha. I parent that to the characters mesh and it seems to work pretty well.

     

    There are decals but they have some performance issues atm and I think a light projection would also be an unnecessary performance hit as well.

     

    post-3220-0-31850700-1348899082_thumb.jpg

     

    The only problem with my texture with alpha is when I put slopes into my game it will look wrong so I'll have to find some work around for that I guess lol

  11. To project a texture you paint a light with a TTexture. i.e LE::PaintEntity(light, texture)

     

    In my game I simply have a texture with alpha. I parent that to the characters mesh and it seems to work pretty well.

     

    There are decals but they have some performance issues atm and I think a light projection would also be an unnecessary performance hit as well.

     

    post-3220-0-31850700-1348899082_thumb.jpg

  12. Ha, that's a great copy ... laughed out loud when I met 'it' (not sure I was supposed to do that)

     

    I had a similar but not the same issue as Rick. As I walked the camera would periodically change to point to the ground, no spinning as such ... just an instant camera rotation downwards.

     

    Same... the camera kept getting pushed down whenever i tried to look up + the controller was moving in 1 foot jumps rather than smoothly even tho i had decent fps

  13. Yeh, I know! But this is like... a huge big deal. There should be flashing neon lights on the site header announcing this as THE biggest thin eva 8)

     

    Btw... link to the blog post? I've missed that one..

     

    wtf seriously? This is what you consider the best thing ever?? I mean don't get me wrong it's cool but I can think of many more important features in LE3... automatic path-finding for one.

×
×
  • Create New...