Category: Old

2003 to 2010

  • 2009-18 Crystal AMP cAmp ▶️

    2009-18 Crystal AMP cAmp ▶️

    ⏱️Overview

    This is my audio player, that I implemented in 2009 (took about 2-3 weeks) and have been using ever since. Occasionally also developing it.

    It has the features I need, which were never present in any other players. And implementing them wasn’t a trouble.

    Its main purpose is to allow working with tens of thousands of files (on tens of tabs), while still being fun and a pleasure to use.

    📂Sources

    The code is here. With also downloads on Releases tab.

    Unfortunately only for Windows and using old coding style (C++03). Updated, newer version here.

    📊Features

    The list is long (as usual) and also has many helpers:

    🔨Basic

    • Playing all needed (by me) formats
      • WAV, FLAC, OGG, MP3, MP2, MPC, APE, WV, WMA
    • Playing Music files (modules, not MIDI)
      • MOD, XM, IT, S3M, MTM, UMX
    • Global Hot Keys
      With settings page to configure. Using Windows Hook.
    • Help page
      With all keyboard and mouse shortcuts listed.
    • Find
      Song name Searching, on all tabs.
      Keys for go to next, previous. Same as for bookmarks.

    🛠️Utility

    • Tabs
      With any number of tab rows and columns. I currently use 12 x 3.
    • Bookmarks
      Many levels (6), changing colors. Also for tabs.
    • Song Rating (-3 to +5)
      Visible as symbol on left and background in one line.
      Optionally, saved in filenames (at end, also with bookmarks). Stays, no matter where files are.
      No need to worry about playlist or when moving, renaming, updating, copying folders.
    • Rating Filtering
      Directly in playlist. It shows only songs rated in current range.
    • Visualizations
      Big, fast (60 Fps) and informative. Types: FFT, Oscilloscope and Spectrogram.

    📊Details

    • Informative Slider
      That isn’t just a plain block, but actually shows a preview of whole playlist.
      With:
      • Cursor and playing positions
      • View area
      • Bookmarks and search results
      • All songs rating preview
    • Time text coloring
      And useless zeros not displayed. It is quite useful.
      You can quickly see (on screenshot): longer songs, and how long are songs in albums, just from the colors.
      I have now about 10 colors for interpolation, every 1 to 1.5 minutes. Test mode with Ctrl-I.
    • FFT. Default small FFT uses 1024 points and in full screen 4096.
      Always 1 pixel line per 1 FFT point, no garbage smoothing slowing it down or wide bars with peaks.
      It uses Direct3D9 directly, with HLSL 2.0 shaders. So it draws using GPU like games, not CPU like old programs.
    • Colored bitmap fonts.
      Custom, for drawing text, from Crystal Font.
    • Fast and smooth display.
      Always achieving 60 FPS (would more, but limited by VSync).
    • Drop and insert.Normally done at cursor, with Shift at top, with Ctrl at end of playlist.
      Faster playlist managing through shortcuts.
    • Always 1 row per song (or folder).
      Showing song rating and bookmark level in just 1 line as background so you can still see as many as possible on screen.
    • Grouping for directories, automatic.
      With 3 display modes:
      • Directory
      • Directory / Parent
      • Full path on disk
    • Directory hiding or showing +
      Regardless of rating of songs inside.
    • Extended mouse areas.
      Song seek, previous/next buttons, playlist slider.
    • Options for keyboard song seek (seconds) and volume step (%) values.
    • Errors count on player, details in .log file.
    • Copy selected / all files to other path (as attribute copy in .xml) by F12.
    • 5 Font sizes (for playlist and others).
    • Whole views loading and saving.
      Window position, size, visualization etc.
      Quickly changing view with Alt-1, Alt-2, .. keys.
    • Full custom look, no title bar or buttons for window.
      Moving and resizing window with Shift-RMB and Ctrl-Shift-RMB.
      Stays in chosen place, not moved by accident and restored with view keys (Alt-1 etc).

    📜History

    I started with audio players by using WinAmp 2, about the year 2000 after moving to Windows 98. I stuck to its look and still see this 1 short column view as the one (and only acceptable) way of showing a list of song titles with their times. It doesn’t waste too much space to see a playlist. I never stepped out of the WinAmp 2.5 (or so) skins either.

    Later I moved to AIMP (2.5 I think, in 2008). It was somewhat better. After customizing the skin I got it to look cool (dark blue). The main advantage for me was that it could have tabs. After tweaking it (which shouldn’t be needed), I got it to show 7 tabs. More looked too tight and there was only 1 row possible.

    ⭐Rating

    Back then I also started using song rating, but I didn’t want to waste an additional line for that (showing half of tracks in playlist) and went for manually adding symbols to song names. That was very tedious.

    ✍️Motivation

    So firstly I wanted more tabs and rows with them. This should be just a matter of clicking buttons, to increase  /decrease rows or columns.

    Secondly, for me the idea for rating symbols in filenames was very good. Whenever I’d change directory, move, rename, copy or whatever, I’d still have my ratings saved. And wouldn’t need to care about playlist anymore too.

    This motivated me to code my own player which deals with both problems by itself. Also for future, to have any feature I wanted when I can code it.

    ⌛Conclusions

    Well 7 tabs quickly weren’t enough for me. My count gradually increased from about 21 in 2009, in 2016 reached 38 in 3 rows. I recently reduced them to 32.

    I’d say it’s the small details (and so easy to implement) that make me like it so much (and not even bother looking at any other players since then (except for a sensible chuckle)).

    Since a while I wanted to port it to GNU/Linux and did once convert most of it into SFML. At first it wasn’t stable and occasionally had weird bugs.
    But the project is working now with SFML, ImGui, and as cAmp2 here.

  • 2008-09 SPH with CUDA 🌊

    2008-09 SPH with CUDA 🌊

    ⏱️Overview

    The program from my master’s thesis from 2009, implementing Smoothed Particle Hydrodynamics using CUDA and proving 5 times faster simulation of small scale fluids on GPU vs CPU.
    Nowadays I would rather use OpenCL.

    The program is very fun to play with and has a vast number of 119 predefined scenes.

    For 56k particles it allows about 2 to 3 times slower than realtime simulation, due to small time step requirement of SPH.

    📂Sources

    Code is on github along with Windows Release 1.0.

    📊Features

    Bold marked features have own tab groups, with sliders for adjusting parameters.

    • Camera with adjustable near distance cut
    • Visual lighting parameters for rendering particles
    • Collider moveable by mouse
    • Emitters and accelerators for flow or fountains
    • Rotors with various shape allowing propellers
    • Two types of Rotational Pumps (like those for PC water cooling or aquariums)
    • Dye allowing flow tracing, with adjustable fading and shape
    • Bounds with Heightmap, sinus modulated, possibly with holes
    • Moving border for shore waves generation
    • Simulation with parameters:
      viscosity, stiffness, time step, gravity
      and vertical acceleration for flow with cyclic borders.

    Some scenes use high stiffness which requires slower time (10x), but acting closer to incompressible liquids. Tested on NVidia GeForce GTX 560 Ti.

  • 2009 Envelope editor 📉

    2009 Envelope editor 📉

    ⏱️Overview

    Envelope Editor was a program I wrote at work once. Used for doing animations in game.

    It was a simple and quite usable tool to create and edit TCB splines (also known as Kochanek-Bartels splines). Each point (besides x,y position) has also 3 parameters: Tension, Continuity, Bias. When all are zero the spline becomes just a Catmull-Rom spline.

    They had only one dimension (time on x) and produced y value.

    🔍Implementation

    The application was written using Direct3D9 (which I already used for few years at the time) and DXUT for GUI controls (I customized the theme).

    It looked nice, dark blue. There was also a second theme that was the boring, eye tiring white.

  • 2007-08 Stunt Rally attempt

    2007-08 Stunt Rally attempt

    ⏱️Overview

    After getting more familiar with OGRE and reaching limits of Stunt Playground fork, I started doing my own project (2007-2008).

    📝Implementation

    It took previous camera code and put Ogre’s terrain component to a good use. Additionally familiarizing myself with PagedGeometry for grass and later for trees too.

    It was using fmod for sound, PhysX for physics (with NxOgre). Those were used by me at work, so it was easier. Of course I wouldn’t recommend any of those two, aren’t open source.

    🔍Detail

    Total sources were just 86kB at this stage.

    You can see Stunt Rally‘s Fps bar here in left bottom corner. Surprisingly the project still starts in 2016. Must have been the time when I finally learned not to use Debug all the time, and leave some Release builds for my future self.

    🛠️Editor

    At the same time I was also experimenting with Editable Terrain Manager to have an editor for terrain, and with RBGui which looked a lot cooler and better for me then.
    There is the first [Cam – Edit] toggle bottom left, same like in earlier Track Editor versions from Stunt Rally and a brush tool window too.

  • 2006-07 Stunt Playground fork

    2006-07 Stunt Playground fork

    ⏱️Overview

    Somewhere around 2006 to 2007 I was learning OGRE in practice by forking an existing project. It was Walaber’s Stunt Playground, original video looked quite different. Is on website, but the sources aren’t available anymore (he’s gone fully commercial).

    📜History

    OGRE was very popular at that time, had many plugins, so it was the best choice of engine for me. Its version was 1.2.1 (Dagon) then.

    GUI was made using CEGUI and physics with Newton Dynamics through OgreNewt. Both of which I didn’t continue to use later since their limitations.

    📊Features

    The game had few cars, dynamic objects, an editor for placing and moving them, loading/saving maps, replay and sound systems.

    Tracks were exported just like objects, which posed a big penalty having no level of detail on them. Plus tedious editing in 3D modellers (not in own editor) and lastly not allowing an optimized terrain, grass or trees.

    ✍️Motivation

    Back then it also had open sources, great to learn from and not too big (180kB total). Compiling them was also not too difficult for me at that time. I learned a lot by modifying the game and it was a perfectly fitting experience that moved me forward in the direction I wanted to learn, without too many obstacles.

    ➡️Next

    The static tracks got me into looking for terrain editors next. And I eventually developed my own track editor years later.

    Now, if you know Stunt Rally 😉, you can probably already start spotting something similar. Well the camera system is greatly based on this one. And particles like sparks and dust I developed then are nearly the same.

  • 2007 Crystal Recorder 🔴

    2007 Crystal Recorder 🔴

    ⏱️Overview

    CrystaL Recorder (or shortly cRec) was a program I wrote for recording audio.

    At first, it just captured and saved in wav file format. It had a counter for files so each new incremented it.

    It was coded in C++ with WinAPI calls, and using bitmap fonts made in my Crystal Font program.

    📊Features

    It also had an volume amplitude bar (similar to VU meter), with overflow indication, signalling too high volume of recording.

    Then I featured it with a nice wave oscilloscope visualization. The line color changed depending on amplitude (going violet for high frequencies). It also has a glow effect, but not a real distance. For me it actually looked better since you could still see smaller details in glow same as in wave. It updated at 60-85 frames per second, same as monitor’s refresh rate. There is a similar wave visualization in my audio player.

    For later versions I’ve also added code to use the Windows Mixer interface. Gaining most of the functionality a sound card mixer has: listing channels, muting, changing volume, picking one for record etc.

    It was a nice, little, very useful program with my style of everything: colors, fonts, keys and visualization.

    ➡️End

    I was quite angry when I moved from Windows XP to Windows 7 and it actively disallowed me to record from “What U Hear”. Due to some crap, that Microsoft always does. There are even websites about it. And people doing something to change for better.

    So I stopped using (and developing) it, after I’ve found another way and then moved.

  • 2007 Physics 🎳

    2007 Physics 🎳

    ⏱️Overview

    These are various demo projects done at work, using PhysX a realtime physics simulation engine. More or less the same features can be achieved using Bullet, is open source and IMO better. I did everything it offered then, e.g. rigid body, joints, cloth, fluid and car (tires) simulation.

    📜History

    I also implemented rag doll (for bodies) and water buoyancy areas. I had a demo with rag doll in water.

    The job was very underpaid (also my first), but educational. Also good experience for my next job, since it used PhysX too.

    In the next one I implemented sailboat dynamics and water buoyancy for objects, way simpler (for my taste), but at least fast. The algorithm was for a height based water and just used 2 points on each shape type to compute forces.

    ⏳Summary

    So I learned and developed many things for game physics at the time. Definitely not all, e.g. no simulation or destruction/fracture, which got me interested. But I’d say I was a game physics programmer for few years.

    The car simulation was very basic, I continued later on my own with car games.

  • 2006 Terrain, Water 🌅

    2006 Terrain, Water 🌅

    ⏱️Overview

    This is a collection of programs written in C++ and using Direct3D9. Only the first one left (with green terrain) was mostly mine. It was also a project on college, for subject: 3D Graphics (I think). I did way above requirements as nobody even knew shaders.

    📷Gallery

    Link to more screenshots.

    📜History

    The first small terrain had a shader for blending (mixing) terrain textures together smoothly. Already found somewhere on internet. This I knew is needed for good looking terrain for start.

    After achieving just a small terrain and a cloth looking, pseudo water I started searching on internet for open source examples (it was likely the first time for me). I managed to build all of them and customize the demo applications. I didn’t put anything together as a game yet.

    The water in middle was great but very demanding for CPU, which was computing the animated noise and its normals. This is done nowadays on GPU only. Still, it had the best look IMO for years.

    White terrain with water on left, had a great animated noise but was always flat. Originally it also featured reflection and refraction. This always flat water, was still good and we had a similar one in our game years later.

    On right there is a terrain with level of detail (LOD) Geomorphing (also described here) if I remember it was CPU generated though, but had 5 levels. That was a great and complicated implementation.

    The car screenshot was someone’s 3D model, with a 2D driving code I found. I made it 3D, but only on flat ground.

    ➡️Conclusions

    Then I started thinking and realized, I don’t want to write all 3D equations, surely not a physics system. This is when I got interested in available physics engines.
    Today I would definitely recommend bullet for collision detection and simulation.

    Next, I had the same thought for rendering. Writing everything using calls to Direct3D was tedious and not very practical.
    By using a 3D engine, all becomes much easier and one can achieve much more with it. But I knew a guy at college, who liked the first approach, read books for it, and wrote his own engine.
    Later I found OGRE 3D and started learning it.

  • 2006 Shader effects 💫

    2006 Shader effects 💫

    ⏱️Overview

    This is a result of me learning bump shaders with also implemented reflection and refraction (just from cube skybox).
    There wasn’t really a goal here, just to learn and show what could be achieved with my GPU (ATI Radeon 9800 I think) at the time.

    📷Gallery

    Link to more screenshots.

    🔍Implementation

    My code was using WinAPI for window creation and messages. Then Direct3D9 calls for rendering and HLSL 2.0 for vertex and pixel shaders. Also D3DX for anything else like 3D matrix and vector operations, compiling shaders, and loading 3D models (meshes) from X files. Lastly a sprite font, for screen texts (with parameters to adjust by keys) using my bitmap fonts.

    To get mouse and keyboard events I was using DirectInput. I made a camera system to move around the scene, rotate and zoom. There was also 1 point light here.
    I wrote a Timer (based on precise QueryPerformanceCounter) for checking intervals and computing current frame rate (Fps).

    I think I made most of the basic models. I would use Blender for this now. The skull model and all textures were gathered from other demos and games.

    ⏳Conclusions

    Professional made textures made the demos look quite good, already with simple 3D objects.
    But those were just demos. In a bad looking, low level written code.

    I continued using just C++ and Direct3D9 for a while in next project’s forks with terrain and water. And after that moved to using OGRE 3D engine.
    All that was too tied to DirectX and would need major rewrites every time I wanted to use new DirectX interface. Another good reason for using an engine, it can have different rendering systems also OpenGL based.

    Still, this experience was good learning for future, as I was developing shaders in Stunt Rally too, years later.

  • 2005-06 Crystal Font 🔤

    2005-06 Crystal Font 🔤

    ⏱️Overview

    This is one of my oldest Windows programs in C++.
    It can generate colorized bitmap fonts from true type fonts with glow effect.

    Done on college as hobby around 2005-2006.
    I used bitmap fonts from it in most of my programs, until about 2010. Additionally it made the text for my logo, and lastly the speed and gear digits in our game.

    📜History

    I had a small font tool without GUI, earlier when I was programming in Delphi. This one evolved to be a full featured program with medium size code.

    I presented the program at college, during scientific circles session, for 15 minutes. The presentation was also a good experience to have.

    It was a nice, useful program for me. Probably difficult to use for others due to only keyboard navigation and value changing. It had a help screen with shortcuts though.

    📂Sources

    Later I’ve uploaded it to Source Forge and thus it became my first FOSS program. Then I moved to Google Code and when it shut down, moved to GitHub.

    Available here.

    There were several programs done called bitmap font creator, maker or editor. It was (or still is) a popular thing to do. Both using bitmap fonts and making a program for it.

    📊Features

    Among other features it allowed quick loading and saving project files and coloring schemes. Also browsing them in its own lists with previews. One could easily pick a scheme for font color and quickly match another for glow.

    Glow was computed on CPU and thus rather slow, especially for big font sizes and large textures. I didn’t develop it further after realizing that all this could probably be done with a GPU shader in real time, even with animations, at least for small to medium fonts.