All Blog Entries

All blog entries, ordered from most recent. Entry count: 1059.

Pages: > 1 2 3 4 ... 133 >

# Visual C++: IntelliSense Versus Macros

21:48
Thu
17
Aug 2017

When you code in C++ using Visual Studio, you may meet following problem: Your code uses preprocessor directives that depend on some macro that is defined elsewhere, e.g. in one of CPP files including the header file you write, and so IntelliSense gets lost and stops working, or even completely grays out that part of your code as inactive. For example:

// Some code...

#ifdef EXTERNALLY_DEFINED_MACRO

// Some code where IntelliSense stops working...

#endif

I just found a solution to that. It turns out there is a special macro predefined when code is processed by Visual Studio IntelliSense. It's called just __INTELLISENSE__. By using it, you can change parts of your code as seen by IntelliSense parser, e.g. define some macros, without influencing logic seen by the compiler. For example:

#ifdef __INTELLISENSE__
#define EXTERNALLY_DEFINED_MACRO
#endif

// Some code...

#ifdef EXTERNALLY_DEFINED_MACRO

// Some more code where IntelliSense is working again...

#endif

Comments | #c++ #visual studio Share

# Understanding Vulkan objects

18:27
Mon
07
Aug 2017

An important part of learning the Vulkan® API – just like any other API – is to understand what types of objects are defined in it, what they represent and how they relate to each other. To help with this, we’ve created a diagram that shows all of the Vulkan objects and some of their relationships, especially the order in which you create one from another.

Read more: Understanding Vulkan objects @ GPUOpen

Comments | #graphics #vulkan Share

# Few organizational advice for game jams

22:38
Wed
02
Aug 2017

I have participated in Slavic Game Jam 2017. I would like to share few thoughts that came to my mind during the event and especially during presentations.

Participation in a game jam is like any gamedev project, just on a small scale. All the rules of a successful gamedev project apply. All the rules of doing a software project apply. You need a good idea for a game, so any method of coming up with ideas (like brainstorming) may help. You need the code, so good programming practices apply as well, so you can implement features fast and not drown in spaghetti code or hard to fix bugs in the middle of the project. Experience in game design and level design is useful. Skill in making good game graphics and sound is essential as well. Some project management is needed too. Even the wisdom about work-life balance apply, because having too little sleep makes you less productive the other day (coffee or energy drinks can help a little bit though :)

There are many books about these topics. What I would like to focus on here is something different - some basic organizational things that can have decisive influence on your performance during the jam. Even if you are a great game developer, you won't deliver a good game (or win, if there is a competition) if you fail on some of these basic topics. They are related to both development process, as well as presentation on a big screen.

1. Come prepared. I don't mean making a game in advance and only adjusting it to the theme during the jam. I mean setting up some basic software environment. If you already have your team, or at least some friends who you plan to team up with, meet together before the jam, decide what technologies and tools you are going to use and set them up. This will save you a lot of time during the event.

2. Take as much hardware and cables with you as you can. You never know what you or other team members may need.

3. Finish early. It doesn't mean you need to stop polishing your game long before the deadline. It means you should strive to have a playable game many hours before the deadline, test it as early and as often as possible, and make first build that you could potentially submit at least one hour before the time is up. Maybe you will crunch and apply critical fixes and improvements to your game in the last moment, but your shouldn't count on that. Maybe the organizers will extend deadline by additional hour, but you shouldn't rely on that either. Even something as silly as compressing your game build to a ZIP file on an old laptop can take unexpectedly long time and make you miss the deadline. If you need to upload the game somewhere on the Internet, keep in mind that everyone is going to do this at the same time, so the transfer may be very slow.

4. Focus on making your game looking good during the few-minutes presentation of you playing it. That's how the game will be seen and judged. Making it fun to play for others or fun to play for many hours is a secondary goal. Of course I don't mean cheating like preparing a prerecorded video. I just mean that you don't need to have 20 levels. It's OK to have enough gameplay for just few minutes, like only a single level. It's even better when the game is fast paced and can be finished during the presentation. You may also cheat just a little, like make a keyboard shortcut for invincibility, advancing to next level or showing final credits screen.

5. Make your game easy to remember and recognize. Sophisticated or generic name and content will make people forget about it. Even if there is a list and an order of presenting games, there is often some chaos happening during presentations. Some games have technical difficulties, some teams just give up, and so viewers may be confused about which game is which. If you design your whole game around a single, simple theme (like "a butterfly") and include it everywhere: in game title, logo/menu screen, and in the graphics visible during gameplay, then everyone will be able to easily identify it and so to vote for it. You want them to later say "I liked that game about the butterfly."

6. Give your game build folder/archive some meaningful name. It should contain the title of your game, possibly the name of your team and preferably some ordinal version number. I've seen game builds called "Build.zip". That's a very bad idea. I know that for you this is a build of THE game, but for others it's just one of the games and so they need to be able to easily identify which one is it. (BTW Same rule applies to the file with your resume that you send to potential employers - don't call it "CV.pdf" :) On the other hand, version number is for you. Believe me, there will be more than one version. Calling any of these "final" is not a good idea, because you will end up with "final final", "really final" etc. :) So it's better to call your game build something like "TeamName - GameTitle v01.zip".

7. Prepare your game for difficult technical conditions during presentation. I've written separate blog post about shapes and colors that you should use: 3 Rules to Make You Image Looking Good on a Projector. Here I would like to add that you should test your game on various resolutions. Projectors tend to have small resolutions. You can also meet problems with sound (too quiet or not working at all), so make sure your game is attractive even without it.

8. Use some margin when displaying things on the screen. It is also known as "safe area". In other words, don't put critical information (like GUI elements) near the edges of the screen. It may happen that the projector is not setup correctly and your image will be cropped, making these things invisible. Same applies to time domain as well as to spatial domain: Don't show important content during first three seconds of your game. Leave some "time margin". Projector may need some time to switch to new source and resolution, so viewers may not be able to see the beginning of your game.

9. Control sound volume of your game. If you learned a little bit about giving speeches, you probably know already that you should speak loudly, slowly and clearly. When you present a game, there is another level of difficulty, because the music and sound effects from your game are played at the same time as you speak. Be aware of how loud they are so that viewers can hear them, but also can hear you speaking.

10. Remove all the distractions that your operating system may experience during the presentation. Receiving notification about incoming Skype call in the middle of your presentation would look funny, but it definitely won't increase your chances to win. Same applies to Windows deciding to install new updates in the worst possible moment on antivirus slowing down your system because it just started to scan your entire hard drive. So for the presentation:

11. Finally, prepare for your talk. Decide who is going to talk and who is going to play the game. Consider how long the presentation should be. Determine what do you want to show, what to tell and in what order. Don't do it spontaneuisly, but rather think about the presentation in advance and discuss it with your team.

Comments | #competitions #events Share

# Thoughts after Slavic Game Jam 2017

21:49
Sun
30
Jul 2017

Slavic Game Jam 2017 ended today. I have not only given a talk as a representative of the sponsor company, but I was also allowed to participate in the jam itself, so I teamed up with my old friends, some new friends that I met there and we made a game :) The theme this year was "Unknown". Our idea was to create a game about a drone flying and exploring a cave. You can see it here: This Drone of Mine.

Screenshot:

There were 2 developers in our team, 3 graphical artists and one sound/music artist. We decided to use Unreal Engine 4, despite we had no previous experience in making games with this engine whatsoever, so we needed to learn everything during the jam. We didn't do any C++ - we implemented all game logic visually using Blueprints. We also set up Perforce for collaboration, so some of us needed to learn that as well (I am fortunate to already know this tool pretty well).

We didn't win or even make it to the second round, but it's OK for me - I'm quite happy with the final result. We more or less managed to implement our original idea, as well as show almost all the graphics, sound effects, music and voice-overs, so the artists' work is not wasted. It was lots of fun and we learned a lot during the process.

You can browse all games created during the jam here: Slavic Game Jam 2017 - itch.io.

Comments | #unreal #productions #competitions #events Share

# Slavic Game Jam 2017 and my talk

12:40
Wed
26
Jul 2017

There are many game jams all around the world. Global Game Jam is probably the biggest and most popular one, but it is a global event that happens at different sites. This weekend Slavic Game Jam takes place - the biggest game jam in Eastern Europe, happening in just one site in Warsaw, Poland.

I will be there not only as a participant, but I will also give a talk, because AMD is a sponsor of the event. My talk will be on Friday at 2 PM. Its title is "Rendering in Your Game - Debugging and Profiling". I will provide some basic information and show some tools useful for analyzing performance of a game, including live demo. This information may be useful no matter if you develop your own engine or use existing one like Unity or Unreal. If you have a ticket for the event (tickets are already sold out), I invite you to come on Friday earlier than for the official start of the jam.

Comments | #teaching #events #competitions #graphics Share

# Vulkan Memory Allocator - a library on GPUOpen & GitHub

13:03
Tue
11
Jul 2017

Vulkan is hard. One of the difficulties is the responsibility of a developer to manually manage GPU memory. Various GPU vendors expose various set of memory heaps and types and you need to choose right ones. It is also recommended to allocate larger memory blocks and assign parts of them to individual buffers and images. Now there is a library that simplifies these tasks - a one that I developed as part of my job duties. It has just been announced on GPUOpen blog and published on GitHub:

It is a single-header C++ library with a simple C Vulkan-style interface documented using Doxygen-style comments. It is available on MIT license.

Comments | #graphics #vulkan Share

# Vulkan Bits and Pieces: Synchronization in a Frame

21:15
Mon
15
May 2017

One of the things that you must implement when using Vulkan is basic structure of a rendering frame, which consists of filling a command buffer, submitting it to a command queue, acquiring image from swap chain and finally presenting it (order not preserved here). Things happen in parallel, as GPU works asynchronously to the CPU, so you must explicitly synchronize all these things. In this post I’d like to present basic structure of the rendering frame, with all necessary synchronization.

There are actually two objects that we must take care of simultaneously. First is command buffer. One time it is being filled on the CPU by using vkBeginCommandBuffer, vkEndCommandBuffer and everything in between (like starting render passes and posting all the vkCmd* commands). Another time (after being submitted to a queue using vkQueueSubmit) it waits for execution or it is being executed on the GPU. These things cannot happen at the same time, so we need synchronization. Because it’s a GPU-to-CPU synchronization, we use fence for that. It’s better to have multiple command buffers and all these synchronization objects, stored in array and used in a round-robin fashion (with help of index variable) because this way one can be filled while the other one is consumed at the same time.

Second object is an image acquired from the swapchain. One time it is being rendered to during command buffer execution. Another time it is presented on the screen. Again, we need to synchronize it so these states happen in a sequence. Because it’s a GPU-to-GPU synchronization, we use semaphores for that. There are multiple images as well because swapchain consists of several of them (not necessarily used in round-robin fashion, we need to obtain index of a new image using vkAcquireNextImageKHR function, so there is separate imageIndex).

Having following objects already initialized:

VkDevice g_Device;
VkQueue g_GraphicsQueue;
VkSwapchainKHR g_Swapchain;
VkImageView g_SwapchainImageViews[MAX_SWAPCHAIN_IMAGES];

const uint32_t COUNT = 2;
uint32_t g_NextIndex = 0;
VkCommandBuffer g_CmdBuf[COUNT];
VkFence g_CmdBufExecutedFences[COUNT]; // Create with VK_FENCE_CREATE_SIGNALED_BIT.
VkSemaphore g_ImageAvailableSemaphores[COUNT];
VkSemaphore g_RenderFinishedSemaphores[COUNT];

Structure of a frame may look like this:

uint32_t index = (g_NextIndex++) % COUNT;
VkCommandBuffer cmdBuf = g_CmdBuf[index];

vkWaitForFences(g_Device, 1, &g_CmdBufExecutedFences[index], VK_TRUE, UINT64_MAX);

VkCommandBufferBeginInfo cmdBufBeginInfo = { VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO };
cmdBufBeginInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
vkBeginCommandBuffer(cmdBuf, &cmdBufBeginInfo);

// Post some rendering commands to cmdBuf.

uint32_t imageIndex;
vkAcquireNextImageKHR(g_Device, g_Swapchain, UINT64_MAX, g_ImageAvailableSemaphores[index], VK_NULL_HANDLE, &imageIndex);

// Post those rendering commands that render to final backbuffer:
// g_SwapchainImageViews[imageIndex]

vkEndCommandBuffer(cmdBuf);

vkResetFences(g_Device, 1, &g_CmdBufExecutedFences[index]);

VkPipelineStageFlags submitWaitStage = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT;
VkSubmitInfo submitInfo = { VK_STRUCTURE_TYPE_SUBMIT_INFO };
submitInfo.waitSemaphoreCount = 1;
submitInfo.pWaitSemaphores = &g_ImageAvailableSemaphores[index];
submitInfo.pWaitDstStageMask = &submitWaitStage;
submitInfo.commandBufferCount = 1;
submitInfo.pCommandBuffers = &cmdBuf;
submitInfo.signalSemaphoreCount = 1;
submitInfo.pSignalSemaphores = &g_RenderFinishedSemaphores[index];
vkQueueSubmit(g_GraphicsQueue, 1, &submitInfo, g_CmdBufExecutedFences[index]);

VkPresentInfoKHR presentInfo = { VK_STRUCTURE_TYPE_PRESENT_INFO_KHR };
presentInfo.waitSemaphoreCount = 1;
presentInfo.pWaitSemaphores = &g_RenderFinishedSemaphores[index];
presentInfo.swapChainCount = 1;
presentInfo.pSwapchains = &g_Swapchain;
presentInfo.pImageIndices = &imageIndex;
vkQueuePresentKHR(g_GraphicsQueue, &presentInfo);

At least that’s what I currently believe is the correct and efficient way. If you think I’m wrong, please leave a comment or write me an e-mail.

That’s just one aspect of using Vulkan. There are still more things to do before you can even render your first triangle, like transitioning swapchain image layout between VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL and VK_IMAGE_LAYOUT_PRESENT_SRC_KHR.

Comments | #vulkan #graphics Share

# Artykuł: Praca zdalna - 10 faktów i mitów

19:44
Mon
01
May 2017

(Polish) Dziś Święto Pracy. Z tej okazji publikuję artykuł, który ostatnio napisałem, tym razem w języku polskim. Opisałem w nim, na podstawie mojego doświadczenia, zalety i wady pracy zdalnej. Rozmawiając ze znajomymi słyszę nieraz różne opinie na temat pracy z domu, spośród których nie wszystkie są prawdziwe. To zachęciło mnie do napisania tego artykułu:

» Praca zdalna – 10 faktów i mitów

(English) This time I publish an article I've written in Polish. Its title can be translated as "Remote Work - 10 Facts and Myths".

Comments | #productions #life Share

Pages: > 1 2 3 4 ... 133 >

STAT NO AD
[Stat] [STAT NO AD] [Download] [Dropbox] [pub] [Mirror]
Copyright © 2004-2017