[Development] 4267 Private server built using the Typesafe stack (Scala, Akka)

06/23/2014 06:42 tkblackbelt#1
Hi Everyone,

Before I begin I'd just like to give a shout out to Korvacs for his packet wiki ([Only registered and activated users can see links. Click Here To Register...]). It's been extremely helpful :)

Just wanted to give you guys a preview of the server I've been working on for the past month.

The server is built using the Typesafe stack with includes the below core technologies. The server seems to handle lots of clients. I've tested it by spawning 15,000 bot clients over all game maps and had them jump and talk every 1 - 2 seconds. It handled this well but of course this is spread out over the entire world. On a single map the server currently seems to handle around 1000 clients before lag starts hitting. I've also designed the server in a way that would allow each map to be run on a different server or all on a single server. This would allow further scalability.

Technologies:
- Scala (Functional programming language running on the JVM)
- Akka (Actor library)
- Slick (ORM)
- Spray (Library for building high performance network applications)
- MySQL

Testing Server:
- Ubuntu 14.04 server running under Windows 8 Hyper V
- 5 Cores allocated
- 4 Gigs of ram

The server is designed using the Actor model. This model makes building highly concurrent applications much easier. All objects (Actors) communicate with each other by sending messages to one another.

As of today (June 22, 2014) the server has the following features developed:
- Login
- Interacting with other players
- Trading
- Warehouse
- NPC Scripting system
- Buying & Selling to NPCs
- DMap loading
- Mob spawning
- Basic monster AI
- Basic stat calculations
- Attack monsters
- Portals
- Dropping/Picking up items from the world

First preview video:

Gallery

[Only registered and activated users can see links. Click Here To Register...]

I will update this thread as more is developed :)
06/23/2014 17:08 SteveRambo#2
Finally. Something good on epvp. Good luck!
06/23/2014 18:57 Wolfy.#3
15000 bots ._. good luck...
06/24/2014 04:55 InsomniacPro#4
Quote:
Originally Posted by Wolfy. View Post
15000 bots ._. good luck...
What's wrong with 15k bots?
06/24/2014 05:37 Spirited#5
Well, the server should be able to handle that type of processing (one or two packets every one or two seconds). That isn't impressive to me. What's impressive is sorting through that and displaying them on the client's screen. What I would like to see is a program that creates server connections and sends 10 to 20 packets a second (more realistic). Then have it spam connect/disconnect and ensure that there are no memory leaks and that GC doesn't slow things down too much.
06/24/2014 13:36 Wolfy.#6
Quote:
Originally Posted by InsomniacPro View Post
What's wrong with 15k bots?
It's just so much, impressive.
06/24/2014 14:26 tkblackbelt#7
Quote:
Originally Posted by Spirited View Post
Well, the server should be able to handle that type of processing (one or two packets every one or two seconds). That isn't impressive to me. What's impressive is sorting through that and displaying them on the client's screen. What I would like to see is a program that creates server connections and sends 10 to 20 packets a second (more realistic). Then have it spam connect/disconnect and ensure that there are no memory leaks and that GC doesn't slow things down too much.
Yeah, I will be updating the stress tester to try more realistic scenarios. First I want to finish the mob ai to see how it performs with that many clients.
06/24/2014 16:42 Korvacs#8
Will you be releasing the bot for testing purposes? I've never gotten around to doing my own because /lazy
06/24/2014 17:29 CptSky#9
Quote:
Originally Posted by Korvacs View Post
Will you be releasing the bot for testing purposes? I've never gotten around to doing my own because /lazy
Same thing.


I think this load-test bot would worth a collaborative work.
06/24/2014 17:35 Spirited#10
Yeah, I meant to do a load test bot as well. I'd be up for working on one.
06/25/2014 06:43 tkblackbelt#11
I'll most likely release the code for the stress tool.

Today I implemented mob and guard ai and a start to the magic attack system. Does anyone know if 4267 has a packet for a re-spawn animation? Currently the mobs just re-appear without an animation.

I'm going to run the stresser overnight with 15k bots again and see how the mob ai handles to all those clients :)

Guard using Tornado!!!!
[Only registered and activated users can see links. Click Here To Register...]
06/25/2014 13:50 CptSky#12
Quote:
Originally Posted by tkblackbelt View Post
I'll most likely release the code for the stress tool.[...]
Ok nice. May I ask you the language used by the load-test tool ?
06/25/2014 14:38 12k#13
Quote:
Originally Posted by tkblackbelt View Post
I'll most likely release the code for the stress tool.

Today I implemented mob and guard ai and a start to the magic attack system. Does anyone know if 4267 has a packet for a re-spawn animation? Currently the mobs just re-appear without an animation.

I'm going to run the stresser overnight with 15k bots again and see how the mob ai handles to all those clients :)

Guard using Tornado!!!!
I know in 5017 i had used the following:
Quote:
name = "MBStandard";
PWR.Fill((ushort)(13 + name.Length), 0);
PWR.Fill((ushort)1015, 2);
PWR.Fill((uint)UID, 4); //UID of the mob
PWR.Fill((byte)Type, 8); //String Type = 10
PWR.Fill((byte)Number, 9); // Number = 1
PWR.Fill((byte)name.Length, 10);
PWR.Fill(name, 11);
PWR.Fill((ushort)0, name.Length + 11);
How relevant that is to 4267 I have no idea.
06/25/2014 14:45 tkblackbelt#14
Quote:
Originally Posted by CptSky View Post
Ok nice. May I ask you the language used by the load-test tool ?
It's written in Scala.

Quote:
Originally Posted by 12k View Post
I know in 5017 i had used the following:


How relevant that is to 4267 I have no idea.
Awesome, thanks! I'll give that a try after work today
06/25/2014 14:52 KraHen#15
Awesome stuff, good job!