I'm continuing and finishing the thread with my own engine. It's for a game in the Free Basic programming language, using various libraries to suit my needs. This includes MP3 audio, PNG graphics, and True Type fonts with Russian language support. This time, everything worked! I managed to get past the cycle of problems. And everything works! Hurray! I'm so happy!
The thing is, Free Basic doesn't have a number of built-in features. Like working with PNG files, it can't read MP3 files, and so on. But you can always find a third-party library. So, this is my first attempt at setting this up. And it worked.
FreePng, for working with PNG files. This is a 32-bit color depth. Transparent backgrounds are enabled only through the ALPHA drawing mode. And not TRANS. I spent a lot of time fiddling with this. I needed to enable the ALPHA mode.
I learned how to scale images. The pixel magnification is exactly what I needed. No anti-aliasing. Basically, we're writing our own zoom function. And we're connecting it to image creation. Basically, we're scaling all the pixels, turning them into larger squares. Drawing point-by-point. We're actually transferring the image point-by-point.
I used the FBSound library for sound. And everything worked right away. I learned how to play sound. Everything was fine with the music file, too. But there was a small issue with stream playback. There was a sharp sound at startup. I fixed that, too. I switched from stream mode to just file playback. Everything worked. And there are sounds. Like character movement or character sounds. And a musical theme. Sound was the easiest part.
For TrueType text, I used the FreeType library. Fonts were a bit tricky. Especially in Russian. I just needed to save the program text file itself in UTF8 with BOM encoding. I spent a long time trying to figure out why it wasn't working. That was my last resort. Could the encoding of the source file really have an effect? I spent a lot of time debugging, so to speak. I started from what I saw on the screen, line by line, looking for the problem.
Now I need to organize all this into BI - BAS blocks. So that all the functions I work with are there. For example, FTText. That's where I work with text. Library functions and what I've wrapped in my functions. And a few other little things. Like where to put the library files. The compiler doesn't always see them. And then I can start making my own games. With these technologies I've already mastered.
I spent a lot of time setting up all these libraries. But in the end, everything worked. Now I have sprite images in PNG format, 32-bit color. With a background cutoff. And I can scale them pixel by pixel. It's the perfect solution! I'm even pleased with myself. I can play an MP3 file as a theme song.
And I can also create sounds for all events in the game itself. Gunshot sounds and explosions, for example. And the theme song plays. The volume can be adjusted.
And also, separately, these are fonts. TrueType format. They're great fonts. They have different languages. English, that's clear. Russian is there. And I can display all of this. In different sizes. Different colors. Set a background for the text. There were some problems with that, but I managed it.
And all of this will now help me in creating the game!
Although I still have a few questions. About the library, how to connect it, some tweaks. But you can leave it as is if you need to. Where do I find the files for the library?
Dima Link is making retro videogames, apps, a little of music, write stories, and some retro more.
Since I've been sick, I haven't been able to maintain my development pace. And yet, I've decided to make a series of games similar in programming and gameplay concepts. I've decided to work on games like Galaga and Space Invaders for now. And in theory, it shouldn't be difficult. I have some ideas.
I've already done some ideas. And I can improve them or change something. On the other hand, my illness has slowed my activity. I'm recovering now. I'm still feeling a bit weak, but my activity isn't quite where it should be. I also noticed a few things in my Free Basic projects that I wanted to change.
First, the graphics. Free Basic itself understands the BMP format via the BLoad command. I decided to try other graphics formats. Jpg, PNG. Anything along those lines. There are many libraries for these things, and I've tried them all. It's been a while. I made mistakes every time and couldn't quite get it right. But I settled on FbPng. It worked.
It's the sound. Free Basic can play WAV files. But they're very large. My games are simple. And things like a WAV track can be extremely large, much larger than all the graphics and code. The sound was faster. That was the first thing I started changing. And it worked quickly. It gave me hope that I could use libraries to expand Free Basic's functionality, and do so with a simple interface.
It's the font. Again, I don't know if Free Basic can handle Russian text or UTF-8. I haven't figured it out yet. I decided to use a library, too. It's FreeType2. I use it to create text. I tested it. I've already gotten some results, but I haven't figured it all out yet.
Right now, I'm working on things like this: graphics, sound, and text using libraries in Free Basic. In a simple version. I haven't figured everything out yet. So the projects themselves are on hold for now. I'm working on these developments.
The sound worked right away. I quickly Googled it. The FBSound library popped up. I stumbled upon it right away. I tried it right away. It worked. There was a slight, extraneous, harsh sound, though. At first. But it just lost everything.
But I struggled with graphics. I tried a bunch of libraries. It was basically like studying. AI isn't exactly an implementation. I had to figure it out a lot. I had to try them out. They were all different. I tried FBImage; it seemed like it was a simple library. But I didn't get it. Then there was something about JPG. But I didn't get it.
Then came more serious developments. Like OpenIL, now called DevIL. Everything there is originally in C. And there is documentation. But it's not that clear. I even configured something there. But I still couldn't get it. I realized I'd spend too much time trying to figure it out. Basically, I need to put it aside for studying. Learn how to use it. Then there was Cairo. Also a large library for graphics. I thought I was starting to get it working. But I spent a lot of time figuring out how to run it. It was starting to work. But only the beginning. In the end, it didn't work out.
And FBPng was the last thing that saved me. And a separate program like ImageMagik. To convert everything from jpg to png. Lots of sprite images. That's all I've figured out so far. I can scale images. I can just output images. That's all I've figured out so far. I still need to figure it out.
So, about sound. FbSound seems to work. But there's a sharp sound when playback starts. With FbPng, I still need to figure out how to make the background of an image transparent. And it looks like it'll be ready.
And Freetype2 for text. I've only just figured out how to write English text. It's also a pretty tricky output format. But I wrote a procedure that can print something. But I need to keep working on it. It's still a bit wonky.
That's the progress I've made on developments and projects. All of this is for Free Basic. Although there are options for other programming languages. I haven't figured that out yet. A lot of it is for C. That's for sure. But for Free Basic, you also use BI files that sort of link these libraries to the Free Basic environment. It's tricky, of course. But it seems to be working. But it's still a bit wonky, and not everything.
Basic Pascal version 1.21 "Sand Road" – most newest version. In this version there are 4 new games! Straight Road, Galixanar, Crest and Shooting Mod X, Fish Arcade Extreme Mod. And even more retro games! It is a pack of retro games with modern versions of Basic and Pascal.