Advertisement

How to program a chess: a forum based tutorial

Started by December 23, 2004 11:09 PM
276 comments, last by da_grat1 19 years, 8 months ago
hmm...odd problem...

Quote:
I copied all the contents from openalsdk include folder ("al.h", "alc.h","alctypes.h","altypes.h","alu.h","alut.h","aluttypes.h",
"alutpyes.h") into Microsoft visual C++ include folder.. and the contents of openalsdk lib folder("ALut", "OpenAL32") into MVC++ lib folder..


What ide are you using? The headers should be coppied into a new folder called AL in your include directory like this: 'AL/al.h'. I think however, that the OpenAL install should have done that for you. What happened when you tried to install the OpenAL sdk from Creative?

Some notes on dlls:
You shouldnt have to include any of the dlls in the same path of the program. The ogg/vorbis dlls are statically linked and whomever is trying to run the program should have the openal binaries (OpenAL32.dll) installed on their system (In any folder specified in your system PATH).

Will post later,
- llvllatrix
Quote:
whomever is trying to run the program should have the openal binaries (OpenAL32.dll) installed on their system

Wouldn't it be better to allow everyone to use this app (regardless of the dll in their system folder), simply by placing the dll in the same folder as the program?

About the others dll's:
I have to include them because I compile my project using Dev-c++, so the libraries I use are not exaclty the same ones included in the package downloadable from the link you gave.
Please excuse me if I'm making such a big mess for such a small thing, but I don't use dll's that much and I've installed OpenAL only once some time ago (not that much, but memory is not my strong point).

Quote:
The headers should be coppied into a new folder called AL in your include directory like this: 'AL/al.h'.

That's precisely what I meant to say...
but I admit it wasn't clear at all in my previous post.
I'd better learn to explain things
Advertisement
Quote:
Wouldn't it be better to allow everyone to use this app (regardless of the dll in their system folder), simply by placing the dll in the same folder as the program?


The advantage of packaging the dll with the program (kinda like what we did for ogg) is that you do not have to install OpenAL to use our program. The disadvantage is that we will not be running the most up to date version. For something like ogg, which is a decoder, I think its fine because we know which sound files we will be decoding (namely our assets). For something like OpenAL, where we don’t know which sound hardware we are running on, I think its best if we use what is on the system. This way we get the most up to date version of the dll, which will hopefully provide the best performance on the machine it is running on.

Quote:
Please excuse me if I'm making such a big mess for such a small thing


No worries :) Its good that you want to discuss it because you usually never get discussions like this in a class (usually its dictated to you). I'm glad you brought it up :D

Quote:
That's precisely what I meant to say...
but I admit it wasn't clear at all in my previous post.
I'd better learn to explain things


lol, I need to work on my communication skills as well :) Communication in a team (which is kinda what this is) is something you really only get exposed to in the workplace. Unfortunately English, imo, is a poor language to reason in. My favorite language is math, followed by c++ :)

Another thing we can do with this thread is guest tutoring:

- Once I finish a part of the code, I'll post with the new source and articles discussing how the code is put together (just like the gamedev articles I posted earlier).
- You guys can then take the articles and source and write a quick post explaining what the code is doing and more importantly why it is doing it, in detail. You should tailor your response to a novice audience (so that it is accessible to everyone in the forum).

Doing things this way would give me more time to concentrate on the source and give you guys a chance to practice your communication skills :) That said, the sound resource component tutorial is up for grabs (feel free to email me at thereisnocowlevel@hotmail.com if you have any questions for your tutorial). Anyone what to go first?

Will post later,
- llvllatrix
Quote: The headers should be coppied into a new folder called AL in your include directory like this:I think however, that the OpenAL install should have done that for you.


No.. when i install openAlsdk.. there is no AL folder inside the include folder.. Then I create a new folder called AL just as you said,, and put all the include folder content inside the AL folder..

After that I copied the content of openAl library "Alut.lib" and "OpenAL32.lib" into MVC++ lib folder... Then I compile it.. yeah it works..
but then when i choose the sound from openAl sample sound, It doesn't work T_T

Dos
Test res_snd_sound.h

res_snd_init_sound(); correct result: true, result: true
res_snd_set_listener_orientation_6f successful
res_snd_set_listener_position_3f successful
res_snd_set_listener_velocity_3f successful
res_snd_set_listener_volume_f successful
sound_buffer.load_sound_file(); correct result: true, result: false
sound_source.set_buffer_i(...); successful
sound_source.play(); successful
Press any key to continue

everything look successful.. when i choose the sound such as "ding" sound.. a message box appeared.. It says "console Basecode.exe has encountered a problem and needs to close. We are sorry for the inconvenience." T_T
Did I do wrong? What else did i miss?
Unfortunately the program only plays ogg file. You can either download ogg files (you can get one from the ogg article on gamedev) or you can convert .mp3 ect. to .ogg.
Thanks for your explaination.. Now I don't have to worry anymore, All I have to do is to convert the file to .ogg :) and test it..
Advertisement
Quote: Next on our to do list is a texture loading resource component.


Great.... :) ... I want to see the chess pieces on the chess board.. :)
I might just take a look into that code, I'de wager I'll develop it with classes..but possibly structs and funcs depending on how things turn out.

Lately I've been having some "issues" with OpenAL ;) But I'm sure they'll be fairly easy to overcome, just one error to get down and I'll be able to get most of OpenAL down. So far it's a pretty straightforward, simple API. The only thing I will have to look into more thoroughly will be OGGs, I hear that is quite a fun time :P
Quote: Original post by llvllatrix
Unfortunately the program only plays ogg file. You can either download ogg files (you can get one from the ogg article on gamedev) or you can convert .mp3 ect. to .ogg.


Here would be a good place for class inheritance, so that the sound system is extensible and support for other audio formats could added later on.
Quote:
Here would be a good place for class inheritance, so that the sound system is extensible and support for other audio formats could added later on.


Thats a good idea :) Using inheritance would let you load your sounds using the appropriate class. Once loaded you could use polymorphism to treat all of your derived classes as the abstract buffer class, abstracting all of the loading away.

The key here is abstraction. You dont want to give anyone using the loading function the responsibility of dealing with how its encoded. The way I get around it...or at least pretend to get around it :)... is by offering a load_sound_file function in the buffer class. The intent is that the load function analyzes the path provided to it and uses the appropriate library to load the file. In this case the only library we have written so far is the ogg library, so we dont have to analyze. Its a bit of a hack, but it works :).

Nj spotting the need for abstraction :D Glad you guys are thinking :)

The next subsystem I am working on is the Image loading subsystem. The basic idea is the user provides a path to an image file and we use that path to create a texture id. I've decided to use the library formerly known as OpenIL (Image Library) to do the job. It supports the following formats (and its Open Source):

.bmp, .cut, .dds, .doom, .gif, .ico, .jpg, .lbm, .mdl, .mng, .pal, .pbm, .pcd, .pcx, .pgm, .pic, .png, .ppm, .psd, .psp, .raw, .sgi, .tga and .tif files.

You can find more about it from:
http://openil.sourceforge.net/about.php

Will post later,
- llvllatrix

This topic is closed to new replies.

Advertisement