Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 03 Aug 2007
Offline Last Active May 10 2013 05:11 AM

#5040056 Game Development Scene

Posted by on 06 March 2013 - 11:34 AM

Developers on different levels/stages are probably interested in different topics, and the difficulty of those (basic explanation of AO/SSAO vs. latest performance tweaks to a specific SSAO algorithm), since all have different experience and knowledge. Hence there are many popular blogs :-)

One thing everybody loves, however, is an image, whether it contains a screenshot of a game, a colorful model, an IDE or just plain statistical data.

And one other thing programmers love is well-documented/-described source.

#5036507 Multithreaded programming

Posted by on 25 February 2013 - 05:10 PM

If you want top-quality reading material with C++ (specifically C++11 and its standard threading library) and threading in mind, I can recommend C++ Concurrency in Action: Practical Multithreading by Anthony Williams (http://www.amazon.co.uk/dp/1933988770) and Herb Sutter's many articles (http://herbsutter.com/).


Pre-C++11 you can use boost::thread (nearly identical to std::thread in C++0x/C++11), so any articles concerning std::thread can also be applied to earlier versions of C++ supported by boost.

#5028075 How detect and resume wireless socket connection falldown?

Posted by on 02 February 2013 - 05:37 AM

This is just an idea, so please inform me if it is totally misplaced smile.png 
Even though the speed is slowed, time is not, so the client should be able to detect that time gap/leap and drop the connection itself after a fixed time interval without signal. The key is that the server's time interval must be a little larger to accommodate clients clients wanting to resuming (without luck) after an interval close to their time limit.
For instance, where X is some time interval (the 1.5 is probably way too much, depending on X itself it may be smaller, but you get the idea):
ClientDropTime = X
ServerDropTime = X * 1.5

#5020817 In-Game Console

Posted by on 12 January 2013 - 01:45 PM

Most, and hereby I mean practically any game I have every played in release, use the in-game GUI to display the console, not an external window API like Windows' own.<br />Thereby they can toggle all aspects of its appearance - but there is much more to it than just pretty graphics, although ones like Source Engine's is both very pretty and functional (listing all cvars related to the chars you have typed so far and easy help/description for any cvars, for instance) IMHO, though I miss an "in-game appearance" (you cannot type while playing - console must be accessed from the menu).<br />You also need a way to bind console input (like "help", "max_fps 100", "quit", etc.) to actual source in order to command the game to do something.<br />Quake, as you mentioned, uses a system of cvars (console variables and commands) - you can read all about both online and in their released source (the newest edition of id's cvar system in actual source, that I know of, lies accessible in their Half Life 2 SDK).<br />Games like FarCry exposes this functionality via a full fledged scripting system (Lua, in this case) and binds commands/variables and the necessary callbacks this way, since they use it for all other scripting purposes anyways.<br />

#5010920 NULL vs 0

Posted by on 15 December 2012 - 06:17 AM

Although NULL IS ugly, it cannot be replaced with 0

What? NULL is #defined as 0, meaning there's absolutely no difference except style/personal preference, and Bjarne "C++" Stroustrup was quoted earlier as preferring 0 (or nullptr in C++11 where available) over the NULL macro.

Sorry. I was under the impression that NULL was commonly defined 0, but was not required to be defined as such. Well, that certainly makes life a bit easier.

#5005981 Accessing other game objects

Posted by on 01 December 2012 - 03:30 AM

Iff the hierarchy manager owns the objects in question (or is otherwise guaranteed equal or longer life time), you can pass a HierarchyManager * to every object, like you do with their parents. A simple pointer is fast to dereference and does not waste much space. If the objects are not guaranteed to die before their manager (but be sure of the reasoning of this decision), you might want to look into a std::shared_ptr<HierarchyManager> (or boost::shared_ptr if your compiler is pre-C++0X/C++11) or another form of reference-counting.

#5005830 Non-Microsoft Market Share

Posted by on 30 November 2012 - 02:35 PM

I develop for both Linux and Windows pre-8 and primarily OpenGL, but since I use a non-platform-dependent API for these platform-specific parts, which is then compiled (or linked at run-time using DLL's/SO's) into platform-dependent source using macros, I can easily compile for a new platform, say Direct3D or MacOS, should I wish to do so later on. This is a common way of hiding away platform-dependent source. For reference, L. Spiro has posted a neat little article regarding the compile-time macro solution: http://lspiroengine.com/?p=49.

P.S. I fancy CodeBlocks too much to let VS get in my way on Windows :-)

#5002025 Developing a game engine. Round 2.

Posted by on 18 November 2012 - 07:15 AM

If yes, where should the id be assigned. In the level file? Or it should be generated on runtime(this is the case I used before) .

How would you otherwise differentiate and cross-reference the different objects in a level file (or in any other saved form) if they do not have some sort of ID already? This might just be a unique name, but it is still an ID. You can always switch one ID-method out for another (they all have their strengths and weaknesses). For instance, you can use unique names (strings) in files for simplicity (easy to edit by hand) and then swap them out with integer ID's for performance when loading files using either hashing or a LUT (string->integer). The opposite is required for saving, of course. An editor (level editor) might do the conversion automatically for you - you use string ID's within the editor, but it only saves integer ID's (and possibly a LUT to display the original string ID's within the editor for re-editing the files).

#4994337 Create an operating system

Posted by on 26 October 2012 - 10:19 PM

So you want to make a prototype of the GUI, not the actual OS, right?
I see no reason why the interface shown in the video is not just another fancy GUI (probably for mobile units) with network connection and a database of your media attached, but I might have missed something?
For the GUI, yes, you can use pretty much any language, including the now out-dated flash and the newer HTML 5. But you can use pretty much anything that enables you to make a graphical and relational mock-up quickly. So if you already know a language/technology or two, I would certainly investigate if you can use that instead of learning a new one.

#4994334 What's the deal with IDE's?

Posted by on 26 October 2012 - 09:38 PM

I have used Code::Blocks nightlies as my main IDE since one of its first releases in '05 or '06.
Since I use nightlies and not the stable builds (there are not many of them and they are quickly horribly outdated), there have been issues from time to time with certain builds, such as frequent crashes or features not working properly, but the developers have always responded quickly to any feedback on their forums. If one particular build annoys you, you can always use a former until the issues are fixed (usually does not take more than 1 or 2 newer builds iff you report the issue).
For instance, in the current Windows build (8438), I have issues with CB's "image" freezing as a screen overlay when (sometimes) minimizing, forcing me to restart CB (but everything is saved, so not a big deal), though the Debian build (Jens') is working perfectly.
Like JTippets said, just save often enough, make use of autosave, or do as I and use both (since I will never trust autosaving features Posted Image).

#4992167 How much CPU usage should just an empty game loop have

Posted by on 20 October 2012 - 08:59 AM

Be careful when using Win32's Sleep. The call might return instantly or sleep for up to ~15 ms when calling Sleep(n), where 0 <= n <= 15. This happens because the default tick resolution is (1/64) s = 15.625 ms, which can be altered (only for the entire system!) using timeBeginPeriod/timeEndPeriod.
So you might want to consider other alternatives when you need to wait for less than 15 ms.

#4987279 Handling a 2D procedural world

Posted by on 05 October 2012 - 05:20 PM

I might have missed if someone else mentioned this, but you might want to take a look at streaming (only load what you need now plus a little more, then let a background thread load more when needed) and/or compression (if you cannot minimize the tile data further), considering the amount of data you are handling. Since you only load one file sequentially, you do not need to worry about (mechanical head) seeking.
Perhaps, depending on the Type/Background/Orientation variables (whether or not they differ a lot for each tile), you can make these objects flyweights, thereby only having one to load 1 object for each different type/background/orientation and in the file reference them by some identifier (ID/GUID)?
Other than that, use as small data types as possible to describe what you need, which I see you already are in Tile, using bytes/shorts. For instance, an int X can often be reduced to short/byte X if any two X does not differ by more than 2^15/2^7 (or unsigned 2^16/2^8). For instance, if your X's are all in the range [545;668], the difference is at most 668-545=123 (making it a perfect fit for a byte), so serialized is byte bX = (int iX - 545) and deserialized is int iX = (byte bX + 545). Warning to readers, in case I just created arithmetic overflow of converted data types (do not know C# well enough to catch these).

#4978120 Swapping addresses between pointers and cache locality

Posted by on 08 September 2012 - 05:01 PM

Assume I have a vector that consist of pointers. When the content of this vector is read (one element at a time in order) I should be reducing cache misses (since the pointers would be adjacent to each other in memory). Now if we assume what each pointer is POINTING at also lies in a continuous block of memory then from what I've understood it should also reduce cache misses (corrections here would be welcomed).

Yes and yes. Since you know how cache lines work, I assume that both your vector's data (pointers) and its pointed data is larger than a single cache line (otherwise you are good no matter what you do, since both arrays are contiguous).

But the real question is, unless I missed something, why do you need to swap the pointers in the first place, and how often do you process pointers and/or iterate the array?
And also, how large are these arrays? The cache consists of several cache lines, so if they fits into the collected cache, it might not become an issue at all.

Of course, if you have a real case, and this is not just hypothetical, you really should profile with a profiler that can highlight cache usage/misses.

#4948577 Help me with ASM

Posted by on 12 June 2012 - 11:52 AM

First hit on Google:

In assembly language finding the length of a C-style string is a snap. The x86 family of microprocessors come with with the scasb instruction which searches for the first occurence of a byte whose value is equal to that of the AL register. The address of the start of the string itself has to be in the EDI register. Technically, it is supposed to be in the extra segment, but we do not need to worry about that in the flat 32-bit memory mode anymore. When used along with the repne prefix, the scasb instruction goes up (or down, depending on the direction flag) the memory, looking for the match.

This is also good:

#4945017 C++ what other IDE other than VC++

Posted by on 31 May 2012 - 09:41 AM

CodeBlocks is certainly not dead, though I admit that is what the appearance of its site suggests. It is constantly evolved, mostly for the better, and the developers listen when you have criticism/ideas or issues. As Samoth explained, when on Windows, you need to install the latest stable version first, then a nightly build. Also, you have to look for the latest builds manually on Windows, but you get automatic updates when on Linux and using Jens Loddy's repository ('jens' on the forums). CB's projects/workspaces seamlessly migrate between Win/Linux and it can import MSVC projects/workspaces.
I try out Eclipse (still way too heavy/slow for my taste), CodeLite and others from time to time, but none have yet impressed me more than CB.