Friday, December 24, 2010

Thursday, December 16, 2010

Coding - It's UML Time!

Sorry folks but...


Note that most classes members are omitted and method signatures simplified.
They say that UML is worth over 9000 words... I'll just throw random class diagrams at you.

1. Controllers 

2. AI

I used NClass for this. NClass is nice for doing C# class diagrams.

End of uml time.

Monday, December 13, 2010

Coding - District Map Generation

How about a coding article? It's been quite a long time, so let's have one.
Let's start with some simple.
If "recursive quad splitting" tells you something you can skip the article alltogether, as the algorithm is really only doing that. It's nothing special really.

If you look at the structure of district surface maps they basically all look the same : blocks of buildings cut by straight roads. It's no coincidence, there is one algorithm that generate all the districts.

...GENERATION : Generating Blocks
How can we get  this blocky district plan?
Let's start with the whole district rectangle and nothing in it.
Mister District.
We want blocks.
How about cutting this district along two lines?
The blue lines would split the district in the middle.
That would be not very interesting for the player.
So let's deviate a bit and cut along the red lines.
We obtain 4 smaller rectangles, call them quads a, b, c, d.
a is topleft, b topright, c bottomleft and d bottomright.
But b is a bit too small, so let's merge it with a instead.
b merges with a
Let's continue splitting shall we?
We apply the same process we did on the big district rectangle on the smaller quads (recursion).

After Cut+Merge on a,c,d.
We try to split a in 4, but the smaller quads are too small, so we merge the smaller quads and get only two quads a1 and a2. Same with c.
We find d is already too small and decide to not split it further.
We decide that's enough as there has to be an end to this madness.
From these quads we make blocks and give them numbers.


... GENERATION : Assigning Blocks.
Looks like your average district map, with the roads and all.
Only thing, the blocks are empty.
So next for each block we decide what to do with them and fill them.

Assigned blocks
h for housing block, p for park.
Different algorithms are used to fill different block types.
Different district types will have different distribution of block types.
That's it.

The block generation algorithms in pseudo code (image).

MakeBlocks : Making Blocks since 1887
Start the recursion with calling MakeBlocks on the district rectangle.
Block is a class that has a rectangle property and various other content properties that are filled later.

QuadSplit is even more simple, choosing the split lines semi-randomly and doesn't split quads that would be too small ("merge"), enlarging one of the quads and marking the merged one as empty.

End of post.

Saturday, December 11, 2010

Alpha 6 release!

Check the download page.

Changes :
New major concepts : personal enemies, murders and murderers, law enforcers and followers trust.
Bunch of bug fixes.
Modified how smell works.
Rebalanced skills and upgrade.
Flavor : Fun Facts, NPC emotes.
Various rebalancing, fixes and AI improvements.

1 Zombified male was created as a zombified female instead.
2 Soldier followers bumped into generators.
3 Player could always break stuff with the break command.   
4 Dying in the sewers with a follower crashed reincarnation if option "Can Reincarnate to Sewers" is off.
5 If you spawned as a slow actor (eg: undead zm) you will not get messages for actions done by actors who get to act before you on turn 0 (eg: getting shot by cop).
6 Flawed spawn logic for undead player.
7 Follower selection menu did not work properly.
8 Looking at a live grenade crashed the game.
9 Armor now drawn on top of torso decoration; might give some funky looks (eg: armor on top of coat).
10 Policeman and male civilians were both named as "man" in post-mortems.
11 Manual : default key for city information is "i" not "m".
12 System.InvalidOperationException: killing deadGuy that is already dead.
13 Reincarnation messed up CUF script. (eg: a zombie could block the stairs forever).
14 Shoving allowed an actor to enter an otherwise unpassable tile.
15 Simulating did not check properly for events.
16 Actors with natural speed over 100% who sleeps can act right after starting to sleep.

New: Personal Enemies!
- Read the manual.
New : Murders and Law Enforcers!
- Read the manual.
- New Order : "give me...".
- New concept : Trust. Read the manual.
Smell sense
- Smell only adjacent and center tiles (FoS/smell = 1 in old system).
- Smell rating now means lowest scent detectable as % of strongest scent possible.
  eg: 100% means will smell all scents.
       50% means will smell only scents above 50% of max value, that is quite fresh scents.
       10% will almost be "scent blind".
- This means :
  - no more "x-ray scent scan".
  - undeads with poor smell will be more susceptible to loose track of their prey.
  - undeads with poor smell rely more on the noses of ZMs/rats.
  - ...and so more packs led by ZM.
  - importance of clever use of rain & stench killer increased.
  - slightly better undead AI performance, since needs to scan only adjacent tiles.
Map Generation
- Rebalanced Housing rooms type distribution.
- Much more food in houses.
- All Shops start with shelves full of goodies.
- CHAR Offices have canned food only rather than a mix of canned food and army rations.
- Less cars.
- Hospital storage has also some canned food, all items there are full stack.
- Zombie rats in basements.
- Building zones extended to cover doors/windows (good for ai & orders).
- Walkway around buildings are zones (good for ai & orders).
- Try to spawn zombies outside (so most of the initial wave will most probably get shot by cops)
- All gangs size down to 8 (was 10).
- Gangsta will show up a bit longer.
- Rebalanced and redone army supplies logic - will be less frequent and drop smaller packages.
- Rebalanced and redone refugees logic - more on city borders, less in center, default everywhere else.
- National Guard less likey to intervene.
Skills & Upgrading
- Max skill level up to 5 (was 3) - only exception is Hauler.
- Upgrade : choose from 5 skills (was 3).
- Rebalanced skills to account for the new max.
- New Skill : Charismatic - gain trust faster and get more trade offers.
- New Skill : Unsuspicious - law enforcers might ignore you.
- All living actors always upgrade each morning (was previously limited to civilians with a % chance).
- Double potential damage when attacking a sleeping target.
- Rats NPCs can use exits (see AI).
- "Zombie" branch renamed "Shambler" to avoid confusion.
- Rebalanced undeads.
- 2 new unique actors.
- Pills stacking limit increased to 20 (was 10).
- New Item : Police Radio - see all the police on the map.
- Tells how many actors you murdered.
- Death reason is "murdered" if you happen to be... well murdered.
- Fun Facts.
- Fun Facts.
- Optimized actor turn ordering.
- Optimized memory usage.
- New simulation algorithm - faster & more accurate.

- New command : Make personal enemies (default Ctrl-E); designate actors as personal enemies.
- Player personal enemies are highlighted on the map :
  red    : mutual enemies.
  orange : the other actor considers the player as enemy, but the player do not.
  yellow : the player considers the other actor as enemy, but the actor do not.
- Break/Attack through exits with the wait key when asked for a direction (NumPad5 by default).
- Player or follower actor description say if made personal enemies.
- Trusting follower : light blue; Untrusting follower : dark blue.
- Follower actor description shows trust level and if trusting murders committed.
- PC cops can see number of murders in actor description.
- Yes/No prompts : ESC key also works for No.
- When simulating refresh screen only 1 time per second.
- Simulating show turns simulated per second, as a performance counter - keep in mind that lower sim rate means higher tps.
- Colored say and emotes messages so they are more noticable.
- "Barricade mode" says "Barricade/repair" - some players might have overlook that you can repair fortifications!
- New gfx for new stuff.
- Updated manual.

- New option : "Aggressive Hungry Civs" - enable or disable aggressive behavior of hungry civilians (default is on).
- New option : "Event - National Guard" - how likely the NG is to show up. See the manual for exact meaning.
- New option : "Event - Supplies Drop" - how likely are supplies drop to happen. See the manual for exact meaning.

- CivilianAI : hungry civilians without food will attack people for food (carrying or standing on food); followers never do this on their own.
- CivilianAI : more aggressive, now charge enemies if they want to.
- CivilianAI : don't wait for starvation to push objects/attack barricades, they start doing it when hungry.
- CivilianAI : reordered behaviors so followers close doors and windows behind them.
- ZombieAI : attack enemies blocking exits (in addition to already attacking blocking objects) - no more "sleeping on stairs" exploit.
- ZombieAI : will explore stairs/ladders more.
- ZombieAI : ZMs will more actively push objects, opening up paths for other zombies.
- RatsAI : will now follow living scents through exits - means they will leave sewers to chase livings.
- SkeletonAI : has a chance to passively wait rather than wandering.
- AI leaders try not to leave followers behind - npc groups have better cohesion.
- Bikers are not interested in trading or picking up ranged weapons - melee fighters.
- JM is free to wander and is more dangerous.
- Improved FightOrFlee and ChargeEnemy behaviors.
- Modified exploration behavior.
- Rewrote smell & tracking related AI due to rules change.
- AIs won't flee through exit if their leader is not on the destination map (eg: they won't left you behind when fleeing).
- AIs will use exits to follow someone.
- AIs warning message for sleeping friends more explicit : "wake up !" instead of "warning!".
- AIs won't warn someone if it is itself adjacent to an enemy.
- Improved skill upgrade choice.
- Improved use of pills.
- Improved large fortification build logic - will tend to make lines anchored on walls.
- AIs might emote (saying stuff or posturing) in some situations; funny and might help understanding what those retards think they are doing.
- AIs more interested in expired food.

- All actor graphics (Actors and Actors\Decoration) are now 32x32 rather than 24x24.
- Data files incompatible with previous versions due to changes : Skills.csv, Actors.csv, Items_Trackers.csv.
- Better modding readme doc.

- Asymetric FoV.

Have fun!
And remember, die with a smile!

End of post.

Monday, December 6, 2010

Sorry no Alpha 5.1...

...Alpha 6.0 instead.

I can't resist adding new features and fixing stuff.

Probable release by the end of the week, somewhere between friday and sunday european time.

End of post.

Friday, December 3, 2010

Alpha 5.1 - Of Murder And Trust

Major new concepts and features for 5.1. Should be renamed 6.0 honestly, didn't thought I would go this fast.
Murder, murderers, law enforcers and follower trust.
Let the annotated screenies tell the story.


A murderer and his future victim.

Designating as enemy so I can attack.

The attack.

A new career in serial killing opens for me.

Got a bodyguard,but he doesn't trust me enough yet to accept my orders.

Need to build trust over time or with other means. good gifts for instance.

...or getting him out of trouble.

He finally trust me enough to accept orders. Notice the new one.

Damn! The Internet Police!
Law enforcers have a chance to recognize an actor as a murderer when they see him.
There are various factors, all explained in the release.
They can also spot actors committing a murder.

Will he stop shouting like that!!

My mate is helping of course. We are now partners in crime.
Right after getting rid of the cop I open the door...

Will all this hate around me never ends? :(

I drop some food for him to avoid more troubles.

There. Good dog.

New features = new skills, so here they are.

Watch out folks. You can get murdered too, most likely by a starving mad civilian in your sleep. I wonder if a follower guarding you would help...
And yes, you can DISABLE the angry hungry civilian thing, it's an option on by default.

Soon my disturbed psychopatic children. Soon.

End of post.

Wednesday, December 1, 2010

Alpha 5.1 - "HEY! YOU!" the return

Already done some work for 5.1, fixing bugs, rebalancing stuff, adding new features.
A feature players kept craving for is coming. You will love it for the freedom it gives you... and hate it when NPCs will use it on you.

Your friendly nextdoor civilian can get quite nasty...

i can haz ur food?

U talkin' to me?

...and that means you can get quite nasty as well.

You will be able to initiate attacks on anyone, but that will make them "personal ennemies" and, depending on who you attack, will have more consequences. Consequences will never be the same. (lulz zomg roflcopter).

End of post.

Saturday, November 27, 2010

Alpha 5 release!

This time it's true.
Get it on the download page.
If you want to unlock all the reincarnation madness go to the options in game.

Two new HUGE features : undead mode and reincarnation.
You can use or abuse the reincarnation feature... or not. Its up to you.
There are also some modifications to gameplay, balance and AI.

- Subway small maintenance room will not overlap platform anymore.
- Post-mortem option "simulate when sleeping" shows properly.
- Attacker icon won't display in odd places when the attacker is out of map (eg: zombie bashing from another map).
- Long names in HiScore table are now truncated.
- Actors who can't talk cannot shout either (eg: undeads).

New : Play as an Undead!
- Choose your race from Skeleton to Zombie Master.
- All undead rules apply to you, so know your abilities and limitations.
- You can see living and zombie masters scents - if ability.
- Scoring comes mostly from killing, no achievement to reach.
- Difficulty rating as undead is opposite to difficulty as survivor.
- No access to the city map.
- Does not get notified of events.
New : Reincarnate!
- When your current character dies you get the choice to reincarnate or not, if the option is activated.
- Continue playing in the game world as you left it.
- After dying you can choose between different reincarnations avatars :
  - Random Actor.
  - Random Living.
  - Random Undead.
  - Random Follower (of yours).
  - Your Killer.
  - Your Zombified Self. 
- You loose everything related to your previous character (scoring, memory etc...).
- Reincarnation as living can be limited to civilians only (an option, on by default).
- Reincarnation as undead can exclude zombie rats (an option, on by default).
- Reincarnation can exclude avatars in the sewers (an option, on by default).
- Some rare reincarnation unique places or actors are forbidden.
- Difficulty value for scoring is divided by each successive reincarnation.
Map Objects
- Iron Gates (subway, hospital, prison) are now breakable but are very resistant.
- Large fortifications are now opaque.
- Followers are always willing to trade with their leader, even uninteresting or silly deals.
- Gangs can trade with friends.
- Relaxed faction leadership restrictions a bit, so civilians can be lead by anyone friendly (eg: civilians led by cops or army).
- Item batteries duration and stench killer capacity increased.
- Flashlights improves FoV only if it is dark (in other words, they are useless during the day).
Map Generation
- Shops might have a window.
- No zombie start in the subway.
- Zombies do not spawn in subway anymore.
- Zombifieds keep one level of a random skill of their ex-living form - skill which might now be useless to them.
- Undeads may stumble while jumping and loose action points (eg: ZMs).
- Rats have the "Small" ability which allows them to slip through any objects except closed doors.
- Pushing is a loud noise.

- Undead : view scents.
- Undead : status line show "Field Of Smelling" range (FoS).
- UI does not display stats irrelevant to your current avatar (eg: food for zombies).
- Reincarnation screens.
- Leaders have a "L" icon.
- NPC/objects in action messages will show up as "someone/something" if when not visible to the player.
- Refugees and Midnight Invasion event won't pause the game anymore - this get annoying after a while.
- Updated the manual.

- New gfx : scents icons for undead mode; leader icon.
- 2 new musics (well one is a sfx actually).

- Difficulty : Show separate difficulty for undead mode.
- New option : Max number of reincarnations allowed (1 by default).
- New option : Allow to reincarnate as zombie rat or not - as they are numerous and quite boring to play (no by default).
- New option : Allow to reincarnate to the sewers or not (no by default).
- New option : Restrict livings reincarnation to civilians (yes by default) - some actors like char guards are not meant to be played, but can be fun
- New option : Permadeath - delete saved game on death, doubles difficulty rating (off by default).
- New option : Death Screenshot - automatically takes a screenshot of your death (on by default).
- Default Zombification up to 100% (was 80%).
- Default Max Undeads up to 100 (was 90).

- Followers : when Guarding or Patroling, mimick leader cellphone usage.
- CivilianAI : desperate starving civilians will push objects around and attack barricades in the hope of finding hidden stashes of food.
- CivilianAI : now interested in stench killers and will use them.
- ZombieAI : reordered behaviors to give more priority to following ZM.
- ZombieAI : ZMs and evolved Zombifieds can and will push objects in various situations.
- ZombieAI : do not attack objects and barricades on sight anymore.
- Soldiers & Civilians will now build large fortifications too.
- Tuned Fleeing logic.
- Updated living AIs to handle being led by the player.

- Asymetric FoV.

Playing as a civilian survivor is still the main focus of the game.
If you play a non-civilian leader, keep in mind non civilians-AI are pretty much limited.
Some living actors do not need to eat, but most have to sleep.
The ability the play other actors has been tested but is not guaranted to work 100% fine yet.
Feel free to report any bug or oddity you might find when playing a non-civilian.
With all this being said...

And remember, die with a smile!

End of post.

Thursday, November 25, 2010

Alpha 5 - From Disciple to National Guard

One of the test runs I made.
Started as a survivor, got killed and zombified.
Reincarnated as my zombie, luckily a Neophyte already.
Killed enough people to get promoted to Disciple.
Eating poor weaklings left and right.
Facing my first serious enemy : a National Guard.

Hello, you look tasty in green.

Like the good blood thirsty abomination that I am now I promptly rush him and we duke it out.
Stop poking me with that gun!

I prevail and make a new friend in the process.
See private, it's not that bad being undead.

I get cocky, don't wait for the night to get more tactical advantages and get what I deserve.
Sorry for your pal dudes, listen I ggrgrrlkggrlkgrg

I choose my killer again as reincarnation and discover life as a Private.
Wait!? What? Who? When?

I perform my duty and hang out with the squad.

Hey Sgt what are we doing here!?... Why don't you answer?

Upgrade time!
Sgt, help! What is that screen!?... Why don't you answer?

You can upgrade when playing a living NPC as you would as a civilian survivor.
If you happen to be a leader, your followers will upgrade too of course.
You can build yourself a nice high level biker gang for instance.

The Civilian and Zombie AI also does get a couple of improvements. Some of the standard tactics might not work anymore. Or they might. But not really. You'll find out.

Mine. I seem to keep missing letters and whole words in my posts recently.

End of post.

Wednesday, November 24, 2010

Fans Forum!

Since RS has no forum yet Survivor Johny 1337 created a forum to discuss all things Rogue Survivor.

Thanks to Johny!
Go there and register. I'm sure you guys will like a proper place to discuss the game.
I will lurk over there and laugh at your pathetic deaths.
what? i die stupidly too in my videos? errr it was all for show of course...

End of post.

Saturday, November 20, 2010

Alpha 5 - MOAR!...

...About the Undead Mode and Reincarnation.

You can pick all the standard undead models, except rats - skeletons are silly enough to play.
Keep in mind you have no skills and you can transform as NPC zombies do by killing people.

You can set options related to how reincarnation.
Disabling rats reincarnation is handy, as there are a lot of rats and they are quite silly to play. So you won't get spammed with them as possible avatars.
Max numbers of reincarnations is a way to limit yourself or disable this altogether with setting it to zero.
Each reincarnation will decrease the difficulty used for computing for this character. Eg: your first life will be 100% difficulty, but if you reincarnate the next one will start at 0 points and score only 50% of base points. This is a way to avoid some stupid cheating, like using past lives to make the following ones easier and scoring big.

When you die you get a set of typical avatar selected for you to reincarnate in.
Here I played survivor Tony Austin. He got killed by a zombie, got zombified in the process and had a follower alive at that time.
So I get the full set of candidate avatars to choose from.

You can image fun play mode and challenges if you restrict yourself to a set of options:
  • Succession game : take control of your followers as your band members die horribly one by one.
  • Killer game : take control of your killer.
  • Till the Last Survivor : take control of a survivor, you loose the game if there are no one available, which could happen.
  • The Equalizer : take control of the opposite side and try to do your best for them.
Just ideas ;)

I intended to allow the player to reincarnate anywhere in the world but it is not practical. I would have to simulate the whole world which would not be a sane thing to do. So instead it is just limited to the district you were in.

End of post.

Friday, November 19, 2010

Alpha 5 - the other big new feature

UPDATE: mmh the screens weren't clear enough it seems so let me detail this feature.

When you die...
  • You get the choice to reincarnate or not.
  • Your dead character still gets its post mortem etc... and for all intent and purpose you can consider the game lost.
  • You then control a random existing NPC in the current game world (= you take control of a previously AI controlled character). You have almost no control over this process, so you first character is still the most important one for you.
  • Your score is resetted, you loose your memory etc...
  • Continue playing in the game world as you left it.
  • So you can in theory continue to play indefinitly in the same game world.   
  • Reincarnation in a living body is limited to civilians.
  • You can get funny reincarnations as a zombie rat, as the Sewers Thing (if lucky!)...
I think the ability to continue playing in the same world if you want to is nice : visit old places, take revenge, switch sides...
You can still die normally of course.
Play as a classic roguelike  with permadeath (and noreload) or explore the world through various characters...
Its new, its fun. You can use it or not.

End of post.

Wednesday, November 17, 2010

Alpha 5 - big new feature

If screens > words Then Post(screens); 

BRAINZ! (1) 
RAGE @ CARZ :X (2)

HI! BRAINZ? :) (3)

  1.  Start a new game as undead.
  2. Remember, some undeads can't jump, open doors etc... The red "glows" are scents, as undead you can smell living scents and zombie masters scents. The freshers the scent, the more visible.
  3. Bash doors, run after people to try to eat them. Great fun.
  4. Followed some poor girl in a basement thanks to the scents. I plan on turning her in...
  5. ...and it works. Maybe she will follow me.
  6. My little horder breaking into a CHAR Office.
I have just started developing this feature. Thanks to the design it was quite easy to implement, a couple of hours of work. Lots of bugs lurking probably.

One thing I can say for sure, it radically changes the gameplay. Its like having another game altogether!

I don't plan on making the player undead special. You are just one of the undeads and have to "survive".
Its really frustrating fun to get randomly killed early by cops :p

Rogue Survivor will still focus on the living survivor gameplay and this mode is meant mostly for fun or a new challenge.

End of post.

Saturday, November 13, 2010

Alpha 4.3 release!

Get it in the download page.
People who could not run the game at all should give it another try. Remember to run the new configuration program!
Mostly a HUGE bug fix and a couple of new sweet features.
Everyone who got crashes should be able to play the game and get sound now!
Fix the crash bug for Win7 and some other configs!
Config program to choose between different Video and Sound engines!

- Some people couldn't run the game at all because of Managed DirectX crashing.
- No music on some computers.
- Modding some items stacklimit down to 1 crashes a new game.
- Rapid Fire taking two turns.

- Run "RSConfig".
- Video :
  - Managed DirectX : default, but might crash on some computers.
  - GDI+            : slower and a bit less good looking, but safer.
- Audio :
  - Managed DirectX : default, plays the mp3 files, but might crash or get no sound on some computers.
  - SFML 1.6        : plays the ogg files.
  - No Sound        : if all else fails, at least it won't crash...
- Pills stacking limit can now be changed properly.
- All melee weapons can now be made stackable, except uniques.

- New Action : Shove people around - kick survivors out of your base or rush through zombies.
- Rain has a chance to put out fires (eg: burning cars).

- Updated manual.

- Musics in ogg format for SFML audio support.

- Asymetric FoV along walls.
- GDI+ : some differences from default Managed DirectX rendering.

Have fun!
And remember, die with a smile!
End of post.

Friday, November 12, 2010

Alpha 4.3 progress & release date

Video & Sound config
Added SFML as audio engine, and No Sound just for safety.
The game should now be playable on all Windows systems and configs... Right!?
If GDI+ is a pain in the ass I'll see if I can get an OpenGL rendering engine implemented.

Two new sweet features
Implemented two new features. I keep them secret until release...
They are nothing revolutionary and they were easy to do but Rogue Survivor fans will like them I'm sure :)

Release Date & Plans
Expect a release in a few days.
Then, if all goes well,  5.0 on the horizon with something big.
I'll also try to update the site to make it better.

End of post.

Wednesday, November 10, 2010

Alpha 4.3 new rendering mode & Interview

Working on Alpha 4.3. Yep.

Video & Sound engine config
RS uses Managed DirectX for rendering. It runs fast and is nice, but has the interesting side-effect of crashing the game on some computers... and the audio API  can't render MP3s on some computers...

RS will now include setup program to allow you to choose different rendering or audio engines.

Managed DirectX is the best but less reliable.
GDI+ should work for everyone but is slower, especially on Windows XP as it does all the rendering in software on this OS. At least more people should be able to play the game!
I had the bright idea to abstract rendering into an interface since the beginning of the project so it took me only a few hours to code the GDI+ engine.

Despite sharing the same interface in the game, Managed DirectX and GDI+ renders things slightly differently.
Catch the differences!

Managed DirectX
There's only one choice for Sound, but I'll add at least one more engine for people who have no sound.

Blog Interview
For hardcore fans I did an interview about the game for a blog: read it there. You might learn stuff. Or not.

End of post.