Convex Polygon Triangulation

Hey all!

I was recently looking around, for a library to do polygon triangulation. I found some great ones, LibTess, Triangle, etc. but they were all a bit heavier than what I needed. I was just intending to do convex polygons, so I figured I could get away with less code to clutter up my folders.

I found an article on that struck my fancy. This article provided two simple examples, the ‘Triangle Soup’ method of making triangles from one point and then dividing them up from there. This mode is easy and simple, but as one commentor suggested, that it does not always make well formed triangles.


Following this suggestion I took a few minutes to modify the basic algorithm into the suggested method of adding a new central point to the polygon and fanning the polygons out from that as the central base. This method makes nice well formed triangles, but adds more of them than the ‘soup’ method.


Hopefully someone out there will find this useful, as I needed it for a project. I have included the simple source example for you to do what you will with. :)

Download Sample .EXE and Source file


Keep in mind the code is just quick and dirty as it was basically a test so there’s no “professional” coding scheme just basic conventions and trying to get it coded up as quickly as possible so it may be a little hackey, but hey it’s a nice learning example and maybe can help some people out as I did not see very many if any at all examples of simple Convex Polygon Triangulation. It’s not meant to do any damage, but I am not liable for any, and use at your own risk.


School Maze 3D

For a long time I’ve been wanting to make a School Maze game that is Wolf3D style. Finally after some doing, the “beta” version is done. The game levels are identical to the Flash version with auto generating enemy placement, item placement, etc.

You can finish it, but it just loops back to the beginning. The basis is done, and it should be quite fun when it’s finished. It is quite fun now on its own, but could use some more features to make it more fleshed out.

I’ll post more info as it is more complete.


Pokemon Adventures and Backlighting!

Of all the projects I had to get around to finally finishing, installing my Gameboy Pocket backlight was one of the ones that was top of my list for a while. I only wish I had been able to do that as a kid! I would have been stoked to play Pokemon more covertly when it was released. Back in 1998 on a family trip to the beach in Maryland, we stopped in Delaware (no sales tax!) at a Walmart shortly after Pokemon Red and Blue were released. My brother and I had been playing Mega Man II on the ONE Gameboy (really it was mine but I was good at sharing) we had in the car at the time.

Our parents thought we had been good or whatever, so we both got copies of Red and Blue just on a whim. This was really rare because we were just middle of the road as far as money went growing up. The guy behind the sales desk was telling us he had heard about this “Pokee-man” thing and it sounded cool, but he hadn’t played it yet. We happily got the games which were like I dunno $40 or $50 back then, it was rare that we got a game that wasn’t on Christmas or Birthday so it was extra cool. We even got a launch day or week whatever button for Pokemon (that I still have, great stuff) which was really cool and added the the mystique of such a new game.

Prior to the release of the games, I had gotten the Pokemon Power magazines which were, and still are, awesome. I loved those things, reading, re-reading, dreaming about all the gameplay and cool things that the game had to offer. The interesting scenarios, the pokemon to collect, it was all so new and cool at that time with the battling and traveling the large world, it was great. When we finally flicked on the Gameboy with the cool Red and Blue cartridges for the first time we were blown away it was unlike anything I had played before. I had played plenty of Western RPGs like Bard’s Tale, and such, but never played a JRPG before, so it was a novelty, and a change of pace.

Now, this brings me to why the backlight would have been handy! We had been staying at a cheap motel that night, and after we arrived and we weren’t very far into the game. We were pretty much still tooling around Veridian forest barely. When it came time for bed, we couldn’t sleep, we were still riding the Pokemon high. So we took turns playing, one of us would pretend to sleep, and the other would go into the bathroom off the to the side and play in there so our parents wouldn’t know. We rotated in 30 min shifts since we didn’t have another Gameboy and it was sweet. Needless to say having a backlit Gameboy would have made covert playing a lot easier!

Now I finally have mine backlit. It’s not the prettiest I noticed after that was installed I need to clean the screen, but it’s still perfectly playable so I’ll do that later. 😉 is where I got my backlight from and it’s great aside from a little “dead zone” where the light doesn’t shine all that well, but it has been sitting in a box for 2 years so I chalk it up to that.

Until next time, have fun!

Blast from the Past: Wolf-Pac

Many many many, moons ago back in the year 2006, I got a GBA flash cart, and started coding for the GBA. The first game I made was Wolf-Pac to honour my dad who was a Pac-Man champion back in the day.

I had forgotten about it until 2012 when I met my friend Darryl. Darryl is a huge Pac-Man enthusiast, and knew of Wolf-Pac before meeting me. He was like, “Whoa, you made that?” when he met me. That was pretty cool, though today after being reminded of it again I typed it into Youtube for whatever reason and found a longplay! Much to my surprise.

It just makes me remember how bad it is haha. It doesn’t really make use of the GBA hardware at all, because I didn’t know how to make use of the sprite or background registers yet. Everything is drawn in Mode 3 (a bitmapped mode) with software sprites and pushing pixels for every object. It uses masking to draw the sprites and only tries to clear the screen as little as possible. There are apparently some errors in this method though as you can see the player has to pause and then resume to see the dots that were inadvertently cleared.

Man, looking at is makes me think how much better I could do it now, but it’s fun to travel down and see your origins. 😀 Anyway I thought you may enjoy seeing it.

Until next time!

Game On Thursday – Dragon Ball: Xenoverse

Hey all! Working hard on games, but gaming too. Dragon Ball: Xenoverse is the first game in a while to really catch my attention.

Now granted I’ve not played a DBZ game since Budokai Tenkaichi 2, but Xenoverse IMO is nearly the perfect DBZ game. I’m a little biased, I’ve been a DBZ fan since 1996 or so, but it’s almost the game I’ve always wanted.

The best offense? Fire Ki Blasts like a Maniac!

The battle system is a bit shy of Budokai Tenkaichi, there are a few things that frustrate me like the inability to block easily after a hit. You’re then stunned for the most part and then can take a barrage of hits. Not game breaking, but annoying when you’re fighting an unrelenting AI at times. Overall the battle system is fun and frantic. It makes you feel like a badass when you charge fly and kick an opponent into a mountain or something. Then blast them with a ki attack. So fun. I did notice though there’s no Beam Battles which I can see because it’s more or less 3 v 3 most of the time, but still hoping to see it in Xenoverse 2.

The game really caters to all my childhood daydreams though, where I would imagine myself fighting alongside the Z Fighters. At times it brought a tear to my nostalgic eye because I really got sucked in, feeling I was helping make a difference for Goku and friends.

Use the Kamehameha like every character ever!

The create a character is a great addition, I love being able to play as my character, but it could use a few more options. Most of the male characters look too similar for my taste (at least for humans and Saiyans), so I ended up making my goto Female character Jinny in DBZ style. She turned out great. I’m pulling for a few more races to be added as well like the Arlians in Xenoverse 2.

Jinny Laughs in the face of Final Form Frieza!

The main game is helping Trunks fix the time line that has been screwed up allowing the bad guys to beat the Z Fighters. This mode is fun, but requires you to grind a bit with the alternative Parallel Quests, this isn’t too bad though as you get items and skills by doing the Parallel Quests. They’re also neat ‘What-if’ scenarios so it’s cool as DBZ fan to go off on those.

If I was IGN or some rating reviewer I’d have to give the game an 8/10, it’s a solid fresh experience, that is just shy of perfection. Give it a go!

Winsocks the Cat Rocks the Hill

After a long time of wanting to tackle some netcode. I finally had the opportunity to do so.

After reading this great article by: @bshokati on the Code Project, I had a good baseline for taking the next step and making some kind of client server program. I decided to keep it simple, I’d make a chat server that spat messages back and forth. Easy enough.


After a little bit of re-reading the code and getting a feel for everything I had a simple chat server. You could connect via IP, set your chat name, and send messages back and forth. Whoo. Such fun. That program was two, separate applications as well, just for the sake of simplicity. One application for the Client and one for the server. I knew in my next step I’d want to alleviate this so I setup a common folder and separated everything into Client/Server/Common code bases and tied them all together with a Main code file.

After I had all the code organized I wanted to step it up and make a simple game, to make a good base for when I add netplay to my 3D School Maze engine. I decided, since I love to abuse the Console window, I’d dust off my old Textmode game skeleton and make a game with smileys running around. I decided to make a textmode smiley deathmatch.

It was simple, the game would be one on one with you shooting the other player with an arrow. Easy. One client, one server, that’s it. Coding the game was easy enough because I already had all the drawing stuff setup, the harder part was figuring out how and when to send the data across the way to keep the games running and the players playing against each other. First I thought, hmm…what if I send the keycodes and have a keyhandler take care of the movement. Then it’ll be like you’re playing someone with a controller right next to you.


This is a good idea in theory, but data packets on the internet sometimes get stuck in traffic and things get out of sync as I quickly learned. Bright eyed and bushey tailed, I fired up my Smiley Deathmatch and started a game 1 on 1 connected via localhost. I moved around and soon I realized, “OMG these are not in sync!” as I looked at the two different windows.

After some thinking, I was on the right track I thought. Sending the keycodes back and forth is a good start, but there needs to be a way to keep things in sync. After some reading, I read about Server Authority, where the Server has final say in everything that happens. So I thought ok, the player can use his keys, and send to the server, and vice versa, but after the server processes the keys of him and the client, he should send a sync packet and sync up all the players.

I then added the states, positions, etc. to the packet, and sent them over. “Viola!” The games were in sync. It does a good job of keeping things in sync, there is no prediciton on the part of the client like “Dead Reckoning” to interpolate where things might be, before the sync packet is sent. This doesn’t seem to be a big deal though as I don’t see things jumping around like crazy. In a 1 on 1 game, with relatively little to keep track of this is fine. Though I imagine that if you scale things up, they may get crazy. It’s a good simple test and I’d like to share with you.

Keep in mind the code is just quick and dirty as it was basically a test so there’s no “professional” coding scheme just basic conventions and trying to get it coded up as quickly as possible so it may be a little hackey, but hey it’s a nice learning example and maybe can help some people out as I did not see very many if any at all examples of simple Winsock games. It’s not meant to do any damage, but I am not liable for any, and use at your own risk.

Enjoy, and make some Cool Stuff!

Download Source and EXE

Doin’ the Donkey Kong

Donkey Kong has been a hot Nintendo property for a long time. Few people I know are as passionate about DK as Darryl. He even wrote an article in the late 90s about Donkey Kong and all his related ports. A great read if you’re unfamiliar with all the different nuances between the various ports, and the game in general. From talking with him it’s a lot deeper than it would appear on the surface.

Give it a read and go enjoy one of the various DK ports.

Hit up his website and check out some of his other work as well.

Until next time!

Happy New Year

Hope everyone had a great Holiday time.

We had some fun working on game stuff, and more importantly playing games. Nothing particularly exciting to post yet, but it’s coming.

If you like Power Rangers though, the legacy Dragonzord is awesome. Legacy Tigerzord is going to be released soon (here in the U.S.), and you may want to snag Dragonzord during the after Christmas sales or something. Great collectible IMO. Never had the original toy as a kid, though I wanted it. Sweet to have it now though. No electronics but that’s a small detail, since it’s show accurate.


Go snag one if it’s up your alley. :)

More progress…

Just a quick update, but got some more time to do some coding.

Bleh Bleh Bleh!” Lil’ Billy’s getting chased by one of the Living lunch monsters! Hurry Billy! Grab that pudding pack. (If you have no idea what I’m talking about these are all elements from my previous game, School Maze.)


Nearly all the elements from my previous Android adventure game and the elements from School Maze have been realized in OpenGL.

One of the next things I want to add is Netplay Code. In School Maze one of the things I wanted to do was have a Co-Op mode, but it was a pain with Flash, so I didn’t get around to adding it. That shouldn’t be a problem though with SDL_Net or WinSockets.

Things are cooking.

Not much to update, but I am working on several projects.

Working on a 3D OpenGL version of a game I originally started as a 2D tile based game on the Android. It translated pretty well to 3D and I just added a new messagebox system. Makes me reminisce the days of my youth when I first started playing with RPG Maker 2000 or whatever.


Levels are completable as of a few weeks ago so that was a nice feeling to get it back to the level of completeness of the Android version. Now that the messagebox system is finished I can start fleshing out the levels with the story prompts and such to give them a bit more polish.

Stay tuned. :)