• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.


  • Content count

  • Joined

  • Last visited

Community Reputation

426 Neutral

About Gor435

  • Rank
  1. I thought it was abstract and artistic. I like it.
  2. I got my hands on some new books that I plan to read. Game Engine Architecture The Ultimate Guide to Video Game Writing and Design Special Effects Game Programming with DirectX
  3. Okay, I think, I have finally gotten past my denial. I am going to have to put this game off for a while. I have way too much going on in my crazy life. I really need to focus on school. The book I am reading on DirectX is a joke. I have tried to use the examples and information provided to make this game and every time I turn around I am having to re-code large chunks of the basic parts because what is provided in the book is not properly implemented or explained. The book does not describe things well and like I have said they leave stuff out. I think I am just going to finish reading the text of this book just because I like to finish books I am reading. Then I am going to start over again. I am going to start with small simple apps and games then work my way up. I am going to see if I can find some other DirectX books or tuts somewhere that are good. I think, at first though, I am just going to stick with the help that comes with the DX SDK. Sadly it makes a ton more sense than this book does. I have already written a review of the book.
  4. Great job! The art is nice and the game plays well. I only have one bug when I play the game. The text seems like it is all smashed together. I mean the font looks ok and the letters are not distorted they just sit on top of one another.
  5. So I am working on a 2D game. I thought it would be a good idea to learn some DirectX and use it in my new game which is going to be a bit more complicated than what I have done in the past. Only problem is that I have had nothing but issues. I am trying to learn DirectX from reading Beginning DirectX 10 Game Programming. So either I am dumb or this book is jacked up (FYI: some of the code does not match in the book and on the CD and I have found that some things have been left out at times). Could be both but it does not matter at this time. Now to the point. My animation speed is really slow. I have checked everything and I cannot figure out why. I even pulled up the example from the CD and it runs like crazy fast. I have compared the code and still do not see anything that looks off. Only real differences between my code and the example is that I have my graphics in a class and I am only using one sprite where the example uses many. Now this may be a bad idea, with the graphics code in a class, but I would not think it would affect the speed in this way. I am pretty sure I was able to do this with OpenGL without problems. So if you have read this far and think you can help then below is my poor code. Just so you know I have tried a lot of things trying to figure out what was causing the speed issue. Oh and ignore the code to slow down the animation it is disabled by "frameDuration = 0.0;" so keep in mind I am not doing anything to slow the animation down. // !?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!? // Test // File: main.cpp // Created by Gor435 // Description: Where it all begins // !?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!? #include "main.h" //going to leave this all global HINSTANCE hInst; HWND wndHandle = NULL; LARGE_INTEGER timeStart; LARGE_INTEGER timeEnd; LARGE_INTEGER timerFreq; float anim_rate; //create the game object Game * pMage = new Game; //This is pulling info from the settings file (test should be replaced with a file name at a later time.) g_Settings Settings = pMage->GetGameSettings("test"); bool InitWindow(HINSTANCE hInstance, int width, int height); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { if(!InitWindow(hInstance, Settings.Width, Settings.Height)) { MessageBox (NULL, TEXT ("Could not initialize window"), TEXT ("Error"), MB_ICONERROR) ; return false; } //Game * pMage = new Game(wndHandle); if(!pMage->InitGame(Settings.Width, Settings.Height, &wndHandle)) { MessageBox (NULL, TEXT ("Could not Initialize the game object"), TEXT ("Error"), MB_ICONERROR) ; return false; } MSG msg = {0}; while (WM_QUIT != msg.message) { if(PeekMessage( &msg, NULL, 0, 0, PM_REMOVE )) { TranslateMessage(&msg); DispatchMessage(&msg); } else { //game code here pMage->Drawframe(); } } delete pMage; return(int) msg.wParam; } bool InitWindow(HINSTANCE hInstance, int width, int height) { WNDCLASSEX Magegame; Magegame.cbSize = sizeof(WNDCLASSEX); Magegame.style = CS_HREDRAW | CS_VREDRAW; Magegame.lpfnWndProc = (WNDPROC)WndProc; Magegame.cbClsExtra = 0; Magegame.cbWndExtra = 0; Magegame.hInstance = hInstance; Magegame.hIcon = 0; Magegame.hCursor = LoadCursor(NULL, IDC_ARROW); Magegame.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); Magegame.lpszMenuName = NULL; Magegame.lpszClassName = TEXT("Test"); Magegame.hIconSm = 0; RegisterClassEx(&Magegame); RECT rect = { 0, 0, width, height }; AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE); wndHandle = CreateWindow(TEXT("Test"), TEXT("Test"), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, hInstance, NULL); if(!wndHandle) { MessageBox (NULL, TEXT ("Could not create window"), TEXT ("Error"), MB_ICONERROR) ; return false; } ShowWindow(wndHandle, SW_SHOW); UpdateWindow(wndHandle); return true; } LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WM_KEYDOWN: switch(wParam) { case VK_ESCAPE: PostQuitMessage(0); break; } break; case WM_DESTROY: PostQuitMessage(0); break; } return DefWindowProc(hWnd, message, wParam, lParam); } Game::Game() { m_Graphics = new Graphics; m_Graphics->GetGraphicsSettings("test"); anim_rate = 0; } Game::~Game() { if(m_Graphics) { delete m_Graphics; } } bool Game::InitGame(int width, int height, HWND * window) { m_Graphics->InitGraphics(width, height, window); m_Graphics->PrepareSprite( TEXT ("images\\testsprites.png")); return true; } void Game::Drawframe() { QueryPerformanceCounter(&timeStart); m_Graphics->UpdateScene(); m_Graphics->Drawframe(); m_Graphics->UpdateSprites(anim_rate); QueryPerformanceCounter(&timeEnd); QueryPerformanceFrequency(&timerFreq); anim_rate = ((float)timeEnd.QuadPart - (float)timeStart.QuadPart ) / timerFreq.QuadPart; } g_Settings Game::GetGameSettings(std::string file) { m_Settings.Width = 640; m_Settings.Height = 480; m_Settings.Fullscreen = false; return m_Settings; } Graphics::Graphics() { //g_Settings Settings = pMage->GetGraphicsSettings("test"); //m_Graphicsstate = LOADING; //m_SubState = LEVEL; m_Level = 0; m_Width = 100; m_Height = 150; m_PosX = 220; m_PosY = 20; m_MoveX = 0; m_MoveY = 0; m_Visible = true; m_CurFrame = 0; m_NumFrames = 3; anim_rate = 0; lastElapsedFrame = 0; frameDuration = 0.0; pD3DDevice = NULL; pSwapChain = NULL; pRenderTargetView = NULL; pTextureResource = NULL; pText2D = NULL; pSpriteTextureRV = NULL; pSpriteObject = NULL; pBlendState10 = NULL; pOrigBlend = NULL; m_CurrentSprites = 1; m_CurrentIndex = 0; m_Settings = new gr_Settings; m_Spriteinfo = new D3DX10_SPRITE; GetGraphicsSettings("test"); m_Spriteinfo->pTexture = pSpriteTextureRV; m_Spriteinfo->TextureIndex = 0; m_Spriteinfo->TexCoord.x = 0; m_Spriteinfo->TexCoord.y = 0; m_Spriteinfo->TexSize.x = 0.5f; m_Spriteinfo->TexSize.y = 1.0f; m_Spriteinfo->ColorModulate = D3DXCOLOR(1.0f, 1.0f, 1.0f, 1.0f); } Graphics::~Graphics() { //release the rendertarget if(pRenderTargetView) { pRenderTargetView->Release(); pRenderTargetView = NULL; } //release the swapchain if(pSwapChain) { pSwapChain->Release(); pSwapChain = NULL; } if(pD3DDevice) { pD3DDevice->Release(); pD3DDevice = NULL; } if(pText2D) { pText2D->Release(); pText2D = NULL; } if(pSpriteTextureRV) { pSpriteTextureRV->Release(); pSpriteTextureRV = NULL; } if(pSpriteObject) { pSpriteObject->Release(); pSpriteObject = NULL; } delete m_Settings; delete m_Spriteinfo; } bool Graphics::InitGraphics(int width, int height, HWND * window) { DXGI_SWAP_CHAIN_DESC swapChainDesc; ZeroMemory(&swapChainDesc, sizeof(swapChainDesc)); swapChainDesc.BufferCount = 1; swapChainDesc.BufferDesc.Width = width; swapChainDesc.BufferDesc.Height = height; swapChainDesc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; swapChainDesc.BufferDesc.RefreshRate.Numerator = 60; swapChainDesc.BufferDesc.RefreshRate.Denominator = 1; swapChainDesc.SampleDesc.Count = 1; swapChainDesc.SampleDesc.Quality = 0; swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; swapChainDesc.OutputWindow = *window; swapChainDesc.Windowed = TRUE; HRESULT hr = D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, 0, D3D10_SDK_VERSION, &swapChainDesc, &pSwapChain, &pD3DDevice); if(hr != S_OK) { MessageBox (NULL, TEXT ("Could not create the Direct3D device and/or Swap Chain"), TEXT ("Error"), MB_ICONERROR) ; return false; } //get the back buffer from the swapchain ID3D10Texture2D * pBackBuffer; hr = pSwapChain->GetBuffer(0, __uuidof(ID3D10Texture2D), (LPVOID*) &pBackBuffer); if (hr != S_OK) { MessageBox (NULL, TEXT ("Getting the back buffer Failed"), TEXT ("Error"), MB_ICONERROR) ; return false; } //create the render target view hr = pD3DDevice->CreateRenderTargetView(pBackBuffer, NULL, &pRenderTargetView); //release the back buffer pBackBuffer->Release(); //make sure the render target vew was created successfully if(hr != S_OK) { MessageBox (NULL, TEXT ("No render target available"), TEXT ("Error"), MB_ICONERROR) ; return false; } //set the render target pD3DDevice->OMSetRenderTargets(1, &pRenderTargetView, NULL); //create and set the viewport viewPort.Width = width; viewPort.Height = height; viewPort.MinDepth = 0.0f; viewPort.MaxDepth = 1.0f; viewPort.TopLeftX = 0; viewPort.TopLeftY = 0; pD3DDevice->RSSetViewports(1, &viewPort); //create the projection matrix D3DXMatrixOrthoOffCenterLH(&matProjection, (float)viewPort.TopLeftX, (float)viewPort.Width, (float)viewPort.TopLeftY, (float)viewPort.Height, 0.1f, 10); ZeroMemory(&StateDesc, sizeof(D3D10_BLEND_DESC)); StateDesc.AlphaToCoverageEnable = FALSE; StateDesc.BlendEnable[0] = TRUE; StateDesc.SrcBlend = D3D10_BLEND_SRC_ALPHA; StateDesc.DestBlend = D3D10_BLEND_INV_SRC_ALPHA; StateDesc.BlendOp = D3D10_BLEND_OP_ADD; StateDesc.SrcBlendAlpha = D3D10_BLEND_ZERO; StateDesc.DestBlendAlpha = D3D10_BLEND_ZERO; StateDesc.BlendOpAlpha = D3D10_BLEND_OP_ADD; StateDesc.RenderTargetWriteMask[0] = D3D10_COLOR_WRITE_ENABLE_ALL; pD3DDevice->CreateBlendState(&StateDesc, &pBlendState10); hr = D3DX10CreateSprite(pD3DDevice, 0, &pSpriteObject); if(hr != S_OK) { MessageBox (NULL, TEXT ("Could not create sprites"), TEXT ("Error"), MB_ICONERROR) ; return false; } pSpriteObject->SetProjectionTransform(&matProjection); hr = pSpriteObject->SetProjectionTransform(&matProjection); if(hr != S_OK) { MessageBox (NULL, TEXT ("WTF"), TEXT ("Error"), MB_ICONERROR) ; return false; } return true; } void Graphics::Drawframe() { if(pD3DDevice != NULL) { //clear the target buffer pD3DDevice->ClearRenderTargetView(pRenderTargetView, D3DXCOLOR(0.0f, 0.0f, 0.0f, 0.0f)); //DrawBackground(TEXT("images\\tiger.jpg")); if(pSpriteObject != NULL) { pSpriteObject->Begin(D3DX10_SPRITE_SORT_TEXTURE); pSpriteObject->DrawSpritesBuffered(m_Spriteinfo, m_CurrentSprites); pD3DDevice->OMGetBlendState(&pOrigBlend, OriginalBlendFactor, &OriginalSampleMask); if(pBlendState10) { FLOAT NewBlendFactor[4] = {0, 0, 0, 0}; pD3DDevice->OMSetBlendState(pBlendState10, NewBlendFactor, 0xffffffff); } pSpriteObject->Flush(); pSpriteObject->End(); } //Restore blend state to orig pD3DDevice->OMSetBlendState(pOrigBlend, OriginalBlendFactor, OriginalSampleMask); //display the next item in the swap chain pSwapChain->Present(0, 0); } } gr_Settings * Graphics::GetGraphicsSettings(std::string file) { m_Settings->Width = 640; m_Settings->Height = 480; m_Settings->Fullscreen = false; sourceRegion.left = 0; sourceRegion.right = m_Settings->Width; sourceRegion.top = 0; sourceRegion.bottom = m_Settings->Height; sourceRegion.front = 0; sourceRegion.back = 1; return m_Settings; } void Graphics::SaveGraphicsSettings(std::string file) { } ID3D10Texture2D * Graphics::LoadTexture(LPTSTR file) { ID3D10Texture2D * pTex2D = NULL; HRESULT hr = D3DX10CreateTextureFromFile(pD3DDevice, file, NULL, NULL, &pTextureResource, NULL); if(hr != S_OK) { MessageBox (NULL, TEXT ("Bad texture data"), TEXT ("Error"), MB_ICONERROR) ; return NULL; } pTextureResource->QueryInterface(__uuidof(ID3D10Texture2D), (LPVOID*)&pTex2D); pTextureResource->Release(); return pTex2D; } bool Graphics::DrawBackground(LPTSTR file) { ID3D10Texture2D * pBackBuffer; HRESULT hr = pSwapChain->GetBuffer(0, __uuidof(ID3D10Texture2D), (LPVOID*)&pBackBuffer); if (hr != S_OK) { MessageBox (NULL, TEXT ("Getting the back buffer Failed"), TEXT ("Error"), MB_ICONERROR) ; return false; } pD3DDevice->CopySubresourceRegion(pBackBuffer, 0, 0, 0, 0, LoadTexture(file), 0, &sourceRegion); //release the back buffer pBackBuffer->Release(); return true; } bool Graphics::DrawSprite() { return true; } D3DX10_SPRITE * Graphics::PrepareSprite(LPTSTR file) { pText2D = LoadTexture(file); if(pText2D != NULL) { //Get the texture details pText2D->GetDesc(&TextDetail); //Clear out the shader resource vew description structure ZeroMemory(&SRVDesc, sizeof(SRVDesc)); //Set the format SRVDesc.Format = TextDetail.Format; //Set the type of resource SRVDesc.ViewDimension = D3D10_SRV_DIMENSION_TEXTURE2D; SRVDesc.Texture2D.MipLevels = TextDetail.MipLevels; } pD3DDevice->CreateShaderResourceView(pText2D, &SRVDesc, &pSpriteTextureRV); //this is just for testing float spritePosX = 70; float spritePosY = 180; float spriteWidth = 100; float spriteHeight = 100; //createthe translaton matrix D3DXMatrixTranslation(&matTranslation, spritePosX, ( m_Settings->Height - spritePosY), 0.1f); //Set the sprite's shader resource view m_Spriteinfo->pTexture = pSpriteTextureRV; //create the scaling matrix D3DXMatrixScaling(&matScaling, spriteWidth, spriteHeight, 1.0f); m_Spriteinfo->matWorld = (matScaling * matTranslation); return m_Spriteinfo; } void Graphics::UpdateScene() { if(m_Visible) { //createthe translaton matrix D3DXMatrixTranslation(&matTranslation, (float)(m_PosX + 200/2), (float)(480 - m_PosY - (400/2)), 0.1f); //D3DXMatrixTranslation(&matTranslation, m_PosX , ( 480 - m_PosY), 0.1f); //create the scaling matrix D3DXMatrixScaling(&matScaling, m_Width, m_Height, 1.0f); m_Spriteinfo->TexCoord.x = ((float)m_CurFrame)/((float)m_NumFrames); m_Spriteinfo->TexCoord.y = 0.0f; m_Spriteinfo->TexSize.x = 0.31f; m_Spriteinfo->matWorld = (matScaling * matTranslation); } } void Graphics::UpdateSprites(float anim_rate) { lastElapsedFrame += anim_rate; if(lastElapsedFrame < frameDuration) { return; } lastElapsedFrame = 0; if(m_Visible) { m_CurFrame++; if(m_CurFrame >= m_NumFrames) { m_CurFrame = 0; } } }
  6. it is about time, I know, but I think I have figured out my problems with DirectX. A tip for all of you out there. If you read Beginning DirectX 10 Game Programming it is a really good book, if you can follow it, know WTF your doing, or are just really good at troubleshooting crazy stuff, you just really have to watch yourself. Things change change from chapter to chapter and sometimes important details get left out. Like in chapter 3 to get my sprite to display properly I had to add spriteObject->SetProjectionTransform(&matProjection);. Now I am no DirectX expert of course but my sprite would not display until this was done. This bit of code was no where to be found for the example I was working with. Only problem is they do not add this until later when they talk about multiple sprites. So the part where you have "all the code" you need to display "a" sprite it totally leaves you scratching your head. Oh and the code on the CD does not match what is in the book. Good thing I was like wtf and figured out what I was missing. If I hadn't I might not be posting this. This is a test of the background and a single sprite. I am going to bed but please... enjoy.
  7. Well, I am working on the project... The problem is that I am trying to learn DirectX, create artwork, and make the game. I will admit the DirectX learning is not going as smooth as I had wanted. I suck at art(At least I do now used to be better). Art is very time consuming and not easy. As far as the rest I keep getting really badly distracted by everything(got a lot on my mind and a lot going on and this is not the time or place to address this). Classes are going to start again next week so I am not sure how much time I will have. Now don't take this as well he is just giving up, because I am not. It is just going to take a little longer that I had planned. I had a comment about getting a screenshot up soon and well I am sad to say I don't think that is going to happen for a while. However feel free to laugh really hard when you see the below really sad attempt at a sprite sheet. Heck I am even going to throw in a bonus image of a 3D head I created in Sculptris Just remember you can't unsee crappy art.
  8. Well, I am working on the project... The problem is that I am trying to learn DirectX, create artwork, and make the game. I will admit the DirectX learning is not going as smooth as I had wanted. I suck at art(At least I do now used to be better). Art is very time consuming and not easy. As far as the rest I keep getting really badly distracted by everything(got a lot on my mind and a lot going on and this is not the time or place to address this). Classes are going to start again next week so I am not sure how much time I will have. Now don't take this as well he is just giving up, because I am not. It is just going to take a little longer that I had planned. I had a comment about getting a screenshot up soon and well I am sad to say I don't think that is going to happen for a while. However feel free to laugh really hard when you see the below really sad attempt at a sprite sheet. Heck I am even going to throw in a bonus image of a 3D head I created in Sculptris Just remember you can't unsee crappy art.
  9. Quote:Original post by Prinz Eugn Cool, well keep working, it's hard to get back into the swing of things... and I expect screenshots in no more than 2 journal entries. I will see what I can do on the screenshots. I do have to warn you early art is going to be rough. I did, however, just get myself a copy of Beginning DirectX 10 Game Programming so that should help... at least with the code. [smile]
  10. You should do a poll on how much peopel drank this new year. Like what kind of drink idd you favore this new year's? and list the kinds. like rum, vodka, tequila, ect... Sorry drank alto of Tequila tonight.
  11. WOOT happy new year woot I am so I am barly able to see to type lvoe you guys you al rock. Go indie games~~~. WOOT.
  12. lol this is all I can see right now. Woot it is 2010 here!!!
  13. I don't see why the Consoles, PDAs, and Cell Phones forum would be a bad place to post about this subject. I know it is about development on Consoles, PDAs, and Cell Phones but I think it should cover new console ideas and the such. Happy New Year... If I don't make any sense I have had a few already.
  14. Quote:Original post by dgreen02 Happy New Years, I hope everybody is going to get plastered tonight lol. Happy New Year to all!!! Let's get the party started!!!
  15. Okay, so I have finished reading Beginning C++ Through Game Programming - Second Edition. Great book, I really like the way it is put together. Although I didn't learn many new concepts, the book was a great refresher and has gotten me all fired up to start on a game. I have been thinking about it for a while and I think I am going to make a 2D side scrolling almost shooter like. I am still playing with some names for the game and the story line a bit. I would like to say that I would like to do something where you play a mage who is betrayed and out for revenge. I wouldn't expect anything too fancy. I have not programmed much of anything in the past few years and this will be a bit of a challenge. The reason for the challenge. I am going to learn DirectX while programming this game and use it in the game. Previous games were in ASCII or OpenGL. This game is going to be a little bit more advanced than some of my previous games because I would like to have a nice polished product when I am done. I do not have much done at the moment. I started creating some basic classes to get started so I don't really have any code or concept art to post. I hope to have at least something soon.