PROJECTS
BLOG
ARTICLES
Yt
Tw
Triangle Game update

The game has lept from the page and i have something basic working. I added the glow to the image manually, but that's what I'm hoping for in-game. You can move the yellow triangle around, and theres a simple mouse-based editor.

Update:
This is an actual screenshot. The levels are still random, and there are no pickups yet, but there is sound!

Triangle Game

I missed out on the April Ludum Dare competition this year. The theme was minimalist, and I came up with this idea while in the bathroom, so I wrote it on paper as soon as I could. The idea is simple, it looks simple, it should be easy to make levels, and theres plenty of room for expansion

The first problem is how to organise and access the level data.

Triangle Grid

A triangle grid is tricky. Some point up, some point down, each has 3 neighbours. I worked it out after realising a pair of triangles make a rhombus, which can be skewed to make a square. So if you imagine a square grid with a right-angle triangle in the bottom left, and the other in the top right, then you've got it. The player can exist in 1 of 2 positions in each grid rhombus.

When drawing the edges, i just need to draw the left triangle of the rhombus (the one pointing up), plus around the outside

3D screensaver

A while ago I created an openGL screensaver to create a 2d screensaver dubbed the "Wave Clock Screensaver"

This wasn't taking advantage of opengl, as it was fairly simple. It also used a lot of deprecated OpenGL functions, so this time around i decided to make an OpenGL 3.0 screensaver, inspired by the loading screen of Halo (gif or youtube).

The placeholder model is a whale from TurboSquid by a user named butterbr0t, which I've grown to like. The particles start of in a ring, and randomly form in the centre to make the whale. The biggest points are almost transparent, and the smalles ones are the most opaque.

Here's a screenshot of the work in progress

 

Godzilla - Sim City

Godzilla came and smashed up my coal power plant. That's what i get for using non-renewable engergy.


If Godzilla had a son, would he be Jesuszilla?

One of my regions became completely corrupted a few days ago, which is a big kick in the teeth, but recently EA gave out free game coupons to those affected by the dodgy release, with the reasoning "You expect better, so do we". I'm going to get Mass Effect 3

Battlefield 3

I bought BF3 for $10 when it was on sale, and after 22 hours of downloading, followed by 1 day of server outage, followed by 6 hours of downloading the update, followed by another evening of server outage, i managed to play.

I'm enjoying the campaign (though its pretty unforgiving at times) and the story seems good enough. I do like how it allows for various types of missions.

Multiplayer is good at the moment too, because there are enough noobs for me to hide amongst. I tried to pilot a helicopter yesterday, but ended up landing rotors-down 5 seconds later.

Similar to the Sim City launch, BF3's "$10 launch" and Origin had its issues:

Sim City

After a very messy launch, I've managed to play the new Sim City a day after launch!

I joined the 3rd Eastern European server, which didn't exist until today. The Oceanic server is still having difficulties.

In that time i managed to create a super hero's base, a university, a water treatment facility, a trainstation and a trillion hospitals, which is still not enough. The map is basically full, so now i have to turn my attention to increasing building density.

I thought this next shot would come out nice, but its too dark to really see what's going on

I won't say much else, because Sim City 'lets plays' and 'playthroughs' are all over the internet .

Rock Paper Shotgun wrote a great, and level-headed article on the launch

Banana Swarm!

I've been playing around with lua and my latest project (codenamed Adventure) and I've implemented a banana swarm! The bananas try to keep between 1 and 2 metres away from you, plus they randomly pick 3 other bananas to move away from

Here's some code, which probably won't make sense, and definitely isn't efficient

function bananaFollow(entId, time)

	this = globalEnts0 -- get the entity
	

	pos = this0
	player = globalState0
	delta = {}
	
	delta1 = - player0 - pos1
	delta2 = - player0 - pos2
	distSq = delta1 * delta1 + delta2 * delta2
	
	if distSq > 4 then
		len = math.sqrt(distSq)
		pos1 = pos1 + delta1 / (len * 100)
		pos2 = pos2 + delta2 / (len * 100)
	elseif distSq < 1 then
		len = math.sqrt(distSq)
		pos1 = pos1 - delta1 / (len * 50)
		pos2 = pos2 - delta2 / (len * 50)	
	end
	
	for i = 1, 3, 1 do
		-- now pick a random other follower
		followers = globalState0;
		otherFollowerId = followers0
		
		if otherFollowerId ~= entId then
			other = globalEnts0
			delta1 = other01 - pos1
			delta2 = other02 - pos2
			distSq = delta1 * delta1 + delta2 * delta2
			
			if distSq < 1 then
				len = math.sqrt(distSq)
				pos1 = pos1 - delta1 / (len * 100 * i)
				pos2 = pos2 - delta2 / (len * 100 * i)
			end
		end
	end
	
	setPosition(this0)
end
3D modelling

I've been messing around with blender and making some low-poly models with low-resolution textures.

You may recognise this truck from my game "Chaos"


And here's a duck for my current project, and just for my library

Adventure Game

Here's a teaser of my latest project

Features:

  • OpenGL 3.#
  • Quadtrees
  • LUA scripting integration
  • XML data files
  • Binary data files
  • PNG texture loading

I've spent about 3 weeks on it so far, adding bits and pieces each day or so.
I'll post more when I feel like it :P

Binary Files & Quadtrees

Binary files are great. You can use them to store your objects byte-for-byte. However this gets tricky when you want to randomly access the file, when you want to jump about.

In my current little project I'm going to have a file with lots of data I dont need. As the player moves through the world, I want to load the area they are walking to. The plan is to slice the world up, into a Quadtree (see the image below)

Each node (square) is a leaf node, or is split up into 4 nodes again. I'll want to skip some nodes, so I need to know how many bytes long they are. My plan for writing objects of unknown length is simple:

  1. Write an int (4 bytes) and remember the position
  2. Remember the current position as the start position
  3. Write the object
  4. Get the current position in the file, and subtract the start position. This is the length.
  5. Go back to the initial int, and write the length of the object over the top
  6. Go back to the end position

This now means that if I want to skip a section, then I just move the positition in the file forward by the length. This method is much eaiser than having a giant index at the start.

Recent Posts








Random Posts









Older>