Jump to content

  • Log In with Google      Sign In   
  • Create Account


deadstar

Member Since 05 Dec 2007
Offline Last Active Sep 06 2011 05:50 AM
-----

#4856687 How to Log and stay Modular

Posted by deadstar on 02 September 2011 - 05:56 AM

I don't understand this fascination either. It would drive me insane having to create a logging object everywhere I needed to add an entry, or passing a logger reference to all my functions, let alone having to manually enter the filename to write to. In my opinion the single most useful and quickest to use logging method is:

#define Log(msg) SomeFreeLoggingFunction(msg, __FILE__, __LINE__)

Now go and worry about writing the game instead.


#4824227 Best Sound API?

Posted by deadstar on 16 June 2011 - 03:04 PM

I've been thinking about using OpenAL for my audio engine just due to its similar model to OpenGL, which is the graphics API I'm using, but I can't be sure since I don't have much experiance in terms of implementing audio in my applications. Any suggestions on a good sound API for C++ and FL Studio?


I've had an excellent experience with FMOD (www.fmod.org), but it does depend on how complex the audio design for your game will be. If you want your game to make some noise and play music tracks, then OpenAL is quick and simple to set up and supports a variety of platforms, but if you want an all-singing-all-dancing event-based audio subsystem with UI tools and advanced effects then OpenAL has been a little outdated for years.

What would you like to achieve?


#4817263 short sounds versus long sounds

Posted by deadstar on 29 May 2011 - 04:38 PM

WAV files contain uncompressed PCM audio, which can be opened, read and fed straight to the sound chip with no data conversion. If you have a scene in your game with 40+ sound effects playing simultaneously, this is ideal, since there's little CPU time involved and the sound chip does all of the work. OGG files require a lot more work from the CPU to decode on the fly. Data must be decoded - in realtime - into packets of PCM data, which is all done using the CPU. If you try to do this with 40+ simultaneous files, your system will choke.

There's no "one size fits all" audio format, UNLESS the hardware supports the decoding on the fly. On the Xbox 360 for example, the sound chip is custom designed to handle the decoding of XMA2 data, so that one format can be used for one-shot sound effects, long dialogue or to stream in music tracks.

It is possible to open all the necessary OGG files at load time, decode them and have the PCM data sit there in memory ready for use, but that all depends on your target platform - I wouldn't consider a method like this for iPhone, for example. Since I try my best to code cross-platform, I find using WAVs for sound effects and OGG for long tracks to suit the majority of devices just fine.


#4812966 really need help with 3D objects in openGL

Posted by deadstar on 19 May 2011 - 06:12 AM

Step 1 - familiarise yourself with some basic 3D maths. For your particular case, look up 3D Vectors - find out what they are, how to add them together, how to use them to represent a position in 3D space

Step 2 - make a basic structure to represent your Vector3. In C++, this would look something like:

class Vector3
{
public:
   Vector3() { x = y = z = 0.0f; }

   float x;
   float y;
   float z;
};

Step 2 - figure out how to apply a desired translation before rendering your 3D object :

- Create a Vector3 to represent your object's position
- Add/subtract to/from your vector depending on keyboard input
- Use OpenGL's glTranslatef() function to apply the translation before your render you object

In its very basic form, your rendering loop will need to look something like:

//Push an identity matrix to the stack
//(any glTranslate operation you do operates on the current matrix - you'll need a blank slate to work with. Look up 'world space' and 'object space' to see what we're doing here)
glPushMatrix();

//Apply the desired translation
glTranslatef(myVector.x, myVector.y, myVector.z);

//Render your object, as you're already doing

//Pop the matrix stack
glPopMatrix();


Once you've grasped the basics, I recommend reading up on 3D Matrix - what they are, how to use them to represent a position and rotation in 3D space, how to add/multiply them together, and how they apply to OpenGL.


#4777695 LEGO Star Wars III: The Clone Wars

Posted by deadstar on 22 February 2011 - 03:15 PM

This is the third title released with my name in the credits, and I'm so excited I'm almost shaking! It's out now on Xbox Live (Gold exclusive) - go to Game Marketplace -> Explore -> Games & Demos -> Demos.

Posted Image Posted Image

Laugh your way through an all-new story with the LEGO Star Wars III demo. This demo includes both space and ground levels from the most action-packed LEGO Star Wars game to date. In the full version, the story takes you through 16 different systems and experience brand new features like massive ground battles, boss fights, and multi-layered space combat. Other enhancements include expanded Force abilities, brand new weapons, characters, environments, and over 20 story-based missions.


Eeeeeeeeeeeeeeeeee I can't wait to see it on the shelves!!


#4763271 loading screen

Posted by deadstar on 22 January 2011 - 09:10 PM

To start off, you'd probably need to get your hands dirty with threading. Create a thread to handle file jobs, then push jobs to the queue from the main thread, and loop around your animated loading screen whilst querying the thread for its current progress. To keep it simple, you could base the progress on the number of files left in the queue.

If you'd like an accurate byte count, it could get tricky, since counting the size of the files you want to load would mean performing file jobs too. Realistically, you would need to know the size of the files without opening them, which would be easy if you had your own filesystem (i.e., one large bespoke data file conatining all of your game content) which had a file table in its header. This is quite common practise, and not as scary as it sounds, but I recommend getting your basic file thread working first.

All of this was a lot simpler in flash, since your app was self-contained in a single .swf file, and the size of all its contents would already be known when the application started.


PARTNERS