# Nytegard

Member

1825

1. ## 2018 New Year Challenge: Missile Command

The problem was, while my explosion displays at a 1:1 ratio, internally, it's being calculated @ 16/9:1. This is mainly an issue for tunneling. Squish the coordinates to 1:1, and voila, you have a circle again. The other stupid improvement I forgot is that you can precalculate when the missiles are going to blow up to avoid unnecessary calculations in the hit detection. The instant you fire, you know when and where your missiles are going to explode, and thus have all the necessary information to determine all known future hits of enemy missiles/crafts/bombs. An enemy missile lasts past time t? Explode at X(t), Y(t), rather than tons of continuous hit detection checks. Just simple stuff like this that I didn't think of during the initial creation. I mean, my game works, but there are so many more optimizations that could be added that would require a rewrite of the logic.
2. ## 2018 New Year Challenge: Missile Command

The problem was, while my explosion displays at a 1:1 ratio, internally, it's being calculated @ 16/9:1. This is mainly an issue for tunneling. Squish the coordinates to 1:1, and voila, you have a circle again. The other stupid improvement I forgot is that you can precalculate when the missiles are going to blow up to avoid unnecessary calculations in the hit detection. The instant you fire, you know when and where your missiles are going to explode, and thus have all the necessary information to determine all known future hits of enemy missiles/crafts/bombs. An enemy missile lasts past time t? Explode at X(t), Y(t), rather than tons of continuous hit detection checks. Just simple stuff like this that I didn't think of during the initial creation. I mean, my game works, but there are so many more optimizations that could be added that would require a rewrite of the logic.
3. ## 2018 New Year Challenge: Missile Command

It's all a learning experience. I made the mistake of starting backwards, and having no plan for the actual game. By the time I got to the actual game portion, I came to realize my mistake. But it's all good. Fortunately, the resolution itself can easily be changed, but I found a cheap and easy solution for my problems, though it is a hack. Just scale everything to 1:1 for hit detection, and easier hit detection for fast moving objects as I have a circle. (Not that anyone would ever really need to worry about that scenario, but bug free is still better than a bug that exists even if no one will ever see it.) I'd like to think of this more as a starting point for a complete rewrite.
4. ## 2018 New Year Challenge: Missile Command

It's all a learning experience. I made the mistake of starting backwards, and having no plan for the actual game. By the time I got to the actual game portion, I came to realize my mistake. But it's all good. Fortunately, the resolution itself can easily be changed, but I found a cheap and easy solution for my problems, though it is a hack. Just scale everything to 1:1 for hit detection, and easier hit detection for fast moving objects as I have a circle. (Not that anyone would ever really need to worry about that scenario, but bug free is still better than a bug that exists even if no one will ever see it.) I'd like to think of this more as a starting point for a complete rewrite.
5. ## Missile Command Challenge Post-Mortem

It's been awhile since I've been on this site. Been busy at work, but as with all contracting, sometimes work gets light, which is the case as of the new year. So I saw this challenge, and thought it might be fun to brush up on my skills. I've been working mainly with embedded systems and C#, so I haven't touched C++ in awhile, and when I have, it's been with an old compiler, that's not even C++11 compliant. So, I installed Visual Studio 2017, and decided to make the best use of this. Time is short, and I don't exactly have media to use, so I decided to just go out and start to learn Direct2D. I have little experience with any modern form of C++, and zero experience with Direct2D and XAudio. Whereas I didn't mind learning Direct2D, I fully admit XAudio presented a bit of problems. In the end, I blatantly stole Microsoft's tutorial and have a barebones sound system working. And unlike the Direct2D part, I didn't bother to spend much time learning what it does, so it's still a mystery to me. I'm not entirely sure I released everything correctly. The documentation said releasing IXAudio2 would release objects, and when I tried to manually delete buffers, things blew up, so I just let it be. There are most likely memory leaks there. As you can plainly tell, this is by far the worst entry in the challenge. This is as much of a learning experience as an attempt to get something out the door. I figured, if I couldn't be anything close to modern, at least be efficient. And I failed at that miserably. Originally I wrote this in C. Excluding the audio files, it came out to a whopping 16 KB in size, and memory usage was roughly 6 MB. And then I decided to start to clean up my spaghetti code (I said start, never said I finished), and every time I thought I was getting more clever, the program grew in size and memory usage. As of right now, it's 99 KB and takes up roughly 30 MB RAM on 720p resolution. I haven't really checked for memory leaks yet, and I'm sure they exist (beyond just the audio). In reality, I'd prefer to clean up a lot of the code. (And I found a few errors with memory management, so I need to track down where I went wrong. I removed allocating memory for the time being and pushed everything onto the stack.) The other thing is, this code is ugly. Towards the end, I just started taking a patchwork approach rather than keeping it clean. I was originally hoping for modularity, but that got destroyed later on. And I'd love to replace the pointers that are thrown liberally throughout the code with smart pointers. Unlike the other entries, I only have missiles for the gameplay. I didn't include UFOs, airplanes, smart bombs, nor warheads. I just don't feel I had enough time. Yes, there's still a couple weeks to go, but I'd prefer to cleanup what I have than add new features. And unfortunately, I was a bit shortsighted, which caused problems later on. There are multiple places where the code is far more verbose than it needs to be, because I wasn't properly focused on the correct areas. I wanted to make it scalable, and I focused making the game a 1:1 ratio internally, yet displayed 16:9 to the user, which caused massive problems later on. I ended up having to do math on pretty much every piece of graphics and game logic whereas if I had just displayed it as 1:1, or handled the internals in 16:9, I could have shaved off a thousand lines of code. And it also caused problems with hit detection, which is another reason I didn't bother adding in anything but missiles. The hit detection was a mess. I had everything mapped out. The game was going to work whether a missile went 1 pixel a second, or 1000 pixels a nanosecond. Calculating moving objects and collision with circles or boxes is easy. Unfortunately, I was using ellipses. And while there are formulas for that, I'll admit my eyes started to glaze over at the amount of math that would be required. In the end, I decided to leave it buggy, and only detect if it was currently in a static ellipse, which is easy and fast enough to calculate. I mean, I guess if the program freezes up, the user was going to lose a city/silo anyway, or lose it if the missile was traveling at light speed, but it's still a bug, and still annoys me, especially since everything else was calculated regardless of what the user sees. (*EDIT* Thinking about this more, the solution was right in front of me the entire time. Just squish the world back to 1:1 and do the hit detection that way). Controls: 1,2, and 3 control the missiles, and the arrow keys control the cursor. Escape for the menu, and Enter for selection. I've only tested this on Windows 10, as I'm pretty sure it requires those libraries. It's a 64-bit executable.
6. ## 2018 New Year Challenge: Missile Command

Since I finally have/had a few days to work on something of my own, why not this? It's the most barebones version of any submitted, and I'm still trying to track down bugs before I focus on adding any features. Still trying to track down a few memory management bugs. Built in Visual Studio 2017, source included. It's a Win 10 64-bit application. Requires Direct2D. Use 1, 2, 3 to fire, and arrow keys to move. Escape for menu and Enter for confirm. http://www.behindtimes.com/nytegard/media/d2dtest.zip
7. ## 2018 New Year Challenge: Missile Command

Since I finally have/had a few days to work on something of my own, why not this? It's the most barebones version of any submitted, and I'm still trying to track down bugs before I focus on adding any features. Still trying to track down a few memory management bugs. Built in Visual Studio 2017, source included. It's a Win 10 64-bit application. Requires Direct2D. Use 1, 2, 3 to fire, and arrow keys to move. Escape for menu and Enter for confirm. http://www.behindtimes.com/nytegard/media/d2dtest.zip
8. ## Who to contact about help with GDNet+?

Not really a site suggestion, comment, etc. Just wondering because on 3 different occasions, I was sent an email about my GDNet+ subscription ending, and on two of them I paid (I have the paypal receipts and bank receipts), yet my subscription expired. Just trying to find an email button for people with issues regarding the site.
9. ## [SDL] Query when screen is capable of rendering

I'm changing the resolution and have multiple monitors and running full screen.  There's several seconds of delay where the screen is black.  I tried SDL_WINDOW_EVENT_SHOWN, but that was returning almost immediately while I was still waiting for the screen to actually display.  I'm looking for an efficient way of knowing when to start actually running the application rather than putting up a delay as a hack.  (I also queried all the Window Events and nothing is being called around the time when the screen returns to a drawable state).   *EDIT*   I only have this issue with multiple monitors.  If only using one monitor, everything works as expected, or if I use a window and not full screen, everything works as expected.
10. ## Who are your developer heros?

I certainly wouldn't say I idolize a developer, but I can understand having a developer hero.  For me, it is probably Roberta Williams.  Her games are pretty much what inspired me to go into the computing field.
11. ## What game type do you prefer and why?

Honestly, I'm not a fan of action games.  I prefer more intellectual games such as puzzles & adventures (not action/adventure, that's a completely different genre).  Think Lucas Arts & Sierra games of old, or The Last Express (similar games which are sorely missing from app stores).  I just like to take my time and play on my schedule and not the games.  As for dimensions, I prefer 2D.  I can only play 3D games for so long before I get nauseous and I also tend to find that 3D gameplay is too simplistic for my taste.  (I don't mind 2D gameplay with 3D graphics though).
12. ## OS X, NSSplitView, Resizing, and drawing issues

If you're paranoid about your information getting out, that's about the last thing you should do. Typically, if I recall correctly, the number one name a person typically looks for on search engines, when you remove celebrities, is their own name.
14. ## So, windows 8?

I've had severe issues with multiple screens and Windows 8, particularly when trying to view video on the secondary screen. Many applications just seem only to work on my primary monitor. Hopefully that's just an NVidia problem. As for boot times, I guess I'm just fortunate to have had a great PC when I had Windows 7, that the upgrade to Windows 8 really wasn't anything noticeable for me. It boots up about 1 1/2 seconds faster than Windows 7. Definitely get the start bar back if you get it. That being said, I'm honestly not too thrilled with the OS. The Metro interface is now cluttered with executables, even if they're the uninstall program that would never be shown on the desktop. And even things such as turning the computer off before you have the start button is not a 1 step affair. Yes, there are ways to alleviate both of the above issues, but a solid OS should not require intervening steps, but work right off the bat. This is an area where Apple does things right imho. All too often the UI gets put on the back burner, because management seems to think anyone can make one, but there's a difference between a UI and a good UI. And making a useful UI is an art.

23. ## No Diablo 3 Threads?

I don't think it's that the magic is gone, I just think that the game hasn't really evolved enough to be seen as a true successor to Diablo 2. It's honestly hard to succeed when you have high expectations (ie. Deus Ex: Invisible War, Ultima 8, etc). Quite honestly, it's refreshing to see a real money AH. If people are going to devote a portion of their lives to the point it's a second job, they might as well be allowed to make real money from it legitimately. The always on connection is definitely frustrating, as I can't tell you how often I've been in the middle of a dungeon to lose connection and have to replay the whole dungeon all over again. It's even worse when you find an awesome item and lose it (hence why I teleport to town now after every major find). I guess another thing I would have preferred is if Blizzard wasn't so west-coast centric. (This isn't necessarily a Blizzard only problem, as many online games seem to treat the west coast as the center of the gaming world if you live in the USA). I don't think I could play HC mode as I've already died several times through warping and other connection issues (I'm lucky if my ping goes sub 200). I might as well join the European servers, as I'd probably have a better connection there.
24. ## No Diablo 3 Threads?

Nah, the legendary, not the rare. (I already have tons of rare, and was surprised that normal actually dropped legendary, but it does). Just started Act 4 (normal) and have 5 pieces. I have yet to sell anything to any shopkeepers (I've been salvaging all my pieces), so I'm severly short of money from being able to buy a tab for more storage space (and the artisans are upgraded as far as I can get them on normal).
25. ## No Diablo 3 Threads?

Honestly, the legendary's aren't that unique, at least compared to uniques in Diablo 3. I'm only in the middle of Act 3, and have found 3 already (albeit I can't use two of them, due to being the wrong class). Honestly, I'm not sure about how I feel about Diablo 3 at the moment. I'm not too overwhelmed by it (in either a good or bad way). I'll continue to finish the game, but I'm not sure I'll play it much longer than that. Definitely not enough to get even half of the achievements. (And quite honestly, I think I'm getting to the point in games where I'm burned out with achievements, especially since some of them seem to be endurance achievements of how many thousands of hours are you willing to devote to the game...)