Whorse

Members
  • Content count

    63
  • Joined

  • Last visited

Community Reputation

158 Neutral

About Whorse

  • Rank
    Member
  1. Unity Decision Tree Delays

    Upon further thought, a structure could be returned with the Action type that was run and the amount of seconds to wait. Store the last Action type, if the new Action type is the same as the last Action type do nothing, if it's a different action type then trigger it.
  2. I've graduated from using a cluttered FSM for my AI to a Decision Tree of my own creation. I'm using Unity3d and C# for this pet project. I've structured my tree in the following manner without pointer capabilities. However my question, could apply to any decision tree which might implement coroutines. protected virtual void Update() { StartCoroutine(TriggerTree()); } IEnumerator TriggerTree() { yield return rootDecisionNode.StartCoroutine(rootDecisionNode.TriggerPath()); } Currently every Update() call a run through of the tree's branches is triggered and it checks branch logic paths to see what leaf should be reached. The last Action leaves at the end of each branch return new WaitForSeconds.   I'm interested in learning the best way to halt the decision tree or perform an animation but still be able to run the tree and check if another leaf has been reached. So if my character is idling, wait for the idle animation to finish before playing another idle animation but if the character is damaged then trigger the damage animation. Is my code design for a decision tree without pointers sound enough as it is?
  3. Keeping it internal like you suggested led me to compare the previous frame's health with the current health. Depending on the amount it had changed, I trigger different animations or death.
  4. I'm making good progress on a shooter I've been working on for the last few months, I've now moved onto the AI. Currently I perform a Raycast from my base Weapon class to check for impacts, and then invoke a function on the hit object after performing the necessary checks. I've implemented an FSM pattern for my enemy AI and I'm having trouble coming up with an elegant solution to transition to a HurtState from another state to perform hurt animations and to momentarily stop the enemy's movement. Since the states check their transition logic internally every frame it seems counter-intuitive to force a transition to the HurtState externally. What's the best way to achieve what I'm after without hacking something in or am I thinking too much into this?
  5. Here it is:   https://github.com/idmillington/aicore   The URL provided in the book was dead.
  6. Hey there. I've recently been attempting to add in support for lightmaps with splatting in a game I'm working on. Right now every attempt I've made has just mixed the original overlay colours with the lightmap and disregards the splatting colours completely. Here's a sample of my code with the extra multiplication by the lightmap: [CODE] vec4 splatting = texture2D(tex_layout, gl_TexCoord[0].st); vec4 d0= texture2D(tex_detail0, gl_TexCoord[1].st); vec4 d1 = texture2D(tex_detail1, gl_TexCoord[1].st); vec4 d2 = texture2D(tex_detail2, gl_TexCoord[1].st); vec4 d3 = texture2D(tex_detail3, gl_TexCoord[1].st); vec4 d4 = texture2D(tex_detail4, gl_TexCoord[1].st); vec4 lightmap = texture2D(lightmap, gl_TexCoord[0].st); gl_FragColor = (((splatting.r * d0 + splatting.g * d1 + splatting.b * d2) + (1.0 - splatting.r - splatting.g - splatting.b) * d3 + (1.0 - splatting.a) * d4) * lightmap) * min(1.0, 0.2 + dot(lightdir2, normal)) * vertex_color; [/CODE] If anyone knows the correct method to apply the lightmap over the added details, I'd love to hear their techniques.
  7. I'm required to crop an 8-bit bitmap to the nearest unique pixel colour in all directions. I've saved my colour table in this format: [CODE] RGBQUAD* colours; [/CODE] I'm a bit lost now as to how to go about doing this though, I'm using C++ without any external libraries. I've been advised that converting my image to greyscale then using an edge detection algorithm would be the best way to achieve this. Could any one comment? There is a lot of information on 24-bit bitmaps, but not much on how to use achieve my results with an 8-bit bitmap.
  8. Thanks for the feedback guys. I think in this case a better idea would be to finish off this simple project and get a quick start with UDK so I can really start scripting the meat of proper AI in some simple top down 3rd person game.
  9. It doesn't strictly have to obey the Space Invaders niche, just the idea of an overhead game with a similar idea to space invaders.
  10. I've begun making a Space Invadersesque clone for a small hobby project to try and delve into AI a bit more. The reason I chose this is due to the fact that the gameplay is pretty simple to code and I felt there was potential to possibly experiment with more adventurous AI ideas. I was wondering if any one had any thoughts or ideas of what would be good to include in this clone to make an AI showcase shine through (if it's a good idea at all). Cheers!
  11. 2d Game Edge Bouncing Effects

    Thanks for the insight, I had a suspicion that the most managable way to achieve this was on a frame by frame basis, I have a fixed timestep already, so that much is covered. I'm going to implement your solution on Monday after which I'll share my results on here! Thanks again!
  12. I've recently been experimenting and attempting to recreate an iOS UI sort of edge bouncing effect in my game so that if you scroll past a level's boundaries, the camera slowly bounces back to the boundary. At the moment I've implemented some of Robert Penner's tweening calculations ported from ActionScript, however I'm unsure whether this is the correct approach due to the fact that it doesn't take into account our camera's velocity. At the moment it looks something like this: [CODE] easeInOut(currentTime, startValue, endValue, duration); [/CODE] The actual implementations are available here: http://www.jesusgollonet.com/blog/2007/09/24/penner-easing-cpp/ I've come to the conclusion that this is a sort of grey area as I haven't been able to find much information on it, either that or I'm not familiar with the correct name for the sort of calculation I'm attempting to describe. If anyone has any advice, or solutions that include velocity in their games or UI's, I'd be very interested to hear it!
  13. Cube Rendering Issue DirectX

    The function is pretty much exactly the same as I listed. It's weird because I'm unable to move the camera from the looks of things, which is what led me to believe it was an issue with the camera in the first place. Unfortunately even specifying the values as floats didn't make a difference. ***EDIT*** I forgot to mention I have similar issues trying a sphere. What appears to be an outline of the sphere's circumference is shown while it rotates. Here is a picture, maybe it will help shed some light on the issue. http://i53.tinypic.com/2rgjls9.jpg
  14. Cube Rendering Issue DirectX

    [quote name='Jason Z' timestamp='1319054459' post='4874429'] Which version of the API are you using? It sounds to me like a problem with either the projection or the view matrix - most likely something with the projection matrix. Can you post your code showing how you set up those matrices? [/quote] I'm using 9. Here's the projection matrix code in a concise view: [code] SetPerspective(3.14159f / 4, 640 / 480, 1.0f, 2000.0f); void SetPerspective(const float fov, const float aspectRatio, const float nearRange, const float farRange) { SetFOV(fov); SetAspectRatio(aspectRatio); SetNearRange(nearRange); SetFarRange(farRange); } void Update() { D3DXMatrixPerspectiveFovLH(&matrixProj, fov, aspectRatio, nearRange, farRange); Globals::GetRenderer()->GetDevice()->SetTransform(D3DTS_PROJECTION, &matrixProj); D3DXMatrixLookAtLH(&matrixView, &position, &target, &upDir); Globals::GetRenderer()->GetDevice()->SetTransform(D3DTS_VIEW, &matrixView); } [/code] That should give you a good idea of how the projection is set.
  15. Cube Rendering Issue DirectX

    [quote name='Dawoodoz' timestamp='1319051540' post='4874418'] Try replacing "matWorld = matRotate * matScale * matTranslate;" with something simpler like "matWorld = matRotate;" and test one thing at a time. [/quote] I'm starting to think it might be an issue with the Camera. Could I be on the right track here?