Just a quick update to let you know that due to popular demand, I’ve packaged up the source code for the Solar System project under the MIT license. You can use this for learning or applying to your own projects
I’ve recently been working on my new “Triangle” project, which is a work-in-progress name until I can think of something better. It’s a top down adventure style game set in a tile based world inhabited by geometric shape people. In this world, you play the role of a triangle who’s either imprisoned or working his way through some kind of facility/enemy base.
So far I’ve made it to the top of Screenshotsaturday on Reddit one weekend, and gotten a lot of positive feedback, so thanks to everyone supporting the project!
I spent a lot of time developing a shadow/field of view projection algorithm, which lets you only see the parts of the level that are within eyesight of your character. It draws a nice smooth vector shadow over anything that’s not visible, for example around a corner.
Click to view
Click to view
I’ve developed a level editor too. I originally started this just so that I could develop the levels for the game, but it’s pretty nice so I might include it with the game. You can draw 3 layers of tile graphics, and also add objects, which you can add from a preset with a button (such as “door” or “enemy1″) or write in XML. The level editor then converts the XML into my own internal level data represented in the engine. The user can save and load the levels from a Base64 string, which is made by converting the level data into a packed byte array, compressing it, then Base64 encoding it. And back again to load. At any point the level can be played.
Click to view
Click to view
I’ve been doing all the code and art myself, but so far it’s only taken about 3 weeks. Hopefully I’ll have it ready to play soon enough, but university sure is taking its toll.
Thanks for reading, if you wanna check out more, here’s some links to dev threads and such.
This is a project I developed in a team as part of my degree at the University of Surrey. We ended up going beyond what we needed to because the project was so enjoyable. I did the majority of the code with Dadamuga Mazino, also on the team was Robert Game, Humza Abbasi and Tong Zhang. We ended up scoring a 1st for this project and better than any other team!
It’s been years since I’ve posted on here, but I think it’s time I started it up again. I thought I’d start by showcasing a little bit of what I’ve been working on during the absence. Expect more posts to come!
I wrote a realtime simulation of the solar system in C++ with OpenGL about a year ago, and just made a Youtube video to showcase it. Here it is!
I used GLUT for the windowing and OpenGL with all the graphics. I implemented my own vector and matrix operations to create the camera system, which allows 3 degrees of freedom using the keyboard controls by having an up vector, right vector, forward vector and position which are converted into the camera transform matrix, as well as my own TGA loader for the textures.
As a lot of game developers know, this weekend was the Ludum Dare game jam/competition! Competitors had 2 days to enter a game they wrote from scratch in this hectic jam.
I made my entry in about 1 and a half days, but I still think it turned out pretty well! I wrote it in straight C using the SDL game library for rendering & input, and compiled it in Windows under VS2010.
Hey, long time no writing in this blog. For anyone who read the blog before, you may have noticed I bought a domain name for it. This is mainly so I don’t have to use the wordpress.com site anymore; it had a lot of restrictions and I didn’t think the price for removing them was fair, considering I could get full hosting & add WordPress to it myself so cheaply.
I’ve recently been working a lot in Flash, and just released a game I worked on for a month or so. The game is called BulletSpree! It’s basically a top down machine gun defense game; totally caters to all your machine gun mowing needs. And it has blood too. If you wanna play it, it’s currently only on Bubblebox.com so here’s the link to that;
The game was programmed by me, and the art was done by Chaz Carter, who you can find at his site, FlashChaz.com. I wrote it all in object oriented Actionscript 3, using Flash CS5. The game idea was rather simple, so the only challenges I met were really integrating it with high scores, but it was a hell of a lot of fun to make.
However, using Flash to compile the game was a pain in the ass, and its IDE is far from ideal. Now I’ve started using Flashdevelop for the code & the Flex AS3 compiler to compile. The art gets made in Flash an exported to asset “component” files that can be used in my code and compiled into the final app. This seems to be a much nicer way to work (at least from a coding point of view) so I’ll probably continue this way.
In other news, I’ve started working on a little something in C. It’s been a while, but I’ll post more when I’ve made more progress. Enjoy the game
Over the last couple of days I’ve been working on a little Tetris type game in C++. I once saw a website that said every game developer should start out with Tetris, and although I’ve been doing this for a while now, I thought it would still be worth it for the practise and fun.
So yeah, here’s the final product. Written in C++, using the SDL & SDL_Mixer libraries for sound/video output. Follow the link below for a zip containing Windows executable, the source code, and makefiles. It will compile on all platforms supporting SDL.
Windows users do not have to compile to play, just download, extract and run tetris.exe.
So anyway, recently I finished a simple TCP/IP multi-client chat program. It’s a pretty nifty, fun little app where you can run the client which will connect to the server and you can chat with other clients on the server. I wrote it using C. For libraries, I used SDL for window management, rendering and threading, and I used the Windows Socket library to handle the networking.
Unblock port 666 to allow people to connect to your server.
This project actually came out of a small, simple SDL command line which I wrote. It allows me to poll for string input, at the same time as printing to the console and displaying the whole thing.
(I even drew out the damn font using the pencil tool in Ms Paint)
This was awesome for me, because I used alot of threading for the networking. So I made this multi-client chat server and a nice client. The server is the most complex part. For this, I first start a listening thread which waits for an incoming connection from a client. On connection, a new socket is created for the new client, and the server starts a new thread which listens to any data being recieved from the client. The client is added to a main list of clients, so that the server can easily send messages to all the clients.
When a message is received from a client, the receiving thread calls a function to send the data to every other connected client on the server. This allows the multi-user chat which can become so fun.
As far as the client is concerned, It’s pretty simple. The user inputs the server IP into the console, this then sends a connection to the server. On accept, a thread is started to listen to the data recieved by the server, and a listener function is set to send all data which the user types in.
So basically, you type -> sends to server -> your thread in the server triggers a send -> the data is sent to all connected clients -> connected clients see your message in their command line.
The FPS counter shows the number of frames per second. The max is 125, and the higher the better. As you can see, it’s very fast, and looks perfectly accurate. This is because I made this while learning OpenGL. The dudes on Elysian Shadows IRC were an awesome help on this project.
What I did was make a simple API for those using the 3d renderer, in which you pass 3d points to functions I make such as drawTriangle.
My drawTriangle then takes these 3d points, and passes them through a function which converts from 3d space into 2d screenspace. I do this using some heavy matrix multiplication; first, the 3d points are passed through the world transformation matrix; this basically controls the camera position and allows easy translation and rotation of objects for the developer. Next, it is passed through the projection matrix. This is a matrix which converts it into a nice proportioned point. With this, I then divide the x and y coordinates by the Z for perspective.
By now I have a 2d point for each point in 3d space, between -1 and 1. So I simply multiply and translate these to fit between the width and height of the flash, which gives me the final 2d point on the screen.
Then I use the Flash API to draw a shape between the 3 points of the triangle, and add the triangle to my display list.
At the end of each frame, the developer calls the update function, which sorts each triangle in the display list by the depth, using my sorting algorithm. This means that triangles further away will be drawn BEHIND triangles that are closer.
This results in the nice system which you can see
However, I didn’t stop there. In order to make this more useful, I then opened up my C environment to produce a .MD2 model file loader. This is a program I made which parses a Quake 2 format file, and produces a .as (actionscript) file with the commands to draw the Quake 2 model in my Flash application. This means that anyone can use a standard 3d modelling package such as Blender or 3DS Max, and render their models inside my 3d rendering API.
This is pretty awesome, and I show you the following example below, in which I used my C program to render the Berserker enemy from Quake 2. Beware that this will run alot slower, as there are a good few hundred triangles being rendered;
Click here to see it rendering a Quake 2 Model using my C++ app.
I might release the source code in the near future, but if I do, I want to make something myself with it first. So stay tuned.