Programming

New FlexIO Module – XYZ Movement Detection

0

I added a basic module to the new FlexIO program this week to assist in detecting moved XYZ tables. After a frustrating day at the office, I came home, had a few beers and came up with this solution to try and fix my problem for the next time. A common problem I faced was after a drawing had been created for a part, the actual part itself had been moved in virtual space. Then when the bend file had been created, the tables were completely different because of the move. Because of this, how to correctly determine if the table is actually correct, or if there was an actual geometry change in the design that had been overlooked?

The module I created just looks for simple X/Y/Z direction movements, it gets a little more complex when looking for parts that have been rotated in 3D space, so the model doesn’t look for that yet. It works by asking for the first row of coordinates from the drawing, and calculates the differences between the X/Y/Z in the bend file. If its just a case of simple movement, the offset is applied to the remaining points and the new table when updated will then identically match the drawing (if there is no geometry change). If you start seeing some points being a little off, you can check in CAD to make sure there is no rotation, and put the difference to being a design change which requires the original part designer to submit a revision change.

It’s a start, and saves me a lot of time when verifying a large number of drawings at one time. Still lots of other verification code to add to other areas of the program 🙂

Share

Win32 – SDL Loses Sound When The Main Window Loses Focus – Fix

0

So, I ran into an interesting problem this week while working on the “Alien Invasion” music disk that causes all sound to be disabled when the main SDL window would lose focus or become hidden. This could be a bit of a problem for a music disk, so I looked into trying to figure it out for myself.At first I tried the usual SDL culprits, which are the event system for handling focus, but no luck there.

After some poking around in the SDL source code, I was finally able to find a fix. In SDL_dx5audio.c you can change the following function to read:

void DX5_SoundFocus(HWND hwnd)
{
    // This makes sound audible regardless of focus being lost
    //mainwin = hwnd;
}

A better solution long-term in SDL will be to have an option to do this, rather than having to change the code, or just have this enabled by default. We’ll see! This was tested on 1.2.14 which is available to download from http://www.libsdl.org Hopefully someone else can find this useful too 🙂

Share

Converting Databases To UTF8 Format From Latin1

1

I have been putting off the inevitable the last couple of weeks, which was the task of converting the database for CVGM.net to UTF8 from the default collation of latin1-swedish-ci. I am not the best when it comes to administering MySQL via command script, and phpMyAdmin didnt do the job properly of conversion for me. After a bit of googling, I found a bash script at islandlinux that was able to help me out considerably:

#!/bin/bash

DATABASE=$1

if [ ! "$DATABASE" ]; then
echo "Please specify a database"
exit
fi

BACKUPDIR="/root/tmp/mysql_backups/"

if [ ! -d "$BACKUPDIR" ]; then
mkdir -p "$BACKUPDIR"
fi

BACKUP="$BACKUPDIR""$DATABASE.sql"

mysqldump --add-drop-table --extended-insert "$DATABASE" > "$BACKUP"

TABLES=`mysql --batch --execute 'SHOW TABLES' "$DATABASE" | grep -v "^Tables_in"`

for TABLE in $TABLES; do
echo 'ALTER TABLE `'"$TABLE"'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;';
# uncomment the following line to process the commands
#mysql --execute 'ALTER TABLE `'"$TABLE"'` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;' "$DATABASE"
done

This script converted the database tables and everything under it to the correct format. It also backs up the databases first in case something decides to take a crap on you. The problem I had with phpMyAdmin was even though I changed the collation to utf8_general_ci it didn’t do it recursively into the tables and the fields underneath it.

Thanks for the script guys 🙂 You saved me even more work!

Share

NOW! Amstrad CPC Music Disk Released At Main Party 2010

1

NOW! Screenshot NOW! is a music disk I have been working on in collaboration with Ultrasyd and Fenyx Kell for the Amstrad CPC 128K system. The music disk features 12 awesome music tracks, and was coded in a little over two weeks before I get settled into working on Zine again. This is my first production on the Amstrad (and also the first CPC project for Brainstorm) that was any good (as I did a bit of BASIC many moons ago), I have played with a friends system many years ago as a kid, but this is the first piece of code I have written on the system that hasn’t been utter shite. I am very pleased with the outcome of this project, and the music is amazing 🙂

I started working on this project on Sept. 13 with Ultrasyd, as the people who were supposed to write him a music disk had bailed out of the project. I took it on as a challenge, realizing the path would not be straight and easy, plus I have been looking for an excuse to get back into 8-bit development for quite some time 🙂

The project is written using Z88DK (available HERE) and uses C and Z80 Assembly language. I used CPCRSlib for some of the graphics code, mixed with a bit of my own dodgy code. The music replayer is by Targhan and available HERE.

There were many technical challenges on this project. The biggest was the small amount of RAM available to the system at any one time, certainly not enough to hold all the music let alone the program and the data it needed to run. At one point, I spent 2 solid days working on getting 5 tunes in and working without crashing the computer, when I realized a mistake I had made in some code earlier that would allow me to hold many more. So at around 4pm yesterday I was able to fit all 12 songs into the production without a problem. Nothing quite like a last second fix for a production thats due to be released the very next morning 🙂 Many thanks to Ultrasyd for staying up late on the CVGM OneLiner to get this thing finished in time for Main (and showing it off to the Amstrad community there). There is also a hidden, 13th tune 🙂

Download the DSK file Here. To run, insert the disk and type RUN “NOW!” to start the music disk. Up & Down arrow keys to change between music. Escape to quit. If you wish to run this in an emulator, I recommend using JavaCPC or WinAPE. This disk has been fully tested on real 6128 Hardware (Thanks again, Ultrasyd!).

Full Production Credits

Music: Ultrasyd/BRS and Fenyx Kell
Graphics: Yes/BRS (Loading Screen), Ultrasyd/BRS (Main Picture)
Code: FishGuy876/BRS
See the TXT file on the DSK/Zip for a full list of everyones greetings and thanks 🙂

EDIT: The music disk was entered into the Wild compo at Main and ranked in 3rd place!!! Fantastic! \o/ Congratulations to everyone again! It can also be found on Pouet now, where you can comment and rate it! Thanks!

Share

Zine Issue #14 Has Been Released!

0

I guess it is safe to say at this point that the secret project I have been working on for the last few months was Zine 🙂  Zine is a demoscene based disk magazine filled with articles and information on the demoscene and demoscene-related productions. Zine #14 is now available for immediate download. The pouet page (where you can download, as well as comment) can be found Here. Enjoy!

Zine is the first project I worked on after joinging the group Brainstorm, and has been more than a year in production on and off. Most of the work was done on the issue in the last 6 months or so, with a lot of last minute changes and implementations in the last 40 days or so until release making this one of the most challenging projects that I have ever worked on. Last minute stuff always works the best, eh?  🙂 In a positive note, it’s also the first issue to go multi-platform, working on Windows, Mac and Linux! \o/

Overall, im OK with this production. There was a shed load of features and things that I needed to get in and working, but simply didn’t have time. They will have to go into the upcoming issues to meet my personal “This rocks” meter – Unfortunately, if I can see or think of problems that exist in a production, I tend not to think too highly of myself.

Zine #14 was released at the Evoke 2010 demo party, which I attended with my wife epec. It was truly amazing to be stood on the stage in front of all those people talking about something I had worked on. Then throughout the party, looking at peoples screens and monitors to see them reading and talking about the issue. Very inspiring, and made me feel good to have produced something people liked to read 🙂 Evoke really inspired me.

The Zine team wasn’t just myself, I would like to thank the following people and individuals for their help and contributions to the issue (and I apologize if I forget anyone!) :

Axel – Chief editor of Zine
Menace – Co-Editor of Zine with Axel, both responsible for article content and chasing down articles etc.
Epec – Copy Editor & Production Assistant.  Her contributions to articles and scheduling were invaluable on this project, and it would have failed without them.
Prm – Responsible for all article and issue layout graphics once a base layout had been devised and coded in.
Prowler – Artist who composed the opening picture in such a short time period, at the same time he was opening a gallery of some of his other works, including the oil painting our picture was based on.
Bit Arts – For creating those wonderful intro & outtro jingles on such short notice.

And the Musicians who contributed to this issue:
Hansee, Mikael Fyrek, c-jeff, Scott and  Willbe

Other Thanks:
My Family – For putting up with my shit this last year as I worked on this project!
Shoecake – Your work on Dexter is invaluable, my friend! I wish you could have been there!
bpoint – Thanks for the last minute code tips and info, even though we couldn’t use most of them in the end, I thank you for being there while I was still awake at 5am fixing this stuff
deathy – Always my voice of reason when I needed to vent 🙂
Brainstorm – You guys fucking rock!

Enjoy!

Share

Messing About With The Site

0

So, ive been tweaking around with the site quite a bit today instead of coding. I actually found a WordPress theme that I really liked, so I went ahead and installed it with a few other bits and bobs. The theme is called Mystique and is one of the free themes offered by digitalInature.

The old theme had a lot of things I couldn’t do at all, whereas with this one I can now do twitter feeds, ajax to display thinks like post comments and tags (by clicking the icons on the right hand side in the top of the big grey box) and a few other things. I also spent some time fixing the Gravatar stuff, so if you have an account at gravatar.com (free) this site will now use your avatar from there.

There are still a few things left to do, I plan to list a complete discography of all my games and projects, and for the ones that I have a lot of fond memories for, I will eventually list pages for each of those items. Feel free to remind me of anything special I did years ago that I might have forgotten about!

Ive also started working on an Amiga section, and added a couple of things to it to get me started. Enjoy!

Share

Annoying Problems With std::vector on Linux Vs. Windows

1

So I spent most of this weekend working on getting my engine to compile correctly under GCC/Linux (Ubuntu 10.4) and ran into some serious headaches. It’s been a few years since I last built anything on Linux at all (last time was when I did some work for Epic Interactive and their linux ports) and took me a little bit to remember how makefiles worked etc. and bring my SDL code up to date.

After compiling the code, I was having a hell of a time trying to figure out why it would always cause a segmentation fault after the first few seconds of running. Here is what gdb had to say:

[Thread debugging using libthread_db enabled]
[New Thread 0xb3da2b70 (LWP 4813)]
[Thread 0xb3da2b70 (LWP 4813) exited]
[New Thread 0xb3da2b70 (LWP 4815)]
Program received signal SIGSEGV, Segmentation fault.
0x0807c27d in ?? ()
(gdb) backtrace

#0  0x0807c27d in ?? ()
#1  0x08083eee in ?? ()
#2  0x0807e59f in ?? ()
#3  0x08082231 in ?? ()
#4  0x08062d98 in ?? ()
#5  0x0804deaa in ?? ()
#6  0x0806659b in ?? ()
#7  0x00369bd6 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#8  0x08049891 in ?? ()

Unfortunately, that doesn’t really tell me much of anything 🙂 After a little bit of playing around with the manual pages in GDB, and some serious googling, I was able to get the app to compile with some debug symbols. This is the output:

[Thread debugging using libthread_db enabled]
[New Thread 0xb3da2b70 (LWP 3711)]
[Thread 0xb3da2b70 (LWP 3711) exited]
[New Thread 0xb3da2b70 (LWP 3713)]
/usr/include/c++/4.4/debug/vector:265:error: attempt to subscript container
with out-of-bounds index 0, but container only holds 0 elements.
Objects involved in the operation:
sequence "this" @ 0x0xb162bf4 {
type = NSt7__debug6vectorImSaImEEE;
}
Program received signal SIGABRT, Aborted.
0x0012d422 in __kernel_vsyscall ()
[Thread debugging using libthread_db enabled]
[New Thread 0xb3da2b70 (LWP 3711)]
[Thread 0xb3da2b70 (LWP 3711) exited]
[New Thread 0xb3da2b70 (LWP 3713)]
/usr/include/c++/4.4/debug/vector:265:error: attempt to subscript container
with out-of-bounds index 0, but container only holds 0 elements.

Objects involved in the operation:
sequence "this" @ 0x0xb162bf4 { type = NSt7__debug6vectorImSaImEEE; }
Program received signal SIGABRT, Aborted.0x0012d422 in __kernel_vsyscall ()

This error is generated whenever I try and set up Vectors in the code to handle some rather simple arrays. I even tested the code where I created a vector, and checked its size to see if it was 0 and was still able to create the same problem. This is how I did all the safety checks in my code; if Vector.size() > 0 { Safe To Do Some Stuff, If Size Was Legal For Array }.

So, for whatever reason, they behave very differently than in Windows. I really don’t have the time to figure out the specific reasons, though after a couple of hours of googling trying to get GDB to display as much information as it did, it turns out a lot of people have issues with vectors doing strange things on Linux.  As a result, I will be removing that code from the project to make sure it’ll compile and run on all 3 platforms (Windows, Mac and Linux) without any further issues! Lucky for me, it is an easy fix!

Share

Using MorphOS Again For the First Time In Years!

0

Finally getting somewhere 🙂

In the last week or so, I have been convinced to un-box my Pegasos II motherboard and boot it up to have a play around with it. It has been at least 3 or 4 years since I last even looked at the board, let alone turned it on. I got the board when I was employed with Epic Interactive, as I ported several games to MorphOS/Mac/Linux at the same time. At that time, I was using MorphOS 1.4 which was very buggy and not very intuitive. While it was nice to be able to run all of my old Amiga apps again, the instability of the OS made it a very troubling task. I still remember the nightmares I had trying to get various ports to build correctly without crashing the system, or editing code changes. Good old days 🙂

After playing around with the Open Firmware (which I am quite sure is horribly out of date) I was able to figure out how to boot the Peg from the CD, and install the OS to the hard drive. It took me a little while to get used to where the different settings were, then I couldn’t figure out why it wouldn’t see the HD, until I realiszed it wasn’t in RDB mode. After that, slapped on a few Amiga partitions and bingo, off it went.

My experience in the short time I have played with the OS is that it is much nicer and cleaner than it used to be. It has come a long way with the new Ambient and other tools. I will take a full play with it and even get it online in the next few days to see just what is out there and available for it. I was very happy to see that they finally included a TCP stack as standard that didn’t have to be registered by itself to use fully. As much as I loved Miami (and did pay for it back in the days of the Amiga), I don’t have my keys anymore and wasn’t able to get Nordic to re-issue them to me.

As much as I would like to start making games for MorphOS again, im not sure if I want to pay the $111 euros to get a license key for something I won’t use all that often, and still not even sure if it’s something thats worth developing for. Based on the price alone, which is a little bit less than buying the new Windows 7 operating system upgrade, i’m sure that there are many people who are still only using the 30 minute restricted version. I have a few games that could be ported, but they will have to wait for a while.

If any MorphOS developers have any free keys they want to give away, feel free to throw one this way 🙂

Share

New CNC Bender Completed – ‘Sir Clive’

0

I have finished working on my 3rd CNC bender, named “Sir Clive” after the great Sir Clive Sinclair. He received a complete refit and various other components. Details of this hardware/software project can be viewed at this link:

http://www.andykellett.com/cnc-projectshardware/sir-clive-bender/

You can also read about the custom software I wrote to power the machine, named FlexIO, at this page:

http://www.andykellett.com/my-discography/flexio-classic/

This project has been a lot of work, and now it is ready I can finish some other projects. Thanks!

Share

New PilesOTiles Version Underway… Again :)

0

Great news for all PilesOTiles fans, is that I have started working on the game again. I have been experimenting a little with online high score tables and banks, and am slowly starting to come up with a system that I like that will let people record their stuff online.

In the same area, I am also looking into ways to download new board and game data automatically. Id still really like to have a ‘Challenge Of the Day’ feature where you can download the days grid and attempt to get your best score for it, then submit it online to see how you did against other people from around the world.

Other features that will be added to the game include a better level designer with online submission capabilities, some tools to assist with tileset creation, and additional game types. More will follow on this subject in the future, as right now I am trying to finish some secret projects for the Evoke! demo party in August. It seems a long way away, but in reality, I feel like I am running out of time!

Suggestions for additional game features & ideas are welcomed in the comments sections 🙂

Share
Go to Top
%d bloggers like this: