Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 21 Feb 2008
Offline Last Active Today, 06:09 PM

#5151386 Resource Cache and Models

Posted by NightCreature83 on 04 May 2014 - 03:52 AM

You probably want to be carefull in how you construct your load units, so that they load only what you need got that unit. Dependency checks in your bundle build step can alleviate these issues, so that you only bundle resources that are often used together. This will remove your problems in that the load unit has to be loaded completely.

#5149376 unhandled exception CreateWindow()

Posted by NightCreature83 on 25 April 2014 - 07:02 AM

You are passing a pointer somewhere that is 0 and shouldnt be zero. This 0xC0000005: Access violation writing location 0x00000000 exception always means you are trying to write to something through a pointer that has value 0.


I expect either strWindowTitle, hMenu or hInstance to be 0.

#5149327 C# for Xbox anyone? I'm excited!

Posted by NightCreature83 on 25 April 2014 - 01:47 AM

While this is indeed encouraging, It is still unclear if C# on XBox One will get the same level of access as the private Indie XBox One program is currently allowed. Specifically, we are not yet sure that apps developed in C# will be considered as Game Apps or plain AppOS with limited resources (don't know the details, but could have memory/GPU restrictions...etc.)

From the details they have leaked at E3 it sounds like you will be considered just windows store apps and not GameOs apps, which means you only have 3bGB of memory and thats shared with the rest that is running in the shared OS.


Most of these apps will just run on windows 8 store too without any real modification to the code.


#5149050 FileSystem Cross-Platform

Posted by NightCreature83 on 23 April 2014 - 03:33 PM

I looked into filesystem boost source code, he uses #ifdef inside one file, he doesn't split, but that end to the same.

It's very full but a lot of function is not needed in a game dev, it's more a lib for soft who needs all about file system.

You can use #if defined() guards too, the split in different .c or .cpp files is another way to achieve this in a less mess way. Code that has a lot of #if defined (PLATFORM_WIN) guards in the code becomes hard to read really really fast, if if you try to minimize this, specially if it is mixed with paths that all platforms need to execute. Having a FileSystemWin.cpp and a FileSystemXOne.cpp with a single FileSystem.h becomes a lot easier to maintain and read.

#5148955 FileSystem Cross-Platform

Posted by NightCreature83 on 23 April 2014 - 07:42 AM


This is not true for everyone, I see this advice too much around here. For some people the fun is actually in writing the systems software and not the game itself, I have done both and I much prefer writing the systems to help other people create the games.
Also remember that for the platform specific implementations you don't need to go with a C interface this works perfectly fine with classes too.

Hey, if writing a cross platform file system floats your boat (assuming you are doing it on your own time and not wasting your employers time), that's cool. Go nuts and sincerely, I hope you end up with something epic that we can all benefit from. smile.png

Most people don't bother with it because it's essentially a solved problem, and unless your solution brings something new, it's pretty much a waste of time (in the context of trying to get a game made).

And yes, I'm aware that classes will work fine, I was illustrating the point with the OPs example.



My comment was more aimed at that we throw this thing at everyone on this forum, but the reality is that in triple A companies you will probably end up developing your own system instead of using a lib. So this is definitely not a waste of time and it is a good thing to know how these things work.


Besides most external libs won't actually work for the consoles you are working on so developing these things is actually worth while.


See on this website we mostly only seem to worry about pc compatiblity, but when you hit consoles or even mobile phones this situation starts to change completely, because they neither support windows api or posix on all spots. And with the new generation it is actually not such a stretch that people here will be able to develop for them to be honest just look at the PSN indie and Xbox Indie programs.

#5148902 Switching between languages/API

Posted by NightCreature83 on 23 April 2014 - 02:22 AM

When I dont spend time on a codebase for a while I will have to read the stuff again and see how I do things, this is normal you can't keep all of this in your head all the time. The thing is though that you haven't actually forgotten how something works it's just the details that you miss, once you have seen them again for once you remember how it works.


I switch between 3 programming languages often, mostly C++/C# the only mistake I always make is array syntax related, if I switch to or from python extra {} are added in python or forgotten in C++.

#5148342 Tips on FileLoader code

Posted by NightCreature83 on 20 April 2014 - 06:02 AM

Just from a coding standard view why are you placing an enter after a function or if conditional and the { and not on an else clause.


I would store the GetLastError code too to be honest or at least trace it to the output log so you can figure out why a file didn't load instead of having error X. This code is also very platform specific, this is ok if you never intend to support another platform. To get a way from this you could use fstreams, but they have no async reads in the way the windows shell file loader does it.


Other than that it looks like a good file loader.

#5147686 What's the point of floats in C?

Posted by NightCreature83 on 17 April 2014 - 11:05 AM

in x64 the first 4 floats are passed through the XMM0 - XMM3 registers which which are actually 128bits wide and are SSE registers. The rest are passed through the stack.

#5147681 String help in C

Posted by NightCreature83 on 17 April 2014 - 10:51 AM

So here is a fixed up C version:

const char* randomString = "Once there was this really old man who tranformed into dust. The end!";
size_t frequency[256];
ZeroMemory(frequency, 256 * sizeof(size_t));
for (size_t counter = 0; counter < strlen(randomString); ++counter)
    ++frequency[(unsigned char)randomString[counter]];
size_t numberOfDs = frequency[(unsigned char)'d'];
//Same linear runtime but you have all of the frequencies of chars for the string, of course this only works for ASCII strings

All fixes to this code are trivial to transform from C++11 to C. You were right in the fact that i missed out one element in the frequency array and that you can have negative numbers in char, so the cast to unsigned char will fix this. And if we are going to exclude the use of ZeroMemory we can replace that with a memset which has a set value of 0.


In all fairness all I wanted to do is show a more generic solution to what was asked, which has a O(1) lookup at the end for all characters of a string.


Ow and if we are really honest here we are answering what is most likely a school assignment.

#5147639 Graph layout

Posted by NightCreature83 on 17 April 2014 - 08:31 AM

Have you looked into graphviz and dot, doxygen uses this to generate their callgraphs and dependency grahps, which are clickable html.

#5147635 String help in C

Posted by NightCreature83 on 17 April 2014 - 08:25 AM

std::string randomString = "Once there was this really old man who tranformed into dust. The end!";
size_t frequency[255];
ZeroMemory(frequency, 255 * sizeof(size_t))
for (size_t counter = 0; counter < randomString.size(); ++counter)
auto numberOfDs = frequency['d'];
//Same linear runtime but you have all of the frequencies of chars for the string, of course this only works for ASCII strings

#5147059 tinyxml2 and how to read files

Posted by NightCreature83 on 15 April 2014 - 01:56 AM

There is no need for you to call ToElement on child, because the for loop makes sure its an element already. And with FirstAttribute on an element you can actually iterate over the attributes of an element cleaning this code up a bit. Also it is better to use FindAttribute on element than just Attribute, you are not trying to match an Attribute with name and value, so FindAttribute actually expresses your intent better and makes your code more maintainable.

#5146964 Great laptop for game development? (Budget of +1200,- euros)

Posted by NightCreature83 on 14 April 2014 - 01:43 PM

Not sure where you from but if you can read this Dutch Tweakers bi-montly laptop guide might be a good start for you. http://tweakers.net/reviews/3479/laptop-best-buy-guide-april-2014.html the ranges you are looking at this would be either a multi-media laptop or main stream laptop. Do you mean to have 8 real cores in the CPU or is a hyper threaded quad core good enough, because there are no 8 core(as in not hyper threaded) intel chips at the moment.

#5145590 Trying to understand vertex shaders better

Posted by NightCreature83 on 09 April 2014 - 01:28 AM

If you need an online math resource this one is decent: http://www.euclideanspace.com/maths/algebra/index.htm

#5145291 directxmath osx/linux?

Posted by NightCreature83 on 08 April 2014 - 05:15 AM

I expect you will run in to some compile issues with WORD, DWORD and such, also probably you will have to do something about the intrinsics and compiler support in the header files which try to figure out if your CPU supports SSE2, but other than that it should be possible.