Tag: C++

GraphStudio fork

by on Jun.07, 2010, under Code

I have made a few improvements to GraphStudio, the open-source GraphEdit clone:

  • The limit for text entry in certain combo boxes has been removed
  • Basic XML graph saving support has been added (only filters and connections at the moment)
  • Pins are now referred by their indexes in XML rather than by ambiguous names
  • Added command-line /render parameter, which loads a graph, plays it and exits

XML support and /render allow scripted generation and rendering of XML graph files.

Source, download.

3 Comments :, , , more...

Why is the amount of text I can type in my combo box limited by its width?

by on May.26, 2010, under Random

Once in a while you’ll stumble upon a combo box which doesn’t allow you to type past the right edge of the control. When normally typing more text would just scroll the contents, you’ll just get back an annoying beep. The amount of text you can enter is actually bound by the on-screen width of the text – thus, you may be able to enter 125 “i” characters, but only 25 “W” characters.

The cause of the problem is that the combo box was not created with the CBS_AUTOHSCROLL style:

CBS_AUTOHSCROLL
Automatically scrolls the text in the edit control to the right when the user types a character at the end of the line. If this style is not set, only text that fits within the rectangular boundary is allowed.

Visual Studio’s resource editor has a different name and description for this property:

Auto
Automatically scrolls text to the left when the user types a character at the end of the line.
Leave a Comment :, more...

The perfect experience / level curve

by on May.16, 2010, under Code

I was recently tasked to create a required-experience-per-level table for a game – that is, create a table which indicates how many experience points the player must earn to progress to a certain experience level. The requirement to reach the next level must continuously increase (the “double derivate” must be non-negative). Of course, it is easy to come up with a function to satisfy that requirement alone, but what about generating a level curve that’s also aesthetic? I mean, it’s much nicer to look forward to reaching 15000 points than, say, 16384.

So, I wrote a small program to attempt to generate experience ranks with the following properties:

  1. Continuous acceleration
  2. Smoothness (calculated as “roughness”, using the sum of squares of the “triple-derivate”)
  3. Roundness (100 is more round than 150, 150 is more round than 160, 160 is more round than 165 etc.)
  4. Emphasis on the roundness of the last level

The qualifying factor here is smoothness vs. roundness. (continue reading…)

Leave a Comment :, more...

TimeTracker – minimalistic time-tracking

by on Apr.21, 2010, under Code

Starting with a new hourly-paid freelancing job, I needed some software to track the amount of time I spend working. I tried a few time tracking programs out there, but they all turned out to be bloated and clumsy (not to mention not open-source), so I decided to roll my own. (continue reading…)

1 Comment :, , , more...

Looking for something?

Use the form below to search the blog: