Jump to content
  • Advertisement
    1. Past hour
    2. Hi guys, I'm a little nervous about this interview that I'm about to go for next week, and I'm planning questions to ask to the employer. I'm not sure if those questions are spot on or offensive? While watching how the game works online, I came up with a few questions: I can see that drawing a line from ship to landing spot was done using a line renderer component, but did you also use a Navigation component to make the ships follow the line to the landing spot? I've also noticed that the line drawn gradually changes to their respective colors. Is there some error checking that happens during that time frame to make sure the color of the ship matches the color of the landing spot? I'm applying for LootKit Studios interview, and they have this game already established for the PC called Cosmic Control. They are looking for an Unity developer. I'm trying to ask questions regarding how their game works. Would it back fire on me in some way or does it show that I'm interested in the project?
    3. = {} doesn't give you defaults. You probably want CD3DX12_<state object type>(D3D12_DEFAULT) from d3dx12.h. Not sure if that's the problem, but it's the first thing that jumped out to me.
    4. Gabz

      Special Effects For Games

      Unique Toon Projectiles Vol.1 - Showcase Cartoon projectiles are awesome! Had a blast creating this package, check it out! WebGL Demo Asset Store Patreon Enjoy & Thank you!
    5. Today
    6. Irusan, son of Arusan

      Question about making meshes for spritesheets

      Er, actually, I misunderstood slightly. Listen to Zakwayda
    7. Hello there! Welcome to this installment of your favourite Weekly Update blog! I'm gonna say this outright: there are two new mechanics and some freshen aesthetics too! So let's get right to it! Alt Fires First up, let's talk about that lonely right mouse button. Previously that button was used to trow crystals around, but due to the previous update, there's no more crystal trowing anymore. This made right click very lonely indeed. To remedy this I've decided to implement secondary actions to weapons. For melee weapons, it's a blocking mechanic while in range ones it's a zoom mechanic. Guarding In melee weapons, the secondary action is some kind of guard. It doubles your defence stat while pressing and holding the secondary action button. You can block any actual attacks, both melee and ranged too. But there's more! Parry Another possible thing is to parry an attack. To do this the player needs to let go of the secondary action button precisely as an enemy attack. Unlike guarding, this technique mirror back the attack to their opponent. This is extremely gratifying to pull it off, but all of this needs to be planned ahead, as you only get a couple of frames to parry an attack. Also, you cannot do a quick parry. If you quickly let go of the secondary action button you will instead get punished by not only not doing a parry but also have a long cooldown too. parry.mp4 Zoom Secondly, range weapons (such as bows and guns) also get a secondary action as some kind of zoom. While holding the secondary action button the player's view will zoom in, making it easier to aim. While zoomed in, the mouse sensitivity will be greatly reduced, helping along with the aiming. There are no statistical benefits with zooming whatsoever. It's just really useful when you're having bad aim. Like guarding, getting in and out of it will induce a longer cooldown, so don't screw around too much! The Jungle Secondly, there's also been some kind of aesthetic upgrades, especially to the first level. Basically, I've changed my prop algorithm to add support for level-specific ones. This effectively meant that different props will appear in different levels, making each level feel a little bit different from each other. Right now I'm focusing on the jungle one, so let's see what's up... Super Ferns First new prop is the super ferns. In rainforests (the main type of forest casually associated with jungles), there is a lot of types of perennial vegetation, especially ferns. So it was a no-brainer to include those in the game (especially for the first level). Luckily, I already fully modelled a leaf of those type of ferns. It was just a matter of merging several duplicates of that model and boom, got yourself a rainforest fern. take a look : Anthurium Sagittatum Another really striking rainforest plant that I've fallen in love with is the Anthurium sagittatum plant. As you can see their leaves got a really distinctive shape that I just got to include in the game. Here's what I got: The Liana is back Also, the liana is back from the dead! It previously used as a placeholder to test my room algorithm, but now it's back in full force! With the new shader and Ambient Occlusion, I've got to say that it looks a whole lot better than previously. And with all those new props the jungle level slowly starts to look a whole lot like a jungle: And I'm technically not done yet! Minor Updates The refactor continues! I was able to shed about 10 MB whit all that duplicated code removed. With all those duplicated codes removed, it's now a whole lot cleaner. I've even managed to remove some typos and duplication corruptions here and there too. Fixed a bug with the animation state machine not being properly set up, meaning that attacks and guarding can override each other. Fixed a bug with 3D catenary slopes (like lianas and bridge ropes) not ending correctly. Upgrade the double-sided shaders to have better lighting when the geometry's normals are facing away from the camera (i.e. when we're looking inside the mesh) Also added some two-sided shading to appropriate models too! Fixed some problems with the level mesh generator generating meshes where it shouldn't. Removed most lighting probes references to static assets (because, you know, procedural generation) Next Week So next week I'm going to continue with the level-specific props and whatnot while looking at bugs too. I'm still planning to have something by the end of the month, or maybe by mid-March if there's any holdup, but we'll see. Otherwise, it's the usual suspects. So that's pretty much it! See you next week!
    8. Something I just noticed is this: overlap.set(overlap.x < overlap.y ? overlap.x : 0, overlap.y < overlap.x ? overlap.y : 0); It seems to me that if overlap.x and .y are equal, you'll get (0, 0), which is incorrect. As such, it seems <= should be used rather than <. Other than that, it may be that all I can say is that your code seems correct. However, I think I missed the above issue (assuming I'm right about it being an issue) the first time I looked at the code, so it's possible I'm missing something now as well. Maybe someone else will be able and willing to offer 100% confirmation that the code is correct, but due to the risk of making a mistake myself, I'm hesitant to do so. I certainly understand your desire for certainty that your algorithm is correct. One thing I will say is that if you don't feel sufficiently confident in your current approach, you could implement the test in a perhaps more traditional way. This might allow you to more easily check your code against other examples. Also, although I doubt it matters in practice, your code takes a 'two-phase' approach that may involve a little unnecessary work, whereas a 'traditional' approach would typically perform the separating axis tests and track/compute the MTV at the same time. If you haven't done so already, you might be able to find some good example implementations by searching for 'sat mtv' or similar terms. [Edit: I should probably add that using <= as I suggested could result in the intersection being resolved along both axes. The traditional approach always resolves the intersection along only a single axis (to the best of my knowledge at least). If you want to stick with your current approach, you might consider selecting an axis exclusively, as I think is more typical.]
    9. https://www.youtube.com/watch?v=28K0oF-xZvU Song Title: "Alchemy" Composed and produced by EL PRASO 2019 Graphics: The Alchemist in Search of the Philosopher's Stone, by Joseph Wright, 1771 ________ #orchestral #instrumental #elpraso
    10. This may be in part a repeat of what Irusan said (I'm not sure). Assuming I'm understanding your question correctly (which I may not be), you don't need to rely on eyeballing to get the results you want. You can compute exact dimensions (e.g. for mesh data or transform scaling) by computing the aspect ratio of the source graphic and creating quads with the same aspect ratio (your mention of dividing width by height hints at this). That may seem obvious I suppose, so apologies if I'm misunderstanding the question. There are various ways you could do it. You could use multiple meshes, as you mentioned. That could result in multiple small meshes and an increase in the number of draw calls, but that might not be an issue, depending on the circumstances. Another approach that's fairly common (as far as I know at least) is dynamic batching with streamed mesh data.
    11. upallinsky

      My first OST | Feedback please

      Thx so much!) Maybe later i add some new track.
    12. Presenting DungeonBot3000: It's an ARPG, in the vein of Diablo or Path of Exile. You play the role of a small prototype bot waking from hibernation after almost 700 years, in order to carry out your final directive: exterminate the Cult of Gamed'ev. Challenge Criteria: Menu: It's there. You can press ESCAPE at any time to instantly quit the game. Also, when playing, you can return to the main menu, but to do so you have to die, at which point you are given the option to Respawn, Return to Menu, or Exit Game. Labyrinth: 10 levels of randomly generated maze. The mazes are generated using the Depth First Search maze algorithm, meaning lots of dead ends and few branching intersections. Some more maze variety would have been nice. Walls count as stationary obstacles, enemies count as moving obstacles since they can block your movement. The end goal is to reach Level 10 and destroy the bosses Khawk and jbadams. I haven't managed to do it yet at current numeric balance levels, but I also need to 'git gud'. Enemies: Enemies come in 4 flavors: Users are the cannon fodder mobs upon which you will grind to gear up. Small, wearing white shirts, and generic, they represent the faceless hordes of the Cult of Gamed'ev. Moderators are the next step up. They are named mobs, with names randomly chosen from the list of gamedev.net moderators. You can recognize them by their red shirts and larger size. Moderators can roll with 3 random modifiers. Emeritus mobs are next. They are even larger still, and are recognizable by their purple color. Even more dangerous than moderators, they can roll with 4 random mods. Staff are the final enemy types. There are only 2 variants: Khawk and jbadams. They are the end-game bosses, and are found only on Level 10 of the dungeon. They have custom attacks (Khawk uses a shoulder-mounted fire grenade launcher, jbadams swings a Ban Hammer) and can have up to 5 random mods. This makes them quite dangerous, as they pretty much always have Berserk and Quick, Life Leech and Life Regen. You can't kill them, and worse you can't escape them. Items and Loot: All enemies have a chance to drop randomized loot. Loot comes in 3 varieties: Blades, Lasers and Shells, to provide offensive boosts to your attacks, and defensive boosts to your character. For the Credits requirement, I implemented an Energy value. Energy accumulates over time, at a base rate of 1 per second. There are random mods on items that can boost this rate. You spend Energy slowly when using your attacks; you can also spend Energy using Gambling. Currently, Gambling is hacked into a button on the main interface. If you have at least 400 energy, click the button to spend 400 and roll a random item. Gambling draw from the full mod tier pool and from the full pool of random item mods, so you can get end-game ready equipment this way. Probably faster to just play to get equipment, though. Visual: Top-down 3D pseudo-isometric ARPG viewpoint. Drab gray dungeon textures. Enemy models thanks to MakeHuman, player model thanks to Blender. Audio: Only a single track, courtesy of Gravity Sound. The sound effects include some of the effects shipped with Urho3D, and a few random sound samples obtained from OpenGameArt. Sound design theme can be summed up as 'cheesy'. Notably lacking is a UI with slider bars to adjust volume. Ran out of time. GameDev reference: The whole thing. You play a robot tasked with killing gd.net members. Super clever! And certainly not a way for me to end up on some kind of watch list! I really only did it this way because I wanted to use MakeHuman to cut down a lot of modeling work, so I needed a reason for a bot to be killing people. Logical. Playing: Use Left Mouse Button to move, use stairs and pick up loot. Use Right Mouse Button to attack. 'q' and 'w' switch between Spin Attack and Laser Beam attack. Hover over items to compare with currently-equipped items for that slot. Left-click on an item on the ground to equip it, dropping your currently-equipped item on the floor. Try not to die, but if you do you can Respawn to retry the current dungeon level. You get to keep your equipment if you Respawn, you'll lose it if you return to main menu.
    13. I'm new to DirectX12. I've read document about DirectX12 for some days and now I just want to use it to draw a triangle. But it's not work! I used PIX to debug the program and I found that my pixel shader has no output!. I don't know if there's something wrong with my Pipeline State Object settings. this is the function that create the PSO /** vs and ps are indices of shader resource which have been compiled with dxc.exe in sm6 and stored in a map called shaders */ void Renderer::CreatePSO(uint32_t vs, uint32_t ps) { D3D12_INPUT_LAYOUT_DESC inputDesc; D3D12_INPUT_ELEMENT_DESC pos; pos.SemanticName = "POSITION"; pos.SemanticIndex = 0; pos.Format = DXGI_FORMAT_R32G32B32_FLOAT; pos.InputSlot = 0; pos.InputSlotClass = D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA; pos.AlignedByteOffset = D3D12_APPEND_ALIGNED_ELEMENT; pos.InstanceDataStepRate = 0; inputDesc.NumElements = 1; inputDesc.pInputElementDescs = &pos; D3D12_RASTERIZER_DESC rasterDesc = {}; /**< use default value */ rasterDesc.FillMode = D3D12_FILL_MODE_SOLID; rasterDesc.CullMode = D3D12_CULL_MODE_NONE; /**< disable cull */ rasterDesc.DepthClipEnable = false; D3D12_GRAPHICS_PIPELINE_STATE_DESC desc = {}; desc.pRootSignature = mRootSignature.Get(); ID3DBlob* const vsb = shaders[vs].Get(); ID3DBlob* const psb = shaders[ps].Get(); desc.VS.BytecodeLength = vsb->GetBufferSize(); desc.VS.pShaderBytecode = vsb->GetBufferPointer(); desc.PS.BytecodeLength = psb->GetBufferSize(); desc.PS.pShaderBytecode = psb->GetBufferPointer(); desc.StreamOutput = {}; desc.BlendState = {}; desc.InputLayout = inputDesc; desc.SampleMask = 0; desc.RasterizerState = rasterDesc; desc.DepthStencilState = {}; /**< use the default value */ desc.DepthStencilState.DepthEnable = false; /**< disable depth testing */ desc.DepthStencilState.StencilEnable = false; /**< disable stencil testing */ desc.IBStripCutValue = D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED; desc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; desc.NumRenderTargets = 1; desc.RTVFormats[0] = DXGI_FORMAT_R8G8B8A8_UNORM; desc.DSVFormat = DXGI_FORMAT_UNKNOWN; /**< since there is no depth stencil buffer */ desc.SampleDesc.Count = 1; desc.SampleDesc.Quality = 0; desc.NodeMask = 0; desc.CachedPSO = {}; desc.Flags = D3D12_PIPELINE_STATE_FLAG_NONE; if (FAILED(mDevice->CreateGraphicsPipelineState(&desc, IID_PPV_ARGS(&mPSO)))) throw("create pipeline state failed"); } And this is the function that setting command list for each frame void Renderer::Run() { WindowBase::MainLoop = [this](float) { /** Command List setting for each frame */ mCmdList->Reset(mCmdAloc.Get(), nullptr); mCmdList->SetPipelineState(mPSO.Get()); /**< Which is created throgh Function CreatePSO */ /** A constant buffer in the heap that I never use within my shaders */ D3D12_GPU_DESCRIPTOR_HANDLE gpuHandle = mBufDescHeap->GetGPUDescriptorHandleForHeapStart(); ID3D12DescriptorHeap* heaps[] = { mBufDescHeap.Get() }; mCmdList->SetDescriptorHeaps(1, heaps); mCmdList->SetGraphicsRootSignature(mRootSignature.Get()); mCmdList->SetGraphicsRootDescriptorTable(0, gpuHandle); /** Vertex And Index Buffers setting */ mCmdList->IASetVertexBuffers(0, 1, &mVtxBufView); mCmdList->IASetIndexBuffer(&mIdxBufView); mCmdList->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST); /** Viewport and Scissor Rect settings. mWidth = 300 and mHeight = 300. */ D3D12_VIEWPORT viewport = {}; viewport.Height = mHeight; viewport.Width = mWidth; viewport.MaxDepth = 1.0f; viewport.MinDepth = 0.0f; viewport.TopLeftX = 0; viewport.TopLeftY = 0; mCmdList->RSSetViewports(1, &viewport); D3D12_RECT scissorRect; scissorRect.bottom = mHeight; scissorRect.right = mWidth; scissorRect.top = scissorRect.left = 0; mCmdList->RSSetScissorRects(1, &scissorRect); D3D12_RESOURCE_BARRIER barrier; barrier.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION; barrier.Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE; barrier.Transition.pResource = mRtvs[mSwapChain->GetCurrentBackBufferIndex()].Get(); barrier.Transition.Subresource = 0; barrier.Transition.StateBefore = D3D12_RESOURCE_STATE_PRESENT; barrier.Transition.StateAfter = D3D12_RESOURCE_STATE_RENDER_TARGET; mCmdList->ResourceBarrier(1, &barrier); D3D12_CPU_DESCRIPTOR_HANDLE rtvHandle = mRtvDescHeap->GetCPUDescriptorHandleForHeapStart(); rtvHandle.ptr += mRtvDescHeapSize * mSwapChain->GetCurrentBackBufferIndex(); static float clearColor[] = { 0.2f, 0.4f, 0.6f, 1.0f }; mCmdList->ClearRenderTargetView(rtvHandle, clearColor, 0, nullptr); /** no depth stencil buffer here, since i don't want to use depth testing */ mCmdList->OMSetRenderTargets(1, &rtvHandle, false, nullptr); mCmdList->DrawIndexedInstanced(3, 1, 0, 0, 0); barrier.Transition.StateBefore = D3D12_RESOURCE_STATE_RENDER_TARGET; barrier.Transition.StateAfter = D3D12_RESOURCE_STATE_PRESENT; mCmdList->ResourceBarrier(1, &barrier); mCmdList->Close(); ID3D12CommandList* list[] = { mCmdList.Get() }; mCmdQue->ExecuteCommandLists(1, list); mSwapChain->Present(1, 0); /** Waiting until above commands were executed */ synchronizationCPU(mCmdQue.Get(), mFence.Get(), mNextFenceValue, mFenceEventHandle); }; win->Run(); /** start window's main loop */ } And here is my simplest vertex shader and pixel shader(I used dxc.exe to compile it in Shader Model 6_0) ///////////////////////////////// // VERTEX SHADER ///////////////////////////////// float4 main( float3 pos : POSITION ) : SV_POSITION { return float4(pos, 1.0f); } ///////////////////////////////// // PIXEL SHADER ///////////////////////////////// float4 main() : SV_TARGET { return float4(1.0f, 1.0f, 1.0f, 1.0f); } Vertex buffer and Index buffer are also very simple std::array<float, 9> VtxData = { -.5f, 0.0f, 0.0f, 0.0f, .5f, 0.0f, .5f, 0.0f, 0.0f }; std::array<uint32_t, 3> IdxData = { 0, 1, 2 }; By the way, I have used the debug layer and there is no error or warning message. When I try to use PIX to debug the pixel that should be inside the triangle, it warn me that "Shader Debugging returned no invocation records. Check that your selected pixel, vertex, or thread exists and was executed on this draw call". My Vertex Shader has the correct output which should not be culled anymore Hope anybody can give me some suggestions to do more test. Thanks!!! (Seriously, DirectX12 is really harder than DirectX11...)
    14. JTippetts

      DungeonBot3000: Postmortem

      I've gotten done about all I'll be able to on this project before the deadline. It was pretty fun to do, even if I didn't end up with as much time for it as I would have liked. Still, I did manage to implement all requirements, so I have that going for me which is nice. The zip file is live now on the project page: You can watch some current gameplay (with lots of me dying) here: Be warned: lots of deaths. I'm kinda terrible at my own game. So, postmortem. I've been tinkering with isometric dungeon crawlers and ARPGs off and on since I played Diablo 1 back in the late 90s, so I've gotten a bit of practice at some things. Still, this effort managed to teach me quite a bit. I didn't reuse much of that old code; almost everything this time was written from scratch for this project. The game is written using the Urho3D engine, using the OpenGL backend. Usually I write mostly in Lua, but this time it's straight C++. The data files come as a mix of XML and JSON documents. The premise of the game is that you play an experimental battle robot from centuries ago, tasked with eliminating the evil Cult of Gamed'ev. This cheesy lore skin, of course, satisfies the "minimum one gamedev.net reference" requirement. The game is an ARPG. You have access to 2 skills (I had hoped for more, but ran out of time): a spinning blades attack (akin to the Whirlwind skill of Diablo 2 barbarians, or Cyclone from Path of Exile) and a channeled laser beam attack. These skills are boosted by equipping a Blade (for the spin attack) and a Laser Beam(for the laser, obviously). Items are randomly generated, can have multiple mods in classic ARPG style, and are gained by killing mobs. Currently, there are 3 types of items: Blades, Lasers and Shells, and they can draw from a fairly broad pool of random modifiers including Increased Life, Life Leech, Damage Reduction, etc... Items come in Normal(white), Magic(blue), and Rare(yellow) varieties. There are also 4 base types for each, with each base type being more powerful than the previous ones, and hence only dropping on lower levels of the dungeon. I wasn't able to implement an inventory system in time, so to equip items you simply click on them in the world and the item you click on will replace the one you are currently using in that slot. Hovering over an item on the ground will show info boxes for both the item you are looking at and the one you are already using in order to compare. You progress through a maze that consists of 10 labyrinthine levels. Stairs up/down are used to transition between levels. Each level is populated by a random assortment of Users (regular gamedev forum members, non-named), Moderators (larger, redder, and having a small number of random mods; named based on the current gamedev.net moderator list), Emeritus (even larger, purple, and with more mods; named from the GDNet Emeritus member list) and Staff (green, very large, and named, only 2 variants: Khawk and jbadams). Khawk and jbadams reside on the very bottom, Level 10, of the dungeon. As you progress through the floors, mob density grows larger. As well, the mobs scale based on the dungeon level, in both health and damage dealing, so that the very last level is quite dangerous indeed. What went right: Lots of things really came together on this project: I drew inspiration for a stats container system from my Goblinson Crusoe project, implementing a system whereby I can have stats drawn from various sources, that all work together to provide complex systems from simple parts. The combat system is definitely something I'd like to flesh out more fully in the future. What went wrong: @Rutin kindly found a crash bug on level transition late last night, almost at zero hour. I was able to fix it, but due to the time constraints there are a lot of other sloppy things in this project that need to be refactored. I did a last-minute revamp of the game state handling system to fix this bug, but there are certainly other bugs lying in wait. Also, balance is sort of ROFL. I have managed to get to L10 using Blades, with lots of death and respawning (luckily, if you respawn you keep your equipment and restart on a fresh instance of your current level). I haven't made it that far with lasers yet, and I haven't managed to kill Khawk or jbadams at the current numerical values yet. They roll with 5 random mods, so they almost always end up with both Quick and Berserk, which when coupled with Life Leech and Life Regen, make them basically unkillable at current power levels. Someone out there might have better luck/skill/determination than me, though, so if you manage to kill them let me know. The UI is rudimentary-to-nonexistent. I hacked the bare minimum to get by, but it's not very user friendly. Luckily, it's an ARPG so all you really gotta remember is: Right Mouse Button to kill, Left Mouse Button to loot or RUN AWAY! You can use 'q' and 'w' to switch between Spin Attack and Laser Beam. Given more time, I wanted to implement at least an inventory screen to manage equipment, but alas... Mobs are not varied in their attacks. Users, Moderators and Emeritus all do just a single Kick attack. I If I get a chance today before the deadline, I might try to add a little bit more variety to their attacks. Khawk and jbadams have custom attacks, at least. Other details: For the Credits, I implemented an Energy system. You use Energy when you attack, slowly, but you can also spend it using a button strategically placed in the upper righto corner, to gamble on an item. This gamble rolls an item from the full pool of item bases, and rolls it at Level 10 so you can potentially get any mod. I've never gotten anything that useful from it, though. I had intended to make gambling reachable by using a kiosk of some sort in-game, but ran out of time.
    15. Hi there, brand new to the forum, and have a few questions. I've been meddling with the idea of creating my own game, and finally have the time, money and inspiration to get started. But I need some advice on what I should be using to achieve my dream of creating a game. Concept The concept I have is to create a 2D turn-based, top-down space strategy game, in the elk of Space Empires III and IV, but also combining elements I liked from other titles, like StarDrive 2, Stellaris and Distant Worlds. I like the idea of 2D as it means I don't have to worry about creating models, and adds an easy element of mod-ability for myself and others who may play the game. There are loads of elements I'd like to add but need to start with the basics. What do I need? First question is 'what is the best programme or programmes to use to realise this dream?' I'm new to the actual design and programming side of things, so need some pointers on what I need to learn. I know this is a very lofty 'first project', and to be fair, it probably won't be my first project - I'll likely develop loads of other things to learn the basics before getting to the core of what I want to make, but I need to start somewhere. Elements I need to develop So, a little more info may be needed on what I'm wanting to achieve. The core of it is a strategy game set in space where you manage an empire of some description, explore the galaxy, colonize worlds and fight other AI/player empires. I envision people designing their ships with Stellaris style simplicity, but one that also allows you to customise your firing arcs, so you could have nearly all your weapons forward (like Klingon's, Shivans, etc) or more balanced. Combat I see as again top-down, but in real time (could be harder than I think, but willing to aim high). As you can see, I've got an idea of what I want, but no idea how to get there. Any help anyone could provide would be most appreciated! I'm aware of creation tools like Unity, but I'm not sure if that would be the appropriate tool for the job(s). Just a starting point of a programme or programmes to learn or a course someone knows about would be a huge step forward Cheers
    16. I think you can learn C# and OpenGL together. For example you can learn how "for" statement works. You can draw 100 squares instead of writing 100 numbers in the console. OpenGL is just API. I highly recommend to download my example GUI WinForms + OpenGL 3.1 and port examples from this book to C# OpenGL: 2013 - 07 - WebGL Programming Guide - K. Matsuda, R. Lea. Source Code: https://sites.google.com/site/webglbook/ It is excellent book for beginners. Authors explain basics of computer graphics very good. I do not know a book where shaders was explained so good.
    17. Updated: 2/15/2019 - added "if...else" Double Selection Statement Visual Studio Enterprise 2015 has build in tool for creating UML Activity Diagrams. We can use this tool for creating flowcharts for describing algorithms. Creating UML Activity Diagram: Select: "File" -> "New" -> "Project..." -> "Modeling Projects" Write a name, for example: UseUMLInsteadOfFlowcharts_ModelingProject Press "OK" button Right Click on a name of the project Select: "Add" -> "New Item..." -> "UML Activity Diagram" Write a name, for example: UseUMLInsteadOfFlowcharts.activitydiagram Press "Add" button To add new items, drag them from the "Toolbox" I get these examples from the book: 2016 - 08 - C# 6 for Programmers - 6th Edition - Paul Deitel, Harvey Deitel. Code Examples: link 1. "if" Single-Selection Statement int studentGrade = 70; if (studentGrade >= 60) { Console.WriteLine("Passed"); } 2. "if...else" Double-Selection Statement int studentGrade = 70; if (studentGrade >= 60) { Console.WriteLine("Passed"); } else { Console.WriteLine("Failed"); } 3. "while" Iteration Statement int product = 3; while (product <= 100) { product = 3 * product; } 4. "for" Iteration Statement for (int counter = 1; counter <= 10; ++counter) { Console.Write($"{counter} "); }
    18. RoKabium Games

      ScreenShotSaturday

      Keeping up with the twitter hashtag of screen shots on Saturday!
    19. i think i need to learn c# before doing that right ?
    20. duke_meister

      c# console snake game

      I thought I'd take up the challenge, seeing as Phil opted out This allows movement but doesn't yet eat the food. Nor does the snake get longer, etc. Want to take it up Phil? Or I'll finish it edit: where did my code colour coding go? using System; using System.Linq; using System.Threading; namespace ConsoleSnake { /// <summary> /// All code written by duke_meister (Valentino Rossi) /// except keyboard reading technique /// </summary> class Program { static int _origRow; static int _origCol; const int PlayfieldWidth = 100; const int PlayfieldHeight = 50; const int MillisecondsTimeout = 50; const int UpdateCell = 10; static readonly FieldVals[,] PlayField = new FieldVals[PlayfieldWidth, PlayfieldHeight]; static int _snakeBodyLen = 4; // not including head static SnakeDirs _snakeDir = SnakeDirs.Right; static readonly Pos FoodPos = new Pos(30, 20); static readonly Pos[] SnakeCells = { new Pos(14, 10), new Pos(13, 10), new Pos(12, 10), new Pos(11, 10), new Pos(10, 10) }; public class Pos { public int X { get; set; } public int Y { get; set; } public Pos(int x, int y) { X = x; Y = y; } } enum FieldVals { Empty, SnakeHead, SnakeBody, SnakeFood } enum SnakeDirs { Up, Right, Down, Left } static void Main(string[] args) { Console.Clear(); _origRow = Console.CursorTop; _origCol = Console.CursorLeft; for (var i = 0; i < PlayfieldWidth; i++) { for (var j = 0; j < PlayfieldHeight; j++) { PlayField[i, j] = (int) FieldVals.Empty; } } PlayField[ SnakeCells.First().X, SnakeCells.First().Y] = FieldVals.SnakeHead + UpdateCell; foreach (var snakeCell in SnakeCells.Skip(1).Take(4)) { PlayField[snakeCell.X, snakeCell.Y] = FieldVals.SnakeBody + UpdateCell; } PlayField[FoodPos.X, FoodPos.Y] = FieldVals.SnakeFood + UpdateCell; DrawBorder(); for (;;) { Thread.Sleep(MillisecondsTimeout); if (NativeKeyboard.IsKeyDown(KeyCode.Down)) { _snakeDir = SnakeDirs.Down; } else if (NativeKeyboard.IsKeyDown(KeyCode.Up)) { _snakeDir = SnakeDirs.Up; } else if (NativeKeyboard.IsKeyDown(KeyCode.Left)) { _snakeDir = SnakeDirs.Left; } else if (NativeKeyboard.IsKeyDown(KeyCode.Right)) { _snakeDir = SnakeDirs.Right; } UpdatePlayfield(); UpdateSnake(); } } static void UpdateSnake() { if (SnakeCells.First().Y < 1 || SnakeCells.First().X > PlayfieldWidth - 2 ||SnakeCells.First().Y > PlayfieldHeight - 2 || SnakeCells.First().X < 1) { EndGame(false); } CalculateSnakeBody(); } static void CalculateSnakeBody() { PlayField[SnakeCells.Last().X, SnakeCells.Last().Y] = FieldVals.Empty + UpdateCell; for (int i = SnakeCells.Length - 1; i > 0; i--) { SnakeCells[i].X = SnakeCells[i - 1].X; SnakeCells[i].Y = SnakeCells[i - 1].Y; } switch (_snakeDir) { case SnakeDirs.Up: --SnakeCells.First().Y; break; case SnakeDirs.Right: ++SnakeCells.First().X; break; case SnakeDirs.Down: ++SnakeCells.First().Y; break; case SnakeDirs.Left: --SnakeCells.First().X; break; } PlayField[SnakeCells.First().X, SnakeCells.First().Y] = FieldVals.SnakeHead + UpdateCell; foreach (var cell in SnakeCells.Skip(1).Take(4)) { PlayField[cell.X, cell.Y] = FieldVals.SnakeBody + UpdateCell; } } static void EndGame(bool win) { Console.Clear(); Console.WriteLine($"YOU {( win ? "WIN" : "LOSE")}"); Console.ReadKey(); Environment.Exit(0); } static void DrawBorder() { Console.SetWindowSize(PlayfieldWidth, PlayfieldHeight); WriteAt("+", 0, 0); WriteAt("+", PlayfieldWidth - 1, 0); WriteAt("+", 0, PlayfieldHeight); WriteAt("+", PlayfieldWidth - 1, PlayfieldHeight - 1); for (var i = 1; i < PlayfieldWidth - 1; i++) { WriteAt("-", i, 0); WriteAt("-", i, PlayfieldHeight - 1); } for (var i = 1; i < PlayfieldHeight - 1; i++) { WriteAt("|", 0, i); WriteAt("|", PlayfieldWidth - 1, i); } } static void UpdatePlayfield() { for (var i = 0; i < PlayfieldWidth; i++) { for (var j = 0; j < PlayfieldHeight; j++) { var val = PlayField[i, j] - UpdateCell; switch (val) { case FieldVals.Empty: WriteAt( " ", i, j); break; case FieldVals.SnakeHead: WriteAt("@", i, j); break; case FieldVals.SnakeBody: WriteAt("o", i, j); break; case FieldVals.SnakeFood: WriteAt(".", i, j); break; } } } } // From Microsoft sample protected static void WriteAt(string s, int x, int y) { try { Console.SetCursorPosition(_origCol + x, _origRow + y); Console.Write(s); } catch (ArgumentOutOfRangeException e) { Console.Clear(); Console.WriteLine(e.Message); } } } /// <summary> /// Codes representing keyboard keys. /// </summary> /// <remarks> /// Key code documentation: /// http://msdn.microsoft.com/en-us/library/dd375731%28v=VS.85%29.aspx /// </remarks> internal enum KeyCode { Left = 0x25, Up, Right, Down } /// <summary> /// Provides keyboard access. /// </summary> internal static class NativeKeyboard { /// <summary> /// A positional bit flag indicating the part of a key state denoting /// key pressed. /// </summary> const int KeyPressed = 0x8000; /// <summary> /// Returns a value indicating if a given key is pressed. /// </summary> /// <param name="key">The key to check.</param> /// <returns> /// <c>true</c> if the key is pressed, otherwise <c>false</c>. /// </returns> public static bool IsKeyDown(KeyCode key) { return (GetKeyState((int)key) & KeyPressed) != 0; } /// <summary> /// Gets the key state of a key. /// </summary> /// <param name="key">Virtual-key code for key.</param> /// <returns>The state of the key.</returns> [System.Runtime.InteropServices.DllImport("user32.dll")] static extern short GetKeyState(int key); } }
    21. Cool, now I understand. So baking reflection probe is basically just rendering it in 6 directions and just save it back on your HDD for further use, right? By the way I've sticked with Texassemble as you adviced and it works great. That's sufficient for my needs and as I'm using it through system("...") in my C++ code it works great. However I have problem with creating diffuse irradiance map. As reference I am using https://learnopengl.com/PBR/IBL/Diffuse-irradiance and https://github.com/TheEvilBanana/PhysicallyBasedRendering/blob/master/Game.cpp#L490. My map convolution looks not as it is supposed. I have black dot on every face. I use 2048x2048 which I render to 256x256 Texture2D and save each face which I then assemble. Below debug image. Up is +Y, Down is -Y, Middle is from the left -X, -Z, +X, +Z. What can I do to fix it? Also it looks like I am rendering same face twice somehow because +(plus) faces looks same like their -(minus) faces. Render to texture method: Vertex shader: Pixel shader:
    22. Looks fantastic from the video, awesome effort, you've made the best part of a lot of games from the late 90s in such a short time!! :) Can't wait to try it.
    23. kseh

      Dungeon Crawler Challenge

      Quest for the Ban Hammer Entry for Dungeon Crawler Challenge Objective Explore the Lounge basement for the Ban Hammer and return with it to the Lounge. Snail enemies rush the player throwing him into the air potentially knocking him into the water to his death. Use crystals to light your way and mark areas that you have explored. Objective is described by conversing with character in the Lounge level. Controls: Arrow Keys - Move Q - Jump W - Attack (only effective with weapon) Number keys - Interact / Pick up item I - Inventory D - Drop Esc - Menu / Pause Stationary Obstacles Darkness Water Items Various weapons (Ban Hammer, Long Sword, and Club give best range or effectiveness while Dagger has the lowest). Backpack (equip to carry multiple items) Light Crystals (3 kinds with different levels of illumination) Glasses (Illuminate the entire play area when equipped) Various clothing that is just decorative. A few miscellaneous objects placed in levels for decoration. Pixels (credit item drop from enemies with no way to spend or use) Gamedev.net Reference / Easter Egg GD.net logo used on sign to return to Lounge level. Some subtle content references. Known Bugs / Issues The Equipment / Inventory interface is a little quirky. Attempts to equip a weapon that's already in the PC's hand has been known to cause a crash. Drops by enemies are leaving a solid, invisible, collidable space. This space can be jumped over. Occasional crash that is difficult to reproduce which seems related to the collidable space left from enemy drops. Debug functionality needs to be disabled. Dagger and Short Sword weapons are very difficult to fight with. Not a bug as much as a design issue. Can only hold one item in hands at a time leaving no way to make use of a light and weapon at the same time. Backpack can be used to carry other stuff.
    24. Quest for the Ban Hammer Entry for Dungeon Crawler Challenge Objective Explore the Lounge basement for the Ban Hammer and return with it to the Lounge. Snail enemies rush the player throwing him into the air potentially knocking him into the water to his death. Use crystals to light your way and mark areas that you have explored. Objective is described by conversing with character in the Lounge level. Controls: Arrow Keys - Move Q - Jump W - Attack (only effective with weapon) Number keys - Interact / Pick up item I - Inventory D - Drop Esc - Menu / Pause Stationary Obstacles Darkness Water Items Various weapons (Ban Hammer, Long Sword, and Club give best range or effectiveness while Dagger has the lowest). Backpack (equip to carry multiple items) Light Crystals (3 kinds with different levels of illumination) Glasses (Illuminate the entire play area when equipped) Various clothing that is just decorative. A few miscellaneous objects placed in levels for decoration. Pixels (credit item drop from enemies with no way to spend or use) Gamedev.net Reference / Easter Egg GD.net logo used on sign to return to Lounge level. Some subtle content references. Known Bugs / Issues The Equipment / Inventory interface is a little quirky. Attempts to equip a weapon that's already in the PC's hand has been known to cause a crash. Drops by enemies are leaving a solid, invisible, collidable space. This space can be jumped over. Occasional crash that is difficult to reproduce which seems related to the collidable space left from enemy drops. Debug functionality needs to be disabled. Dagger and Short Sword weapons are very difficult to fight with. Not a bug as much as a design issue. Can only hold one item in hands at a time leaving no way to make use of a light and weapon at the same time. Backpack can be used to carry other stuff.
    25. My submission for the challenge. Pretty sure there's a number of issues I haven't yet found and there's a lot that needs improvement but the game is playable and winnable. Quest for the Ban Hammer Objective Explore the Lounge basement for the Ban Hammer and return with it to the Lounge. Snail enemies rush the player throwing him into the air potentially knocking him into the water to his death. Use crystals to light your way and mark areas that you have explored. Objective is described by conversing with character in the Lounge level. Controls: Arrow Keys - Move Q - Jump W - Attack (only effective with weapon) Number keys - Interact / Pick up item I - Inventory D - Drop Esc - Menu / Pause Stationary Obstacles Darkness Water Items Various weapons (Ban Hammer, Long Sword, and Club give best range or effectiveness while Dagger has the lowest). Backpack (equip to carry multiple items) Light Crystals (3 kinds with different levels of illumination) Glasses (Illuminate the entire play area when equipped) Various clothing that is just decorative. A few miscellaneous objects placed in levels for decoration. Pixels (credit item drop from enemies with no way to spend or use) Gamedev.net Reference / Easter Egg GD.net logo used on sign to return to Lounge level. Some subtle content references. Known Bugs / Issues The Equipment / Inventory interface is a little quirky. Attempts to equip a weapon that's already in the PC's hand has been known to cause a crash. Drops by enemies are leaving a solid, invisible, collidable space. This space can be jumped over. Occasional crash that is difficult to reproduce which seems related to the collidable space left from enemy drops. Debug functionality needs to be disabled. Dagger and Short Sword weapons are very difficult to fight with. Not a bug as much as a design issue. Can only hold one item in hands at a time leaving no way to make use of a light and weapon at the same time. Backpack can be used to carry other stuff.
    26. 8Observer8

      c# console snake game

      I ran your project but I do not see the snake head which moves to the right. I see three problems in your code: You need to call drawing from the Form1_Paint() method You do not call the Invalidate() method in the timer1_Tick() method You have too big offset for the snake head: Rectangle rect_green = new Rectangle(340 + x, 280 + y, 10, 10); Rectangle rect_black = new Rectangle(330 + x, 280 + y, 10, 10); Default size of windows is 300x300. I solved these problems: using System; using System.Drawing; using System.Windows.Forms; namespace SnakeByPhil_WinFormsGDI { public partial class Form1 : Form { public Form1() { InitializeComponent(); CenterToScreen(); } int x = 0, y = 0; private void Form1_Paint(object sender, PaintEventArgs e) { Graphics g = this.CreateGraphics(); SolidBrush greenBrush = new SolidBrush(Color.Green); SolidBrush blackBrush = new SolidBrush(Color.Black); Rectangle rect_green = new Rectangle(20 + x, 20 + y, 10, 10); Rectangle rect_black = new Rectangle(10 + x, 20 + y, 10, 10); g.FillRectangle(greenBrush, rect_green); g.FillRectangle(blackBrush, rect_black); greenBrush.Dispose(); g.Dispose(); } private void timer1_Tick(object sender, EventArgs e) { if (x >= 340) { x = 340; } x += 5; if (MouseButtons == MouseButtons.Left) { } Invalidate(); } } }
    27. Ok in this case there should probably be some maximum COC radius during the first pass to avoid that the bokeh's "dot pattern" (slide 38, left image) drifts too much apart for the 3x3 sampling in the second pass. Have not seen any max radius being mentioned in the slides, though. Thanks! I will take a look at this paper! So k is basically chosen based on half res dimensions and this max COC radius. I see. In this case the implementation is straightforward. I was a bit afraid there is another "diploma thesis" behind their "custom bilateral filter" ;-) Yeah you're so right, a LOT of room for interpretation. If I find out more I will definitely share it here. Yeah, just want to understand everything as detailed as possible and really appreciate the discussion. I am not here to deny somebody knowledge or skill. Thanks!
    28. Webellion

      Five Nations

      Five Nations is a real-time sci-fi strategy game for PC platforms, Switch, and mobile. Encompassing tactical combat in space in real-time mixed with micromanagement of economy, construction, and production, it will play both in single player and multiplayer modes. The RTS mechanics being custom-made to deliver action-packed gameplay. Gameplay You are a commander of one of the five greatest galactic empires in the far future Develop your space facilities, mining stations, factories, power plants, and research centers. Produce a gigantic armada of spacecraft to confront and destroy your rivals by applying shrewd strategies to outmaneuver their fleets. All this in real-time, by micromanaging your spaceships and structures through conventional RTS mechanics tailored to modern action-packed gameplay. Story In the near future, countries of the Earth are clustered in an international organization to create co-operation between states and prevent future wars. Aligning mankind under a common flag helped the economic and technological progress that paved the way for space conquest. During the colonization of the solar system, a group of pioneers discovered a wormhole that led to an unknown corner of the galaxy. Although the first attempt to enter the wormhole was deemed a complete success, the second expedition never returned... Join our Discord server and get Super Early Access https://discord.gg/uSSzUKs Social Media Facebook fan page: https://www.facebook.com/fivenationsthegame Instagram: https://instagram.com/fivenationsthegame GameJolt: https://gamejolt.com/games/fivenations/389358 Itch.io: https://webellionlimited.itch.io/five-nations Twitter: https://twitter.com/webellion
    29. duke_meister

      c# console snake game

      I don't think there's a problem using the console. I think it's an interesting challenge. Plus also haven't you already written the GDI one? ed: ok after a quick look, it doesn't seem that much fun. It's just too slow without some advanced console IO.
    30. Irusan, son of Arusan

      Question about making meshes for spritesheets

      You need to scale your quads to the actual pixel size of your screen. 1x1 in render space is not necessarily square on your screen.
    31. Updated 2/16/2019 Behaviour-Driven Development: 2014 - 10 - BDD in Action: Behavior-driven development for the whole software lifecycle - John Ferguson Smart. Source Code: https://www.manning.com/books/bdd-in-action Test-Driven Development: 2013 - 12 - The Art of Unit Testing: with examples in C# - 2nd Edition - Roy Osherove. Source Code: https://github.com/royosherove/aout2 Writing Games: 2010 - 06 - C# Game Programming: For Serious Game Creation. Source Code: 9781435455566.zip (121 MB) 2015 - 09 - Build your own 2D Game Engine and Create Great Web Games Using HTML5, JavaScript, and WebGL by Kelvin Sung, Jebediah Pavleas, Fernando Arnez, and Jason Pace. Source Code: https://github.com/apress/build-your-own-2d-game-engine 2017 - 10 - Pro HTML5 Games - 2nd Edition - A.R. Shankar. Source Code: https://github.com/apress/pro-html5-games-17 2018 - 04 - Unity in Action - 2nd Edition - J. Hocking. Source Code: https://www.manning.com/books/unity-in-action-second-edition Computer graphics: 2013 - 07 - WebGL Programming Guide - K. Matsuda, R. Lea. Source Code: https://sites.google.com/site/webglbook/ 2013 - 06 - Computer Graphics Principles and Practice - 3rd Edition - John F. Hughes, Andries van Dam, Morgan McGuire, David F. Sklar, James D. Foley, Steven K. Feiner, Kurt Akeley. Source Code: http://cgpp.net/about.xml Multiplayer: 2015 - 05 - Multiplayer Game Development with HTML5 - Rodrigo Silveira. Source Code: https://www.packtpub.com/code_download/21527 2015 - 10 - Multiplayer Game Programming - &nbsp;Josh Glazer, Sanjay Madhav. Source Code: https://github.com/MultiplayerBook/MultiplayerBook
    32. I will try to explain a process in step-by-step how to prepare server but it will be good if you will watch this video tutorial in parallel: Setup & Sending Files. Node.js Tutorial Guide At first test let's create a very simple server script locally that will write in the console terminal "client connected" when client will be connected to the server. You need to download and install Node.js: https://nodejs.org/en/download/ Create a folder for your project and go to the folder using CMD. Write this command in the console terminale to create package.json: npm init -y Install "socket.io" and "express" to a local "node_modules" folder. Enter the command for this: npm install --save socket.io express Now we are ready to write a simple server script and a client script. I use VSCode editor: https://code.visualstudio.com/ Open your prefered code editor. If you use VSCode you can run in the console terminal this command from your project folder: code . (you need note that it is "code" word and dot ".") Create two folders in your project: "server" and "client". Create the "server.js" file in the "server" folder. Create the "client.js" file in the "client" folder. Create the "index.html" file in the "client" folder. index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Multiplayer Snake</title> </head> <body> <h1>Hello, World</h1> </body> </html> Create the file: "app.js" in the root of your project: app.js var express = require("express"); var app = express(); var server = require("http").Server(app); app.get("/", function(req, res) { res.sendFile(__dirname + "/client/index.html"); }); app.use("/client", express.static(__dirname + "/client")); var port = 8080; server.listen(port); console.log("Server started. Port = " + port); You can run this script from the console terminal by the command: node app.js You will see a message: "Server started. Port = 8080" Write the address in the browser: localhost:8080 You will see "Hello, World" on the web page. Let's find "cnd socket.io" url in the Internet. Add this code to the index.html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.2.0/socket.io.js"></script> <title>Multiplayer Snake</title> </head> <body> <h1>Hello, World</h1> <script> var socket = io(); </script> </body> </html> Create a socket callback in app.js: app.js var express = require("express"); var app = express(); var server = require("http").Server(app); app.get("/", function(req, res) { res.sendFile(__dirname + "/client/index.html"); }); app.use("/client", express.static(__dirname + "/client")); var port = 8080; server.listen(port); console.log("Server started. Port = " + port); var io = require("socket.io")(server, {}); io.sockets.on("connection", function(socket) { console.log("socket connection"); }); Run the server: node app.js Write the address in the browser: localhost:8080 You will see the message "socket connection" in the console.
    33. I have a spritesheet that consist of seven 50x37 pixel frames. I'm rendering the image onto a 1x1 unit quad. This is one of the frames outside of my engine: Everything is animating correctly but he looks thinner in my engine: In order for my character to look the right proportions: I have to instantiate the quad mesh wider...since each frame is greater in width (50x37). const model = Model.IndexedQuad(1.3, 1); Only then everything looks great, still I eyeballed that 1.3 value. My questions: 1) Does this mean I have to make a quad for every sprite that has different dimensions? For example, if I have four 50x20 characters, and three 20x30 characters: I'd need two quads for those different sizes? Or should I use one 1x1 quad for all sprites and scale its transform relative to the frame size afterwards? Not sure how to do this though. It's easier for me to instantiate a mesh for different sizes, but doesn't that mean binding more meshes? 2) Again, I'm eyeballing the size of the quad, but is there a way I can calculate the right size of the quad in normalized units? Considering that my character is 50x37 (in pixels). Maybe dividing width/height. Oh and almost forgot to mention, I'm rendering each frame by passing a texture matrix to my shader. I'm not altering the uvs on the mesh. Thank you very much for reading, hope I made sense!
    34. Just make sure you give 'me' your top fan an exclusive rewards room.
    35. Simple enough feature, but I'm sure the rewards will be popular with players. Interesting reading how you got it working with a gamepad!
    36. chasedoesmusic

      Music composer and producer looking for feedback.

      Thanks so much for the feedback, Alec! I'll definitely keep what you've said in mind.
    37. phil67rpg

      c# console snake game

      well I have decided to take observers advice and work on a winform gdi+ snake game. I am able to make the snake head to move to the right in the screen. here is my code so far, I am just starting on my project. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace WindowsFormsApp2 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void Form1_Paint(object sender, PaintEventArgs e) { } int x = 0, y = 0; private void timer1_Tick(object sender, EventArgs e) { Graphics g = this.CreateGraphics(); SolidBrush greenBrush = new SolidBrush(Color.Green); SolidBrush blackBrush = new SolidBrush(Color.Black); Rectangle rect_green = new Rectangle(340 + x, 280 + y, 10, 10); Rectangle rect_black = new Rectangle(330 + x, 280 + y, 10, 10); g.FillRectangle(greenBrush, rect_green); g.FillRectangle(blackBrush, rect_black); if (x >= 340) { x = 340; } x += 5; greenBrush.Dispose(); g.Dispose(); if (MouseButtons == MouseButtons.Left) { } } private void Form1_MouseDown(object sender, MouseEventArgs e) { } } }
    38. That's a shame I really liked your take on the prior games you've done. Hopefully next challenge we can all finish. I had way too many things come up which made it hard to stick to a steady schedule, and I'm sure we all cannot devote 8 hours a day.
    39. Brain

      Mr Boom's Firework Factory

      Mr Boom's Firework Factory is a fast paced puzzle game written in Unreal Engine 4 with a combination of Blueprints and C++. Through many levels of mayhem, you'll discover the secret behind the firework factory. This game is approaching the point where a complete vertical slice can be submitted to various distributors such as steam. I welcome contributors, please note that this is a hobby project and there is at yet no agreement as to profit sharing etc.
    40. Hi everyone! Another week, another update to the development blog for Mr Boom's Firework Factory! The Easy Stuff: Creating the Stock Room This week, I have been creating a way to reward players for successfully completing levels. Every time a level is completed with a three star rating (the best possible rating) the game will route the player to the stock room on the completion of the level. The stock room is an enclosed area, containing some junk and six boxes. Selecting from the boxes will reward the player with one of the following: A random power-up Nothing (along with a condescending message) A booby prize, for example a burned cereal box. This new feature can be seen working in the video below: The booby prizes, if won, will just stack to an inventory, e.g. multiples are represented by "x2", "x3" etc. These can't be gotten rid of an have absolutely no use except cosmetic, so I can imagine that the player may find a way to meta-game this, and i may add an achievement relating to this if there is time before release. It is obvious on the video above that selecting boxes in the stock room is simple enough if the player is using a mouse and keyboard, simply clicking on a box will select it, and this is done effectively using the onclick events within blueprint on those particular components for the crates. The More Interesting Stuff: Making This Work With A Gamepad This becomes slightly more complex when dealing with a gamepad. Unreal Engine 4 has facilities when dealing with UMG for UI so that each control which can receive focus has a 'next' control for each direction, so if for example "Up" is pressed when focused on control A, it can be told that control B is "Up" in relation to it, and that control "B" should then receive focus. When dealing with an actor built with components, which is not UI, we're out of luck and have to implement this ourselves. Time to roll up our sleeves and see how I did this! Firstly, we must map out visually how each of the crates relate to each other. Consider that each crate has an index number between zero and five, and that for each crate index, we have a table of relations based on the direction of travel for which is "nearest" to it in that direction: So, for example, if the current crate was crate index 1 and we wanted to move up, then the crate index would become 0. Similarly if the crate index was 0 and we wanted to move right, the crate index would become 2. We can represent the currently selected crate then as a simple integer value. All clear on this? OK, let's continue! Based on this layout, we can click on each of the components in the actor, and set up these representations using the tags within the component, always sticking to a uniform layout, tag index 0 representing down, index 1 representing up, index 2 representing left, and index 3 representing right: Once all these have been defined, we have a way, completely within data, and without having to adjust code, of being able to indicate the relationship between the components so we can navigate between them. All we need to do now is write some code to do it. Firstly, we need a function which if given a a direction (as an integer) will update the current crate to a new crate, still going with the same constant directions as above, 0 = down, 1 = up, 2 = left, 3 = right. We'll call this function "Move Selection Cursor", because... well why not?: We will also need to define in the constructor, or in the Begin Play Event, the indices of each of the crates in a simple array (as a member variable of the actor class) which this function can use. Remember the order of the items in this array is important as we determined our layout in the first picture when we mapped out the relationships between the objects. If there were more objects or in different positions in relation to each other, this would need to be adjusted: Once we have done this, it is a simple matter to attach five events to action mappings, which will allow us to detect input events from the gamepad, and route them to the functions we have created. For readability's sake, we can also define four constants (see the top left in the green square) representing our index values for up, down, left, and right respectively, which means that the code becomes more understandable, rather than just a mass of magic numbers between 0 and 3: Once this is in place, as many before me have said, sometimes in jest and sometimes in seriousness, "it just works". I hope you found this journey into the depths of my mind enlightening, please do comment and leave feedback if you have any questions or comments! Stay tuned for more blog entries!
    41. Yesterday
    42. Alec Weesner

      Music composer and producer looking for feedback.

      Great stuff, I'm glad you're going to become a part of our small community, Chase! Like you said, I enjoyed the amount of variety in your songs. There was a new experience in each one. Here are some of my notes: - I think the aspect you should work on most is dynamics. Control the volume automation and velocity of each instrument over time in the song and your songs will go from okay to professional. - Try expanding the stereo width by adjusting panning. Songs like "Vertigo" and "Onward" are too mono for me. Take a look at a random song you like and see which instruments are panned where. Using panning creates excitement in the listener's ear. In conclusion, you should make an effort to create as much stereo width as possible. - Your piano tracks such as "I Opened My Eyes" and "The Edge" seemed to be drawn in a piano roll. I recommend recording your self playing to get a human performance. Even if you are not a great piano player, you can also adjust things later. I think my favorite is "Snowdrop". You presented your message without letting too much stuff get in the way. I wish you good fortune on your path to become a composer!
    43. That's the typical approach for generating reflection probes: render in 6 directions, each time rendering to a single face of the cubemap as the render target. It's not strictly necessary to create a cubemap in the end, it's just the most convenient format since there's dedicated hardware support.
    44. Using SV_SampleIndex in your pixel shader (or alternatively using the "sample" modifer on a pixel shader input attribute) will cause the PS stage to run at "sample rate" instead of "pixel rate" (note that it actually has to be used by the shader, and not optimized away). When running at sample rate, the pixel shader will be run for every sub-sample in the pixel. So if you have 4xMSAA enabled, you will end up with at least VPWidth * VPHeight * 4 pixel shader invocations. This allows you to output a unique value to every sub-sample, suitable for things like 4x super-sampling. Otherwise the pixel shader will be run once for every pixel regardless of the MSAA mode, and will output the same value to all sub-samples covered by the coverage mask (which is determined by testing if the triangle covers the sub-sample position). Another related feature is SV_Coverage, which lets you specify the bitwise coverage mask that should be used when outputting the pixel shader value to MSAA sub-samples. The value of SV_Coverage is AND'd with the coverage mask produced by the rasterizer before writing the PS output to the render target, which as an example can be used to only write a value to the first sub-sample of each pixel.
    45. Yes that's correct, I am calculating a Minimum Translation Vector and using it to move the objects out of collision so that they are resting against one another. What I would like to know is if the way in which I calculate this displacement vector is valid. As part of this calculation I look at each objects position to determine the direction of displacement. Is comparing positions like this a valid way of calculating the MTV or is it a flawed approach?
    46. I'm having a weird issue with what appears to be transparency, but I'm not sure exactly what's causing it. Parts of the mesh get hidden by other parts of the mesh that are supposed to be behind it, however it only happens at certain camera angles. Here is a brief video of that happening. The towers get hidden by the floor at certain angles of the camera. Here is some code from the rasterizer states and the mesh generation. D3D10_RASTERIZER_DESC rasterizerState; rasterizerState.CullMode = D3D10_CULL_BACK; rasterizerState.FillMode = D3D10_FILL_SOLID; rasterizerState.FrontCounterClockwise = false; //.... D3D10_BLEND_DESC BlendState; ZeroMemory(&BlendState, sizeof(D3D10_BLEND_DESC)); BlendState.BlendEnable[0] = TRUE; BlendState.SrcBlend = D3D10_BLEND_SRC_ALPHA; BlendState.DestBlend = D3D10_BLEND_INV_SRC_ALPHA; BlendState.BlendOp = D3D10_BLEND_OP_ADD; BlendState.SrcBlendAlpha = D3D10_BLEND_ZERO; BlendState.DestBlendAlpha = D3D10_BLEND_ZERO; BlendState.BlendOpAlpha = D3D10_BLEND_OP_ADD; BlendState.RenderTargetWriteMask[0] = D3D10_COLOR_WRITE_ENABLE_ALL; struct MeshVertex { XMFLOAT3 pos; XMFLOAT2 uv; }; //allocate space for the mesh MeshVertex* floorMesh = new MeshVertex[bmpWidth*bmpHeight]; //load the height map texture SoftwareBitmap::Bitmap heightMap(pathToHeightmap); int bmpHeight = heightMap.GetHeight(); int bmpWidth = heightMap.GetWidth(); //set vertecies in a grid and trasnfer height data to vertex's y value UCHAR* source_mem = (UCHAR*)heightMap.GetData(); for (int xdim = 0; xdim < bmpWidth; xdim++) { for (int zdim = 0; zdim < bmpHeight; zdim++) { float height = source_mem[xdim + zdim*heightMap.GetPitch()]; float color = (height)/ 255.0f; floorMesh[xdim + zdim*bmpWidth] = { XMFLOAT3((float)xdim, height , (float)zdim), XMFLOAT2(float(xdim)/ bmpWidth, float(zdim)/ bmpHeight)}; } } Any ideas why this might be happening?
    47. Hi, this is my submission for the challenge. Bad news first: The game is currently only playable on Linux - until I won the fight against Mingw32 and Python under Windows. Story The game takes place in a world which is infested by the curse of the daemon lord Ardor. Burning like a fire and spreading like a plague, the curse causes people to become greedy and grudging, some of them even turn into bloodthirsty monsters. By reaching out to reign supreme, the fire of Ardor burns its way into our world. The player is a nameless warrior who crested the silver mountain in order to enter Ardor's world and defeat him. To open the dimension gate, the player has to defeat a dungeon and obtain the soul stone that is hidden inside. During the game you won't confront the daemon himself, but obtain the soul stone from the dungeon and bring it to the wizard Randuras, the last resident of the doomed town at the top of the mountain. Engine The game uses a raycasting rendering engine, written by me, which is uses SDL2 for windowing, sound playback and texture loading. The rest is a lot of vector geometry and digging pixels. Gameplay The game is played in the first person perspective. You have a sword as a melee weapon and can cast fireball spells for far-ranged combat. There are three different enemy kinds: rats, black rats and ghosts. The enemies will chase you until you either kill them or they lose your trace. Rats and black rats drop meat. Ghosts don't drop items. Items: Health potion Mana potion Meat Mushroom 3 different keys Soul stone Additional Item: Gold (can be used to buy potions from the wizard) Audio Each scene has its own music track (CC0 - licensed tracks from opengameart.org). Each action in the game produces a sound (sword fighting, spell casting, enemies notice you, item pickup and consumption, etc...) GameDev.Net Reference / EasterEgg Screenshots Youtube Video Project Page / Download The download link can be found on the GameDev.net project page (currently only Linux 64 bit, Windows build will follow) Post-Mortem
    48. Hi, thanks for your reply. I recorded a video of the game (full playthrough, so spoilers ahead -- you'll probably notice that I know the dungeon layout...) and uploaded it to Youtube: The Windows version will have to wait...
    49. I see. There are some interesting considerations here, but since it's off topic, I'll just mention that if you want or need to pool vector objects, you could possibly make them static members of the 'Rectangle' class, or perhaps even implement a general-purpose pooling system (which might be preferable if you find yourself creating temporary vectors often). In any case, unless I'm missing something (which I may be), there's probably no need for them to be instance members. h8CplusplusGuru's response may include all the info you need, but regarding the rest of your post, it's not a given that you need to take velocity into account. It really just depends on the circumstances. In some contexts, a discrete test may be adequate. The only thing I'll mention with respect to tunneling (and you may have already thought of this) is that considering object dimensions and speed isn't necessarily sufficient; you may also need to ensure there's an upper bound on time deltas. Although I could be misinterpreting your code, it looks like you're essentially implementing a 'minimum penetration' algorithm, which is a valid way of resolving intersections, generally speaking. As discussed earlier, with this approach you can get 'wrong' results that are different than what a continuous test would return, but whether that's an issue or not is context-dependent (see earlier in the thread for some discussion on this).
    50. upallinsky

      My first OST | Feedback please

      Hello! Thank you very much. I am very glad to see your feedback. If you have any ideas how to do it better, I would like to hear it. I could give you a project and if you have some time, I would work with you. I understand that you probably don't have a time, but just 5 minutes and I would be very grateful)
    51. h8CplusplusGuru

      Axis Aligned Rectangle Collision Handling

      Here is the algo I used on a platformer recently. I am unsure if the following line is 100% correct as I haven't done as much testing as I'd like however it all seems to work just fine. Note that this only considers that the player has a velocity, not both objects. I haven't considered two velocities yet, though maybe this could be a starting point for you. if (xD < yD && xDV.y() ){} //unsure if this is the correct way to determine outcome The complete routine is as follows: void collisionCallback(btCollisionObject* obj1, btCollisionObject* obj2) { CollisionPhysics::CollisionObject* objA = static_cast<CollisionPhysics::CollisionObject*>(obj1->getUserPointer()); CollisionPhysics::CollisionObject* objB = static_cast<CollisionPhysics::CollisionObject*>(obj2->getUserPointer()); if (objB->getCollisionID() == COLLISION_IDS::ID_PLATFORM) std::swap(objA, objB); if (objA->getCollisionID() == COLLISION_IDS::ID_PLATFORM) { if (objB->getCollisionID() == COLLISION_IDS::ID_PLAYER) { //a collision between these two objects has occured //platform collides with player, uncollide player; GameObject* player = dynamic_cast<GameObject*>(objB); PlatformObject* platform = dynamic_cast<PlatformObject*>(objA); btBox2dShape* playerBox = dynamic_cast<btBox2dShape*>(player->getCollisionObject()->getCollisionShape()); btVector3 playerHalf = playerBox->getHalfExtentsWithoutMargin(); btBox2dShape* platformBox = dynamic_cast<btBox2dShape*>(platform->getCollisionObject()->getCollisionShape()); btVector3 platformHalfNoMargin = platformBox->getHalfExtentsWithoutMargin(); btVector3 platOrigin = platform->getTransform().getOrigin(); btVector3 playerOrigin = player->getTransform().getOrigin(); // determine what quadrant the player object is in compared to the platform btScalar polarityX = 1; btScalar polarityY = 1; btVector3 playerVel = player->getVelocity(); btVector3 platformQuadrantPoint(0, 0, 0); if (playerVel.y() > 0) { //going up platformQuadrantPoint.setY( platOrigin.y() - platformHalfNoMargin.y() ); polarityY = 1; } else {//going down platformQuadrantPoint.setY( platOrigin.y() + platformHalfNoMargin.y() ); polarityY = -1; } if (playerVel.x() > 0) { platformQuadrantPoint.setX( platOrigin.x() - platformHalfNoMargin.x() ); polarityX = 1; } else { platformQuadrantPoint.setX( platOrigin.x() + platformHalfNoMargin.x() ); polarityX = -1; } //now get both possible outcomes and then determine which one is correct btVector3 theoreticalPositionY, theoreticalPositionX; btVector3 playerPrevOrigin = playerOrigin - playerVel; //come up with y-edge position //we know the desired y-coord: btScalar y = platformQuadrantPoint.y() - polarityY * playerHalf.y(); btScalar m = 0; if (playerVel.x() != 0) m = (playerVel.y() / playerVel.x()); btScalar x = 0; if (playerVel.x() != 0 && m) x = (y - playerPrevOrigin.y()) / m + playerPrevOrigin.x(); else x = playerOrigin.x(); theoreticalPositionY = btVector3(x, y, 0); //now come up with x-edge position //we know the desired x-coord: x = platformQuadrantPoint.x() - polarityX * playerHalf.x(); if (playerVel.y() != 0 && m) y = m * (x - playerPrevOrigin.x()) + playerPrevOrigin.y(); else y = playerPrevOrigin.y(); theoreticalPositionX = btVector3(x, y, 0); btScalar deCollide = 0.5f; //get distance to each theorypoint, the furthest btVector3 xDV = (theoreticalPositionX ) - playerPrevOrigin; btVector3 yDV = (theoreticalPositionY ) - playerPrevOrigin; btScalar xD = xDV.length(); btScalar yD = yDV.length(); btVector3 finalPosition; if (xD < yD && xDV.y() ) { finalPosition = theoreticalPositionX - btVector3(polarityX* deCollide, 0, 0); player->stopX(); } else { finalPosition = theoreticalPositionY - btVector3(0, polarityY * deCollide, 0); if (polarityY > 0) { player->startFalling(); } else { player->stopFalling(); } player->stopY(); } btTransform trans; trans.setIdentity(); trans.setOrigin(finalPosition); player->setTransform(trans); } } } Let me know if this is useful and you have any questions or come up with a two-velocity method.
    52. nsmadsen

      My first OST | Feedback please

      Hey, Thanks for sharing this for feedback! Some ideas: - Your trombone crescendo patch gets pretty tiresome after a while. I'd change that much sooner as you're giving the listener about a solid minute of having that repeat over and over. - Your piece lacks a defined melody. Instead it's a several segmented grooves or ideas. Until about 2:08. And now that same issue you had with the trombone crescendo repetition is now happening with your violin patch. - I think you can transition from segment to segment in a bit better method and manner. There's some good ideas but you just have to be careful not to make these so repetitive that they begin to annoy your player/listener. Also in your mix I'm not hearing a cohesive sound. Some instruments are pretty dry while others have a lot of reverb on them and this destroys the sense of space and environment of the actual recording itself. Finally, this track wouldn't work "as-is" if you wanted it to loop. I'd work on that a bit more. To me it feels like you could split these track up a bit more into smaller themes and really spend some time developing them. I hope that helps! Thanks, Nate
    53. Yes, these variables are member variables so that I do not instantiate new vectors each time the resolveCollision() function is called, which may be many times per frame. It is for performance reasons. I do not understand what you mean about the need to take velocity into account. Would you please expand on that? Yes that's right I do handle collisions discretely, they are resolved after the collisions have already occurred. In terms of potential object tunneling this is not a problem for me as if it does occur I will adjust the objects dimensions and speed so that it does not. Is my approach to resolving collisions flawed or is it acceptable? I'm not sure if it is a problem but I have a feeling that taking the objects positions into account to determine the direction of displacement out of collision is wrong somehow or a bad way of doing it. It works of course but is it "proper"?
  • 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!