Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by GrimmBro

  1. Familiar with Unreal Engine 4 and have seen through multiple projects from beginning to end which were smaller in scope. These projects were created with underlying C++ code which could be tweaked easily through blueprints as I think this makes it easier for non programmers to edit. Send me a message if you think I can be of any help.
  2. Always interesting to read up on Procedural Level Generation. A nice addition would be to let the path intersect itself. 
  3. GrimmBro

    Game Development - Where to start?

    Hi Arsoul, I think I know where you're coming from. Before doing a Computer Game related degree at a well known university I studied Computing & IT. The Computer Game related degree had more complex programming as well as learning other new skills. Going to do a Computer Game related qualification is good because you get to study with like minded individuals in a focused environment but it all depends if you can afford it or not. After university there are Student Loans and such to worry about.   Like Avalander says you can teach yourself from the internet; either that or books. Sometimes it may be best to work with what you've got and develop a portfolio in your own time if possible.    All that aside a Computer Game related course can help you get on your way to learning what you need but making some demo programs and putting them on a site is a good way to get noticed. There are also various expos and such you can showcase work if you feel confident enough to show off your work when ready.   Most importantly you should get a grasp on the programming/scripting language(s) you wish to develop games in.   Hope that helps.
  4. GrimmBro

    Windows 8 Game Development

    Rapid2D is worth checking out; would definitely recommend.
  5. Hi there,   If I have a 2D array consisting of cubes which represents a dungeon; different values in the array being what that cube will render as. The values all render fine when run and the 2D array can be hard coded to make up a level. However when I change the value of a specific location in the array, say dungeonArray[6][6] = 1;   to     dungeonArray[6][6] = 2;   This is to change the cube from a path to wall say. The physical properties of the new value are applied but not the change of texture appearance. The graphical elements of the array contain these values which do not seem to visually change no matter what I have tried so far. I am using    d3dContext->UpdateSubresource(        constantBuffer[0].Get(),         0,         NULL,         &constantBufferDataUpdate,         0,         0         );   in the update function of the Game class; should this not update the textures. As when I press a test key the array does update as I said but no change in appearance. Any help or advice on this would be greatly appreciated.
  6. GrimmBro

    Change texture at runtime?

    Sorry for all the code in advance but am I to update the render call somehow after a graphical element in the array is switched?   PixelShader.hlsl Texture2D Texture; SamplerState samplerState; struct PixelShaderInput { float4 pos : SV_POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD; }; float4 main(PixelShaderInput input) : SV_TARGET { return input.color * Texture.Sample(samplerState, input.texcoord); }   VertexShader.hlsl cbuffer PerFrameCB : register(b0) { matrix view; matrix projection; float4 lightVector; float4 lightColor; float4 ambientColor; }; cbuffer PerObjectCB : register(b1) { matrix modeltransform; } struct VertexShaderInput { float4 pos : POSITION; float4 normal : NORMAL; float2 texcoord : TEXCOORD; }; struct VertexShaderOutput { float4 pos : SV_POSITION; float4 color : COLOR; float2 texcoord : TEXCOORD; }; VertexShaderOutput main(VertexShaderInput input) { VertexShaderOutput output; float4 pos = input.pos; // Transform the vertex position into projected space. pos = mul(pos, modeltransform); pos = mul(pos, view); pos = mul(pos, projection); output.pos = pos; output.color = ambientColor; float diffusebrightness = saturate(dot(input.normal, lightVector)); output.color += lightColor * diffusebrightness; output.texcoord = input.texcoord; return output; } in Dungeon.cpp void Dungeon::CreateGraphicsElements(Microsoft::WRL::ComPtr<ID3D11Device1>& dev, Microsoft::WRL::ComPtr<ID3D11DeviceContext1>& devCon) { //create graphics elements m_DungeonElements.resize(m_DungeonArray.size()); for (unsigned int i = 0; i < m_DungeonArray.size(); ++i) { m_DungeonElements[i].resize(m_DungeonArray[i].size()); } float dungeonWidth = KElementSize*m_DungeonElements.size(); float dungeonHeight = KElementSize *m_DungeonElements[0].size(); for (unsigned int i = 0; i < m_DungeonElements.size(); i++) for (unsigned int j = 0; j < m_DungeonElements[i].size(); j++) { Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> selectedTexture = nullptr; int scaleHeight = 1; float elementY = -ElementSize; switch (m_DungeonArray[i][j]) { case 1://wall scaleHeight = 2; elementY = 0; selectedTexture = m_TextureWall; break; case 2://cave selectedTexture = m_TextureCave; break; case 3://vegetation scaleHeight = 2; elementY = 0; selectedTexture = m_TextureVegetation; break; case 4://liquid selectedTexture = m_TextureLiquid; scaleHeight = 2; elementY = 0; break; case 5://gold selectedTexture = m_TextureGold; scaleHeight = 2; elementY = 0; break; } m_DungeonElements[i][j] = new CDungeonElement(Vector3D( 0+j*KElementSize-dungeonWidth/2.0f, elementY, 0-i*KElementSize+dungeonHeight/2.0f), Vector3D(KElementSize, KElementSize*scaleHeight, KElementSize), selectedTexture, aDev, aDevCon); //states to try and change certain blocks on array which are triggered by key presses. if (m_blockState == BlockState::Path) { m_DungeonArray[3][3]=5; } if (m_blockState == BlockState::Wall) { m_DungeonArray[2][3]=5; } } } this is called in void Dungeon::createDungeon(Microsoft::WRL::ComPtr<ID3D11Device1>& dev, Microsoft::WRL::ComPtr<ID3D11DeviceContext1>& devCon) in Game.cpp   void Game::Render() { // bind the render targets m_d3dContext->OMSetRenderTargets( 1, m_d3dRenderTargetView.GetAddressOf(), m_d3dDepthStencilView.Get() ); // clear both the render target and depth stencil to default values const float black[] = { 0.0f, 0.0f, 0.0f, 1.000f }; //Clears screen to black. m_d3dContext->ClearRenderTargetView( m_d3dRenderTargetView.Get(), black ); if (!m_deferredResourcesReady) { // Only render the loading screen for now. m_loadScreen->Render(); return; } m_d3dContext->ClearDepthStencilView( m_d3dDepthStencilView.Get(), D3D11_CLEAR_DEPTH, 1.0f, 0 ); if (!m_loadingComplete) { return; } m_d3dContext->IASetInputLayout(m_inputLayout.Get()); // set the vertex shader stage state m_d3dContext->VSSetShader( m_vertexShader.Get(), nullptr, 0 ); m_d3dContext->VSSetConstantBuffers( 0, 2, m_constantBuffer[0].GetAddressOf() ); m_d3dContext->PSSetShader( m_pixelShader.Get(), nullptr, 0 ); mp_Dungeon->Render(m_d3dContext, m_constantBuffer[1]); }   void Game::Update(float timeTotal, float timeDelta) { UNREFERENCED_PARAMETER( timeDelta ); #pragma region loading checks if (!m_loadingComplete) return; if (!m_deferredResourcesReady) { return; } #pragma endregion loading checks ProcessInput(); int res = mp_Dungeon->Update(timeDelta); //update dungeon (only deals with player position for now) m_d3dContext->UpdateSubresource( m_constantBuffer[0].Get(), 0, NULL, &m_constantBufferDataPerFrame, 0, 0 ); m_d3dContext->UpdateSubresource( m_constantBuffer[1].Get(), 0, NULL, &m_constantBufferDataPerObject, 0, 0 ); } Pretty sure I'm going to kick myself when I find out how to do this but I will be so happy when I do. Can anyone let me know how I can switch the graphical element value in the array and have it update in game?
  • 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!