Jump to content

  • Log In with Google      Sign In   
  • Create Account

Zaoshi Kaba

Member Since 04 Nov 2012
Offline Last Active Yesterday, 02:30 PM

#5301254 When you realize how dumb a bug is...

Posted by Zaoshi Kaba on 18 July 2016 - 01:53 PM

Today, at work I wrote code equivalent to this and spent over an hour debugging why username was randomly becoming empty. FML

// LPCWSTR username
if(username) {
	AutoPtr<WCHAR> ptrUsername = wcsdup(username); // cannot modify const so we duplicate
	username = removeLeadingWhitespace(ptrUsername.get()); // modifies
	username = removeTrailingWhitespace(username); // modifies
}
// use username sometime later



#5298816 [D3D11]Any explanation for a temporary performance hit on binding a 4k by 4k...

Posted by Zaoshi Kaba on 02 July 2016 - 11:11 AM

4k x 4k texture is about 67 MB (depends on format), so it's not exactly small. My GPU has 2 GB dedicated and video player eats 1.5 GB. Most software does wonders at memory consumption. Especially Chrome.

You can use this tool but I'm not sure how accurate it is: https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx




#5297664 What maximum amount of flood fill can a dijkstra handle?

Posted by Zaoshi Kaba on 23 June 2016 - 12:01 AM

Slightly off topic, but I want to ask.

 

Most games use the A* (A star) algorithm, which is Dijkstra's single pair shortest path algorithm plus a small heuristic value to speed up the search a bit, at the cost of potentially not being optimal.

 

In which cases it would not be optimal? I thought it always takes the most optimal path.




#5288642 Diagsession files?

Posted by Zaoshi Kaba on 25 April 2016 - 01:51 PM

Just .zip it.




#5288276 Is there an official list of all registered game titles out there?

Posted by Zaoshi Kaba on 23 April 2016 - 05:33 AM

if a trademark is not registered does it carry the same weight legally?

 

I'm not an expert or lawyer, but I believe in case of dispute the one who proves they used that title earlier will be assumed to have ownership. Therefore, automatically you cannot use any existing titles. Sometimes even similar ones.

 

I remember reading a story where guy released game similar to Candy Crush and it was similar in name, later on Candy Crush came out and they started legal war. Of course Candy Crush was on losing side, since they came up with the name later, so they found another game with similar name, which came out much earlier, bought copyright for like $100 and made poor guy take down his game, because now Candy Crush holds rights to earlier title.




#5287168 Pressing a key down generates both KEYDOWN and KEYUP event

Posted by Zaoshi Kaba on 16 April 2016 - 05:45 AM

Aren't you just missing break; at the end of SDL_KEYDOWN case? Same issue with SDL_KEYUP case.




#5281874 Why didn't somebody tell me?

Posted by Zaoshi Kaba on 18 March 2016 - 10:20 AM

I thought I'd share this extension:

https://visualstudiogallery.msdn.microsoft.com/be91feef-8dc3-4f7a-ac9f-f34e7ca5918f




#5281175 how could unlimited speed and ram simplify game code?

Posted by Zaoshi Kaba on 14 March 2016 - 04:27 AM


Is this true Waterlimon?

I had to write a small program in Prolog that finds all magic squares constrained by certain rule. So I just wrote down all the rules:

  1. rows 1..n add to N
  2. columns 1..n add to N
  3. diagonal adds to N
  4. all numbers in cells <= n*n

And Prolog just proceeded bruteforcing all answers.

 

In Prolog you just write rules / result you WANT to have and it tells how to achieve that result.




#5279209 "It's when you...", or: little things you've discovered about...

Posted by Zaoshi Kaba on 03 March 2016 - 02:22 AM

This thread is probably more suited for Coding Horrors section.

 

I've encountered people who don't know this so I'll mention:

  1. Hold ALT and drag vertically to edit multiple rows in same location. Allows easy aligning, copy/paste works as well.
  2. Use this extension to add extra functionality to ALT - hold ALT and click arbitrary locations to add carets there.



#5277783 Determine whenever box is visible in frustum

Posted by Zaoshi Kaba on 23 February 2016 - 02:38 PM

You should only reject a box if all vertices are "outside" the same frustum plane.

OP doesn't mention whether he's trying to implement frustum culling so I believe it's worth to mention that such approach isn't error free. Sometimes it gives false-positives, as in flags box as visible even though it is not.




#5274873 Have You Ever....?

Posted by Zaoshi Kaba on 08 February 2016 - 11:38 AM


was copy-pasted in 5 different locations in the code

I spent a week creating such situation. Now I get to fix it.




#5273692 Frustum Culling Question

Posted by Zaoshi Kaba on 01 February 2016 - 11:36 AM


See Quad-Trees, Oct-trees, BSPs, K-trees.

Basically...

Quad-Trees, and Oct-trees work by recursion. You start off with very large volumes, and you work your way downwards, checking smaller volumes, till you finally get to the actual meshes to check. For small worlds... these tend to be more costly. For larger worlds these are efficient. 

 

Are hierarchical structures even necessary for frustum culling? My CPU can cull ~450,000,000 AABBs per second (on 1 thread). 1 ms would be 450,000 AABBs. I'm sure you'll run into a dozen other problems before bruteforce frustum culling becomes a bottleneck.




#5270239 why does visual studio do this?

Posted by Zaoshi Kaba on 09 January 2016 - 03:41 AM


That isn't the issue. It won't recompile that cpp for some reason. it's using the old code.

What makes you think that? Debugging is impossible in Release build, so anything it tells you is false.




#5268973 Criticism of C++

Posted by Zaoshi Kaba on 03 January 2016 - 06:22 AM


C legacy

I agree but too bad this is required for backwards compatibility. Personally I'd prefer if Microsoft just scrapped all pre-Win10 code / API and just remade whole thing from scratch in C++. But that would mean we'd lose lots of already existing libraries.

 

 

 


Templates are ugly

Isn't that the case only with template metaprogramming?

 

 

 


No easy way to print enums

Can Java do that? (I don't use it so I am not aware). Besides, is there a use for that outside debugging / logging reasons?

 

 

 


Hard to parse causing problems with code analysis, navigation (intellisense etc.)

Isn't this mostly caused by C legacy and multiple syntax (ex. C vs C++11 uniform initialization & so on)?

 

 

 


Uninitialized variables still cause a lot of security bugs

You just need to turn up warning levels and treat warning as errors. Compiler won't let you compile uninitialized variables, unused variables, precision loss (ex. implicit cast from uint64 to uint32), & some other things. From my little experience majority of open source libraries don't even compile with those settings.




#5267167 How do you organize your time for game dev?

Posted by Zaoshi Kaba on 20 December 2015 - 11:24 AM

stay clear from anime

 

Might as well change my degree then.

 

I'm terrible at planning time so my advice isn't worth much. 

First of all, you might want to read this article: http://www.gamedev.net/page/resources/_/business/production-and-management/getting-games-done-r3564

I also remember someone saying you have to force yourself to work on your game. For example, you set timer to 1 hour, sit down, and work on your game. You have to do 1 hour every day at minimum, no excuses, no procrastination, etc. Just 1 hour spent on your game, and it doesn't even matter what you do.






PARTNERS