Goal: A 1.0 Playable Multiplayer ALPHA Version!
Server Side Combat
Up until now, most of the hitting of nodes, other players and walls has been done client side. When you used a weapon or tool, it would create a slash effect, and at a certain frame it would create a hitbox item and if there was a collision with a certain object, it would tell the server it’s hitting something and the server would respond appropriately (do damage, gather resource, damage a wall, etc)…
Obviously, this could be abused by hackers so I’ve fixed this up!
It’s now handled completely server side. When you use a tool or weapon, all the client does it tell the server that you want to use a tool/weapon.
The server then
1. Sees if you can actually use that item.
2. Checks players cool down (so they can’t spam attack)
3. Calculates where the hitbox should be
4. Checks if there’s a node, player, base wall, etc at that position
5. Runs the appropriate script (damage player, damage wall, gather resource)
6. Lets clients know what’s going on.
This is a lot less messy, and has made about 15 scripts obsolete since the client doesn’t have to let the server know everytime he hits a node, tree, player, etc… 🙂
NPC’s – Farm Yard Animals
Attacking & Killing
Farm Animal Drops – New Items
Hitting dead animals with a tool will give you items. Depending on what tool you’re using will determine how much loot you get! I went ahead and added the following items to the game: pork, steak, chicken, bones, feather, leather, fat and wool! Now that we have all these new resources (and ways to obtain them), I can start working my way towards crafting!
Better Collisions & Path Finding
Barn Animals now consider resource nodes, walls and players and will no longer walk through these things. If they collide with something, they’ll try to find a better path rather than mindlessly walking into them. Also, when they are hit or take damage they will attempt to run away.
Players also collide with Barn Animals (and nodes) and will no longer just walk through them.
I’ve added appropriate sound effects to the animals for when they get hit, or if they die. There are 3 hit sound effects per animal, and one death sound.
A special thanks to Cole Monpas on YouTube for suggesting this new wall style. He also sent me a project file of his own. Though I didn’t use his code, I certainly took his suggestion and I think this style makes a lot more sense for now!
Sign up for a free Alpha Key
Since a lot of people are following this project (some on and off) I’ve decided to go ahead and start allowing people to sign up for free Alpha version keys. You will receive an e-mail once the alpha is released with a game key and download link once the Alpha version is ready to be played. Feel free to sign up while keys are available!
Sign up for free Alpha version key
~ Did some upgrades to the code behind resource nodes so they can support more than only 100 at a time