• Content count

  • Joined

  • Last visited

Community Reputation

133 Neutral

About Scorp07

  • Rank
  1. Prince of Soul Strider Combat

    <OPINION> I don't think this is adding that much more complexity to the game, really. Actually, let me clarify: considering this is a mini-morpg, to me this would be like saying I want to add this style of brick into the house. With the adventuring and combat being the primary focus in the engine, I think it's a great idea. Considering the technicality of it, obtaining the different styles of movement such as jumping, swimming, tumbling, etc, these are 95% based on simply adding some new animation sequences with certain rotations applied, aren't they? I ask more of the others aside from swimming, because I already added swimming into one of my learning apps with terrain. I simply added another animation for my character, changed the rotation appropriately for swimming, enabled it when the character was under a waterline, change the fogging up a bit, and bingo-boingo I had swimming =D. With jumping from ledge to ledge and hanging from ropes, etc, I haven't any experience with that specifically, but think it would be very interesting to implement. </OPINION> Scorp
  2. Class Special Abilities

    This is looking great so far, IMO. I have to admit, I'm partial to the specials myself, as they are a huge influence on class selection. In my experience, there's a lot of weight put on the "oooh look what I'll be able to do if I'm a ... ", so seeing specials and how they'll work is an automatic builder for game excitement, I think. Keep up the fantastic work. From seeing your previous work here at GD, I have no doubts at all in your ability to pull this off, and I personally think it would be awesome for the masses of "it's impossible" coders to have a little "crow" so to speak :D Scorp
  3. More Combat Statistics

    I'll second the vote on Special Abilities. They will all be nice to see laid out as you've done so far, which is a very nice job. Scorp
  4. Feature Analysis Draft 3

    Hey there, Just wanted to add a note to also mention that I'm very excited to see someone doing this. I check here all the time for updates. I'm sure if anyone can do it, you can. Hope everything is going good for you and look forward to any future additions. Kind regards, Scorp
  5. Vertex Shader in DX problem

    Just as an update, I did find the problem with the DrawPrimitive failing. I was on the understanding from a statement made in the MS documentation that before you can call the draw methods, the device must have the FVF set or the vertex declaration set. That makes me believe that either one will work. But in fact, even though I had the declaration set, not having the FVF set was causing the failure. I set the FVF and now it doesn't fail. {Edit} WooT I finally got a triangle! lol I only got it after removing all but the position from my vertices, but at least I'm getting clues now. If the vertices have texture coords, does that mean that *must* have a texture applied for them to show? Because I wasn't loading any textures... I had simply set them up for it because I'll be using them soon obviousy. I do still have a matrix transform issue as well, but I'll see if I can refresh myself on the proper matrix math to be sending what it should be getting. Right now, as the camera is moved around, the triangles stretch and skew in some cool funky ways. Unfortunately, they're not supposed to lol {/Edit} Scorp [Edited by - Scorp07 on May 18, 2007 4:18:19 PM]
  6. Vertex Shader in DX problem

    Actually, I went in and cranked up DX debugging to full tilt, and discovered that my pDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 2); is not successful. Since the function only returns D3D_OK on success or D3DERR_INVALIDCALL on fail, it's got me scratching my head as to why it's failing. It's the first time I've had a DrawPrimitive call fail lol. I'm looking, but haven't come up with the reason yet. From what you mentioned, it has me wondering something about the actual differences in the calls. If only using the SetMatrix and not SetMatrixTranspose or the other specialized matrix assignments, isn't it just setting a matrix, with the size and structure predetermined, whereas when setting a value you're indicating the data and how many bytes of data there is, which would ultimately do the same thing? I'm just curious. From the array of value setting options at hand, it makes me want to believe that one would need to use the more specialized SetMatrix calls, if they have certain transforms already performed... maybe? Not sure, and I'll be reading more about those once I give DrawPrimitive a complete enema =D Scorp
  7. Vertex Shader in DX problem

    In working further with this and trying to get my quad rendered, I'm starting to question the view projection matrix that I'm sending the shader before rendering. Considering that my camera object returns the view and projection matrices in the following code... ... pDevice->SetTransform( D3DTS_VIEW, m_camera.GetViewMatrix() ); D3DXMATRIX* viewMatrix = m_camera.GetViewMatrix(); D3DXMATRIX* projMatrix = m_camera.GetProjectionMatrix(); D3DXMATRIX wvpMatrix; D3DXMatrixIdentity(&wvpMatrix); D3DXMatrixMultiply(&wvpMatrix, viewMatrix, projMatrix); pDevice->Clear( 0, 0, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB( 0, 0, 0), 1.0f, 0 ); pDevice->BeginScene(); m_MyQuad.Render(pDevice, &wvpMatrix); ... Am I calculating the matrix correctly that the shader needs? I've been going back through the books and documentation on things, and it seems right, but perhaps someone can verify whether it's correct or not? The matrix is sent to the render method as a D3DMATRIX*, and is then assigned to the shader so it can do its thing... if(FAILED(m_pEffect->SetValue("matWVP", vProj, sizeof(D3DXMATRIX)))) { SHOWERROR("Failed in setting effect projection", __FILE__, __LINE__); return; } Thanks a ton for any feedback on this. Trying to eliminate some possibilities here. As a side, I did throw a much larger vertex buffer through the shader, and from watching my FPS it does seem to affecting my fillrate, so I'm loosely assuming that the vertex data is actually getting channeled (which is why I'm looking hard at the positioning transform) Thanks! Scorp
  8. Vertex Shader in DX problem

    Thank you so much jpetrie! I swear I should have caught that. It's right there in the documentation, which I've read several times, and still failed to do it right :/ I've added that in, and now I at least have changes happening. Now the quad isn't being rendered at all, or it's not getting positioned where it should be - however this I'm sure is me not having the FX structure setup quite right yet. I can now dig more into that specifically and hopefully make some progress. Thank you again to both of you - the help is greatly appreciated, as I'm a complete nOOb to the shaders right now (I'm behind the times lol) Cheers! Scorp
  9. Animation

    I wish I could throw more ideas your way, but I haven't gotten advanced enough to work with mesh animations yet. Hopefully some other members will have some additional ideas perhaps. Scorp
  10. Vertex Shader in DX problem

    Thank you so much for the response, Arex. The good news is that regardless of the outcome, what you pointed out with the missing vertex elements is definitely a problem. I spent so much time looking at Composer's default material that I didn't even notice them removed when I created a basic "empty" material to work with. Then was so wrapped up in my code, I never noticed what was blatently staring me in the face, so thank you for pointing that out for me. I opened up the file and made the additions thinking that certainly had to be the problem, but even with fixing that, I do get the same results. To answer your questions, I did try changing the positioning around in the FX file, with no changes in the result, so whatever is going wrong is definitely causing it to be skipped, or... something in my DX code is causing it to never actually be used in the first place, even though it's loaded. {Edit} Oh, and I did also remove the ColorArg assignments as well, but no changes. Just wanted to add that. I've even set the diffuse values to the input positions which creates a nice gradient color shading, and it compiles fine in Composer and works as expected, but again, nothing ever changes with my main app {/Edit} I'll keep on looking and Googling and experimenting. If any other thoughts happen to come about, I really do appreciate the extra input. Thanks! Scorp
  11. Animation

    You may want to check out Blender, if you haven't already. It exports the .MD2 format, along with a very nice assortment of other 3D formats as well. After getting to know it a bit, I've found it to be very flexible and powerful, and it's completely free. Blender Home Page Regards, Scorp
  12. Hello, I had posted this in the beginners forum, but haven't gotten any possible ideas in a couple days now, so I'm hoping maybe someone that browses here might be able to help. I've been trying to shift gears and move from the fixed function pipeline to shaders, and am not having the best of luck. I'm using the very basic empty .fx file from FX Composer, which follows: // An empty material, which simply transforms the vertex and sets the color to white. //------------------------------------ float4x4 matWVP : WorldViewProjection; //------------------------------------ struct vertexInput { float3 Position : POSITION; }; struct vertexOutput { float4 HPosition : POSITION; float4 Diffuse : COLOR0; }; //------------------------------------ vertexOutput VS_TransformDiffuse(vertexInput IN) { vertexOutput OUT; OUT.HPosition = mul( float4( , 1.0) , matWVP); OUT.Diffuse = float4(1.0f, 1.0f, 1.0f, 1.0f); return OUT; } //----------------------------------- technique simplest { pass p0 { VertexShader = compile vs_1_1 VS_TransformDiffuse(); // Just use the color ColorArg1[0] = Diffuse; AlphaArg1[0] = Diffuse; ColorOp[0] = SelectArg1; AlphaOp[1] = SelectArg1; } } In the DX code, I made a simple class to hold a quad for learning with, which is as follows: #include "..\include\CVSQuad.h" void CVSQuad::Render(LPDIRECT3DDEVICE9 pDevice, D3DXMATRIX* vProj) { if (FAILED(pDevice->SetVertexDeclaration( m_pVD ))) { SHOWERROR("SetVertexDeclaration failed", __FILE__, __LINE__); } D3DXHANDLE hTechnique = m_pEffect->GetTechniqueByName("simplest"); if (FAILED(m_pEffect->SetTechnique(hTechnique))) { SHOWERROR("Error setting the technique", __FILE__, __LINE__); return; } if (FAILED(m_pEffect->GetTechniqueDesc(hTechnique, &m_TechDesc))) { SHOWERROR("Error getting the technique descriptor", __FILE__, __LINE__); return; } if(FAILED(pDevice->SetStreamSource(0, m_VB.GetVertexBuffer(), 0, sizeof(cuCustomVertex::PositionColorTextured)))) { SHOWERROR("Failed to set the stream source", __FILE__, __LINE__); return; } if(FAILED(m_pEffect->SetValue("matWVP", vProj, sizeof(D3DXMATRIX)))) { SHOWERROR("Failed in setting effect projection", __FILE__, __LINE__); return; } for( UINT p = 0; p < m_TechDesc.Passes; ++p ) { m_pEffect->BeginPass(p); pDevice->DrawPrimitive(D3DPT_TRIANGLELIST, 0, 2); m_pEffect->EndPass(); } } void CVSQuad::Initialize(LPDIRECT3DDEVICE9 pDevice) { m_Verts = new cuCustomVertex::PositionColorTextured[6]; m_Verts[0] = cuCustomVertex::PositionColorTextured(-20.0f, 0.0f, -20.0f, D3DCOLOR_ARGB(255, 0, 0, 255), 0.0f, 1.0f); m_Verts[1] = cuCustomVertex::PositionColorTextured(-20.0f, 0.0f, 20.0f, D3DCOLOR_ARGB(255, 0, 0, 255), 0.0f, 0.0f); m_Verts[2] = cuCustomVertex::PositionColorTextured( 20.0f, 0.0f, 20.0f, D3DCOLOR_ARGB(255, 0, 0, 255), 1.0f, 0.0f); m_Verts[3] = cuCustomVertex::PositionColorTextured(-20.0f, 0.0f, -20.0f, D3DCOLOR_ARGB(255, 0, 0, 255), 0.0f, 1.0f); m_Verts[4] = cuCustomVertex::PositionColorTextured( 20.0f, 0.0f, 20.0f, D3DCOLOR_ARGB(255, 0, 0, 255), 1.0f, 0.0f); m_Verts[5] = cuCustomVertex::PositionColorTextured( 20.0f, 0.0f, -20.0f, D3DCOLOR_ARGB(255, 0, 0, 255), 1.0f, 1.0f); m_VB.CreateBuffer(pDevice, 6, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1, sizeof(cuCustomVertex::PositionColorTextured)); m_VB.SetData(6, m_Verts, 0); ID3DXBuffer *pBuffer = NULL; if (FAILED(D3DXCreateEffectFromFile(pDevice, "media/myShader.fx", NULL, NULL, 0, NULL, &m_pEffect, &pBuffer))) { SHOWERROR("Create Effect function failed", __FILE__, __LINE__); } if(pBuffer != NULL) { MessageBox(0, (const char*)pBuffer->GetBufferPointer(), "Effect Compilation Error", 0); } D3DVERTEXELEMENT9 vElements[] = { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, {0, 44, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END() }; if (FAILED(pDevice->CreateVertexDeclaration( vElements, &m_pVD ))) { SHOWERROR("CreateVertexDeclaration failed", __FILE__, __LINE__); } } CVSQuad::CVSQuad() { } void CVSQuad::Release() { m_VB.Release(); SAFE_DELETE_ARRAY(m_Verts); } pDevice is obvious, m_VB is a from a vertex buffer class to encapsulate vertex buffer functions, and I believe everything else is self explanatory. The problem I'm having is this... when I run the app, I get no errors at all, no failed functions and no compilation errors from the shader file, etc. I've even created bugs in the fx file to make sure it was loading, which threw the app, so I know it's being used. But - the quad still gets rendered blue, and t shouldn't. From passing through the shader file, it should be forced to white. A bigger problem is that when I through this simple quad through the FFP, my system runs it perfectly around 3000 fps. When using this version, my fps only ranks around 600 at first and as it runs will slowly continue to drop. To boot, the longer I let the app run, the longer it takes to unload and return me to the IDE. It seems as though there's a memory leak within the render call itself, but I can't figure out where. I'm at a loss as to why this isn't working, and if anyone can throw some info my way, that would be awesome. Thanks much, and if anything else needs to be provided, just shout.. Scorp [edit] I know the error catches are ugly right now... added as many as possible in an attempt to find what the issue is... they'll be cleaned up once I get things running
  13. Question about the main function

    Yep, what MrRage said. If it helps to have a direct example from what MrRage posted, consider this. Let's say for some reason I don't like the provided library of functions that have been placed into the "std" namespace, so I create my own functions and place them into my own namespace, say... "myLib". In my own version of this library, I also use some of those key function names, such as cin and cout. Now, I could actually mix and match between both versions of cout, by directly using the namespace with it. For example std::cout would call cout in the "std" library, whereas myLib::cout would call mine. That being said, as long as you know ahead of time that you'll never use a duplicated function name in your program from a different namespace, putting the "using namespace" global is fine, and saves some typing. If you get to where you could have multiple functions with the same name, but in different namespaces, such as what MrRage said, putting a global "using namespace" would no longer work, as the compiler wouldn't know from which namespace your calling the function from. Scorp
  14. Question about the main function

    Basically, it comes down to whether or not you want your program to accept "command line arguments". If you declare... int main() { ... } You're indicating that you have no use for arguments coming into the app. If you do want to be able to use arguments, then indicate those in the function header. An example might be something like running "unzip.exe" from the command line. Not useful unless you can also indicate what you want unzipped, such as "unzip.exe". That's where those passed in arguments would be used. {Edit}I was too slow... lol what nmi said is perfect :) {/Edit} Hope this helps, Scorp
  15. Vectors of Classes

    Did you change the int i to 0 instead of 1? I mentioned earlier about vectors being 0-based, which one needs to be careful of. I'm only asking that because the code as it is, with that exception and ref.push_back(Reference("Book")); it compiles and runs fine for me. As far as what will go in the other two functions, I honestly don't know if I would worry about that a ton at this time, because your class doesn't have any members that require dynamic memory allocation. With that, the defaults it will run with may work ok. If not, then tackle those. But for now, try changing how you're indexing the vector array and see what happens. {Edit} I said it compiles fine and runs, which it does, but with one warning. That warning points out that in your ReturnReference method, it doesn't return a value (object) on all return paths. For example, if the reference object type is not "Book", nothing is returned, which could cause the calling code to crash. {/Edit} Cheers! Scorp