Skip to main content
GameDev.net gamedev.net

PRO Tired of ads? Read GameDev.net ad-free and help keep the community independent with GameDev Pro — $3/month.

Programming a bit again

Programming a bit again

Aardvajk
Aardvajk
Journal of Aardvajk · · 2 min read
719 0
Managed to get myself motivated to do a little bit of background work on Squishy at last. Been a long time since I've been feeling like doing anything.

Just been tinkering really. Squishy takes command line parameters in my XCS format, since there is a fully built system for parsing and converting.

Calls from a command line would look a bit like:

squishy "test=level.sqx; windowed=1;"

then the first parameter is converted into an XCS tree. It's a bit unconventional but my XCS library is fairly battle-hardened now and it saves duplicating effort to convert normal parameter syntax into different types etc.

Tonight I've added the ability to specify the resolution at the command line which, if present, will override the values in the user's config file.

I've also added a field to the options panel of the editor to allow specification of the parameter string that gets passed to Squishy when a level is tested from the editor.

This involved a brief sidetrack into writing a parser that would convert tokens in the $(Token) format in a string. I have a method now:


std::map Tokens;

Tokens["Name"]="Paul Cook";
Tokens["MentalState"]="wobbly";

std::string Text=ShellTokenExpand("My name is $(Name) and I feel $(MentalState).",Tokens);


This correctly replaces the values with the contents of the map, throwing std::runtime_exceptions on syntax errors etc. Total overkill since I only actually needed to be able to dynamically specify the temporary level file path that the editor generates in the parameter string, but could always be reused.

Long and short is that I can quite easily now test different aspect ratios by editing this string within the editor. When I recently moved from a 1280x1024 to 1600x900 native aspect monitor, I found a few errors and problems that had slipped through the net, so I need to be able to easily test different aspects in a window to simulate different monitors for the games normal full-screen mode.

Dialogs were behaving incorrectly at 16:9 but this was just a bug that did not manifest at 5:4 or 4:3, like all good bugs.

However, I've had to rethink the title that appears on the menu screen. Since I was placing it in world space rather than screen space, it was clipped off the top of the screen in widescreen mode. Need to move it into screen space I guess.

Far less easy to solve is the fact that in widescreen the camera is in much tighter than in 4:3 and 5:4. This is, as we've discussed on the fora many times, a hard issue to get right with 2D games and will need a bit of a think to find the best solution for this specific game, since no overall best solution exists for this issue.

But no graphics or video as a result of today's efforts so a text only post today. BORING.

Discussion

Loading comments...