Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / Zombie Apocalypse Simulator (Just for fun)

Author
Message
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 29th May 2007 00:15 Edited at: 5th Jun 2007 23:17
This is just a bit of fun. Kinda like those Life sims where the rabbits breed and eat the grass and the foxes eat the rabbits, and it shows you how an ecosystem balances itself. This is similar, except it simulates a zombie apocalypse! It's nice as it's pure code and logic and practically no media.

The idea will be to simulate the basics of zombies hunting for food and attacking houses. People taking refuge in houses and barricading themselves in, plus having to eat food and sleep, and contracting the virus from bites, then becoming zombies. I'll add rules slowly over time to make it more complicated, then release upgrades builds so people can play with a few sliders and simulate their own custom zombie apocalypse.

At the moment it's the basic zombies trying to chew the nearest person and people fighting back. There are fear and skill threshholds which determine if some fights back and succeeds, but I've cranked them to max so we can just see a bit melee. Next step will be to add some elements to the environment to interact with (like houses to hide in) and then enhance the path finding and hunting. I could go all out and end up with cars being driven and vigilantes firing guns, but for now I'll keep it simple and see how far I want to push it.

Just a bit of fun. Graphics are crap, but once more is in place it'll be interesting to see how the apocalpyse fans out. Currently it seems like a 2:1 zombie:human ratio means certain death for humans, even all with high combat skill.

All source code will be released too, for people to learn about basic AI and pathfinding etc.



Little vid of the early bits of logic (not exciting, but it's a scientific sim (in the broadest possible sense!), not a game! )
Zombie Sim 1 (WMV 3.7MB)

8700 Zombies on screen:
Zombie Sim 3 (WMV 2MB)

Zombie Sim source and media (ZIP)


Current features:
Basic human/zombie AI and movement
Zombification, plague timing, basic combat
Added animations for units
Human fatigue (humans get tired and slow down unless they rest in a building)


tha_rami
18
Years of Service
User Offline
Joined: 25th Mar 2006
Location: Netherlands
Posted: 29th May 2007 01:06 Edited at: 29th May 2007 01:07
All I miss is a female figure with a big gun (and similarly sized attributes), a foggy town and medkits, guns and the like placed seemingly random everywhere.

No seriously, this is a cool idea. Work it out!

I'd say keep the zombies limited in AI and speed, but high in power and fearless and the people smarter, faster but weaker and in need of supplies.

GatorHex
19
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 29th May 2007 02:19
Nack
21
Years of Service
User Offline
Joined: 29th Jul 2003
Location:
Posted: 29th May 2007 05:55 Edited at: 6th Jun 2007 18:25
oh wow, this is amazing!! like really really cool! always had a thing for zombies LOL really cant wait to see more of this!


Beta Level out! Check it out. =]
http://s7.invisionfree.com/NacksBunkie/
bond1
19
Years of Service
User Offline
Joined: 27th Oct 2005
Location:
Posted: 29th May 2007 06:27
You should really release this to the Center for Disease Control (CDC) as well as your local government/authorities. The "powers that be" really need to see how a worst case scenario would pan out when the real thing happens. And it will.

Looks cool.

----------------------------------------
"Your mom goes to college."
My FPSC stuff at http://www.hyrumark.com
Wiggett
21
Years of Service
User Offline
Joined: 31st May 2003
Location: Australia
Posted: 29th May 2007 07:41
lol this game would be awesome to watch if you stepped up teh graphics to a cinematic level, like nice shady spots around houses etc and screaming people when zombies smash through their barricades etc.

Though the engine would also be cool for battle recreations, like say trade zombies with romans and humans with huns, take out the infection and you could get awesome looking battles!

Syndicate remastered: Corporate persuasion through urban violence.
Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 29th May 2007 07:58
You ought to make this into a screensaver... It could be real creepy if you do waht Wiggett said!

Free music, textures, models, and tutorials.
Silver Dawn
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 29th May 2007 12:42 Edited at: 29th May 2007 12:48
@Wiggett

You're a bit of a 2d guru aint ya? If you fancy knocking out a few 2D top down (or kinda half top-down half-side-on, almost isometric) animations for zombies and humans, that'd be great. I'd happily ad em to make it look better. Can't do it in full 3D since it's designed to simulate thousands of zombies/humans on screen at once, so that'd run like a dog, but switching between a static image to an animating one is pretty much the same overhead. Top down would probably be best, as then you only have to draw one set and I can rotate them, rather than drawing 16 different directions, for example.

Lemme know if you're interested (hint hint etc.).


tha_rami
18
Years of Service
User Offline
Joined: 25th Mar 2006
Location: Netherlands
Posted: 29th May 2007 12:54
Humans should also be able to suicide when infected... Or would that just turn the into zombies?

Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 29th May 2007 13:17
You gotta destroy the brain, so a human could only suicide by blowing their brains out with a shotgun, or putting their head on a train track, or reading War and Peace. If I get to a stage where I'm making each human quite complex, then I might add a random chance for a human to commit suicide if he had the appropriate weapon or access to a library.


Wiggett
21
Years of Service
User Offline
Joined: 31st May 2003
Location: Australia
Posted: 29th May 2007 15:38
you're really not a fan of war and peace are you

and by your suttle hints, I am way ahead of you!


ok so I'm not but now that you asked me I will get to work to catch up and then get way ahead of you!

will make a few lil anims for them. try my hand at some more pixel art, did you just want 2 frame anims for walking and like 2/3 for attacking etc?



Syndicate remastered: Corporate persuasion through urban violence.
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 29th May 2007 15:53 Edited at: 29th May 2007 15:57
Nice one. Cheers Wig.

Draw whatever you want, and spend as much or as little time as you like. It's up to you, and anything will be an improvement over my quick graphics. Top down is the way forward I reckon, cos then I can just rotate them, so you only have to draw them once.

Here's what I could use, and if you can't be bothered to animate them, no problem, just do the final image. Whatever you can be arsed to make.

Walking animation (3 - 5 Frame - Zombie and Human)
Attacking image (1 Frame - Zombie and Human)
Dead image (1 Frame - Zombie and Human)

That's 10-14 images. 64x64 with solid colour background is spot on. That'd be awesome mate. You're a star. Once again, whatever you can be bothered to do.


Wiggett
21
Years of Service
User Offline
Joined: 31st May 2003
Location: Australia
Posted: 29th May 2007 17:53 Edited at: 29th May 2007 17:58
oh, well i went ahead and did stuff befor ereading, so without further ado here is what i have whipped up!



After a few failed hand drawn attempts i loaded a human model in milkshape, posed it a few times and then took screens. The camera may have moved a few times so some of them are off balance, if they show up too much let me know so I can redo them (which I probably will later anyway..) but for now here is a 3 frame attack, 3 frame walk and 2 frame idle for mr zombie !!! sizes should be good, it was 800*800 with 200*200 squares, shrunk down 25% so that is what 200*200 with 50*50 pixels per square? hope that helps with coding ;D oh and the image says the background pink is 255:82:245 I can come up with a better one or a human one soon, it's just a matter of jumping (and plugging/unplugging) machines which I don't have time to repeat tonight will try again tomorrow! in the mean time if anyone has any milkshape compatible models of humans/zombies it saves me having to hand draw the textures in photoshop



Syndicate remastered: Corporate persuasion through urban violence.

Attachments

Login to view attachments
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 29th May 2007 18:17
Good idea man! Like it. Cheers for having a go! HOWEVER (), I think the camera needs to be directly above (even though isometric looks better) otherwise when I rotate them about, they'll look odd, like they're all leaning backwards. Secondly, if you take images of models and then shrink them, you'll need to make sure you can shrink without anti-aliasing on, otherwise we'll have pixels blended with pink around the border, and then the zombies will look camp.

Will have a look when I get back from work, but I'm guessing these are anti-aliased and will have a weird fluffy border.

This is the problem with asking people to help you do media like this. You end up having to get them to redo it, or tweak it loads of times, such that it becomes a chore for them and they wish you dead. If it gets to that stage mate, just don't worry about it. Don't want you to have to go out of your way.

Will feedback when I get home.


Wiggett
21
Years of Service
User Offline
Joined: 31st May 2003
Location: Australia
Posted: 29th May 2007 18:25
hehe yeah the rendering to jpg may have been dodgey, i still have it all in psd format and can play around with whatever. Top down doesn't allow for much detail in the images so I decided a slightly off top angle. I will have a bunch of free time tonight (1am now :x) and I will go over it again, i've been meaning to render out some 3d anims to overlay ontop of live footage anyway.

while you're waiting, FIX YOUR WEBSITE IMAGE! claymore island coming january 2007?! why tease me!!



Syndicate remastered: Corporate persuasion through urban violence.
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 29th May 2007 21:22
Ok, fixed my site. Shame, but it's the truth.

Tried out the graphics. Doesn't look quite right with the perspective unfortunately. Defo needs to be top down. Also the anti-alias makes the border look pink and and the compression on the image means there is no flat background colour (it's all random). It needs to be saved as a bmp or similar and scaled with no anti-alias. I can scale if needs be mate!

Apart from that, fixed a few bugs tonight I didn't know were there, so it's all hunky dory.


Dr Manette
18
Years of Service
User Offline
Joined: 17th Jan 2006
Location: BioFox Games hq
Posted: 29th May 2007 22:17 Edited at: 30th May 2007 01:12
Very cool, hope to see this become more complicated.

Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 29th May 2007 23:23 Edited at: 29th May 2007 23:26
Ok. Did a few optimisations and fixed a few issues. Also arranged the code a bit better and commented it all out. Visually I can run 3500 zombies on screen at once (AMD4000+ GeForce5600) and keep the desired 30 FPS. Drain is split 50-50 between CPU and GPU. Should be able to simulate a lot more off-screen though, as various checks and movements won't be required, so I reckon maybe 20,000 humans/zombies can be simulated with upto 2000 on screen, but that's a random guess at the moment.

Just a little vid of what 3500 zombies looks like. Looks quite cool, and that's about as zoomed out as you'll want to be, else you won't be able to see anything.

Zombie Sim 2 (WMV - 2MB)

For those that are interested, I think I'll release the first iteration of the source code when there're enough elements to play with ... so probably once buildings are in and working and you can randomize maps and zombie/human clusters etc.


Deathead
18
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 29th May 2007 23:30
So many zombies so many un-dead humans!

My Avatar is copyright to John F's Wick Models
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 30th May 2007 03:09
Looking really cool so far Fallout.

Just an idea:

Allow the user to pickup humans with the mouse, and drop them elsewhere. While being heald, the squirm around and scream, then when you drop them they shout "nooooooo" and hit the ground, where zombies hoard them.

Or not , just some way the user can get into the game.


Zombie 20
17
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 30th May 2007 03:47
YEAAAAAAAAAAAAA!!!!!!! Its a zombie game!!! Can't wait for it.

Agent Dink
20
Years of Service
User Offline
Joined: 30th Mar 2004
Location:
Posted: 30th May 2007 04:11
You could make it a god game. Maybe sort of like lemmings in that you try to keep the people alive by assigning them tasks to stop the zombie invasion from reaching them. Whether that be building walls, digging ditches, setting traps, standing guard, or running away, etc.

Free music, textures, models, and tutorials.
Silver Dawn
Dr Manette
18
Years of Service
User Offline
Joined: 17th Jan 2006
Location: BioFox Games hq
Posted: 30th May 2007 04:35
Simulation turned rts; sounds like a good way to go, Fallout!

Mr X
19
Years of Service
User Offline
Joined: 25th Sep 2005
Location: Universe, milkyway, sol-system, Earth...
Posted: 30th May 2007 10:58 Edited at: 30th May 2007 10:59
I like both the idea of grabbing humans and giving them tasks... and it would then be nice to play on the zombie side too (you can grab zombies and give them tasks!!!). Anyway, even if you don't "go rts", I definetly thinks this is very nice. Keep up the good work.
tha_rami
18
Years of Service
User Offline
Joined: 25th Mar 2006
Location: Netherlands
Posted: 30th May 2007 11:22
I don't think you should go RTS or I actually think you shouldn't give the player any control after the simulation starts (maybe a world editor and such would be cool) - it will be fun to build scenarios and watch it unfold, much more fun than a extremely simple Zombie Tycoon version.

Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 30th May 2007 11:52
Rami's idea is kinda what I'm going for. You can choose the initial spawn points for zombies, and humans, and where cities might be etc. and then drag loads of sliders about to tweak all the variables, then click go and watch it unfold. However, I might add the "drag and drop" person feature .. that sounds quite cool, so you can have a degree of control over events.

The ideas of setting traps and standing guard etc. are possible, and I might implement some stuff like that, but it'd all be automated to keep it as a simulation.

Right, better do some real work.


Wiggett
21
Years of Service
User Offline
Joined: 31st May 2003
Location: Australia
Posted: 30th May 2007 16:02
ok her eis the bmp of the new zombie set, 1 idle frame, 3 walk frames and 3 attack frames. all 64 *64 but again probably slightly unaligned as the capture process requires to shrink the image by hand. Shouldn't have a problem with solid colour this time as it's in bmp format on the blue colour which is rgb: 0,128,192 . hope it works this time

Syndicate remastered: Corporate persuasion through urban violence.

Attachments

Login to view attachments
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 30th May 2007 16:25
Thanks man. Will give em a try. Don't do anything else, cos I'm having problems with the animation slowing everything down, so I dont want you to waste your time incase it doesn't work! Cheers for this though, will give it a bash when I get home tonight.


The Nerd
20
Years of Service
User Offline
Joined: 5th Jun 2004
Location: Denmark
Posted: 30th May 2007 16:34 Edited at: 30th May 2007 16:35
This looks really awesome Fallout! And a really interesting idea it is too I'm gonna follow this thread for sure, as I think this could turn out to be very, very interesting. Hey, who doesn't wanna see how the humans are gonna handle a load of zombies?

And umm... there sure is a lot of zombies in the latest video...

Good luck on this project!

Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 30th May 2007 19:14 Edited at: 30th May 2007 19:19
Ok, bit of an update. I've got it rolling with about 8500 zombies with loads of optimisations in there. That's the max my compo can run. It runs at 30FPS without visuals (so CPU is just keeping it together) and 15FPS when all zombies are visible. So CPU is the weak point until you zoom out and then it's the GFX card. That's on an AMD 4000+ and 5600. It'll be up to you to tweak the max entity count to whatever runs best on your compo, or I might put in a system test to auto-calculate it.

Here's what 8500 looks like. Appologese to you Mr Wigget - I couldn't use your graphics because of the anti-aliasing problem, but you inspired me to try the same technique, so I took a zombie from Claymore Island and took snapshots in Milkshape and went for 10 frames (big spender) and it looks quite smooth! So cheers for the ideas mate.

Zombie Sim 3 (2.4MB WMV)




Wiggett
21
Years of Service
User Offline
Joined: 31st May 2003
Location: Australia
Posted: 31st May 2007 05:51
no probs dude glad i could help! your model looks better anyway can i ask though what happened to claymore island? I don't think i was around when whatever stopped it occured, uhh you can email the answer to me if you don't want it aired in the thread.

Syndicate remastered: Corporate persuasion through urban violence.
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 31st May 2007 10:21
I want to know what happend to claymore Island as-well! It was looking great!


dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 31st May 2007 11:10
What sort of optimizations are you doing? when zoomed out are you using a lower res texture for the zombies? are you also increasing the time step between frame updates at those distances? As for movement are you storing Sin / Cos in an array?

Also is there any chance of a release? I'd like to try my hand at optimization .

Looks cool too, I've always wanted to make a mini zombie shooter.

Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 31st May 2007 11:29 Edited at: 31st May 2007 11:31
@Wigget

I never official stopped Claymore Island, I just don't have enough time for game dev. It's just way too much effort for not enough reward. This sort of thing I can just sit down and spend an hour, bash out some code and see some results. With Claymore Island, I'm faced with big things like enemy AI, multiplayer coding etc etc. before I get to the next step, and it's just too much of an uphill struggle for someone without the time (or inclination).

It's not dead. I'll get back to it at some point.

@Dark Coder
Quote: "What sort of optimizations are you doing? when zoomed out are you using a lower res texture for the zombies?"


Yes, but I've experimented with different sizes and the final FPS is the same, so whatever dbp is doing internally, it's not making a difference (only when I use really big textures it makes a difference, but these are only 256x256 with 64x64 frames UVed into position).

Quote: "are you also increasing the time step between frame updates at those distances?"


Yep, at a certain distance, no rotating of the zombies occurs and they're only moved by full squares (rather than smoothly between them), and no animation occurs, so that's fully optimised.

Quote: "As for movement are you storing Sin / Cos in an array?"


Not even in an array. All individual zombie speeds (across and diagonal) are precalculated and stored with each zombie, so there is no maths in position calculation at all. It's just literally 'x = x + speed' or 'x = x + diagonal speed and z = z + diagonal speed'

The idea of releasing the source will be for less experienced coders to learn from it and not open source. However, if you're experienced and you want to play around, that's cool, and I will integrate optimisations and stuff if you can make em. I'll probably be more picky about adding new technical 'features', but will be up for adding those too if they don't go too far away from the initial idea.


dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 31st May 2007 14:02
Hey, I only want to poke around the code to see if I can optimize it any more, I like random small challenges you see.

Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 31st May 2007 14:22
I have an idea for an optimisation.

Your using plains right? - well if you have 10 frames of animation, I'd make 10 plains, each with a different frame textured, then for the rest of the plains, I'd clone a different plain each time. So by positioning alternate plains for the zombies, you get an animation for free.

Like say your texturing a plain for each zombie, by changing the start plain number each loop, between 1 and 10, and using incrementing objects, when you come to position the plain for each zombie, you'd be starting from the next plain, so every zombie would be animated by that. So you would be using instanced plains instead of cloned or created plains, and you wouldn't need to texture the plains. I'd say you could be looking at an insane speed increase because texturing objects can be a performance drag, but using instanced object as opposed to creating them, well it's just a hella lot faster.

If you upload your code I would give it a go myself, like DC I enjoy messing around with this stuff. I think there could be a game in it somewhere, maybe guide survivors through a maze by setting direction arrows to send them down the right routes, while avoiding swarms of zombies, simplified top-down lemmings with zombies, hell that's the sort of game that would make you famous!.


Good guy, Good guy, Wan...
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 31st May 2007 14:31
Thanks Van, but way ahead of ya! I have one base object that all zombies are instanced from, which seems to give the best performance. I don't retexture to animate either. All frames of the animation are on one texture (applied to the base object) and I simply move the UV coords of the base object using the vertexdata commands to animate through them, so I just use one set of UV adjustments every 5 syncs or so, and that affects all zombies without having to retexture, reposition or reinstance objects.

I think the slow down is just how DB renders objects. It's never liked a high number of objects, and although that's been improved a while back, 8000 still seems to be a performance hog. I have noticed there are a few commands that change stuff behind the scenes (like texture swapping etc) so I might play around and see if there's a magic command that makes rendering this many instances faster.


Zombie 20
17
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 31st May 2007 15:31
Fallout-Looking good dude, keep it up the good work. .

Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 31st May 2007 21:17
Added fatigue, so humans get tired after legging it about (giving the zombies a chance to catch up). Fatigue is restored by going into a safe house. Going to work on houses/buildings next.


Oolite
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Middle of the West
Posted: 2nd Jun 2007 00:37
Very Nice, so this is all coded by you and not dark ai commands then?

I wouldn't mind getting a peak at the source code, i'm hopeless at programming but i always like looking through source regardless.


[Looking for work]
Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 5th Jun 2007 22:47
Ok, bored of this one now. The buildings are in, but aren't functional at the moment. There's a good base of code here for inexperienced coders to learn from and more experienced coders to advance upon. Plenty of comments.

Here's the source:


Here's a zip with some media to work from and the dba in the right place:
ZombieSim.zip

I've had my fun with it, so hope someone else can make use of it. Feel free to use the code anywhere, or add any updates here.


Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 6th Jun 2007 00:32 Edited at: 6th Jun 2007 00:36
Damn, I like it!

EDIT: can you add some Soldiers who kill the zombies?
It would be fun seeing them getting overrunned.

[/center]
Zombie 20
17
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 6th Jun 2007 00:41
Nice work dude, this is simply wonderful.

Fallout
22
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 6th Jun 2007 00:49 Edited at: 6th Jun 2007 00:56
If you wanna see some proper carnage straight away, change lines 229 and 230 for:

MakeZombiePack(125,100,2000,50)
MakeHumanPack(75,100,500,50)


@Jack

Someone else might give that a go mate, but I've had enough of the zombie simulator. My attention span has gone. Time for something else.

Btw, the sounds signify the following:
-Bashing sound is a zombie being killed by a human
-Subtle grunt/moan is a human being infected by a bite
-Growl/screetch is a human turning into a zombie


Wiggett
21
Years of Service
User Offline
Joined: 31st May 2003
Location: Australia
Posted: 6th Jun 2007 17:28
someone post me a video of it!

i am running a mac



Syndicate remastered: Corporate persuasion through urban violence.
alucart13
17
Years of Service
User Offline
Joined: 16th Jun 2007
Location:
Posted: 19th Jun 2007 00:00
Looks interesting. Hope to see the final product!!

Login to post a reply

Server time is: 2024-11-24 01:01:04
Your offset time is: 2024-11-24 01:01:04