Friday 30 January 2015

Development Blog #0010 - Server Population

If you don't know Wool, click here.

This week I made newmans log on and off the server.

Newmans will now go back to their base and log off after they have played for between 2.5 and 3.5 hours.  If you watch this week's video, you'll see newmans disappear after they have logged off.  Newmans will come back online at the same time each day and play.  To keep the model accurate, I updated the AI and the combat system so that newmans will attack sleeping enemies without hesitation, and are guaranteed to win combat.  Cool, now I've got a baseline model of Rust!


Wool Devblog 10 - 5 Days @ 20x speed


Server Population
I got in touch with Bugs, the guy that runs Rustafied. Using some estimates he gave me about the server base, I've programmed Wool to model the average server.  The Wool server sees a peak of about 60 players at 12:00, and a low of about 20 at 0:00.   I also looked into Steams stats for Rust, and to no surprise, found a bell curve player distribution.  So I programmed this trend into Wool's server.

Online Steam Users


Raiding is not common, but is possible.
If you watch for Garry's base in this week's video, you'll see that it survives about a day and a half before being raided.  A couple people managed to build a tier 2 base before their ~3 hours were up, and all of those bases survived the first 24 hours.  However, some people with tier 1 bases did get raided, and they'll wake up dead and poor.  I'm going to change things so that over 50% of people get a tier 2 base for three hours of work, because that's what I set out to do.  I'll probably tweak the base cost to get the desired result.

Bugs
There are bugs affecting the AI.  I've programmed AI logs to see where they are making the wrong decisions, and it's going to take time to sort though that.  However, most of the time, they're quite capable.  I'll make this a priority next week.

Conciousness
Newmans are not aware of other newmans unless they run into them.  I'll update the AI to make intelligent fight / flee decisions.  I'm thinking that, since most people KOS, I'll make newmans KOS if they have equal or better weapons and armor than their target, and flee otherwise.  Newmans will flee for a random duration before deciding to turn and fight, and conversely, their pursuer will only chase for so long too.  This should be done next week.

Data Mining
After the AI is in good shape, I'll draft up which graphs I want to show, program the data collection for it, bring the collected data into Matlab, manipulate it, and finally display it.  These graphs will provide evidence that this progression system is fun to play, and well balanced.



Friday 23 January 2015

Development Blog #0009 - More Brain Power

This week I improved the AI.

I spent this week making last week's code run better.  Newman's make more intelligent decisions now.  They'll go back to their base when they've got a fraction of what they need, and store it in case they get killed.  When they raid, they'll bring some resources to repair the base they are raiding so they can make it their own.  Those were the big changes this week.  Server maps have been made available for imaging, so I thought I would generate one, and turn it into a Wool map. 

The server map (Thanks PlayRustHQ)


The Wool Resource File

I'm not currently supporting snow / mountains so I just turned them into forest.
 


The video this week is a time-lapse of Wool - by popular demand.

Barrels / Rad Town Analysis
The last couple weeks of Rust have been a barrel looting game.  Here's my take on how that changed Rust; the inclusion of barrels widened the gap between the end game and the start game.  The difference between having a spear and a stone spear is huge, but even bigger for spear to AK47.  Personally, I think its great that weapon tiers are further spread, but I'm not too happy about needing to do a lot of barrel hunting.  I would be happier if we could spend resources on research kits for the weapons we find in barrels and on our enemies.   Furthermore, I think we should be able to directly craft (expensive) blueprints -- that way you could guarantee (slow) progress toward whatever you want rather than rely on luck.

Wool and Blueprints
In Wool, bases act as blueprints. If you've got enough resources to build a T2 base, then you get the blueprints for T2 weapons with the base.  There's no need for blueprints in Wool because the weapon tiers are already largely separated (You can't build a T3 gun with a T1 base -- unlike in Rust).  It's going to make my conclusion weaker if I don't model this just like Rust -- but frankly, I don't have time to keep up with the updates and finish the project.  Again, the point of all this is to show a raiding system that strikes a balance between losing your base and stealing others -- which will still apply to the current build of Rust.

All said,

Hopefully, next week I'll finish the log on / off system -- but don't count on it.  The A.I. has some bugs from all the work I did on it this week.  Hope you all enjoy reading about my project, don't forget to comment / like the reddit post!



Friday 16 January 2015

Development Blog #0008 - Base Inventory Management and Loadouts

This week I completed Base Inventory and Loadouts for Wool's WLNewmanBrainBasic AI.


So what's base inventory management?
Newmans now consider the weapons, armor, tools, wood, stone, metal, and food that they have inside their bases as well as on their person.  They use this information to see if they can afford whatever they want to craft, like more weapons, armor, or upgrade a base.

Okay and what's a Loadout?
If you've ever played Call of Duty, or Team Fortress 2, you'll recognize a loadout -- it's the stuff you carry into combat.  I coded the Wool loadout system.  This means that a newman will only carry enough stuff to survive for a while, and store the rest back in his base.  It's a really important feature because newmans' can now equip their stored weapons and armor when they respawn (previously, they carried everything they owned).   A newman has a different loadout depending on what he's up to.  If he's gathering, he'll carry enough weapons and armor to kill 10 people, and enough tools to mine 100 resources.  He'll return to base when he's gathered about 1/8th of the resources he needs for the next base upgrade.  If he's raiding, he'll carry enough weapons, armor, and of course, tools to breach the walls.  Newmans will leave their raw resources at home during the raid.  The real beauty of this system is that newmans both store excess resources in their base, and equip only what they need.



I spent a lot of time debugging this week because every part of AI code had to be reconfigured for the loadout system.  It was a bit tedious, but I'm confident the worst is over.  I had been hoping to even start on the logg on / off system, but it must be delayed until next week.  When that's in, the model is complete (save for some AI tweaks), and I can begin doing an analysis. That means printing out lots of data, and processing it in a language that's better suited for this sort of work (Matlab).  I'll make some pretty graphs and stats, then tweak the game, and then this project will be finished!

Woot! I got featured on playrust.com!









Friday 9 January 2015

Development Blog #0007 - Raiding Part 2

 This week I finished the raiding system.

As of this week, the AI can:
-Discover their base was raided / not theirs anymore
-Upgrade and repair multiple bases
-Built additional bases

I said I'd code the inventory storing system last week, but I didn't get around to it.  Instead I spent the time filming a few videos.  Apparently I'm going to appear in the next community update, so keep a lookout.

Next up, I'll make newmans store resources in their bases so that they aren't set back to square 1 on death.  After that, I'll implement the logg / in off system.  That will probably take up all of next week.  So, by the end of next week, I should have a reasonable representation of a Rust server :D

In this video, I summarize what this project is.


In this video I spend 17 minutes talking about Wool.


And if you're super interested in watching the simulation, 
here's 50 minutes of Wool. (48 simulated hours)


Friday 2 January 2015

Development Blog #0006 - Raiding Part 1

This week I coded the raiding system.

This week's development blog is going to be a lot more technical, as there's nothing new to film or image.

The raiding system is the game engine code that manages base attacks.  A newman declares that he would like to attack a base, then the game engine handles damage, attacks, and inventory.  This also includes looting a base and claiming ownership.

How it works:
When a newman attacks a base, anyone inside the base has the option to attack from the base -- with a 20% bonus chance to winning combat.  In Rust, the 20% bonus comes from things like shooting / spearing from windows, controlling the doors in the base, and using the base layout to the defender's advantage.  Of course, it's entirely optional to defend your base while you are inside. 
However, once your walls are breached, you have no choice but to defend yourself.  That said, the 20% attack bonus remains while you defend.  After a base has no health left, it can be looted.  Who ever loots a base becomes the new owner.  A damaged base can then be repaired.  The repairs significantly less than building a new base.  A defender can repair a base as it is being attacked, until out of resources, or the enemy has a relatively high tier weapon and does damage faster than repairs.  A base can only be upgraded once it has been fully repaired.  It costs about 50% of a new base in resources to raid someone else's base.

Coding this system was fairly straight forward and did not require must time to write and debug.  I moved on to upgrading the AI to actually do the raids, and that proved to be much more time consuming.

WLNewmanBrainBasic - Raiding AI
The goal is to upgrade the current basic AI to raid enemy bases sometimes. This called for a ton of necessary upgrades.  To raid a base, newman's have to first figure out when to raid.  For this AI, I figured it was reasonable attempt a raid once enough resources had been gathered for a raid, and a target base was in sight.  If there's no base nearby, the newman will continue to upgrade his base.  Second, once a newman has a target, he needs to craft enough tools to breach the walls.  After enough tools are crafted, the newman must head toward the target.  Upon reaching the target, the newman destroys the walls, and then loots the base. 

This much is coded -- but it's too buggy, so I won't show a video this week.

But even more needs to be done in order to make raiding work.  Raiding is pretty pointless if there's never anything inside the base, so I need newmans to consider how much stuff to store in their bases, and code a system for newmans to use their base inventory as well as what is carried in cost calculations and resource gathering. 
Furthermore, I need to code a small system that allows newmans to react to discovering that they have lost a base -- it doesn't work out if they keep thinking their raided base is still their own.

I figure at least this much should be complete by next week.  After raiding, I'll build AI support for multiple bases, then AI for hunting other newmans -- including strategies for fleeing.  After that, I'll build game engine support for newmans to logg on and off, and build the AI for that.  

Then the graphs come out.  I'll be able to say things about how Rust should change with some authority -- backed up by graphs and videos of the simulation.  That will be splendid.

Chances are, the AI is going to need significant refinement before I can claim it represents the average competitive player.  But that's cool with me -- I love working on AI.