Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Cyrano

Pages: [1] 2
1
Audio / Multiple audio channels that can be individually managed
« on: May 09, 2010, 09:11:09 pm »
Quote from: "Laurent"
So you don't really want to manage output channels (speakers) separately, you just want to be able to manage "groups" of sounds and assign them properties in a single operation on the group?

This isn't hard to implement, you just need to create a SoundChannel class which is a container of sf::Sound instances, and provide the functions that you want (SetVolume, SetPitch, ...) that just forward the calls to the contained sounds.


Bingo!

That should work. Thanks.

2
Audio / Multiple audio channels that can be individually managed
« on: April 24, 2010, 05:54:25 am »
I think a graphic representation of my situation is in order:

-------------------------------------------------------------------------------------

Engine/resources
 |
\/
Channels 1-5
 |
\/
---1---2---3--4---5
--|--||--||--||--||--|
--|--||--||--||--||--|
--|--||--||--||--||X|
--|-s||--||--||--||--|----sounds are organized by "channels".
--|--||--||--||--||--|
--|--||--||--||--||--|
--\--\\--\|--|/--//--/
---\--\\--------//--/-----mixed together
-----\------------/
-----|----------|-------To output.
-----|----------|
-----|----------|
----------||
----------\/
-------speakers

-------------------------------------------------------------------------------------

This shows that a "channel" can be dealt with individually. Let's say channel 5 had all enemy characters' dialogue playing through it. I could mute it (the "X") and not affect any other sounds.

The benefit here is that I don't have to hunt down every sound belonging to that group, just to mute them. I can simply trigger the mute feature for the channel, and it accomplishes the same effect.

Other things, such as volume control would also be possible.

Since I highly doubt such a system exists, I expect I'll have to build this myself.

Happy coding!

-Cyrano

3
Graphics / Sprite Rendering, bit blitting, and other questions
« on: April 24, 2010, 04:50:09 am »
Quote from: "Ashenwraith"
You do realize you have to write an entire engine with animation, timing, and collision at the minimum? That is unless you are writing a complete turn based/non-animating game.


Writing an engine will be the fun part for me (I already am laying the groundwork for one). Animation, timing, and collisions are areas I'm much more familiar with. Figuring out rendering calls, however, will not be pleasant, as I have virtually no experience with rendering code. I feel fairly confident about the other areas, though.:)

Quote
Doing an OpenGL tutorial is like a breeze in comparison.


Well, I'll take that into consideration, seeing as Ashenwraith appears to favor it highly.

I've got some great ideas, but I'll just have to see how OpenGL will work with them before I go full bore on this.

-Cyrano

4
Graphics / Sprite Rendering, bit blitting, and other questions
« on: April 23, 2010, 03:28:56 pm »
Quote from: "Breakman79"
Actually, you don't need to know any OpenGL to use this library to make a 2D game.  

It's just that this library is built on top of OpenGL though so it creates a 2D scene by mapping your images to a texture that is applied to a flat polygon which is then drawn by your 3D video card.  This allows all of your sprites to be hardware-accelerated and thus freeing up your CPU for other tasks.

Works wonderfully for things like alpha-blending and lighting which were extremely slow and CPU intensive with the old blitting way.


Thank you! :)

5
General / Pushing around things on the stack
« on: April 23, 2010, 05:47:16 am »
Quote from: "Breakman79"
No problem.  Sometime you should take a look at the C++ Standard Template Library.  Many useful and time saving classes for building data-structures.  

Here's a tutorial site


Thanks for the link. I'm already familiar with the STL, and use it frequently.

In retrospect, I probably should have read the 'ol "C++ for Dummies" a little more thoroughly in the data structure sections. :roll:

-Cyrano

6
Audio / Multiple audio channels that can be individually managed
« on: April 23, 2010, 05:40:47 am »
I'm new to multimedia programming, so of course I have a huge amount of questions. Some programmers don't like newbies and simply shove documentation links at the hapless fellows (not to say that those links aren't useful!). I'm glad to see that at least some are willing to put up with my periodically clueless questions.

Quote
Cyrano, you really are full of questions :D


That I am. I don't know the answer, so I ask. I think the worse sin on my part would be not to ask, but to code on in ignorance. THAT would be a sin. There is enough worthless code out there already (*cough* Google, wikipedia). I don't want to add to that refuse heap. My knowledge base is limited in several areas, so I ask the questions that seem most pertinent to the issues I have at hand.

Quote
Quote from: "Cyrano"
Also, if stereo, would that be a 2 channel system?

Stereo does mean 2-channel, doesn't it? o.O


Dumb question, I apologize. I had seen an issue where a guy basically had to make stereo sound by having dual mono channels outputting the same data...it's a long story.:?  Gave me the wrong impression, which led to a foolish question.

Quote
By the way. Maybe this is a stupid question. Let's imagine we have a 5.1 sound system. I want to send data only to the.... well, let's say, to the 4th channel. So far, i managed to do it by creating a sample array with the size of 6 * [sample number], filled with zeroes, and the fourth number of every six-number-packet is filled with the desired data. (I really hope this is understandable :D) But I find this very... I don't know which word is suitable here, so.. I find it wasteful. Is there a way to send data only to a selected channel, or this is the way how OpenAL works? Thanks for the answer :)

[EDIT]
I have a feeling that I just asked the same question that Cyrano did... :$


That is a far better way of phrasing it than I could have done. :!:  Not a dumb question at all. Thank you!

And yes, that is more or less what I was trying to articulate, if unsuccessfully. :roll:

I have my own reasons for wanting such a structure.

-Cyrano

7
Graphics / Sprite Rendering, bit blitting, and other questions
« on: April 23, 2010, 05:15:40 am »
Quote from: "Ashenwraith"
Read and do the NeHe opengl tutorials.

Then come back and do the sfml tutorials.

You can talk about basics all day long and not understand anything because it's meaningless since you have no where to start from.


Sorry, I don't do OpenGL at this time.

I don't need to render 40 gazillion polygonal, gourad-shaded, light and bump-mapped sprites. All I need are the tools to quickly take 2D images from image sheets and put them on a screen. That's why I haven't really looked into OpenGL. I expect it probably has most of the functionality I'm looking for, but I have been under the impression that it is not the easiest API to learn. I've got other things to do with my life than program, so I don't want to spend half of my programming time sifting through loads of documentation just for the few graphics functions I need.

Still, it could save me a lot of trouble...

I'll consider it.

-Cyrano

8
General / Pushing around things on the stack
« on: April 22, 2010, 11:04:45 pm »
Quote from: "Breakman79"
In that article stack is a datastructure


I'm guessing that you must be very new to programming in general as that's a fairly basic concept.


Correct you are! I am a beginner, yes, but I'm not totally stupid. I'm asking questions to fill in the gaps in my knowledge.

I can write a perfectly good program that runs, start to finish, but I'm afraid that the books I read on C++ did not heavily cover datastructures. Anything I know about those has come from reading articles and examining other people's code.


Thanks for the article. I was already familiar with the concept of the linked list and the array, but I wasn't 100% sure what the term "stack" meant. Now I know.

-Question answered! Thanks!

-Cyrano

9
Audio / Multiple audio channels that can be individually managed
« on: April 22, 2010, 10:53:28 pm »
Right, so that "tunnel"... would it be a mono or stereo output?

Also, if stereo, would that be a 2 channel system?

How does SFML decide how to mix the sounds together? (Ex: .wav1, .wav2, and .wav3 all want to play simultaneously from a mono channel.)

10
Graphics / Can you "send to back" with graphics?
« on: April 22, 2010, 07:15:48 pm »
Quote from: "Mindiell"
You have to order them, they are drawn in the code order.


You could make a ZOrder manager for your sprites, but it's a fiasco try to do if you're just starting out. It would probably have to manually assign the order sprites are to be drawn in and...it gets messy, but it is doable.

11
General / Pushing around things on the stack
« on: April 22, 2010, 07:07:09 pm »
Another question:

After seeing this: (http://gamedevgeek.com/tutorials/managing-game-states-in-c/), I noticed that the author of the article mentioned "pushing and popping" objects  on the stack. What does that mean? How is it accomplished?

From what I understand, the stack is part of the memory used by the program, and objects can be loaded into it. When an object is "pushed" it moves up or down on the stack, right?

Thanks again!

-Cyrano

12
Graphics / Looking for a better design for drawing sprites in order.
« on: April 22, 2010, 06:41:15 pm »
Quote from: "Laurent"
Optimizations that you can make depend on what the application, what it draws and how it uses the graphics module.

But basically, SFML is designed so that people can concentrate on high-level stuff and not on finding the most optimized way of doing things -- there's only one in SFML.


I like that line of reasoning. :)

The reason I asked was simply to find out whether or not there was a more efficient way of getting the job done.

Thanks!

-Cyrano

13
Audio / Multiple audio channels that can be individually managed
« on: April 22, 2010, 06:39:00 pm »
Quote from: "Laurent"
If you want channels you can design your own system, but the audio module of SFML doesn't work like that. The library already takes care of mixing sounds that are played simultaneously.


Oh!

Ok, I kind of figured that that was what I'd have to do in the end; I just wanted to see if such a system had already been implemented by someone else.

Another question (I'm full of them):
What do you mean by "mixing sounds"? Does that mean that they are all just mashed together in the same output stream/thing?

14
Graphics / Sprite Rendering, bit blitting, and other questions
« on: April 22, 2010, 06:35:35 pm »
Quote
You don't need to.  All of the complicated opengl calls for binding the textures to quads for 2D rendering are nicely wrapped up in easy to use objects and methods.  

I suggest taking a look at Drawing Sprites tutorial and the source code example it provides.


Thanks for the link, it looks good from what I saw.

So if you bind a texture (which seems to be akin to an image ".gif, .png, .jpg, etc.") to quads (some form of coordinates? like x and y perhaps?), that simply  means that you have attached coordinates that can be manipulated to an image?

Answers appreciated!

-Cyrano

15
Graphics / Looking for a better design for drawing sprites in order.
« on: April 22, 2010, 04:00:39 pm »
Quote from: "Laurent"
"The fastest geometry is the one that you don't draw".

Reusing sprite instances is not really an optimization, a sprite is a lightweight object and its creation/destruction doesn't involve expensive operations.


So then, what is an optimization?

I can see how not drawing geometry over and over is a good idea. It wastes time and CPU power, but aside from reducing redundancy and useless system calls, what other optimizations can you make?

Pages: [1] 2
anything