Zombie Simulator

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
neilb
Posts: 31
Joined: Fri Jan 08, 2010 12:31 am
Location: Australia
Contact:

Post by neilb »

Thanks for stopping by, Lonesome Ducky. It was getting a bit lonesome around here :lol:

I've found that it's motivational to create a "diary" of what I'm up to with a project, even if nobody is looking at it. It also helps me figure out why I decided to do something when I'm looking at the results months later and scratching my head :oops:
Check out my development blog for the Zombie simulator
Or how about the RSS Feed for regular updates?
Andreas
Posts: 166
Joined: Sun Oct 31, 2004 7:15 am
Location: Münster / Germany
Contact:

Post by Andreas »

neilb wrote:Thanks for stopping by, Lonesome Ducky. It was getting a bit lonesome around here :lol:
I like your updates, please keep them going. Especially the videos are nice, although i'm still waiting for some zombie hordes... :D
neilb
Posts: 31
Joined: Fri Jan 08, 2010 12:31 am
Location: Australia
Contact:

Post by neilb »

The zombies are coming, just as soon as I upgrade the sprites to handle animation and actually animate the human model...

Rubbish bins, traffic lights, stop signs and bus stops are in, correctly positioned on the side of the road. Traffic lights appear at four way intersections, stop signs at three way, rubbish bins and bus stops appear interchangeably on streets at least three map units in length (256 pixels). I've also added fire hydrants.

Image
Image

That's enough props for now to be sure the system is working. Onto the next bit :)

As usual, more detail on my blog.
Check out my development blog for the Zombie simulator
Or how about the RSS Feed for regular updates?
neilb
Posts: 31
Joined: Fri Jan 08, 2010 12:31 am
Location: Australia
Contact:

Post by neilb »

I thought a video would be nice for today's episode. This one features the first car model.

I decided to do a car next to make sure the scale of everything else fits - I was a little worried that the road wouldn't be wide enough. It turned out that the people were slightly too large (easy fix), and I'll have to tweak the road to remove the edge of the sidewalk to widen it a little, but apart from that it fits in OK.

The model uses 150 triangles, excluding wheels and it's been designed so that the doors, hatch and bonnet are removable. I think I'll have to implement vehicles as meshes, rather than sprites because they are large enough to show clipping problems as sprites when passing one another - if they were drawn as two flat planes facing the camera, then all of a sudden one would jump in front of the other.

http://www.youtube.com/watch?v=RfESsLe7a4U
Check out my development blog for the Zombie simulator
Or how about the RSS Feed for regular updates?
neilb
Posts: 31
Joined: Fri Jan 08, 2010 12:31 am
Location: Australia
Contact:

Post by neilb »

Well, it's been a couple of days of pain.

I added in the ability to handle multiple cars and create them like sprites, causing the engine's frame rate drop alarmingly.

Image

I've been able to work through it though, sprites have been merged into a couple of mesh buffers allowing me to have thousands of billboards with little performance affect.

I also found a work around for the slowdown caused by Irrlicht setting all material properties for every mesh buffer for every scene node. That alone had eaten up about 20% of the frame rate because of the number of meshbuffers I'm using, but the solution is pretty specific to my implementation, so don't get excited.

Finally, the big performance killer turned out to be toOpenGLColor(), which ate about 44% of the frame rate for nothing more than converting DirectX colours (Irrlicht internal) to OpenGL format, for every vertex, for every frame. I've got a sort of work-around which halved the performance hit to about 21%, you need to change the function in SColor.h to

Code: Select all

		void toOpenGLColor(u8* dest) const
		{
		  if (color == 0xFFFFFFFF) *((u32*) dest) = 0xFFFFFFFF;
		  else {
			  *dest =   (u8)getRed();
			  *++dest = (u8)getGreen();
			  *++dest = (u8)getBlue();
			  *++dest = (u8)getAlpha();
			}
		}
But the code is only faster if most of your objects have all white vertices. It'll be slower if you use colours extensively. It basically just checks if the colour to convert is all white, and if it is simply assigns it rather than mess around. It would be better if this function were not used at all though.

Anyway, the gory details are on the blog and I'm back on track with a frame rate measured in hundreds rather than dozens.
Check out my development blog for the Zombie simulator
Or how about the RSS Feed for regular updates?
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Keep up the good work :D
neilb
Posts: 31
Joined: Fri Jan 08, 2010 12:31 am
Location: Australia
Contact:

Post by neilb »

I'm exhausted.

I just spent my spare time the last three days cramming pixel shaders...

I wanted to give my cars bump/normal mapping, but Irrlicht's materials weren't up to the task (don't support directional or ambient lighting on OpenGL).

I ended up having to write my own pixel shader... got it working though.

It's a phong bump mapper that can colour the mesh independant of the texture - applying the colour to any pixels that are transparent. This will allow me to make every car a different colour... I want to cheat a bit and have a wider variety of car colours and fewer different models - they take ages to make!

Image

This model looks more realistic than the last one and uses fewer triangles too. That's more like it! Of course now I have to re-do the first one...
Check out my development blog for the Zombie simulator
Or how about the RSS Feed for regular updates?
Adler1337
Posts: 471
Joined: Sat Aug 09, 2008 6:10 pm
Location: In your base.

Post by Adler1337 »

This game looks awesome. I love the videos. :D
multum in parvo
neilb
Posts: 31
Joined: Fri Jan 08, 2010 12:31 am
Location: Australia
Contact:

Post by neilb »

Thanks Adler1337. I'll do some more videos once I get the cars rolling on the roads, which isn't too far away.

I went back and fixed up the hatchback using the same method I used for the new car and it looks a lot better, so much better it makes the second car I did look worse! Guess I'll have to update that one a bit too...

I've also added a police car.

Image
Check out my development blog for the Zombie simulator
Or how about the RSS Feed for regular updates?
neilb
Posts: 31
Joined: Fri Jan 08, 2010 12:31 am
Location: Australia
Contact:

Post by neilb »

Pathfinding/following has been implemented using opensteer... mostly. It's still early days, and there are glitches to work out, but it's getting there.

http://www.youtube.com/watch?v=QyDQo_aa5VQ
Check out my development blog for the Zombie simulator
Or how about the RSS Feed for regular updates?
neilb
Posts: 31
Joined: Fri Jan 08, 2010 12:31 am
Location: Australia
Contact:

Post by neilb »

I've been busy.

First of all, I wasn't happy with the roads from the last video. Too narrow, so I doubled the road width and I can assure you, although it sounds easy, it was a challenge.

I've also added a new vehicle, a two door 4WD.

Image

I've mostly fixed the path finding issues from the last video... there's still a couple of problems, and the process of capturing the video can make it appear that the cars are shooting off the road or suddenly reverse direction because of delays while writing data... they don't do that when running it with video capture off... have to figure that one out!

And finally, the cars now come in a random rainbow of colours, except police cars of course.

http://www.youtube.com/watch?v=a1YomDG00ow
Check out my development blog for the Zombie simulator
Or how about the RSS Feed for regular updates?
neilb
Posts: 31
Joined: Fri Jan 08, 2010 12:31 am
Location: Australia
Contact:

Post by neilb »

It's been a few days since my last post.

The reason was traffic rage

To paraphrase my blog: every time I tweaked the car control to stop two cars colliding, it would cause two other cars to collide.

AAARRGGGHH!!

Thankfully, I got it working in the end.

Here's a short video to celebrate.

Cars obeying traffic lights
Check out my development blog for the Zombie simulator
Or how about the RSS Feed for regular updates?
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Alright, you m8 are doing a wonderful job. I haven't seen the source, but I'd wager I'd be honored to work with you on any coding project. Thanks for keeping us up to date and carry on with the best of luck ^^
neilb
Posts: 31
Joined: Fri Jan 08, 2010 12:31 am
Location: Australia
Contact:

Post by neilb »

Thanks Dorth.

Things are going a bit slower at the moment due to the Real World catching up with me. I'm still forging ahead though when I get the time...

Since the last installment, the sprite generator can now create sprites from b3d bone animations, these animated sprites can now be loaded into the engine, the animated sprites are now part of one large mesh buffer the same as the static sprites (much faster than using a node per sprite) and I've updated the original human model, Mr. Blue Jumpsuit, so that he now has a walk cycle.

I haven't got any video to show this time though, because I realised that I needed to work out how wide the pavement was going to be before I could put the humans on it - I'd noticed that it was looking too narrow, and since I updated the roads to be double width, I had some extra room to play with along the road edges. This meant that it was time to finalise the road and pavement textures, which has now been done. Here's a shot of the result.

Image
Check out my development blog for the Zombie simulator
Or how about the RSS Feed for regular updates?
Dorth
Posts: 931
Joined: Sat May 26, 2007 11:03 pm

Post by Dorth »

Aw man, you didn't even read your private message? If you take a week or more to show up, at least check if you have a pm ;)
Post Reply