Jump to content
  • Advertisement

ayrton2388

Member
  • Content Count

    24
  • Joined

  • Last visited

Community Reputation

100 Neutral

About ayrton2388

  • Rank
    Member
  1. I`m working on some basic pathfinding in 3D space. I`m able to create a navigation graph, using a flood-fill algorithm. I start in one point, and extend it in 4 directions, if there are no colliders in that particular direction. It`s pretty nice until now. Works ok. Creates a nice grid, without the inaccessible nodes or edges. But there`s one more thing i have to do in order to make enemies / NPCs come to the player or go to a certain place. Use A* to find the shortest path from a node closest to the enemy to a node closest to the target. I studied A* 1-2 years ago in college, gotta read a bit more about it though, to refresh my memory. But still, which heuristic is the most suitable here? Is it ok if i use the straight distance between 2 points? And the cost being the number of graph edges traveled until the current position? (since each edge has the same length.) And is there anything else i should need to know about this? Im gonna look into it today, but a direction, for a head start, would be really, really nice.
  2. 1st of all, i made a game, having just 1 controlled player in it. No other chars. So i wrote almost everything i needed for that in a single class. Character input, animation control, everything. That`s like 0 reusability. Well, now i`m working on another project, and i wanna do things differently. Gonna have a player character, enemies and maybe NPCs. How should i separate everything? I was thinking about creating a Character class, which has a "State" structure that links a state to an animation, and the common fields like health, etc. Then creating 2 subclasses for Player and Enemy. The Player class should treat and change states based on a character controller class (keyboard input, etc), while the Enemy class would have a kind of action queue. Like .attack(target) , .walkTo(position) etc. A separate animation player class would play animations corresponding to the player`s / enemy`s actual state. Will this be ok? What kinda problems will i walk into? Any suggestions, ideas?
  3. ayrton2388

    Got my 1st interview on monday...

    Thanks for the advice, guys really appreciate it. Hope everything goes well.
  4. So. I applied for a job in a small company, who produces iphone / android games. They asked me to come for a short interview, to talk about their games and the tools they use, and about the games i created. Well, i have an incomplete RPG game, which i will bring on monday. Thing is. Will they be interested in the source code? if so, what will they be looking for? The game still has some small glitches... oh, and they will probably think the code is messy (this game being more of a learning experience) ... I still got like 2-3 days, so how should i prepare? what should i expect? any help would be greatly appreciated.
  5. I`m trying to create shadow maps, based on Riemer`s tutorial. Everything`s fine, except that the shadow map is 100% white, instead of showing different shades of gray due to their distance from the light position. I realized it`s because of the light`s projection matrix. The frustum of my normal view camera is set from 10 to 50000. I can`t set the same value for the light`s projection matrix because it will be either invisible or full white. So i`m trying to find the right light`s proj. matrix. If i set it to (5 000 to 100 000) it works. I can see different shades of gray. If i set it to (2 500 to 50 000) , i can still see different shades, but overall, the image is a bit lighter. What should my light`s projection near and far planes be?.
  6. My water component is not 3d, and it`s not a post-process. If it was a post-process, this would`ve been easier It`s just a simple plane. Sticking to a cheap water cause i still got a lot of things to do. Might switch to a better ocean technique when all the other things are done. Anyway, do you guys have any ideas how can i improve this for now? At the moment, im drawing the foam texture and the white lines on the terrain, not on the water plane. You probably won`t notice this. They`re animated, getting shorter or longer, based on a sin(). Any ideas on how can i do a better foam on this kinda water? [media]http://ayrton2388.deviantart.com/art/Ocean-foam-test-254893022[/media]
  7. I decided to use some 3d models for the vegetation. Nothing very very fancy. Not very detailed model, but a bit more than the 3 quads, star-formation grass. I do have some individual, bigger plants, but also small patches of grass. Each type of small patch as a model. I haven`t implemented a quadtree/octree yet, but i definitely will. So here`s my question. How should i store the plants/grass positions? - should i manually place them? store all the positions in a vector or something? - should i use a color map? If i use a color map, generating just a patch of grass or a plant might not be enough. Im using a 1024x1024 heightmap for the terrain, and a scale of 60. So the plants could be wide apart. Should i also generate let`s say 10-15 more random plants around the one placed on the vertex? Either way, the number of plants needed might be big. Let`s say 300 000. Just an example. Should i store all those 300 000 positions somehow? Guess it`s not a good idea. Should i store only the positions from the color map, and generate few random positions around each, every time i enter another block from the quadtree? When im drawing the vegetation, should i have a fixed block size, and draw just the surrounding quadtree blocks, around my character?
  8. Oh, just got it, thank you! The Z offsef should be inverted, too. zNormalized is actually -zNormalized. Works now,. Both problems solved. Thank you. 1st time, i wrote the function based on Riemer`s book, and it was a bit confusing, since his and my heightmap were pretty different. Did try the same thing there, but i guess i had other bugs, too. Anyway, works, so a big thanks, Postie.
  9. public float GetHeight(Vector3 pos) { float height = 0.0f; if (heightMap == null) return height; int left, top; left = (int)pos.X / (int)scale; top = (int)pos.Z / (int)scale; top = -top; float xNormalized = (pos.X %scale) / scale; float zNormalized = (pos.Z % scale) / scale; float topHeight = MathHelper.Lerp( heightData[left, top + 1], heightData[left + 1, top + 1], xNormalized); float bottomHeight = MathHelper.Lerp( heightData[left, top], heightData[left + 1, top ], xNormalized); vect = new Vector2(topHeight,bottomHeight); height = MathHelper.Lerp(topHeight, bottomHeight, zNormalized); return height*scale; } This is the version that i adapted from MSDN`s example.
  10. Need a bit of help. I`m having trouble getting the right value for Y. Here`s how my axis system looks like. The heightmap starts in (0,0,0) and extends towards X and -Z. http://imageshack.us/photo/my-images/580/49630723.jpg/ Got two problems, actually. Sometimes, the object is set under the triangles. And not only on steep slopes. You can see that at 0:15, or even clearly at 1:10 in the video. Second problem is that the object moves smoothly on the X axis. But kinda ... jagged? on the Z axis. Around second 0:35. i tried to write 2 totally different GetHeight() functions,with the same results, so could it be something else than this? any ideas?
  11. Is there any way i can use the FBXimporter from the XNA 3.1 version in XNA 4.0? Is this possible? I would like to use it as a custom importer. I added a reference to c:/program files/.../MS xna 3.1/... /Microsoft.Xna.Framework.Content.Pipeline.FBXImporter.dll. I renamed it, cause i can`t have 2 with the same name, and when i try to compile it, i get the following error: Assembly Microsoft.Xna.Framework.Content.Pipeline.FbxImporter was built with a reference to Microsoft.Xna.Framework with an incorrect version 3.1.0.0 when version 4.0.0.0 was expected.    SkinningSampleWindows Any ideas?
  12. Thank you, Geri, i will look into it! Thanks.
  13. Thing is, every time you want to render some transparent/semitransparent (using alpha-blend) models, you have to sort them 1st. You have to sort them by the distance from the camera, and then draw them backwards. So.... you draw all your opaque models. Sort the transparent models/meshes/MeshParts/polygons , whatever they are . You turn on alpha blending, draw them backwards, and then turn off alpha blending. Have a look at this. http://forums.create.msdn.com/forums/p/82491/497908.aspx#497908 Or you can can do as i did. Using a two pass rendering technique. You need a bit of knowledge about shaders. * Pass 1: draw the solid part: alpha blending disabled, alpha test set to only accept the 100% opaque areas, and depth buffer enabled * Pass 2: draw the fringes: alpha blending enabled, alpha test set to only accept pixels with alpha < 1, depth buffer enabled, depth writes disabled
  14. yes... dsstate.DepthBufferWriteEnable = true; right?
  15. Thanks, but... that`s definitely not it.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!