Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by Sammie22

  1. Sammie22

    So let's talk weapons...

    What about a Wine Opener? That could get pretty gory!
  2. Sammie22

    GameState / Animation Skew

    Perhaps you could speed up the animations? I like the one-at-a-time approach because it keeps things simple. As long as it doesn't take too long to complete them each turn, it should be fine. You can also include a 'skip' feature, if the players do not want to see them. I also think the time during the animations might be good for the players to 'talk smack' or whatever to the other players. Might actually be good for the game to bring in some interaction.
  3. Sammie22

    Your Idea Is Too Big

    Very nice, well written article. Makes a lot of sense and certainly something I will keep in mind for any future projects.
  4. Sammie22

    Simultaneous turns in a Risk-like game

    The penalty is not a bad idea. Coordinating a large army into attack positions (versus a smaller one) is more time-consuming. You could restrict this by putting a limit on the amound of forces movable from one region to another in a single turn. Also, the map/world could be designed with more choke points, and allow defenders to focus in those areas for some predictability. A good map design could probably fix a lot of these issues. The project sounds interesting. I loved Risk!
  5. Sammie22

    questing pack mule concept

    Just some random thoughts: Since he's in a cave, how about a scene where the character has to knock down some pointy-shaped boulders, to protect the questers, from a higher-up cliff walkway within the cave. Could do some nice camera work with a scene like that. The character could be tasked with crawling through tight spaces within the cave, and figuring out how to open areas for the questers. The challenges faced along the way along with opening the passage could be made into quite a few puzzles.. i.e. crossing over fire, figuring out a path, etc. Have the character find some rope and have him figure out how to swing to various areas. Can use the camera to show swinging spots as well as the animation (ala Indiana Jones :-) ).
  6. Sammie22

    When "All's Well" Isn't

    The player's power is a result of other influences. For example: - Player is forced to make a sacrifice. Perhaps they must give up something which is part of their 'power' that they gained from an outside source, earlier in the game, in order to accomplish a goal, or protect another goal. Now they must sacrifice that power to accomplish a different goal. - Those / that which made the player powerful, turn against the player. Maybe due to perceived corruption of that power or abuse of it, weakining the player as a result. Or, as mentioned above, the landscape of the game changes drastically, reducing the power of the player. IMO, best done mid-game with good story-telling and the player has time to regain power before endgame.
  7. Trying to handle key combinations with Raw Input API and having some trouble. For example, in a typical FPS, you can press 'W' and 'D' and move forward and to the right. Releasing 'D' would still leave you moving forward... etc. What I have done is this: // keyboard if( raw->header.dwType == RIM_TYPEKEYBOARD ) { // get key value from the keyboard member USHORT key_code = raw->data.keyboard.VKey; // key down if( raw->data.keyboard.Flags == RI_KEY_MAKE ) { if( key_code == 'W' ) { g_Camera->MoveForward( g_Camera_Movement_Speed ); } if( key_code == 'S' ) { g_Camera->MoveForward( -g_Camera_Movement_Speed ); } if( key_code == 'A' ) { g_Camera->MoveRight( -g_Camera_Movement_Speed ); } if( key_code == 'D' ) { g_Camera->MoveRight( g_Camera_Movement_Speed ); } } This only captures the last key pressed. Does anyone know of any samples which handle key combinations? Or can anyone help on getting this to work? Thanks, Brad
  8. Sammie22

    Choosing a programming language

    Excel / Access integrate well with C# and Visual Basic using Visual Studio. Is this a web based app? And is it running on a MSFT server? If so and using VS, look into ASP and Silverlight too.
  9. Sammie22

    Raw Input and Key Combinations

    Ya I got that part working the way I want it now thanks to oler1s pointing out I am receiving an action, not a state. It is inconsistent to what was oler1s described, from my tests, which I was curious about. I'll post the code which might help others that may have the same question (in addition to above code): //----------------------------------------------------------------------------- // Global variables //----------------------------------------------------------------------------- static bool w_down = false; static bool s_down = false; static bool a_down = false; static bool d_down = false; // keyboard if( raw->header.dwType == RIM_TYPEKEYBOARD ) { // get key value from the keyboard member USHORT key_code = raw->data.keyboard.VKey; if( g_LoggingEnabled ) { g_Logger->Log( " Keyboard: " ); g_Logger->Log( IntToString( raw->data.keyboard.VKey ) ); g_Logger->Log( "\t" ); g_Logger->Log( " Flags: " ); g_Logger->Log( IntToString( raw->data.keyboard.Flags ) ); g_Logger->Log( "\n" ); } // key down if( raw->data.keyboard.Flags == RI_KEY_MAKE ) { if( key_code == 'W' ) w_down = true; if( key_code == 'S' ) s_down = true; if( key_code == 'A' ) a_down = true; if( key_code == 'D' ) d_down = true; } // key up if( raw->data.keyboard.Flags == RI_KEY_BREAK ) { if( key_code == 'W' ) w_down = false; if( key_code == 'S' ) s_down = false; if( key_code == 'A' ) a_down = false; if( key_code == 'D' ) d_down = false; if( key_code == VK_SPACE ) jump = true; } Then in some other function / method: //----------------------------------------------------------------------------- // Name: KeyboardMovement() // Desc: Applies movement to camera based on raw keyboard input //----------------------------------------------------------------------------- VOID KeyboardMovement() { if( w_down ) { g_Camera->MoveForward( g_Camera_Movement_Speed ); } if( s_down ) { g_Camera->MoveForward( -g_Camera_Movement_Speed ); } if( a_down ) { g_Camera->MoveRight( -g_Camera_Movement_Speed ); } if( d_down ) { g_Camera->MoveRight( g_Camera_Movement_Speed ); } } According to, probably best not to use a dynamically allocated array to store on each input message. And don't forget to delete[] it if you do (I did, til I caught it). Thanks for the help. I got my little prototype working and now I can move on to the next piece :) ps. still don't know the proper tags to post code. using [ code ] is that correct ? [Edited by - Sammie22 on March 6, 2010 4:05:37 AM]
  10. Sammie22

    Raw Input and Key Combinations

    Ok thanks.. that's kinda what I tried in a different attempt (the psuedo code), but I must have implemented it wrong. I will try again and see if I can get it to work. Edit (just tested your post): When I press 'W' I move forard until another kb action is taken. I then press 'D' and move right until another action. If I release 'D' I stop. This fits your description perfectly. But, when I do the same, and instead release 'W' I keep moving right. But that is not the last action taken? Edit 2: I ran some logging on the key-down / key-up events, and the associated key-pressed / key-released events. The last key-down event is reported continuously, until it is released. Key-release events from keys other than the last-key-pressed are sent once while the last-key-pressed remains down. When the last-key-pressed is released, no other kb events are sent except key-releases. So I guess raw input always reports the last-key-pressed until it is released, and key-releases are only reported once regardless of the key-press state? Appreciate the help! [Edited by - Sammie22 on March 5, 2010 2:07:51 AM]
  11. Sammie22

    Raw Input and Key Combinations

    Ok I will give that approach a try. But I am still perplexed as to why the last key pressed is the only key registered? If I hold down 'W', then press 'D', will 'W' still report? I also tried doing this like (psuedo code since I scraped it already): if key down { start moving in proper direction } if key up { stop moving in that direction } I thought this might handle it as the key up message might be sent at a different time for each key. But that did not seem to work either. Thanks for the help, Brad ps. What is the code tag for posting? pss. Here is a more complete cod listing for what I have done too: Set it up ========= //------------------------------------ // Raw Input (keyboard and mouse) //------------------------------------ // keyboard g_RID[0].usUsagePage = 1; g_RID[0].usUsage = 6; g_RID[0].dwFlags = 0; g_RID[0].hwndTarget = NULL; // mouse g_RID[1].usUsagePage = 1; g_RID[1].usUsage = 2; g_RID[1].dwFlags = 0; g_RID[1].hwndTarget = NULL; // register RegisterRawInputDevices( g_RID, 2, sizeof( RAWINPUTDEVICE ) ); Messages ========= case WM_INPUT: { // determine size of buffer UINT buffer_size; GetRawInputData( ( HRAWINPUT ) lParam, RID_INPUT, NULL, &buffer_size, sizeof( RAWINPUTHEADER ) ); // create buffer with correct size BYTE* buffer = new BYTE[ buffer_size ]; // get the data GetRawInputData( ( HRAWINPUT ) lParam, RID_INPUT, ( LPVOID ) buffer, &buffer_size, sizeof( RAWINPUTHEADER ) ); // process data RAWINPUT* raw = ( RAWINPUT* ) buffer; ... The rest is in the code I pasted in the first post. [Edited by - Sammie22 on March 4, 2010 10:43:06 PM]
  12. I have done quite a bit of searching here, and other places in the web, looking for actual implementation examples of MVC game design. I found this article very useful for visualizing for a high level design: .. But, while I have learned a lot conceptually, I am struggling turning it into an actual program. I want to learn MVC to decouple the rendering, model, input, logic, etc to ease the rafactoring pain in my projects. I came up with a simple game project to practice MVC (I am sure MVC is overkill for it and not necessary, but I wanted to learn in a simple manner). The project contains simple 3d primitives for graphics, and no animation. Using the above link as my template, I have built my Model out as I typically do: EntityBase <- Non-MovingGameObjects EntityBase <- MovingEntityBase <- MovingEntityGameObjects I created a EntityManager to contain the EntityObjects, and provided Add(), Remove(), and Update() interfaces. I am comfortable with this setup and feel it will work fine for this project. But now I have reached a bit of a hurdle in my understanding of the implementation. I am trying to build out the representation piece, and am not quite sure how to proceed. I was thinking of something like: RepresentationBase <- Non-EntityGameObjects (i.e. background) RepresentationBase <- EntityRepresentationBase <- EntityRepresentationGameObjects In this setup, I am unclear as to what to pass to the EntityRepresentationGameObjects, nor how exactly to structure it. Do I provide a pointer to the EntityGameObject in the representation class to get position information? Or do I use a messaging system? How do I implement the actual shapes of the objects into the representation class? Use another class to represent the shape and have a pointer to that in the representation class? Any help / advice, or actual implementation examples, would be greatly appreciated. Thanks, Brad Edit: If this question seems to vague or unclear and you need more info, please let me know and I will provide it as best I can. [Edited by - Sammie22 on February 12, 2010 1:41:02 AM]
  13. I would like to rotate a cube primitive around a single axis. To be more specific, I would like to rotate the vertex points (8) of the cube, which uses an index buffer to create the triangles. In GDI and other projects, I have written my own functions to handle matrix transformations. However, I would like to use methods provided by dx if possible (since I am trying to learn it). I have done some searching and found this: D3DXMATRIX mSunScale; D3DXMATRIX mSunSpinRotation; D3DXMATRIX mSunMatrix; D3DXMatrixRotationY( &mSunSpinRotation, D3DXToRadian( fSunSpin ) ); D3DXMatrixScaling( &mSunScale, 5.0f, 5.0f, 5.0f ); // Now, concatenate them together... mSunMatrix = mSunScale * // 1. Uniformly scale the Sun up in size mSunSpinRotation; // 2. and then spin it on its axis. g_pd3dDevice->SetTransform( D3DTS_WORLD, &mSunMatrix ); g_pSunMesh->DrawSubset(0); This example applies to a mesh, not a primitive. I also do not see where the matrix transformation is actually applied to the mesh?? Is that in the DrawSubset(0) call? Further down the rendering process, a similar approach is repeated mutliple times for different meshes, and DrawSubset(0) is called each time. So I am guessing that this is part of applying the transformation to the mesh, but my searches on the DrawSubset() function didn't turn up much info. Can anyone point me in the right direction for example(s) of transformations on primitives? Or provide a sample here? Thanks for any help, Brad
  14. Sammie22

    DirectX Matrix Transformations

    Ok, thanks for the info Erik. That cleared it up for me.
  15. Sammie22

    DirectX simple game sample with classes?

    Thanks again Buckeye. I was able to get the tic tac toe board drawn using a class hierarchy. Appreciate the help, Brad
  16. I am looking for a sample (or some info) on using multiple classes with directx. Particularly, I am curious about the render() call. I was planning on writing a 3D tic-tac-toe game (very basic, no sound) and wanted to build a simple class hierarchy so that the render call goes through a level class, which calls a render on each object on the level. It will use primitives and update on mouse input (not really important to a sample but just extra info on the project). The samples in the sdk are all in 1 class file (using primitives anyway), and I am trying understand what is needed to break it up into a hierarchy. For example, can I use more than 1 custom vertex definition? Can I draw primitives from different collections? Etc... If this does not make sense, please let me know any additional info needed and I will try to clarify. Thanks for any help, Brad
  17. Sammie22

    DirectX simple game sample with classes?

    Yes that is very helpful... thanks! Do I place the render() call between the begin/end scene: VOID Render() { // Clear the backbuffer to a black color g_pd3dDevice->Clear( 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB( 0, 0, 0 ), 1.0f, 0 ); // Begin the scene if( SUCCEEDED( g_pd3dDevice->BeginScene() ) ) { ... render() call to level here, which calls render on the objects in the level ... g_pd3dDevice->EndScene(); } ps not sure how to get this to post as code
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!