Subscribe: SproutWorks Software Blog
Language: English
Tags:
blog  code  data  drawing  game  games  iphone  made  make  mario  new  program  screen  spam  sproutworks  started  time
Rate this Feed

Feed Details and Statistics
Preview: SproutWorks Software Blog

# SproutWorks Software Blog

## Programming, web design, technology related blog.

another perlin noise experiment

Fri, 18 Nov 2011 01:35:22 PST

I decided to work on a javascript canvas experiment where I can drag the mouse and scroll within a map. I got a simple "map" drawing colored squares that can be dragged around. I found a perlin noise library, and made the map look like wavy colors. It was pretty slow at that point, so I rewrote the drawing code so it writes directly into the image data. Now I have a smoothly scrolling wavy thing, but I'm not sure what I'm going to use it for. sproutworks.com/demos/perlin

fractal terrain generation

Sun, 30 Jan 2011 06:09:09 PST

The other day I read an article about how to create fractals using the midpoint displacement algorithm. It's a simple recursive algorithm where you take a square, and split it into 4 smaller squares while displacing the height of the corner where the 4 squares join by a random amount. This process is repeated, creating smaller squares which gradually make a smoother terrain. I spent an hour or two writing a PHP script to make a terrain image using this method. After I got some decent looking greyscale images, I added a color map so I could create colored oceans and mountains. Today I modified my old 3D graph script to generate 3D terrains using a bitmap and elevation map from my new fractal Here is what it looks like: sproutworks.com/artgraph.php?bitmap=image_1296466523.jpg&elvmap=elevation_1296466523.jpg&height=200 I might work on getting a terrain generator running in the iPhone, and rendering it with OpenGL.

iPhone pixel data

Mon, 13 Dec 2010 12:39:51 PST

The other night while watching a cartoon, I thought of a way to create levels for my iPhone game by scanning an image drawn on graph paper. To do this I need to access the raw pixel data from a CGImage. I already have a method that is loading png images into OpenGL texture maps, so I started modifying it to get the pixel data. I made some progress altering the pixels, which can lead to procedural texture generation later. I am going to try to make a program that detect shaded cells on graph paper and convert them to polygons in my game level.

Sun, 14 Nov 2010 02:18:23 PST

I just discovered twitterfeed.com/ , where I can post to my blog, and twitter feed will find new posts in my RSS feed and post to twitter and facebook automatically. Hopefully this will encourage me to write in my blog more often, knowing that my posts will be distributed to more people without any extra effort.

PHP 5.3

Sun, 14 Nov 2010 01:06:32 PST

Dreamhost has just added beta support for PHP 5.3. I can finally start implementing the new language features I've read about. Unfortunately, I just discovered it breaks all my scripts that use GD, so I had to switch back to 5.2

more iPhone coding

Thu, 12 Aug 2010 07:28:46 PST

Yesterday I moved the code that draws the walls in my maze app to the MazeParts class. Now it can share memory with the floor drawing code and got rid of the allocating/deallocating memory on each frame rendered. I also enabled the depth buffer and depth sorting, finally the walls are overlapping correctly. I started adding some code to load a plist file into an array. This will help me create levels besides the random mazes it makes now.

iPhone programming

Tue, 10 Aug 2010 08:22:25 PST

Did some more iPhone programming. The other day I took some of the maze drawing code and put it into a new MazeParts class. This class will be handling the drawing of the floor and walls of the maze. It will make the renderer file cleaner and easier to work with. Today I rewrote the floor drawing code to use translation calls instead of rebuilding vertex and texture buffer data for each floor tile. Next I will do something similar to draw the walls. I also added a setting to my info.plist file to hide the status bar.

QuickPWN iPhone 3GS contest

Wed, 10 Jun 2009 09:47:22 PST

I'm excited about the new iPhone 3GS. The hardware support for OpenGL ES 2.0 will make it more fun to explore advanced graphics in my projects. I have a basic 3D maze running on my iPod touch, and it would be awesome to be able to add shader programs to it. Here's the link for info about winning an iPhone 3GS from QuickPWN www.quickpwn.com/forums/iphone-3g-s/4177-iphone-3g-s-giveaway.html

I got a Macbook Pro

Wed, 28 Jan 2009 11:19:52 PST

Last month I purchased a new unibody 15" Macbook Pro. It is my first Mac in over 10 years. It's so nice owning a Mac again. I've been dabbling in iPhone development since I got it, and I have a basic OpenGL application working. My app lets me move a marble around the screen using the Macbook's accelerometer. I used the accelerometer simulator code.google.com/p/accelerometer-simulator/ and the unimotion program unimotion.sourceforge.net/ to accomplish this. It would be nice to have this functionality built into the iPhone simulator. I bought a book about game physics, and I'm on my way to creating a great game. Next I will be simulating interactions between multiple marbles, and figuring out how to load level configurations.

3D Digg Explorer

Sat, 26 Jan 2008 01:13:30 PST

Presenting SproutWorks 3D Digg Explorer www.sproutworks.com/digg3d.php I have just put SproutWorks 3D Digg Explorer online. It is my latest attempt to display textual information in an interesting way. I use JavaScript with jQuery to script the interactive elements of it. It fetches a JSON string from my server, and creates a three dimensional scene using the data from it.

ProBlogger \$54,000 Birthday Bash

Fri, 5 Oct 2007 01:06:23 PST

www.problogger.net/archives/category/birthday-prize-giveaway/ ProBlogger is having a birthday bash with \$54,000 in prizes. ProBlogger is a blog dedicated to the topic of making money with blogging. It is a tantalizing idea, but I tend to spend more time programming my site than writing on it. Still, I enjoy reading the tips about blogging, which I may actually implement someday. I am writing this post as my entry to win 2 LG 20" USB LCD monitors provided by DisplayLink (www.displaylink.com) That would be an awesome compliment to my new 22" Viewsonic LCD. So, everyone check out ProBlogger, it's an interesting read.

New logo animation

Sun, 23 Sep 2007 04:45:49 PST

I have just added a new animation program to the logo area of this site. I have been working on variants of this system for a while. First, I wrote a JavaScript program that uses a drawing method similar to Google Maps. It uses square tile graphics, arranges them in a grid, and then moves them inside a scrolling area. When a tile moves off the edge of the scrolling area, it is moved to the opposite side of the area. Before it is moved, the tile graphic is updated with the graphic that is appears on the opposite side that is scrolling into the scrollable area. After I got a basic tile scrolling engine working, I made it work with several layers of tiles that can scroll at different rates. I then added the ability to make additional layers of objects that can be positioned anywhere. The animation at the top of this page uses this object layer system. I will make more interesting scenes as the engine becomes more sophisticated.

Price Tracker Speed Boost

Fri, 21 Sep 2007 10:55:35 PST

I have just optimized the performance of the Blogshares Idea Tracker's graph rendering program. The graphs are loading much faster now. The industry listing page now allows you to load the graph for any industry by clicking a button.

Viewsonic VG2230vm

Tue, 18 Sep 2007 10:59:34 PST

A few days ago I ordered a Viewsonic VG2230 22" widescreen LCD for about \$300 from www.newegg.com It replaces an ancient 19" Viewsonic G790 CRT display. I also have a little 15" Gateway LCD as a secondary monitor. So far I'm loving this new monitor. I have a lot more room to do stuff, and games look awesome on it. It is plugged into a DVI port on my Radeon x1950 Pro. I briefly ran Quake 4 and Half Life 2. I ran F.E.A.R. Combat but it insisted on running on the secondary display. I hope I can resolve this later. I still need to try Bioshock on this thing. This monitor can swivel on its base, and it has a height adjustment that can go pretty high. It has some speakers I will never use. This monitor will improve the many, many hours I spend on my computer. Now I just need to upgrade my secondary monitor.

new video games

Tue, 18 Sep 2007 10:49:35 PST

I have purchased a few new video games over the last month or so. Here is a little info on each of them. I bought Bioshock for PC on it's release date, right after I got off work. Bioshock is set in 1960 in an underwater city called Rapture. Something has gone horribly wrong there, it appears to have something to do with the rampant genitic modifications performed there. The environment is really well done, it really seems to fit with the time peroid. Bioshock plays like a first person shooter, but you can use powers from plasmids in addition to the standard weapons. You find plasmids enabling you to throw fire, ice, use telekinesis, electrocute, and many other things. There are endless ways to dispatch the mutant freaks known as slicers. I may write more about Bioshock later, it is one of my favorite games at the moment. I also bought Metroid Prime Corruption for the Nintendo Wii. The game makes very good use of the motion controls. I like the puzzles and the varied worlds of the the Metroid universe. I picked up Brain Age 2 for the Nintendo DS along with Metroid. Brain Age is intended to be played daily, and it claims to train your brain. This idea seems to make sense. Each of the mini games makes you think in ways you normally don't. It tracks your progress in each game, and you can view a calendar of your results. Every day when you train your brain, you get a stamp for that day. Earning stamps unlocks more of the games. The creator of the game, Dr. Ryuta Kawashima, gives you brain tips in between games. I hope my neurons are making more synaptic connections as a result of playing Brain Age 2. Last Saturday I bought Castlevania, Portrait of Ruin for DS. It was on sale at Walmart for \$25 so I just had to get it. I have played a few of the Castlevania games, including the original, Super Castlevania, and one on the PS2. It is a great series. Portrait of Ruin stars 18 year old Jonathan Morris and his 16 year companion Charlotte Aulin. They are on a mission to vanquish the vampire Brauner from Dracula's castle, where he is up to no good. I've played through a few worlds, which you enter from magical paintings. There is a large variety of enemies and weapons. You can upgrade your characters through earning experience points and collecting items. I enjoy this game, it has the feel of a classic platformer with lots of modern additions.

Idea tracker update

Sun, 16 Sep 2007 04:20:48 PST

I just noticed that the Blogshares Price Tracker has not been updating for a couple weeks. When I looked into it, I discovered that something happened on the server so that the include files were not being found. A Dreamhost tech pointed me to their wiki page about cron jobs, where I found I had to change the path to PHP. After I got the updates going again, I rewrote a few key parts that were making the price tracker very slow. There were some SQL queries that were inefficient, so I rewrote those, and moved some data into different tables. Now the industry listing and details pages are much faster. I made the graphs a little faster, but they are still way too slow. The problem is that the graph script queries a table with over 10 million rows. I'll try to think of some ways to speed it up.

Feedblitz features

Mon, 10 Sep 2007 09:59:57 PST

I got an email from Feedblitz saying that they are adding some new features to the free accounts. I have customized the appearance of the email with some graphics I had laying around. I'll try to make a more extensive email template later.

Hoover Mach 5 vacuum cleaner

Fri, 6 Jul 2007 01:12:35 PST

A few months ago I purchased the Hoover Mach 5 vacuum cleaner from Walmart for around \$160 at Walmart. I was looking for a replacement for our Hoover Fold Away. The Fold Away did not have much suction power, and the filter clogged quickly. I originally sought out to buy a Hoover Fusion, which has Dyson-like cyclonic filtering technology. I discovered that the Fusion had been discontinued and replaced with the Mach 3. The Mach 3 has a cyclonic main filter and a washable pre-filter. It comes with a turbo brush tool, dusting brush, 2 extension wands, and a crevice tool. The turbo brush excels at removing pet hair, but I have found that it needs servicing once in a while. The pet hair tends to wrap around the ends of the brush where it rotates, eventually preventing it from rotating. It can be cleaned by disassembling it with a Phillips screwdriver. The Mach 5 improves on the Mach 3 by adding a HEPA filter, a dual chamber cyclonic filter, a retractable power cord, an adjustable handle, and a brush roll control. Cord rewind is a nice feature that reels in the cord at the press of a button. No more rolling up the power cord. Another nice feature is that the brush roll automatically turns off when the Mach 5 is in upright position. The Mach 5 offers many of the same features as a Dyson much less money. There are no filters to replace, and no loss of suction.

Id tech 5

Fri, 22 Jun 2007 11:42:10 PST

John Carmack demoed Id tech 5 at Apple's Worldwide Developer Conference. Id tech 5 is his latest game engine that features technology that allows artists to use unlimited textures. This sounds like a major development in computer graphics, which would simulate environments much more realistically. More and more the video game industry is contributing to the advancement of mankind by pushing the limits of real-time graphics and physics. The singularity is approaching. www.youtube.com/watch?v=HvuTtrkVtns

BlastEngine

Fri, 22 Jun 2007 11:33:24 PST

I have just signed up at the search engine submission service www.blastengine.com . They submit to over 1 million search engines. I used this service a while ago and it resulted in more traffic for this site.

Mon, 28 May 2007 06:03:55 PST

I have been busy at work, and I've been neglecting this site for the past few months. I looked at the forums today, and I was shocked to see that there were over 500 spam messages here. I have cleared out the spam and I also programmed a captcha system to prevent spam in the future. Captchas are those images where you have to type the letters in the image when you fill out a form. So now the spam should not come back.

Wed, 3 Jan 2007 11:58:14 PST

I have started work on version 7 of the SproutWorks layout. I have decided to incorporate a scrolling tile engine I made. It uses scrolling tiles in a similar way that Google maps does, only it's not for displaying maps. I intend to use it for games and animations. When the new layout is completed, it should look far more interesting than the current one. It will probably have some interactive elements in place of where the logo is now. Last night I wrote a PHP program that draws a spinning gear. It can draw the gear in any given size, color, and with different numbers of teeth. I will make some sort of interesting animation with the gears.

my new computer

Wed, 3 Jan 2007 11:44:10 PST

A while ago my old computer's power supply fizzled out. I bought a 430 watt Thermaltake power supply, but something was wrong with the motherboard (an Asus A7M266-D with 2 Athlon 1900 MP processors). I eventually replaced the motherboard with an Asus P5B Deluxe, an Intel Core 2 Duo 6600, with an Asus Radeon x1950pro video card. The new computer is running great. I can finally play modern video games again. I have been playing a lot of F.E.A.R. Combat online. I just bought Quake 4 and FarCry, and have been having a lot of fun with both of them. Now that I have a video card that supports shader model 3, I can finally mess around with the examples in my programming vertex and pixel shaders book. I started a new Visual Studio C++ project where I copied an example program from the DirectX 9 SDK. I have been making a basic framework for doing 3D stuff. So far it just shows a textured triangle strip plane spinning around.

updated blog spider

Wed, 18 Oct 2006 09:35:00 PST

I've just updated SproutSearch's blog spider. It now tries to fetch the RSS feed for a blog before parsing it with my HTML parser. This should save some CPU time and give me better results. It also gets the date and time of the blog's latest post and some statistics about the number of words used. This new data will allow me to generate better pages in the future. I am also brainstorming some methods of data mining I can use to make SproutSearch a bit more interesting. With over 8 million blogs in the database there are lots of possibilities. http://www.sproutsearch.com

MySQL optimization

Mon, 16 Oct 2006 03:18:06 PST

I have noticed a lot of queries of SproutSearch's main database table are getting slow as SproutSearch passes 8 million indexed blogs. I finally decided to do something about it after trying to add alter this table. I attempted to add a column that keeps track of the date and time of each blog's most recent post. The alter table command ran for at least 8 hours, and then MySQL either crashed or the admins killed my process. I attempted this a second time without making a new index, which also failed. I figured I would just create a new table with the extra column and write a program to slowly copy everything over. The first version of this PHP program queried 10,000 rows of data from the old table and inserted them one by one into the new table. I set up a cron job to run this every 10 minutes. Once the new table started getting big, the cron jobs were overlapping, some records were not copied, and copy processes started backing up. It dawned on me that I'd better learn something about MySQL optimization. I read some online articles and decided to try using mysqli_multi_query to copy the records. That would reduce the network overhead. The program ran several times faster but I wanted to look into other methods. I tried using prepared statements, which wasn't much better. I found this excellent article (http://www.informit.com/articles/article.asp?p=377652&seqNum=4&rl=1) which said if I use the insert format like: insert into table (column1, column2) values(val1, val2), (val1, val2)... MySQL wouldn't have to flush the index after every insert. I made my program create a giant insert statement in this format. I tried it out and it only took a few seconds when the new table was empty. I modified the program to run 10 batches of 10,000 records, which would take a few minutes. This program has been running for a few days, and all my data is finally in the new table. I am still having problems with the table being locked during lengthy select statements. It causes certain pages to hang for a long time. I am now copying all the data from a MYISAM table to a INNODB table because it has row level locking.

splogs

Mon, 25 Sep 2006 05:23:20 PST

My blog search engine SproutSearch is now indexing over 8 million blogs. I am now working on changing the way the blogs are ranked. For now, they are sorted by the sheer amount of content they contain. I noticed a big problem with this method is that many spam blogs contain masses of content. I don't like SproutSearch linking to so much spam, so I need to find a way to remove a lot of these listings. It is not practical for me to read 8 million blogs, so I need to come up with an automated method to detect spam. Many spam blogs use the same words over and over. So I wrote a program to count the number of repeated words. Most spam blogs seem to use a similar number of words per post. I made another program that computes the standard deviation of the number of words in a post. Using these metrics, I will make a program that flags potential spam so I can review and delete it.

AJAX icon editor

Wed, 16 Aug 2006 06:31:36 PST

I've just uploaded a new program I'm working on. It's an icon editor that uses AJAX to provite a multi-user editing experience. At this early stage in the program, many features are missing, but there is some basic functionality. You can select a color, then click on the grid. Your click will be stored on the server, where other people who view the page will see your work. When you change a pixel, you will see any changes other people have made to the icon. I will be adding some more real-time features and drawing tools in the near future. In the meantime, you can try to make simple pictures with the program. http://www.sproutworks.com/pixeleditor.php

SproutWorks Layout 6

Sat, 12 Aug 2006 02:12:17 PST

I have just uploaded version 6 of the SproutWorks layout. This layout has a "grassy hills" theme that I think looks more pleasant. I will be adding more to this layout as I develop new features and graphics. I am also working on reorganizing my code. The code base is about 30,000 lines, and needs some better management tools. I have started to organize all the scripts, and have also been working on a PHP/AJAX project manager application. It will help me keep track of all my websites my keeping all the code synchronized.

Nintendo DS Lite

Tue, 25 Jul 2006 12:31:37 PST

It was my 28th birthday a little over a week ago. My little brother Garett got me a Nintendo DS Lite and New Super Mario Bros. It was a nice surprise. The DS Lite is a smaller version of the original DS with a brighter screen. It has 2 screens in a case that folds like a clamshell. The lower screen is a touch screen, which adds a whole new dimension to gaming. The DS has 2 speakers, with a surround mode that sounds pretty good. It has a built in microphone for voice commands, a headphone jack, and a AC adapter port. It has a rechargable battery that is supposed to last 15-18 hours on the dimmest screen brightness. When I turned on my DS for the first time, it had me go through some setup screens, like setting the time and date, choosing a profile name and color, and choosing some other preferences. After that it shows a default screen when it is turned on. The top screen has a clock and calendar, the bottom screen has buttons with different functions. There is a built in picto-chat program, which can be used to chat wirelessly with other DS's. I wish the DS came with more built in programs, such as a notepad, ebook reader, and a scheduler. It would also be nice to have some built in apps that use the Nintendo Wifi connection, like a web browser or instant messenger. New Super Mario Bros is a side-scrolling game that has elements from the 2D Mario games of the past. It has 8 worlds to explore. The world map is drawn in 3D, and is simular to the map style in Super Mario Bros 3 and Super Mario World. The levels are drawn in classic 2D style, with updated backgrounds. Mario and some elements use polygonal models to enable some effects, such as the giant Mario. The graphics are drawn in typical Nintendo style, with bright colors and cute characters. Every level has 3 coins you can collect, to open special paths with require spending 5 coins. If you miss some coins you can always replay a level to try to find them. There are red and green mushroom houses in many of the special paths. In the green houses you can get up to 10 extra lives by hitting a sequence of blocks. New Super Mario Bros. also has 18 minigames that are mostly played using the stylus. There are some creative uses of the stylus, such as using it to aim a slingshot, or draw trampolines. Dani has been playing these mini-games every day. There is also a 2 player mode, which I haven't used because I don't know anyone with a DS. Overall, my DS lite is a very fun toy. I look forward to getting some more games for it. I think I'll start with Mario Kart DS and Metroid Hunters. Brain Age also looks interesting. I hope Nintendo makes a full featured painting cartridge, and more educational games. I think the creative and educational potential of the DS has not been fully realized yet.

AJAX and JSON

Sun, 9 Jul 2006 04:06:25 PST

I have been writing simple AJAX applications for a while now. Up to now I have stuck with procedural JavaScript that fetchs raw HTML and inserts it in the page. I knew these methods were lacking, but I used them for quite a while anyway. I started reading about how to write object oriented JavaScript. I don't what took me so long to look into it. I've been using OO in C++ for about 10 years, and PHP for 3 years. I'm a big fan of objects. So tonight, I decided to write an Ajax object as part of a bigger scheme to buld myself a useful library for doing net stuff. I ran into some problems using a callback function for the xmlhttp response, but I figured it out. Next I started reading about parsing XML and JSON. I decided to try JSON since it sounded easier. I made a PHP class that converts an array of derived classes into a JSON object. I made a simple callback to parse the object on the client side, and write some boxes full of fake data into the page. Now everything is in place to use in a real application. I think I'll start with making an AJAX file/directory browser for a PHP project management system I'm developing. Then there are plenty of things I want to ajaxify.