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 24 Apr 2010
Offline Last Active Private

#5077990 Emo framework for mobile games?

Posted by Khatharr on 15 July 2013 - 05:06 PM

Personally, I don't think you're a real programmer unless you do it all in assembly.



Don't be a sissy. Break out those puch-cards.

#5077988 Function addresses are not fixed relative to each other?

Posted by Khatharr on 15 July 2013 - 04:58 PM

I have library-internal calls to functions A and B too. And those calls will sometimes call the wrong address (as strangely as it seems!). My library and client application run on Windows, Mac and Linux. Windows and Mac run fine. Linux used to run fine until I switched to the newest Qt version (but still same compiler). Is it possible that Qt appended additional compilation flags that influence the way my library gets loaded?


Are you sure you fully recompiled everything?

#5077773 Function addresses are not fixed relative to each other?

Posted by Khatharr on 14 July 2013 - 10:19 PM

It's normal module loading behavior. Within the file on the disk there's a table that lists the location within the file for all the relocatable assets (import descriptor table). When the module gets loaded, whether it's a dll (or whatever) or an exe, the system spreads things out in a way that makes access more convenient for runtime use, then it recalculates the addresses and updates all the references in the table to point to the memory location within the module's code page.


This article is outdated, but - to my knowledge - there haven't been any really major changes:



#5077479 Poll: Does Gladwell's rule apply to game programming?

Posted by Khatharr on 13 July 2013 - 08:51 PM

I only have 9855 hours of practice so far, dammit! sad.png


Just be thankful that you don't live in an old Final Fantasy title.

#5077477 What do i need for android mobile game development?

Posted by Khatharr on 13 July 2013 - 08:50 PM

A physics engine is just a library that you'd use to compute the physics in your simulation for you. Strictly speaking you don't need anything other than the ADK or a suitable replacement (if there is one), but if you hear about engines or libraries that catch your interest you may want to visit their site and look them over to see if they're something that you would want to use. There are some popular physics engines floating around right now. I think the one I hear mentioned most often is Box2D. I'm not sure if it's compatible with what you're doing, but looking over their site may give you a better idea of what a physics engine is.

#5077439 Game message loop - using 50% of CPU when window is minimized or inactive

Posted by Khatharr on 13 July 2013 - 05:01 PM

Since the rendering is probably skipping a lot of its actual work when the window is minimized, you're ending up with a very tight loop that's essentially calling PeekMessage() endlessly. You may want to place a short loop in there somewhere that calls SwitchToThread() until a certain amount of time has elapsed before processing the next frame.

#5077436 Poll: Does Gladwell's rule apply to game programming?

Posted by Khatharr on 13 July 2013 - 04:57 PM

It's true as much as anything Malcolm Gladwell says is true. Which is neither here nor there. 10,000 hours, what a conveniently round, easy to remember, catchy number. Almost as if it were pulled out of ass. But the basic sentiment is perfectly accurate.


Ad-anum rather than ad-hoc?

#5077236 What is ping time?

Posted by Khatharr on 12 July 2013 - 06:28 PM

If I remember correctly, in IRC a ping response is called a pong.

#5076793 Macro and GCC Compiler problem

Posted by Khatharr on 10 July 2013 - 09:08 PM

Dear Robert Geiman,


If you ever, ever do something like this again...




#5076508 Managing objects in different game states

Posted by Khatharr on 09 July 2013 - 09:37 PM

You may want to consider using your game states as distinct interfaces to an underlying model of your simulated world. In the case of data that needs to be persistent throughout, you can have a class at the game level which contains that data set. For sets of data that are only expressed through a single state, but need to persist if you switch away from that state temporarily, you can have a dual-class state, where one class holds the data and the other class interacts with it. For instance, in a JRPG, your overarching game state can hold things like your party member objects, the amount of gold you have, etc. Meanwhile, the 'map' data state will hold the objects required for the map, where the actual 'map' game state will be responsible for rendering everything, playing the audio and reacting to player input.


It sounds like this is the model that you're approaching. I've seen it used to good effect in the past.


Don't use singletons or the skeleton man will eat you.

#5076218 Difference between 8bit, 16bit, 32 bit .... graphics/video mode

Posted by Khatharr on 08 July 2013 - 03:31 PM



It's not 'better access' or 'better colors'. It's simply a higher color resolution. A 32-bpp ARGB value can provide the exact same result as an 8-bpp RGB value. The difference is that the 32-bpp color can potentially represent many many more colors, not all of which are available to the 8-bpp space. As has been mentioned, an 8-bit color palette can be used to map 24 or 32 bpp values in cases where you use 256 or fewer distinct colors, and a 16-bit map can give you up to 65536 values. The DXT formats also provide a sort of linear block-compression that uses small linear maps for blocks of four pixels.


In standard color modes, though, it's basically a difference of how large your denominator is for each channel. It's even becoming more common these days to represent each individual channel with its own float value, though storing the image in that mode would generally be a ridiculous waste of disk space. In the anime community there was a... fracas? ... anyway, there was some argument about "10-bit" color for a while. Since pre-recorded video doesn't need to make use of the alpha channel, some people were alloting 10 bits for each of the RGB channels in order to gain more color depth. The argument was really stupid in nature, since most of the people involved didn't know much of anything about video, color depth, or hardware.


Long story short, the difference in quality is nearly imperceptible, and in many cases the encoder was up-sampling from an 8-bit-per-channel source, which means that there was mathematically no image difference whatsoever. It was sure as hell noticeable when you tried to run a 10-bit video in a player that didn't support the new format, though.


But garsh, we shore got us some more bits, now didn't we?


The moral of the story is - a lower depth image can appear exactly the same as a higher depth image, provided you take a little time to learn how the different color modes work and pick the one that accomplishes your goals with the least overhead.

#5074235 Rawinput gives me only pixel accuracy

Posted by Khatharr on 30 June 2013 - 02:17 PM

I thought this was discussed in the RawInput docs.


Let me dig up my Raw Input stuff and look at it. brb






You should already be getting hardware resolution results from what you're doing.



#5074219 Circular buffer usage

Posted by Khatharr on 30 June 2013 - 01:38 PM

Circular queues are common when decoding audio, which is an example of a producer/consumer queue like Night mentioned.

#5073465 funky looking conditional statement i think

Posted by Khatharr on 27 June 2013 - 09:33 PM

It's bitwise logic operators being used the same way that you can use the addition operator to say +=.


That is:


a |= b


is the same as:


a = a | b



Seeing the |= at the top there, I'd imagine that those variables are being given a value prior to what you posted. Since boolean values are either true or zero, these operations can be used as standard logic operators in the case that they're working on boolean values (in this case they are). You'd need to be careful with &= in cases where you're not using boolean inputs, since you can have two nonzero values that would be true for && but not for &.


The idea is that you can break up complex conditionals:

if(((a && b) || (c && d) || (x && y && z)) {


bool condition = a && b;
condition |= c && d;
condition |= x && y && z;
if(condition) {

If this confuses you, do some research on bitwise logic and truth tables for and/or/xor. It should start to make sense once you have all the information.

#5073432 Forward Declaration of Class breaks the game

Posted by Khatharr on 27 June 2013 - 06:56 PM

Could you explain what the problem was so that people looking at the same problem in the future can find the solution?