Chris Plays Divine Divinity : Part 1June 12th, 2009

Divine Divinity is an RPG that was released for PC back in 2002. It’s one of my favourite RPGs, and you can do some fun stuff in it, so I have decided to play through it and post some of my progress and the things I get up to here. I’ve played through it a few times already, so this will be more of a playthrough where I mess around and experiment with things.

Character Choice and First Moves

I chose the Survivor class, mainly because I’ve already played through as a Warrior and I can’t be bothered just using magic as a Mage. I put it on hard mode, and chose the incredibly fantasy RPG like name of Chris.

In the room you wake up in, there’s some shoes and a knife, both of random quality. After taking them, I went over to the chest, and found some handy gold. One of the nice features of DivDiv is the ability to pick up virtually anything. So, taking advantage of this for a future plan, I took the chest as well.

I then went upstairs and had a chat with Joram, who I was nice to as always. Then I took all of the things in his house, including books and manuscripts. He did say I could take what I wanted! I also picked up another chest, which should come in handy. Here’s my stuff at this point.

After leaving Joram’s house, I headed north to my new base. It was filled with packages, which I removed. I then went inside and dumped my chests, filling one of them with the books that I picked up earlier. I’ll store everything miscellaneous in here. The other chest will be used for weapons and everything else ( until I get some more chests ).

I then did the healing gem puzzle for some quick exp, and +1′d my lockpick skill. I’ll be working on this skill until its maxed for a plan I have later on. I then unfroze Lanilor, and turned all the dragon statues to the north to open the entrance to the catacombs. I then got the most useful item ever, the teleporter stone. I’ll be using that a lot in the future.

Well, thats then end of this part. Some fun with the teleporter next time.

Lardfish, VS2010June 4th, 2009

A new version of Lardfish is avaiable here. There are more details on the page.

I also recently tried out the Visual Studio 2010 Beta. It was nice, I especially liked the External Dependencies filter in the project. That would have helped me with a problem I had some time ago. The one major problem I had with it, and the reason I’m not using it now is the stupid blurry font in the intellisense dropdowns.

Not sure if it’s intentional, but apparently it’s a WPF thing that makes fonts accurate to how they should be rendered, where GDI just used to do it to the nearest pixel. I don’t know enough about fonts to tell if it looks right or not, but it seriously hurts my eyes and gives me a headache pretty much instantly.

So yeah, if they fix that I’ll use it.

Not DeadMay 18th, 2009

Somehow I’ve managed to not get around to updating the site for nearly a month. I’ve been busy at work with the DXMesh API, I keep having to go places at weekends. Anyway, in the last month I’ve updated Lardfish to use exceptions, to make it load from files safely. It can now handle incorrect file types, broken files and the like. Overall it seems quite hard to break, which is good.

At some point I may change the Lardfish format to allow for larger files ( > 2^32 bytes ). It would mean changing it to use 64 bit offsets into the data blocks. Also will need to look at streaming the file in, or loading and unloading based on access. At present it loads it all into a block. With larger files this may use a lot of memory. Ideally it would only store the beginning parts, and transparently load data as requested.

On the GFR2 front, not a lot has happened, as I’ve been a bit lazy. I have however solved the random flickering issue with updating text. Apparently I had a Begin/End scene in there for some reason ( oops ) which was causing a jump.

On the todo list is converting Radnom::IRXSprite plugin to use Lardfish, and updating the Lardfish download on the site, which I will do soon.

Late UpdateApril 25th, 2009

I’ve been a bit busy at work in the last 2 weeks, with all the import/export stuff, and now the mesh splitter. Also, my internet at home has been cut back to 70K again (thanks Virgin), which is why I’ve not posted until now.

I’ve improved Lardfish slightly, adding some exceptions for bad files, things like that, which is clearly better than just crashing or reading random data. I decided to use exceptions as opposed to error codes because then the user cannot ignore them. Well, they can just wrap it in a try catch block and catch everything, but then that’s their problem.

I’ve also worked on the editor for GFR2, which is coming along now. I have decided to reorganise the Editor/Main Game relationship though, which should be done sometime this week.

LardfishApril 11th, 2009

I added the first version of Lardfish here. I will probably add a new version soon, since this version  didn’t take very long to do, and has some points that can be improved on.

Interesting TitleApril 4th, 2009

As usual I have become distracted with some new interesting thing. This week it’s been DLL Injection, which I’ve been using to try and create a souped up version of MSPaint. 

Basically I made a DLL, and used SetWindowsHook (Ex) to get into the process of MSPaint, where I then Subclassed the main window, so I could intercept messages from my new buttons which I’ve add to the menu.

So far the only thing I’ve added thats of any use is a keyboard shortcut for invert selection ( now ctrl-shift-I ). I have a plan to add layers, through some copy paste manipulation maybe.

On another note, I saw a squirrel today, and multiple snakes.

Local Functions in C++March 25th, 2009

Lots of programming languages have local functions – however they are illegal in C++. They can be simulated though by using a local struct and overloading its operator(), like this :

int main()
{
	struct LocalFunction
	{
		void operator()(int a)
		{
			printf("Number : %d\n", a);
		}
	};
	LocalFunction function;
	function(1);
	return 0;
}

If you dont like the look of that, add some #defines :

#ifndef BeginLocalFunction
#define BeginLocalFunction(ret,name) struct __##name { ret operator()
#endif

#ifndef EndLocalFunction
#define EndLocalFunction(name) }; __##name name;
#endif

int main()
{
	BeginLocalFunction(void, Flibble)(int a)
	{
		printf("What are arms %d\n", a);
	}
	EndLocalFunction(Flibble);

	printf("Local function sample\n");
	Flibble(3);
	return 0;
}

There are probably a lot of things that can be improved, and its pretty basic. Its probably also been done before, and done better in boost somewhere. But it was fun to mess around with anyway.

Interesting TitleMarch 24th, 2009

So, not much different to post about this. Mostly just working on GFR2s campaign structure and the levels. Also trying to decide if I should use binary files or XML for the levels. Binary is obviously more fun to do and looks more impressive, but XML does have the advantage of not causing ultimate death if the file is wrong.

Also finally got around to uploading badly drawn commando (my paint and windows movie maker video) to youtube, the link be this.

Will probably do a bigger post soon, this one seems a bit brief.

GFR2 Progress, some other thingsMarch 16th, 2009

Ooh look at me, leaving it for 2 weeks to do a post. Yes. Anyway, more of the same really, been working on GFR2. It actually has some reasonable art, thanks to me editing some photos. It makes the game feel a lot better than when it used my rushed rubbish paint images of bananas.

It now has an editor (incomplete), which lets you place objects, save etc. Pretty much the things you would have an editor do. Still not got the points/fuel/air stuff back in yet, but that wont take that long. Will probably do it tonight, as long as I dont go off and do something else.

Radnom has also been improving along with GFR2, as I find bugs and ways to improve it. I am trying to make sure that Radnom doesn’t become a tool to make this one game, like previous versions of Radnom became.

I found an irritating bug the other day – I have been using std::tr1::hash to hash strings, to facilitate faster lookup. However, I found out (the hard way) that it hashes “banana1″ and “banana2″ to the same result, which caused problems on level load. Also caused wormholes to warp themselves, which really confused things. So I changed to murmurhash2 (thankee Jamie), and things have been fine since. Maybe I was doing something wrong with tr1::hash, I’ll go back and look at that sometime, but for now I’ll stick with murmur.

Radnom, GFR2 and tr1 ramblingsMarch 4th, 2009

This week I’ve been continuing work on GFR2. I updated the collisions so they were slightly more sophisticated than the version that I managed to get in in about 30 minutes when I first made the game, and added some new gameplay elements that I think turned out quite well.

While working on GFR2 I of course found faults with Radnom that needed to be fixed. One of which was the overall structure of the whole thing. A small fault then. As it was, every plugin was registered with RadnomCore, which you could request module instances from. This was fine, but getting plugin instances from sources that were definitely going to be there was a bit long winded, and involved finding the plugin, calling the creator, returning the instance, casting to the type.

I decided to completely remove RadnomCore and ditch the whole plugins thing for now, since most components of Radnom are actually just mini projects built as DLLs. At some point I’ll create a plugin manager DLL which will do the same as RadnomCore, but for now I’m just going to call functions directly in the DLL.

I also started changing all the Radnom components from raw pointers to tr1::shared_ptr, something I should have done (and wanted to do – I couldn’t because I had a different VS version on laptop) from the start. For each module, a shared and weak pointer type is available. Makes things a lot easier, since I don’t have to care about when things get deleted now. One thing I did have to take into account was where the pointer was being deleted – I had to make sure that it was in the same place (EXE vs DLL) as the allocation, but tr1::shared_ptr provides a constructor which you can pass a deletion function to.

I finally got round to setting up version control too, so I can actually work on laptop and pc without endless copy pasting over the network.

I’ll be working on the characters and the UI in GFR2, and hope to have character creation done soon – if all goes well it will be quite good.

On a side note, the local shop is offering 6 double dip for 50p. Great Justice.