# Guilherme Amorim

Member

9

224 Neutral

• Rank
Newbie
1. ## My first Lord of Dwarves playthrough

I just found this game and it's looking incredible! Keep the good work. Looking forward to play it too!
2. ## Indian spam

That new one with only a checkbox works well even on mobile, the only case I had to input anything was using private mode and even then I only had to choose between photos of numbers and trees, no writting.
3. ## Indian spam

How about captcha? They probably have bots doing that... Maybe adding a captcha when a user is posting too much and no one is answering or in a short period of time or, hell with it, every time you post. I wouldn't mind click on that "I'm not a robot" checkbox from Google every time I need to post.

5. ## question on camera rotation on 2D billboard sprite, 3d level

Hello, I'm doing this on the game I'm working as well. This is how it looks when the character have 4 directions   Not so smooth in my opinion, in Ragnarok they have at least 8 directions, and I think would look a lot better if my char had this much sprites. Ok, now abou the technical part: First, your game object must have an "facing angle", this is the angle he would be facing if he was not a sprite (North, South, West, East), Let's say that when this angle is 0º he is facing North; Then you will map the sprites to ranges of this angle, for example in my case I mapped this way: if angle is between 315º and 45º, then draw UP sprite if angle is between 45º and 135º, then draw RIGHT sprite if angle is between 135º and 225º then draw DOWN sprite if angle is between 225º and 315º then draw LEFT sprite Now you need to draw it on screen and you need to find the angle you will draw. This how I calculate that: // Distance between camera and object, ignoring Y axis var delta = new Vector2(obj.Position.X - camera.Position.X, obj.Position.Z - camera.Position.Z); // Normalize the vector delta = Vector2.Normalize(delta); // Find which angle the character is, relative to the camera var angle = facingAngle + MathHelper.TwoPi - ((float)Math.Atan2(-delta.X, delta.Y) + MathHelper.Pi); while (angle >= MathHelper.TwoPi)                 angle -= MathHelper.TwoPi; In other words, Atan2 will find the angle of the distance Vector, and the value will be between -180º and 180º, I add 180º so now the value will be between 0º and 360º, since angles grow anti-clockwise and I mapped my sprite clockwise, I convert it by making 360º-angle, sum with the facingAngle and while the value is over or equal to 360º, I subtract 360º from it so it stays between 0º and 360º   I can draw up to 2500+ unique animated sprites without going under 60fps.   EDIT 1:   I assume that Atan2 is an expensive function, so I work with a cache: If I find that the distance from the camera, camera angle or facing angle haven't changed from the last frame, I reuse the one I calculated before.   And this code works well with high perspective (objects closer to the borders of the screen are turned more than the ones in the center of it), you can make it go away if instead of using the angle of the distance, you use the Y angle from the camera View Matrix and you avoid Atan2 altogether.
6. ## Smooth Animation for Characters

Thanks Guilherme, I thought of this before and seems you are right about moving them like paper dolls will be a very good starting point. At the same time, I am still curious on how can they rotate the head along y-axis and render it smoothly like a slow motion 3D but still 2D animation. It's kinda hard to explain on words but you can check out the game as reference if you have time. I just thought they might be a very good animators or they are using a software or masking technique.      That's probably a combination of both techniques, while they move the eyes and hair side ways, the face is sprite animated so they can render the in between frames, once the face is 'enoughly' turned you flip those features horizontally. I'm not an animator myself so I can only guess that a good result is very hard to obtain.   Buster2000 solution is another technique you can combine with it. None seems easy to the animator, lots of drawing and calculation for positioning the assets ^^'.   I don't believe that every is in a sprite sheet because this would need a lot of disk space and time to load for smaller devices. If you intend to release it on pc, MAY not be a problem to use huge sprite sheets (depends on how you use/load them).
7. ## Smooth Animation for Characters

They are in fact moving on their own. Every moving part is a separated layer of the character, like in this picture:   These are used by an animation software called "Live2D" The character have no animation by default, but you can add movement to each part individually and animate it via rotation, translation or scaling. Every "layer" (torso, arms, legs, hair) are different entities drawn in order one over one another, this way you have control over every part (let's say you want to rotate the arm, but not the torso)   Now using the example of the game you've shown us, take the girl with the long red hair: They probably have a sprite map for her body without the back of her hair and the hair sprite itself in another place, when rendering the scene, they will draw first the hair in it's position relative to the body rotate it a little to give a sensation of animation and then draw the body over it. This way the player feels as it is only one entity.   You can combine both sprite animation with this layering technique to obtain a hybrid animation like in the G.o.D.   Hope it was helpful.
8. ## Rendering 2D tiles - performance issues

Try avoiding these boilerplate code (gl_enable, gl_activeTexture, etc) callings for each tile since they won't change between these calls and set them before both of the for blocks too.   I would too keep m_texture->getShader()->getProgram() in a variable so I wouldn't call the get methods every time, the cost must be minimum since it is just a get operation, but access to memory is faster than method calling, but most importantly, cleans up the code.

Thanks, Correct me if I'm wrong, but a pseudo code for that would be something like this : Create a stream from my stored image Initialize a decoder passing the stream Get Frame 0 from decode Pass to bitmap creation (I can guess that the decoder can produce the dimensions) and keep bitmap pointer to use it to draw Use this guy: http://msdn.microsoft.com/en-us/library/windows/desktop/dd371797%28v=vs.85%29.aspx Is That it? Again: thank you for the help.