Jump to content
  • Advertisement
    1. Past hour
    2. This is what I thought as well, I have done some tests and I also think this is how it works.. but I copied the code from stack exchange, so I do not really understand why it works. I think that there is just a problem in my logic not setting true after completing, so in some it is resolving false when I think it should be true. No not really. I have only been coding for about a week, and learning from a book called "The C# Players Guide". I am using the free visual studio and if I press f5 and there is an error I can see some issues in the log thing. I do not know about breakpoints and stuff though or how to "watch" variables or w/e. I assume the book just hasn't gotten to that stuff yet. This looks like it also works.. I did a test but I do prefer the simple format of the other way, now I know it actually functions as I thought it would. I've edited the OP Title to include that I am, indeed, talking about C#
    3. Yesterday
    4. Hey there, I've finished a new project and wanted to post it here as I think it's the best thing I've ever done, thanks so much for your time
    5. babaliaris

      Textures, some work and some doesn't???

      Forcing stb_load to use 4 channels solved the problem but why the code below does not work? What I'm doing is checking if division by 4 is an integer. If it's not an integer the do alignment by 1 else do alignment by 4. Texture::Texture(std::string path, bool trans, int unit) { //Reverse the pixels. stbi_set_flip_vertically_on_load(1); //Try to load the image. unsigned char *data = stbi_load(path.c_str(), &m_width, &m_height, &m_channels, 0); //If the size of each row is not divideable by 4 // then use alignment of 1. float check = (m_width*m_channels) / 4.0f; if (check != ceilf(check)) { std::cout << "working" << std::endl; glPixelStorei(GL_UNPACK_ALIGNMENT, 1); } //If it is divideable by 4, use alignment of 4. else glPixelStorei(GL_UNPACK_ALIGNMENT, 4); //Image loaded successfully. if (data) { //Generate the texture and bind it. GLCall(glGenTextures(1, &m_id)); GLCall(glActiveTexture(GL_TEXTURE0 + unit)); GLCall(glBindTexture(GL_TEXTURE_2D, m_id)); //Not Transparent texture. if (m_channels == 3) { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, m_width, m_height, 0, GL_RGB, GL_UNSIGNED_BYTE, data)); } //Transparent texture. else if (m_channels == 4) { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_width, m_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data)); } else { throw EngineError("UNSUPPORTEWD"); } //Texture Filters. GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); //Generate mipmaps. GLCall(glGenerateMipmap(GL_TEXTURE_2D)); } //Loading Failed. else throw EngineError("The was an error loading image: " + path); //Unbind the texture. GLCall(glBindTexture(GL_TEXTURE_2D, 0)); //Free the image data. stbi_image_free(data); }
    6. babaliaris

      Texture mapping acts weird on some images.

      @Cararasu please take a look on this thread too. Lets have a conversation there as well. I just solved it by forcing 4 channels to be used but I would like to ask you something else too. I'm going to post right now in that thread.
    7. Cararasu

      Texture mapping acts weird on some images.

      Well if you use 4 channels then the size of one row is always divisible by 4 so there can be no issue because of weird line-sizes. An issue might appear if the data pointer returned by "stbi_load" is not divisible by 4. I do not know if stb guarantees a certain alignment, but I would be very surprised if you ever get a pointer that is not at least divisible by 4. So yeah you should be safe when always using 4 channels. Additionally, I think most hardware does not store RGB images tightly. They will leave space for a fourth value because of (surprise surprise) 4-byte alignment. That means you do not lose anything in terms of GPU-memory when using RGBA over RBG. I am not 100% certain about this, so if there is anyone who has more in-depth knowledge feel free to enlighten me😉
    8. You should probably mention the progamming language used somewhere in the post. It looks like it's C#, so I'll assume that. With the given example, I think draw will be true if every element of isSlotTaken is a bool with the value true. This sounds like a problem you should look into using a debugger -- are you familiar with debugging techniques? Breakpoints, etc.
    9. babaliaris

      Texture mapping acts weird on some images.

      Thank you so much! That was the issue! Just from curiosity, instead of glPixelStorei(GL_UNPACK_ALIGNMENT, 1) if I always force stb image to use 4 channels (no matter how many channels the source file might have) because RGBA is 4 bytes, will this ever be problematic? In my case now it's working and I can see the image being rendered just fine.
    10. If you want to cycle through an array it's pretty easy, you can use for loops, or foreach. For example, if you need to check all values in the array to be true then you would do something like this: bool allValuesTrue = true; for (int a = 0; a < array.length; a++) { if (array[a].status == false) { allValuesTrue = false; // Code to exit loop } } The second something isn't true there is zero point in checking the rest if you need all to be true, and you can safely exit out. Also when posting code questions, please indicate the language you're using.
    11. Cararasu

      Texture mapping acts weird on some images.

      No that's not OpenGL ES. I just looked it up and it seems that the 4-byte alignment rule also affects normal OpenGL even though it is not mentioned directly in the description of glTexImage2D. The problem seems to be a common one. They even put it inside the common mistakes section of the OpenGL-wiki: https://www.khronos.org/opengl/wiki/Common_Mistakes#Texture_upload_and_pixel_reads To fix the issue either make sure that the alignment of each row is always 4 bytes. or call glPixelStorei(GL_UNPACK_ALIGNMENT, 1) before glTexImage2D. The problem with changing the alignment rules is that uploading the texture can be slower than if the alignment is not 4-bytes.
    12. Hi there... I am having a issue in C# with checking if all the values in a array are True... I'm getting strange behaviour... so I wanted to ask to make sure this code is correct.. or if there is a deeper problem with my logic after this test happens... // Check for Draw bool draw = isSlotTaken.All(x => x); if (draw) { rungame = false; winner = "Draw"; } Will that IF STATEMENT resolve is every single value in the bool isSlotTaken is set to true? Thanks!
    13. babaliaris

      Texture mapping acts weird on some images.

      glGetString(GL_VERSION) reports: 3.3.13541 Core Profile Context 24.20.13019.1008 How can I see if it is OpenGL ES? Does the above information says that I'm using regular openGL?
    14. Cararasu

      Texture mapping acts weird on some images.

      Are you by any chance using OpenGL ES? In that case, take a look at the documentation of glTexImage2D. Especially the sentence That means after every row the pointer is rounded up to be divisible by 4. The images from the explosion are exactly 480 pixels wide. Every pixel has 3 color values, which means 480*3 = 1440 bytes, which is divisible by 4. So no adjustment. The image of the arrows is 115 pixels wide. This makes 115*3 = 345 bytes per line. OpenGL will then pad it by 3 bytes effectively skipping 1 pixel. So the second line will look 1 pixel shifted. The third line will look 2 pixels shifted. I have already mentioned it but I think you have missed it. If you look at the rendered image you will see 93 pixels missing from the last line, which is the height of the image. If you load an image with 4 components the size of each line is trivially divisible by 4 which means no adjustments. Curiously enough this alignment of rows seems to be only part of the OpenGL ES standard and not the normal OpenGL.
    15. InterlockedOr requires shader model 4.0, don't know what you mean by texture UAV. Although I found a perfect solution for my specific case. I can just use additive blending among the shadows being drawn in the same batch because they are all created by different lights, which will create the same result as using bitwise OR 1 + 2 = 1 | 2 = 3, however if the bit is already set 2 + 2 ≠ 2 | 2 = 2 It will still need to sample the shadows from other characters and check if the bit is already set, if that's the case it should return 0 (add 0), otherwise, return light bit for the shadow.
    16. CSharpCoder

      HLSL - Additive blending

      You need to set a BlendState for this, the following code adds the two colors together and calculates alpha as source * 1 + destination * 0, the result will of course be source. BlendState additiveColorBlendState = new BlendState { ColorBlendFunction = BlendFunction.Add, ColorSourceBlend = Blend.One, ColorDestinationBlend = Blend.One, AlphaSourceBlend = Blend.One, AlphaDestinationBlend = Blend.Zero, AlphaBlendFunction = BlendFunction.Add };
    17. JWColeman

      Texture mapping acts weird on some images.

      I'm really not certain, and as for the gimp images, I'm pretty sure they are rgba, could be wrong though. Like I said, I'm really no pro when it comes to the inner workings of this stuff, and fortunately, it looks as if you've pretty much solved your problem. Maybe someone with more experience can chime in and thoroughly explain why its behaving this way.
    18. babaliaris

      Texture mapping acts weird on some images.

      Well, how do you explain then the gimp images. They have 3 channels too and they work without the need to force 4 channels. Also in my code, if the file has only 3 channels i'm telling the driver through the glTexImage2D function to handle the data as rgb not rgba. And if 4 as rgba.
    19. JWColeman

      Texture mapping acts weird on some images.

      Well, likely, my best guess, is that stbi_load is putting something other than a null value in the A channel when its not present, therefore your shader handles it normally.
    20. babaliaris

      Texture mapping acts weird on some images.

      Yes, with the ones from paint which was causing the problem. These images have 3 channels (according with stb_image when i don't force how many channels to be used).
    21. JWColeman

      Texture mapping acts weird on some images.

      It worked with the old image?
    22. babaliaris

      Texture mapping acts weird on some images.

      I tried to force how many channels to use in stbi_load() and it worked! Now from your expirience do you now why this might have fixed that? The files have 3 channels only. The code: Texture::Texture(std::string path, int unit) { //Try to load the image. unsigned char *data = stbi_load(path.c_str(), &m_width, &m_height, &m_channels, 4); m_channels = 4; std::cout << m_channels << std::endl; //Image loaded successfully. if (data) { //Generate the texture and bind it. GLCall(glGenTextures(1, &m_id)); GLCall(glActiveTexture(GL_TEXTURE0 + unit)); GLCall(glBindTexture(GL_TEXTURE_2D, m_id)); //Not Transparent texture. if (m_channels == 3) { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, m_width, m_height, 0, GL_RGB, GL_UNSIGNED_BYTE, data)); } //Transparent texture. else if (m_channels == 4) { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_width, m_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data)); } //This image is not supported. else { std::string err = "The Image: " + path; err += " , is using " + m_channels; err += " channels which are not supported."; throw VampEngine::EngineError(err); } //Texture Filters. GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); //Generate mipmaps. GLCall(glGenerateMipmap(GL_TEXTURE_2D)); } //Loading Failed. else throw VampEngine::EngineError("There was an error loading image \ (Myabe the image format is not supported): " + path); //Unbind the texture. GLCall(glBindTexture(GL_TEXTURE_2D, 0)); //Free the image data. stbi_image_free(data); }
    23. I'm what you might consider a "casual prosumer" when it comes to commenting. I comment important stuff, but only if the code isn't written in a self-explanatory way. Which is why I've also adapted a really simple and descriptive naming scheme and done away with any and all notation systems. That being said, there are occasions where I want to either document a whole system of code or provide a summarized walk-through on a per-function basis. This is where I find myself in a frustrating spot since none of the solutions on the market seem to be quite for what I want. So I figured I'd list things I want to achieve and what I want to avoid in hopes that I'm either not familiar with something or perhaps am simply not configuring stuff properly. I'm willing to pay for a good solution. The dream wish list of things I want and need: full documentation generation, a la Doxygen a non-verbose (lightweight) and non-monolithic style non-XML style markup (eg the way Natural Docs does it, not Doxygen) no block comments in documentation (I use block comments extensively to manage code flow during development) partial documentation (I really don't want to provide an explanation for each and every argument and return type) a concise format with a clear layout, so no \param and \return shenanigans automatically filled in for me no duplication of obvious information (eg the function name) in the comments inline documentation no explicit flow direction (in/out/inout) in documentation, but rather taken directly from code - I already provide this information! proper macro expansion I've tried Atomineer and it doesn't work for me at all. So far the Doxygen style in general is pure bloat in my eyes since it becomes bothersome to maintain as soon as you make something as simple as a name change. Allow me to demonstrate by example: Here's what a typical function in my code might look like: _BASEMETHOD ECBool OnInitialize( IN MODIFY ResourceType& object, IN const char* type, OPTIONAL IN ISignalable* signalable = nullptr, OPTIONAL IN uint32 flags = 0) const { ... } _BASEMETHOD expands to 'virtual'. Atomineer doesn't handle this too well since it is adamant about placing the documentation below that line unless I take care to actually generate it on the word _BASEMETHOD itself. Here's the default "trite" Atomineer generates: /// Executes the initialize action /// /// \author yomama /// \date 12-Dec-18 /// /// \tparam ResourceType Type of the resource type. /// \param [in,out] {IN MODIFY ResourceType&} object The object. /// \param {IN const char*} type The type. /// \param [in,out] {OPTIONAL IN ISignalable*} signalable (Optional) If non-null, the signalable. /// \param {OPTIONAL IN uint32} custHandlerFlags The customer handler flags. /// /// \return {ECBool} An ECBool. This is close to being the least useful way to say what the function actually does. None of the auto-generated stuff makes sense, because it's already obvious from the names. In addition, data flow direction is assumed, not extrapolated from markup that already exists in the code (notice the in/out of signalable while certain conditions might force me to accept a non-const pointer, which is nevertheless never written to). The return type is obvious. Even the general description is obvious to the point of being insulting to the reader. Of course this is all meant to be manually edited. However, the problem is that: 1) on the one hand, writing this stuff from scratch using this style of markup is time consuming and annoyingly verbose. 2) auto-generating the template and editing is also time consuming, because again, it's way too verbose. Here's what an ideal way of commenting the above function looks to me: /// Fill \p object with data and notify \p signalable once the procedure is complete. Runs asynchronously. _BASEMETHOD ECBool OnInitialize( IN MODIFY ResourceType& object, IN const char* type, OPTIONAL IN ISignalable* signalable = nullptr, /// Type-specific flags. See documentation of related resource type for possible values. OPTIONAL IN uint32 flags = 0) const { ... } That's it. This should be enough to generate feature-complete documentation when the docs are finally built. AND it's easy to read inline while writing code. A major hurdle is that while I actually kinda like the Natural Docs style, to the best of my knowledge it's only able to generate documentation for things that have actually been manually documented. Facepalm. So no automatic full documentation of classes, inheritance diagrams, etc. This seemingly forces me into using Doxygen, which is much more feature complete, but suffers from the abovementioned stylistic bloat and for some reason cannot handle relatively simple macro expansions in imo-not-so-complicated cases. I simplified the following from a real world example, but this includes auto-generated class implementations, eg: BEGIN_DEFAULT_HANDLER(foo) _BASEMETHOD const char* bar() const _OVERRIDE { return "yomama"; } END_DEFAULT_HANDLER(foo) which might expand into something like ---------> class foo : public crpt_base<foo> { base_interface* GetInterfaceClass() const _OVERRIDE { _STATIC foo_interface if; return &if; } _BASEMETHOD const char* bar() const _OVERRIDE { return "yomama"; } }; extern "C" _DLLEXPORT base_class* _fooFactory() { return static_cast<base_class*>(new foo); } Doxygen doesn't even recognize foo as a class. The bottom line is it seems to me I shouldn't be asking for too much here. I'd really like the clear coding style I've adopted to pay off in more than just the code. What's your approach? Any suggestions? Ideas or alternative options to explore?
    24. Cararasu

      Texture mapping acts weird on some images.

      It looks to me that you are not filling the whole memory of the image on the GPU. If you look closely at the rendered image you will notice at the last pixel-line that some pixels are missing. The amount seems to be about the same as the height of your image, which would mean the width is one pixel too wide. Your image loading code seems alright on first glance so that is strange. I do not think that the problem is that you are loading an RGBA image and treating it as RGB. This would create a different effect as the image is fully opaque. In this case, every pixel in the black area would be I think either red, green or blue.
    25. I'm learning how to implement a scripting language into my c++ game engine, specifically Mozilla's JavaScript engine: SpiderMonkey, but I'm still very confused. First I try to follow their How to build SpiderMonkey document, but it indicates I need the right build tools for my platform. In my case Windows 10 and Visual Studio 2018 Community as my IDE. I go to that "build tools" documentation for Windows but it then says Building Firefox for Windows. I guessing the same tools to build Firefox are used for SpiderMonkey, but I'm not sure what part of what I'm installing is overkill, I just want to #include "jsapi.h" in my project. Note, I realize it's not as easy as including a bunch of header files. I just don't know where to start or how to do this properly. From what I see in the documentation, using the API is very straightforward, but building is so confusing for me Would anybody know of a more straight forward step by step guide? I can't find one anywhere.
    26. I would start with the idiomatic, iterator-based approach and simply add a convenience method for containers and other "iterable" types: template <typename InputIt> std::string join(InputIt begin, InputIt end) { std::string result; /* does the thing */ return result; } template <typename C> std::string join(const C& c) { return join(std::begin(c), std::end(c)); }
    27. babaliaris

      Texture mapping acts weird on some images.

      I searched and they say you can't debug shaders natively. They have also Nvdia Inslight gor visual studio but i have amd and i cant use that debugger. I will see This gDebugger and i will come back later to post re results what do you mean by that? Can you understand if I;m doing it in the code below? What is what you're saying and where i might be doing that? Texture::Texture(std::string path, int unit) { //Try to load the image. unsigned char *data = stbi_load(path.c_str(), &m_width, &m_height, &m_channels, 0); //Image loaded successfully. if (data) { //Generate the texture and bind it. GLCall(glGenTextures(1, &m_id)); GLCall(glActiveTexture(GL_TEXTURE0 + unit)); GLCall(glBindTexture(GL_TEXTURE_2D, m_id)); //Not Transparent texture. if (m_channels == 3) { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, m_width, m_height, 0, GL_RGB, GL_UNSIGNED_BYTE, data)); } //Transparent texture. else if (m_channels == 4) { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_width, m_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data)); } //This image is not supported. else { std::string err = "The Image: " + path; err += " , is using " + m_channels; err += " channels which are not supported."; throw VampEngine::EngineError(err); } //Texture Filters. GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); //Generate mipmaps. GLCall(glGenerateMipmap(GL_TEXTURE_2D)); } //Loading Failed. else throw VampEngine::EngineError("There was an error loading image \ (Myabe the image format is not supported): " + path); //Unbind the texture. GLCall(glBindTexture(GL_TEXTURE_2D, 0)); //Free the image data. stbi_image_free(data); }
    28. JWColeman

      Texture mapping acts weird on some images.

      Also, it may be that if you're pushing an RGBA through to your device but only sending it data for an RGB, it could be that each frame your RGB is getting shifted by sizeof(A)... I'm really no expert on the rendering pipeline but these are oddities that I'm aware can occur when data is not pairing up just right.
    29. We are pleased to announce the release of Matali Physics 4.4. The latest version introduces comprehensive support for Android 9.0 Pie, iOS 12.x and macOS Mojave (version 10.14.x). Latest version also introduces Matali Render 3.4 add-on with normal mapping and parallax mapping based on the distance from the observer as well as other improvements and fixes. What is Matali Physics? Matali Physics is an advanced, multi-platform, high-performance 3d physics engine intended for games, virtual reality and physics-based simulations. Matali Physics and add-ons form physics environment which provides complex physical simulation and physics-based modeling of objects both real and imagined. Main benefits of using Matali Physics: Stable, high-performance solution supplied together with the rich set of add-ons for all major mobile and desktop platforms (both 32 and 64 bit) Advanced samples ready to use in your own games New features on request Dedicated technical support Regular updates and fixes You can find out more information on www.mataliphysics.com View full story
    30. We are pleased to announce the release of Matali Physics 4.4. The latest version introduces comprehensive support for Android 9.0 Pie, iOS 12.x and macOS Mojave (version 10.14.x). Latest version also introduces Matali Render 3.4 add-on with normal mapping and parallax mapping based on the distance from the observer as well as other improvements and fixes. What is Matali Physics? Matali Physics is an advanced, multi-platform, high-performance 3d physics engine intended for games, virtual reality and physics-based simulations. Matali Physics and add-ons form physics environment which provides complex physical simulation and physics-based modeling of objects both real and imagined. Main benefits of using Matali Physics: Stable, high-performance solution supplied together with the rich set of add-ons for all major mobile and desktop platforms (both 32 and 64 bit) Advanced samples ready to use in your own games New features on request Dedicated technical support Regular updates and fixes You can find out more information on www.mataliphysics.com
    31. G'day. So I have been doing a lot of work in the console as I try and learn the basics of C#. I got sick of going all over the place for ASCII symbols to use as "graphics" in my console apps so thought I would simply list them all here In addition, I found this cool "Ascii Font Generator" Ascii Font Generator (link) Finally some other cool links I found useful... http://www.asciiworld.com/ https://www.asciiart.eu/ https://manytools.org/hacker-tools/convert-images-to-ascii-art/ https://asciiart.website/ If you know of any other cool ones.. let me know!
    32. JWColeman

      Texture mapping acts weird on some images.

      Yep, Now, how to use it, is a whole other discussion I'm sure openGL has a device debug layer as well, its possible it could be throwing some warnings at you because of this.
    33. babaliaris

      Texture mapping acts weird on some images.

      I don't think i have a graphics debug. Can I somehow use Visual Studio for that?
    34. JWColeman

      Texture mapping acts weird on some images.

      It sounds like your shader is the problem then, a null value in an alpha channel in your shader could cause some unexpected behavior. Have you tried stepping through the graphics debug and checking the alpha value, when from your paint file, the alpha isn't there? The quick solution is to just not use any png files that don't have an alpha
    35. JWColeman

      Texture mapping acts weird on some images.

      So, the file from gimp worked but not from paint?
    36. babaliaris

      Texture mapping acts weird on some images.

      it has 3 channels. Also I tried to make this image on gimp and saved it as a PNG and it works just fine.
    37. JWColeman

      Texture mapping acts weird on some images.

      How many channels does your image have? Could there be a problem where you are reading in a channel that isn't there, or, applying a value to a channel that is causing the distortion? IIRC paint does not support alpha channel
    38. babaliaris

      Texture mapping acts weird on some images.

      Yes they are not packed, they are individual images made with paint from windows 10.
    39. JWColeman

      Texture mapping acts weird on some images.

      What I mean is are they all packed into one image, or individual images. It looks like they are individual images so i dont think that is the problem (U/V's)
    40. babaliaris

      Texture mapping acts weird on some images.

      I created the images using paint in Windows 10 and saved them as PNG. I'm not sure what do you mean by atlas??? Edited: You mean sprite sheets. No I'm not using them, the images are individual made with windows 10 paint program.
    41. ethanosborne

      Feedback Loops in Super Mario Bros. 3

      I recently purchased a Nintendo Switch to prepare for the release of Super Smash Bros. Ultimate. I had played the previous incarnations of the series growing up, but mostly in college where “retro” games were popular to play again. One of the reasons I wanted to get this game was to play online with friends from college who had moved to various places. We loved playing together in college, and felt like this was our chance to play again. In order to play online, you need to purchase Nintendo Switch Online. One of the perks of purchasing this online service was a download of Nintendo Entertainment System (NES) virtual console that comes preloaded with many popular games. Since I purchased online a few days prior to the release of Super Smash Bros. Ultimate, I had time to play some of the games on the NES. The first game that I chose was Super Mario Bros. 3. I had played this very sparingly during my life, but had watched plenty of videos of people playing it on YouTube and had a confidence I would perform decently in the game. I booted up the game, and did not make it past the first stage. In fact, I died relatively quickly on my first attempt and did not make it much farther on my next two either. The main reason as to why I did not make it very far was due to my desire to not search for any mushrooms and instead hold the sprint button and try and make it through the map. I pretended I was a professional speed runner who knew what they were doing. What this did make me think about, however, was feedback loops that were put into this game and how they contributed to making Super Mario Bros. 3 one of the best games on the NES. In Designer’s Notebook: Positive Feedback , positive feedback is defined “as occurring whenever one useful achievement makes subsequent achievements easier” (Adams, 2002). In terms of how this works in Super Mario Bros. 3, the most basic example is getting a red colored mushroom. By doing so, the player is able to not only grow Mario in size making the level easier to traverse, but you also gain the ability to get hit by enemies one more time before losing a life. There are other items to collect that grant the player more positive feedback. A green mushroom will grant an extra life, a brown leaf grants Mario the ability fly, and a fire flower that grants Mario the ability to shoot flower, amongst others. All of these are attainable by even the most novice of players, ensuring that everyone has a chance of achieving the completion of a level/the game. Another way in which Super Mario Bros. 3 provides positive feedback is more subtle than the items, but it is nonetheless effective. When this game first came out, new players did not have the same advantage as I did. They could not watch other people who grew up playing this game play through it themselves and give pointers along the way. Rather, they had to figure things out themselves. This is where I think that Super Mario Bros. 3 is great. With the first two levels of the game, World 1-1 and 1-2, respectively the player is met with some challenge. More so however, they are given an environment to try and manipulate. This achieves two things: teaching the player how Mario can interact with the game environment, but also, and ultimately more importantly, how to traverse through the game utilizing those interactions. In the first level you can use Mario to get question blocks which grant the player coins or a mushroom, you learn that Mario can jump onto enemies and kill them, and you learn that there are secrets hidden around the levels that you find if you look hard enough. In the second level, you learn that you can slide down hills to kill enemies too. These are the introductory levels without coming out and saying they are. These skills are able to be used throughout the rest of the game, and provide a relatively subtle, but smart, way to introduce the players to the game without making them go through a tutorial to learn about the game. Super Mario Bros. 3 is not without its negative feedback loops either, or else this game would have felt too easy, like some people felt about Super Mario World. Mart Virkus, in talking about negative feedback says that it was created to not make boring because of imbalance (Virkus, 2018). For his example, he talks about the blue shell in Mario Kart and how it is used by players who are falling behind to try and give them a chance to make it back to the top position. In Super Mario Bros. 3, the big negative feedback loop that stood out most to me was the what happened to you if you lost all of your lives. When you lost all of your lives, you were sent back to the beginning of whatever world you were currently on. For example, if you were on level 6-4 and you lost all of your lives, you go back to 6-1 and have to play through everything again. This was a way to punish the players without taking away everything they had achieved like what happened in the original Super Mario Bros. This smaller negative feedback loop ensures that players cannot just play through the game dying as many times as they want. It ensured that they were always looking for ways to get extra lives and that they were strategizing how to make it through whatever section they were struggling on. This was counterbalanced by allowing players to go and get items at toad houses and to play the in-game mini-game called match the picture which would allow you to potentially win items as well. This meant that players who were struggling could get a positive feedback loop to help them make it through those harder levels. While this is just a brief overview of feedback loops that are present in Super Mario Bros. 3, it comes as no surprise to me that this game has remained so cherished over its 30 year existence. It was a well crafted game, and provides the player autonomy with just the right amount of guidance that it does not feel like they are receiving help at all. Hopefully more games in the future will follow this scheme as opposed to hammering in more and more positive feedback loops because we have entered the age where everyone wants something and does not want to work hard to get it. References: Adams, E. (2002). Designer's Notebook: Positive Feedback. Retrieved from http://www.gamasutra.com/view/feature/131426/designers_notebook_positive_.php Virkus, M. (2018). How Feedback Loops Work in Game Design. Retrieved from https://arcaderage.co/2018/02/11/game-design-feedback-loops/
    42. Today Epic announced that throughout 2019 they will be launching a large set of cross-platform game services built originally with Fortnite. These services, built across 7 platforms and tested with over 200 million players will be free for all developers and open to all engines, platforms, and stores. All services will also be operated in a privacy-friendly, GPDR-compliant manner. The service will launch with a C SDK providing access to the online services along with Unreal Engine and Unity integrations. Services will include: Cross-Platform Login, Friends, Presence, Profile, and Entitlements (coming Q2-Q3 2019 to PC, other platforms throughout 2019): Provides the core functionality for persistently recognizing players across multiple sessions and devices; identifying friends; and managing free and paid item entitlements. This will support all 7 major platforms (PC, Mac, iOS, Android, PlayStation, Xbox, Switch) to the full extent each platform allows per-title. PC/Mac Overlay API (coming Q3 2019): Provides a user interface for login, friends, and other features in a game-agnostic, engine-agnostic way. Cross-Platform Voice Comms (coming Q3 2019 to all platforms): Epic is building a new in-game voice communications service supporting all platforms, all stores, and all engines, which will be available for free. (For developers needing an immediately-available voice solution, check out Discord, Vivox, TeamSpeak, Ventrilo, and Mumble.) Cross-Platform Parties and Matchmaking (coming Q3-4 2019 to all platforms) Cross-Platform Data Storage, Cloud-Saved Games (coming Q2 2019) Cross-Platform Achievements and Trophies (coming Q3 2019) Learn more from the Epic blog.
    43. Today Epic announced that throughout 2019 they will be launching a large set of cross-platform game services built originally with Fortnite. These services, built across 7 platforms and tested with over 200 million players will be free for all developers and open to all engines, platforms, and stores. All services will also be operated in a privacy-friendly, GPDR-compliant manner. The service will launch with a C SDK providing access to the online services along with Unreal Engine and Unity integrations. Services will include: Cross-Platform Login, Friends, Presence, Profile, and Entitlements (coming Q2-Q3 2019 to PC, other platforms throughout 2019): Provides the core functionality for persistently recognizing players across multiple sessions and devices; identifying friends; and managing free and paid item entitlements. This will support all 7 major platforms (PC, Mac, iOS, Android, PlayStation, Xbox, Switch) to the full extent each platform allows per-title. PC/Mac Overlay API (coming Q3 2019): Provides a user interface for login, friends, and other features in a game-agnostic, engine-agnostic way. Cross-Platform Voice Comms (coming Q3 2019 to all platforms): Epic is building a new in-game voice communications service supporting all platforms, all stores, and all engines, which will be available for free. (For developers needing an immediately-available voice solution, check out Discord, Vivox, TeamSpeak, Ventrilo, and Mumble.) Cross-Platform Parties and Matchmaking (coming Q3-4 2019 to all platforms) Cross-Platform Data Storage, Cloud-Saved Games (coming Q2 2019) Cross-Platform Achievements and Trophies (coming Q3 2019) Learn more from the Epic blog. View full story
    44. JWColeman

      Texture mapping acts weird on some images.

      Are you using individual images for the arrows? Or, are they packed together in an atlas? If you're sure it's not UV's... Try making your own set of arrows in gimp or something, maybe that will change it?
    45. Hello! My texture problems just don't want to stop keep coming... After a lot of discussions here with you guys, I've learned a lot about textures and digital images and I fixed my bugs. But right now I'm making an animation system and this happened. Now if you see, the first animation (bomb) is ok. But the second and the third (which are arrows changing direction) are being render weird (They get the GL_REPEAT effect). In order to be sure, I only rendered (without using my animation system or anything else i created in my project, just using simple opengl rendering code) the textures that are causing this issue and this is the result (all these textures have exactly 115x93 resolution) I will attach all the images which I'm using. giphy-27 and giphy-28 are rendering just fine. All the others not.They give me an effect like GL_REPEAT which I use in my code. This is why I'm getting this result? But my texture coordinates are inside the range of -1 and 1 so why? My Texture Code: #include "Texture.h" #include "STB_IMAGE/stb_image.h" #include "GLCall.h" #include "EngineError.h" #include "Logger.h" Texture::Texture(std::string path, int unit) { //Try to load the image. unsigned char *data = stbi_load(path.c_str(), &m_width, &m_height, &m_channels, 0); //Image loaded successfully. if (data) { //Generate the texture and bind it. GLCall(glGenTextures(1, &m_id)); GLCall(glActiveTexture(GL_TEXTURE0 + unit)); GLCall(glBindTexture(GL_TEXTURE_2D, m_id)); //Not Transparent texture. if (m_channels == 3) { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, m_width, m_height, 0, GL_RGB, GL_UNSIGNED_BYTE, data)); } //Transparent texture. else if (m_channels == 4) { GLCall(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_width, m_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data)); } //This image is not supported. else { std::string err = "The Image: " + path; err += " , is using " + m_channels; err += " channels which are not supported."; throw VampEngine::EngineError(err); } //Texture Filters. GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST)); GLCall(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); //Generate mipmaps. GLCall(glGenerateMipmap(GL_TEXTURE_2D)); } //Loading Failed. else throw VampEngine::EngineError("There was an error loading image \ (Myabe the image format is not supported): " + path); //Unbind the texture. GLCall(glBindTexture(GL_TEXTURE_2D, 0)); //Free the image data. stbi_image_free(data); } Texture::~Texture() { GLCall(glDeleteTextures(1, &m_id)); } void Texture::Bind(int unit) { GLCall(glActiveTexture(GL_TEXTURE0 + unit)); GLCall(glBindTexture(GL_TEXTURE_2D, m_id)); } My Render Code: #include "Renderer.h" #include "glcall.h" #include "shader.h" Renderer::Renderer() { //Vertices. float vertices[] = { //Positions Texture Coordinates. 0.0f, 0.0f, 0.0f, 0.0f, //Left Bottom. 0.0f, 1.0f, 0.0f, 1.0f, //Left Top. 1.0f, 1.0f, 1.0f, 1.0f, //Right Top. 1.0f, 0.0f, 1.0f, 0.0f //Right Bottom. }; //Indices. unsigned int indices[] = { 0, 1, 2, //Left Up Triangle. 0, 3, 2 //Right Down Triangle. }; //Create and bind a Vertex Array. GLCall(glGenVertexArrays(1, &VAO)); GLCall(glBindVertexArray(VAO)); //Create and bind a Vertex Buffer. GLCall(glGenBuffers(1, &VBO)); GLCall(glBindBuffer(GL_ARRAY_BUFFER, VBO)); //Create and bind an Index Buffer. GLCall(glGenBuffers(1, &EBO)); GLCall(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, EBO)); //Transfer the data to the VBO and EBO. GLCall(glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW)); GLCall(glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW)); //Enable and create the attribute for both Positions and Texture Coordinates. GLCall(glEnableVertexAttribArray(0)); GLCall(glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(float) * 4, (void *)0)); //Create the shader program. m_shader = new Shader("Shaders/sprite_vertex.glsl", "Shaders/sprite_fragment.glsl"); } Renderer::~Renderer() { //Clean Up. GLCall(glDeleteVertexArrays(1, &VAO)); GLCall(glDeleteBuffers(1, &VBO)); GLCall(glDeleteBuffers(1, &EBO)); delete m_shader; } void Renderer::RenderElements(glm::mat4 model) { //Create the projection matrix. glm::mat4 proj = glm::ortho(0.0f, 600.0f, 600.0f, 0.0f, -1.0f, 1.0f); //Set the texture unit to be used. m_shader->SetUniform1i("diffuse", 0); //Set the transformation matrices. m_shader->SetUniformMat4f("model", model); m_shader->SetUniformMat4f("proj", proj); //Draw Call. GLCall(glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, NULL)); } Vertex Shader: #version 330 core layout(location = 0) in vec4 aData; uniform mat4 model; uniform mat4 proj; out vec2 TexCoord; void main() { gl_Position = proj * model * vec4(aData.xy, 0.0f, 1.0); TexCoord = aData.zw; } Fragment Shader: #version 330 core out vec4 Color; in vec2 TexCoord; uniform sampler2D diffuse; void main() { Color = texture(diffuse, TexCoord); }
    46. Hi everybody, Xilvan Design building 3D games since 2004 in Blitz3D, we now present you our kindly official gaming related pages. (please click on each links, download games & bookmark the pages): Lights of Dreams IV: Far Above the Clouds v10.37. Candy World II: Another Golden Bones v10.37. Candy Racing Cup: The Lillians Rallies v3.57. Candy World Adventures IV: The Mirages of Starfield v7.97. Candy to the Rescue IV: The Scepter of Thunders v8.07. Candy's Space Adventures: The Messages from the Lillians v18.37. Candy's Space Mysteries II: New Mission on the earth-likes Planets v8.75. New Xilvan Design Websites. Xilvan Design's Youtube Channel. Friendly, Alexandre L., Xilvan Design.
    47. I'm forced to use TCP this is a browser game via websockets.
    48. lawnjelly

      Yet another interpolation question

      Isn't this why UDP is recommended over TCP for this kind of thing? https://gafferongames.com/post/udp_vs_tcp/
    49. Oh? wow that would be really awesome. I have tried different mingw versions already (5.3.0,6.4.0, 8.1.0), but that does not seem to be the root cause.
    50. There's tons of other information out there on "steering" and "obstacle avoidance" and whatnot.
  • 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!