Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » This Place Just Doesn't Die

This thread is locked; no one can reply to it. rss feed Print
This Place Just Doesn't Die
Chris Katko
Member #1,881
January 2002
avatar

Polybios said:

I thought Allegro5's audio addon could play MOD files using libdumb? I've never tried it, though.

I thought that too. Worst case it couldn't be that hard to interface to a separate mod playing library like fmod, or, writing your own / adapting libdumb--I can't imagine modules are "that" hard to play, their entire design was one of practicality. A list of patterns, a list of pattern order, BPM, and a bunch of samples. They didn't even have "instruments", IIRC, until XM/IT file formats.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

Gideon Weems
Member #3,925
October 2003

Are you guys trolling or something? Of course A5's audio add-on (i.e. DUMB) plays MOD files. I thought that was common knowledge.

I did just notice, however, that there does not seem to be an example program for MOD playback.

Chris Katko
Member #1,881
January 2002
avatar

I honestly never checked and thought it wasn't ported to A5. Fair enough.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

Niunio
Member #1,975
March 2002
avatar

Are you guys trolling or something? Of course A5's audio add-on (i.e. DUMB) plays MOD files. I thought that was common knowledge.

I did just notice, however, that there does not seem to be an example program for MOD playback.

I didn't saw such information in documentation, and an example should help too.

-----------------
Current projects: Allegro.pas | MinGRo

Gideon Weems
Member #3,925
October 2003

Quote:

Depending on what libraries are available, the full set of recognised extensions is: .wav, .flac, .ogg, .opus, .it, .mod, .s3m, .xm, .voc.

http://liballeg.org/a5docs/trunk/acodec.html

Maybe you guys don't have DUMB installed? I'm not sure how it works, as I install DUMB on pretty much every system I own.

Neil Roy
Member #2,229
April 2002
avatar

Are you guys trolling or something? Of course A5's audio add-on (i.e. DUMB) plays MOD files. I thought that was common knowledge.

Sorry, but my fantastic powers of ESP aren't working. There is no documentation or examples of how to use that at all. You need to quit assuming that people can guess what the library can do and provide solid documentation and examples.

SDL2 + SDL2 Mixer had plenty of examples. I got it working with it with no problems.

This is some the code from my own experiments (aside from the usual SDL init stuff) to load and play MODs in SDL2 Mixer, minus the error checks...

// load support for the OGG and MOD sample/music formats
Mix_Init(MIX_INIT_OGG | MIX_INIT_MOD);
Mix_OpenAudio(22050, MIX_DEFAULT_FORMAT, 2, 4096);

Mix_Music *title_music = Mix_LoadMUS("Title.mod");
Mix_PlayMusic(title_music, -1);   // Play title music in an infinite loop

Too easy, and I have barely gotten started with SDL2 but it was easy to implement.

Got an Allegro 5 example? I would love to try it out.

Niunio
Member #1,975
March 2002
avatar

Neil Roy said:

Got an Allegro 5 example? I would love to try it out.

Me too.

-----------------
Current projects: Allegro.pas | MinGRo

Bruce Perry
Member #270
April 2000

I honestly never checked and thought it wasn't ported to A5. Fair enough.

There is something similar-ish that wasn't ported, and that's the MIDI infrastructure and the DIGMID driver. As I recall, it allocated some voices synchronously, then used a timer interrupt to start/stop/reassign those voices in response to MIDI events. Designed for DOS where you had one 'thread' and then interrupts where everything was dangerous. :)

Although I liked the ingenuity at the time, it didn't make a great deal of sense (at least for MIDI files where the timing information is embedded), because you want those events timed in terms of sampling positions in the audio output, not done using a parallel clock that isn't well synchronised with the audio output. JGMOD was an Allegro add-on that did MOD playback using the same approach, but DUMB and most other mod players work with sampling positions.

[EDIT]
<-- Do I win the thread?

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Peter Hull
Member #1,136
March 2001

Neil Roy said:

I think Allegro lost it's edge when they made Allegro 5.

Agreed. A5 gives you a lot of control but it doesn't make simple things simple, like A4 did.

For instance, most programs I would guess need to create an event queue and attach an event source from the display; this should be made easier.

For instance, the examples (Skater, Allegroids and the other one) all use different methods to do the main loop. There should be one simple way to do this.

Where you need extra control, that should not be the default. Just needs a few helper methods I suppose.

Regarding age, I definitely used Allegro 3.x in the last century, before that I was using xlib with Borland. But for some reason I didn't sign up to a.cc until 2001. Was there another site for Allegro at that time? (Allegro Games Depot or something?)

[edit] Aha! http://www.gamasutra.com/view/feature/131793/allegro_inspires_a_new_generation_.php

Polybios
Member #12,293
October 2010

Neil Roy said:

Got an Allegro 5 example?

When you have Allegro built with DUMB, minus initialization and error checking, the shortest way boils down to:

al_init_acodec_addon(); // Don't forget.

al_reserve_samples(NO_SAMPLES); // Creates default mixer.

// You can pick NO_BUFFERS=8 and SAMPLES_PER_BUFFER=1024 for a start
ALLEGRO_AUDIO_STREAM *stream = al_load_audio_stream("yourmodfile.mod",
                                                    NO_BUFFERS, SAMPLES_PER_BUFFER);
al_attach_audio_stream_to_mixer(stream, al_get_default_mixer());
// It will play once... You can make it loop by calling
al_set_audio_stream_playmode(stream, ALLEGRO_PLAYMODE_LOOP);

NO_SAMPLES may be 0 here, this refers to the number of samples that can be played simultaneously with al_play_sample.

So you can just load it as any other audio stream. You don't need to call DUMB yourself at all, you just need Allegro built with DUMB. Under Linux, it seems to be available via the libdumb1 package. I'm not so fluent with Windows binaries, but it is included in SiegeLord's allegro_winpkg.

You can also get a nice ALLEGRO_EVENT_AUDIO_STREAM_FINISHED event when the stream finishes playing, as it's also an event source.

As for the docs, I've noticed there is no FAQ for Allegro5. This would be a candidate.

Chris Katko
Member #1,881
January 2002
avatar

I really don't see what's so overly complex about Allegro 5. Even SFML has basically the same functions, in the same order, just with different names.

I think it's more an issue of documentation and really, community interest / advertising. If more big games used Allegro, everyone would know about it.

Factorio uses Allegro 5. But they're not exactly going out of their way to brag about it.

But all game programming libraries took a serious hit when "game engines" became common place. Now you don't have to be a programmer. You can just "start making a game" instead of writing boilerplate engine code and having to learn "how physics work" and how to design a game loop, etc.

I'm still not entirely sure why SDL has much more recognition. When it comes to games that are multi-platform and open source, SDL is ubiquitous. Everything "gets ported to SDL" eventually. OpenTTD. OpenRCT. OpenRA. OpenGlad. Hell, I think Unreal Engine 4 even supports SDL as a backend on Linux.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

bamccaig
Member #7,536
July 2006
avatar

I don't know much about SDL. I imagine part of it is that it's a simpler damn name. :) That shit can matter when it comes to competition. In any case, we also lost several key members here over the years for various reasons. That has a lot to do with it. And for a while people were downright hostile here on the forums. It stopped being a friendly place. It became a place where you didn't want to post. The Allegro community is barren now so when newbies find us they don't find a thriving community. They find a community that looks like it just started and don't understand the history behind it. SDL is presumably still on fire like Allegro was 10 years ago. Of course, I never really found much use for Allegro personally. I found that I was not a very good game programmer. But I learned a lot about programming in general from these forums, as well as off-topic ordeals, which is why I stick around. Maybe someday I'll figure out the missing pieces to develop a game... :(

Edgar Reynaldo
Member #8,592
May 2007
avatar

I joined right around 2007. I started programming in C and C++ messing with the command line and interactive programming but I needed a graphics library, and the first thing google came up with worth anything was Allegro 4. I actually started programming when I was like 10, with GWBasic making simple screen drawing programs. I missed that, and I didn't program for a long time, until I was in my late twenties.

I found the allegro forums, and it was a fantastic format for question and answer. I loved helping people out, and I made the most detailed posts. I posted my questions, and people were usually quick to help. I've never felt unwelcome on the forums. We've had our fights, but we always make up. :-*

Sometimes it gets heated, seems a few people have had their feelings hurt, and a few people left. Most people just grew up and got jobs and families to take care of. Our incoming newbies haven't been staying as long, or people are just lurking these days, but our intake has been less than our outtake, and our community has been shrinking. It doesn't help that a.cc has mostly been put on the back burner. Files page is severely out of date, and people get distracted by a.cc and miss liballeg.org and the wiki, and it leads to endless confusion.

EDIT
In fact, May 2017 was my 10 year anniversary here at a.cc. yay!

_o/
[]
/|

Niunio
Member #1,975
March 2002
avatar

Polybios said:

When you have Allegro built with DUMB, minus initialization and error checking, the shortest way boils down to:
(some sample code)

Thanks. :)

-----------------
Current projects: Allegro.pas | MinGRo

Specter Phoenix
Member #1,425
July 2001
avatar

When SDL is mentioned, these are the two videos I think of:
Getting Started with Linux Game Development

video

Game Development with SDL 2.0
video

"Can't a man even talk to himself without being interrupted?" -Krull(1983)
"Through vengence I was born. Through war I was trained. Through love I was found. Through death I was released. Through release I was given a purpose." -- Specter Phoenix
"Programming == AWESOME the rest is just tools to accomplish it."
END OF LINE

Chris Katko
Member #1,881
January 2002
avatar

Oh, I forgot. Another thing that took A.CC down some was Stack Overflow being the "goto" for questions, and Reddit being the goto for "cool links to share with people."

That being said, SDL still seems to have survived much better. And I have no idea how the newer up-and-comer SFML became so popular.

I need to spend some more time investigating their APIs but I'm really thinking it has nothing to do with API structure. They're all thin wrappers around DirectX, OpenGL, etc. You can't abstract away the fact a screen has a resolution, a refresh rate, windowed vs fullscreen, etc. Comparing 7 lines of API code to 5 lines of API code for X library vs Y library cannot be a significant reason for the disparity. My only guess is the integration or attraction of people with community connections or skillsets. Either acadamia (e.g. game dev schools using SDL because it showed up first on Google or whatever.), or a few notable guys working for notable companies making notable products.

IIRC, SDL was written by a company that was developing ports of games to Linux / MacOS and needed a cross-platform layer. So that's instantly more industry exposure than most of us have with the sole exception of the long departed Shawn Hargreaves.

As long as you guys keep supporting Allegro 5, I'll keep name dropping it whenever I make a product that uses it. I've got a couple in the pipeline. But as always... health and life (hugely behind in work!) issues have been taking precedence.

I've got a really cool utility I think will make a big PR/viral splash when I get it running. But I'm trying to keep it secret right now because the idea is so novel.

--

Not sure if we should start another thread for this but... what does Allegro 5 really lack at this point? Other than rigorous bug testing / unit testing on many platforms (Linux, Mac OS X, Windows, iOS and Android), are there any features that really need done?

- A network library is, as we've discussed, a "bad idea". Newbies like it, but we should at least have a FAQ and explain why it's a bad idea. (IIRC, great network libs exist already, and network libraries are usually so coupled to a custom game that taking a pre-packaged one can be a real PITA.)

- A proper FAQ.

- Wiki work. Tutorials. Articles? Etc?

- Is there any kind of PR work we can do? Great articles submitted to Gamesutra? (Can anyone submit them?) Articles submitted to Reddit and Hacker News.

- YouTube videos.

I'm actually planning on doing some YouTube videos on game development subjects (as well as many others like physics). As mentioned, I'll be name dropping Allegro.CC/A5/etc.

Lastly, slightly related: I just uploaded an hour ago my 15 minute speedrun of Fallout 1!

video
(Click the full YouTube link to see all my speedrun notes in the description.)

I just found out about, downloaded and tried KDENLIVE which is a FOSS non-linear video editor. It's AMAZING on first impression. Exactly the kind of "full editor" you expect it to be like Adobe Premiere when I was in high school. It has tracks, clip editing, effects and transitions. And outputs to any format, framerate, etc. I JUST started with it but so far I found it to be fairly straight forward. In this video, I had to edit out all the times I saved the game (because they don't count for time, and also, they they're kind of annoying to the flow of watching the gameplay).

Now that I found a non-linear editor I can finally use (that's free!), I'm going to start making more videos, of higher complexity and production value. This video was kind of a short test of those skills since I have zero modern experience in video editing and all my previous uploads have been simply 1-to-1 captures from Open Broadcast Studio.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

Neil Roy
Member #2,229
April 2002
avatar

The thing that attracts me to SDL2 (and I haven't created anything with it aside from some test projects) is the support, it is updated quite regularly, there are always builds available for download for all platforms and in 32 and 64bit and they work as intended. There are many addons for it to cover other support you may want (Mixer comes to mind). I personally was able to easily compile SDL2 GFX addon for MinGW into a library as it was the only one I found where I couldn't get something for MinGW. It was a breeze and worked no problems.

There's plenty of documentation and tutorials out there.

I love Allegro, used it since I first started C programming in the '90s, but the support for it has become sporadic and the builds may or may not include everything you wish and may or may not work. Also, I strongly feel Allegro 1-4 was loved for it's ease of use, Allegro 5 changed all that. Now SDL, SFML etc... are all fairly similar to Allegro 5, but that is the problem. They are all t he same, so what is there to make Allegro stand out? Nothing. If a new Allegro went back to the old ways like Allegro in the past where things were made simple. You don't NEED to support every little thing out there with every feature possible, but mainly the common elements and make it simple to use. The audio part of Allegro 5 is horrendous compared to Allegro 4! In my Deluxe Pacman 1 game, which uses Allegro 4 I was easily able to change the pitch of the sound, gradually over time. I would raise the pitch as the player ate the pills but in Allegro 5, I need to jump through hoops to do it and there is no clear documentation on how to achieve this.

The fact that I just got started with SDL2 and I was easily able to figure out how to get started in things like audio and graphics without having to ask ANYONE any questions online at all, speaks volumes about it and why people gravitate towards it. I don't want to have to post online and wait a week for replies to figure out something that should have documentation with examples.

I may just reprogram my game with SDL2 just to compare functionality and my experience between the two. I'll say one thing in favour of Allegro 5 right now, it's physfs support is nice. It is looking like more of a task to do something similar with SDL2.

Specter Phoenix
Member #1,425
July 2001
avatar

The two videos I linked pretty much say why SDL took off compared to Allegro. SDL, being used to port AAA titles to Linux and Mac, getting a huge push by being used by Valve for the Steam App on Linux.

SFML is only getting a push because of how the C++ Standard and the committee appears to be edging out C. Honestly that is the only reason I see people recommend SFML, because it is written in "native C++".

Same way with Amazon's Lumberyard engine and the Vulkan API. People are swearing by them solely because AAA devs and big name indie devs are using them. When I looked into it, most articles said Vulkan and DirectX were similar API wise and the main reason to chose between them was because DirectX was Windows 10 and Xbox One while Vulkan supports Windows 7 and 8, giving you a larger consumer base.

Honestly, that seems to be the only determining factor in recent years. Do AAA or big name indies use the engine, tool, library, etc.? Yes? Then learn it. No? Then move on. I wish I could say it was more in-depth, but the more I see on game development sites the more I really think it is just that factor.

Then you get into the fact that with Game Maker, Unity, Unreal, etc. It's easier to learn C# and Unity tutorials to do 2D and 3D games cutting out the libraries altogether.

I weep when I see new game developers whom I've talked to on social media refer to making a game with C/C++ and Allegro/SFML/SDL as doing it 'old school'.

"Can't a man even talk to himself without being interrupted?" -Krull(1983)
"Through vengence I was born. Through war I was trained. Through love I was found. Through death I was released. Through release I was given a purpose." -- Specter Phoenix
"Programming == AWESOME the rest is just tools to accomplish it."
END OF LINE

bamccaig
Member #7,536
July 2006
avatar

I just found out about, downloaded and tried KDENLIVE which is a FOSS non-linear video editor. It's AMAZING on first impression. Exactly the kind of "full editor" you expect it to be like Adobe Premiere when I was in high school. It has tracks, clip editing, effects and transitions. And outputs to any format, framerate, etc. I JUST started with it but so far I found it to be fairly straight forward. In this video, I had to edit out all the times I saved the game (because they don't count for time, and also, they they're kind of annoying to the flow of watching the gameplay).

Now that I found a non-linear editor I can finally use (that's free!), I'm going to start making more videos, of higher complexity and production value. This video was kind of a short test of those skills since I have zero modern experience in video editing and all my previous uploads have been simply 1-to-1 captures from Open Broadcast Studio.

Thank you for sharing. I didn't know about that, but it seems like a nicer way to upload demos!

video

I haven't tried KDENLIVE yet, but it also sounds like a useful tool.

Neil Roy
Member #2,229
April 2002
avatar

SFML is only getting a push because of how the C++ Standard and the committee appears to be edging out C. Honestly that is the only reason I see people recommend SFML, because it is written in "native C++".

I'll never use a library written with C++, I want speed and C is the closest one can get to machine code without using machine code. C is also more portable. C++ is not.

With that said, I checked out SFML and it does seem like a nice little library, but I see no reason to use it over SDL2 or Allegro to be honest. Anyone who feels it will be somehow more compatible with C++ only shows off their ignorance. Besides, I still program in C, C++ is too convoluted for my tastes.

There's a really good talk on SDL here...

video

Around 6:10 into it he mentions why C is the best to use over C++ for the library.

Edgar Reynaldo
Member #8,592
May 2007
avatar

Neil Roy said:

I'll never use a library written with C++, I want speed and C is the closest one can get to machine code without using machine code. C is also more portable. C++ is not.

Sigh. Old timers. STL. Smart pointers. Destructors. Exceptions. Classes. C++. Nuff said.

Neil Roy said:

There's a really good talk on SDL here...

video

Around 6:10 into it he mentions why C is the best to use over C++ for the library.

For a library maybe, but for an app, no. An hour talk, admittedly with zero code. Great. I'm not gonna waste my time.

Neil Roy
Member #2,229
April 2002
avatar

For a library maybe, but for an app, no. An hour talk, admittedly with zero code. Great. I'm not gonna waste my time.

I'm not surprised. But, my comment, if you look back and actually learn to read, was about what the LIBRARY WAS WRITTEN IN.

How do you know there is zero code when you didn't watch it? I won't waste my time with anything you do from now on either. It's a two way street buddy.

"Old timers" my ass. All of the libraries that are worth using, INCLUDING ALLEGRO are written in C! There's nothing "old" about it!!! Grow a brain. You insulting little puke! >:(

Edgar Reynaldo
Member #8,592
May 2007
avatar

Overreact much? :-/

You're so stuck in your ways, you'll never change.

The guy himself says about 2 minutes in there isn't any code.

Besides, I hate videos. They take forever, and they rarely teach you anything when it comes to coding. An hour of watching a guy click buttons on his IDE's GUI. Woo. Hoo.

Neil Roy said:

All of the libraries that are worth using, INCLUDING ALLEGRO are written in C!

Except for most GUI libraries, like WxWidgets and Qt. Doing the exact same thing in C that you could do in C++ takes like 10x longer, and is way more inconvenient. As for a compiler not being able to generate good machine code for C++ as opposed to for C, that is just bullshit.

Arvidsson
Member #4,603
May 2004

Ah such a friendly community over here. Feels just like home. :-*

bamccaig
Member #7,536
July 2006
avatar



Go to: