ericrrichards22

GDNet+ Basic
  • Content count

    317
  • Joined

  • Last visited

Community Reputation

2422 Excellent

About ericrrichards22

  • Rank
    Member

Personal Information

Social

  • Github
    ericrrichards
  1. Looking for advice on training a older colleague.

    Sadly, it is often far, far easier to just shunt useless people off onto side tracks where they can't actively hurt a project, than it is to try to get them to be productive. At times, I've spent so much more time cleaning up other peoples' messes and clusterfracks that never worked, that it would have been a net win to just assign them to go sit in the corner and play Tetris and stay the hell out of the source code.
  2. If I'm using Visual Studio, I just go into the options and setup my desired code formatting styles once. Then I open a file that has weird formatting and hit Ctrl-K Ctrl-D or Ctrl-E Ctrl-D, depending on which keymapping is in place on that particular machine. Boom, it's all formatted more or less consistently. That's almost always good enough. If you have more than one person on a team though, you really want to enforce something consistent, or better yet, have your tooling enforce it automatically for you. It can be hell trying to merge code where two or more inconsistent styles have warred back and forth, or to understand the change diffs.
  3. Unity and Unreal Engine in the Latest Humble Book Bundle

    Has anyone read any of these books before, and can give recommendations? I have found the quality of Packt books to be wildly uneven. Some of them are very good, others look as though they were not even put through the spelling and grammar checker in Word before they went to the presses, nor the code samples run through a compiler. It's hard to complain at these prices, but time is also a finite resource.
  4. Last time, I had started working through Jamis Buck's Mazes for Programmers. I've made quite a lot of progress in the meantime, but haven't managed to keep up with posting about that progress. Today, we're going to work through the meat of Chapter 3, where we'll implement a simplified version of Dijkstra's Algorithm (really a breadth-first search), which we'll use to find paths through our mazes. We will also use this algorithm to help visualize the biases that exist in our two previous maze generation algorithms, by coloring the backgrounds of each cell according to its distance from a starting point. You can download the code for this post by downloading or cloning the Post_2 branch from my GitHub. Going forward, I'm going to try and tag the code for each post in a new branch - I'm still used to the old SVN model, but I'm trying to figure out how to take advantage of Git a little more. Below you can see an example of where we'll end up, drawing the longest path through a maze, and coloring each cell according to its distance along the path. Let's get started! Read more...
  5. Looking for a roguelike influenced book

    Since you mentioned tile-based RPG games, I've been slowly working through https://howtomakeanrpg.com/ .  I'd recommend it, it's a pretty thorough, project-based approach. It's primarily in Lua, although if you want you can tear into the C++ engine that backs it up - it's open-sourced on GitHub and pretty approachable.
  6. Mazes in C# - Part 1

    A few weeks back, I picked up a copy of James Buck's Mazes for Programmers: Code Your Own Twisty Little Passages. (The title is, of course, an homage to one of the original text adventure games, Colossal Cave Adventure, or Adventure for short, which featured a maze puzzle where every room was described as "You are in a maze of twisty little passages, all alike"). I read through most of it on my veranda in the mornings, looking out over Long Bay in Antigua while I was on vacation, wishing I had brought my laptop along with me (although my girlfriend is probably happy I did not...). Once I got back, I started diving into implementing some of the ideas from the book - it's been quite a joy, and a much needed break from debugging UCWA applications at the day job. The code in the book is implemented in Ruby, however, I'm not a Rubyist, so I decided that I'd work through the examples in my language of choice, C#. The code is pretty simple, so porting it over has been pretty straight-forward. I also figured it would be an interesting exercise for trying out some of the newer features in the more recent versions of C# - I've been stuck using C# 5.0 due to some tooling that we haven't had a chance to upgrade yet at work. Today, I'm going to mostly cover the examples from Chapter 2, which lays out the general plumbing of the framework that the rest of the book builds on, and implements two simple maze-building algorithms, the Binary Tree and Sidewinder algorithms. For the full code, you can check out my GitHub repository; things there may change slightly from the version presented here as I work through more of the book, but the general structure should remain similar. Video: http://richardssoftware.blob.core.windows.net/video/binaryTree.mp4 http://richardssoftware.blob.core.windows.net/video/sidewinder.mp4 Read more...
  7. Implementing Rijndael Encryption

    It's probably not something you'll come up against very often, but you should be aware that the System.Security.Cryptography.RijndaelManaged implementation is not FIPS compliant.  FIPS compliance is something that even Microsoft doesn't really recommend be turned on in Windows any more, but you may come up against it in certain environments, and in those cases, instantiating a new RijndaelManaged() will throw an InvalidOperationException. If you do have to be FIPS compliant, you generally have to resort to the AesCryptoServiceProvider
  8. Software-Documentation creates Clutter?

    I do most of my work in C#, so I do use the triple-slash xmldoc comments from time to time.  Mostly I do this for my own purposes, because that stuff gets picked up by Visual Studio Intellisense, and can be helpful.  Note that this is essentially function-level comments.  I also use some ReSharper plugins that can parse these xmldoc comments to determine if a function could throw a particular type of exception, so I try to add those to help me out as well.   I have used Doxygen on our codebases before, but aside from the graphing capabilities, to get a sense of the structure of a projects, I haven't found it terribly useful.  I was originally hoping people might actually read the docs, but was sadly mistaken in the reality.
  9. Directx or OpenGL

    D3D/GL are low level ways to send code for execution on the GPU. They don't have the concept of a model - it's your job as an engine programmer to define what a model is and tell the CPU how to load the data into RAM and tell the GPU exactly how to draw it. If you want to make a game instead of reinventing this low level stuff, then you should use an existing game engine like Unity or Unreal.   DirectX 9 used to have okay mesh support, but in DirectX 10 & 11, those parts of D3DX were deprecated.  So you either need to write your own mesh loading code for whatever model formats you intend to use, or use something like Assimp, which has support for loading most of the common formats you'll see in the wild, albeit into their own idiosyncratic data format.  In either case, you will then need to bind to vertex and index buffers and handle textures and animations yourself to actually draw the models.
  10. This is a joke! (US Presidential Election Thread)

    The cognitive dissonance is staggering.  Neither candidate is the spawn of Satan, much as their opposing trolls and partisans battle to paint it that way. The angle that I think is kind of interesting is that we've got a lush up against a teetotaler.
  11. C++ is probably the commonest, more because game engines tend to be written in C++ than any other reason, although since Lua has pretty simple C-bindings, there are a plethora of bindings for other languages (http://lua-users.org/wiki/BindingCodeToLua)
  12. Types of Character Fighting Archetypes in RPG's

    I don't see the Archer - mostly medium health, medium-to-good ranged damage, mediocre but ok melee There's also often something like a Berserker, with lower armor and very high attack   There are also many shadings of combinations of these types.  For instance, a paladin is often a tank/warrior with some priestly abilities, or a ranger might be roguish and the ability to summon beasts, etc.
  13. How you would do this depends on how static the textures that you are applying are - do you want each side of the box to be different, but each box to be the same, aside from rotations?  If that is the case, then usually what is done is to create a texture similar to a 2D pattern that could be folded up into the 3D box shape, and UV-map the faces of the box to match the texture.   For instance:
  14. Frank Luna's DirectX 11 book has a chapter on using the tessellation hardware support (Hull and domain shaders) to do a dynamic LOD tessellation of a simple quad mesh based on a heightmap texture.  If you don't want to buy the book (which I would recommend, it's a pretty good resource for learning Direct3D 11), you can download the code samples from his site http://www.d3dcoder.net/d3d11.htm, Chapter 19.
  15. Coding-Style Poll

    If I was going to implement a standard formatting style, I'd look into some kind of source-control commit hooks that could run new/modified files through a formatter, and enforce it that way.  Automate the tedious part, somewhat like what gofmt does.   But as to my own preferences: Opening braces aren't special, and they don't get their own lines.  Likewise, else, catch, finally, things like that, live on the same line with the closing brace of the previous block.  Otherwise it's just too much wasted vertical space. Everything that can have braces around it should.  No exceptions for one-line if's, and definitely no same-line ifs.  I even like to put braces around my switch-case blocks, especially in languages where braces create a new scope. Interfaces can get the I prefix.  Private member variables start with _.  Properties are capitalized, regardless of visibility.  Locals and function parameters start with lower-case. GUI controls get Hungarian-ish prefixes, since I started programming with Visual Basic, and it was always taught txtFoo, lblBar, etc.  I kind of like it anyway, even for things like HTML element ids that get used in Javascript. Don't bother fully-qualifying variable declarations if type inference can figure it out -> LongObnoxiousEnterpriseGangOfFourPatternAbstractFactoryFactory = new LongObnoxiousEnterpriseGangOfFourPatternAbstractFactoryFactory() blows.