osIROSE Project Status [4/25/2017] (in development )

Welcome in the osiRose emulator Project.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

Re: osIROSE Project Status [2/23/2016]

Postby ihaki on Fri Feb 26, 2016 10:28 am

Nice !

Thank you for coming back to the rose scene.

Are you trying to make a complete iRose emulator or will you do something like Arua did, like, irose skill system, with evo client (extended number of maps, items and more content in it)
User avatar
ihaki
Jelly Bean
Jelly Bean
 
Posts: 20
Joined: Tue Apr 21, 2009 9:43 am

Re: osIROSE Project Status [2/23/2016]

Postby aerocoke on Fri Feb 26, 2016 1:42 pm

Well it sort of depends on what client does raven decide to base this thing on i guess :p
For now the github project is mainly focusing on coding style and login/char cleanup tweaking AFAIK, raven has irose source apparently tho so maybe we could have a very basic neutral client for everyone.

I know Hrose client was quite good but there's definitively some issues that would be a pain to fix ( even with the titan rose release )
aerocoke
Jelly Bean
Jelly Bean
 
Posts: 16
Joined: Wed Feb 24, 2016 2:31 am

Re: osIROSE Project Status [2/23/2016]

Postby Raven0123 on Fri Feb 26, 2016 4:08 pm

aerocoke wrote:Well it sort of depends on what client does raven decide to base this thing on i guess :p
For now the github project is mainly focusing on coding style and login/char cleanup tweaking AFAIK, raven has irose source apparently tho so maybe we could have a very basic neutral client for everyone.


You are correct. Right now, I'm trying to make sure the core systems (networking) are stable so we won't have to rewrite huge peaces of the code later.

As for the client I do plan on releasing a version of the client that improvements and will also make it possible for people to mod the client as well. But the client is in the future, not now.
User avatar
Raven0123
osiRose dev
osiRose dev
 
Posts: 379
Joined: Tue Sep 11, 2007 11:06 pm
Location: USA, NJ

Re: osIROSE Project Status [2/23/2016]

Postby aerocoke on Fri Feb 26, 2016 4:29 pm

Raven0123 wrote:
aerocoke wrote:Well it sort of depends on what client does raven decide to base this thing on i guess :p
For now the github project is mainly focusing on coding style and login/char cleanup tweaking AFAIK, raven has irose source apparently tho so maybe we could have a very basic neutral client for everyone.


You are correct. Right now, I'm trying to make sure the core systems (networking) are stable so we won't have to rewrite huge peaces of the code later.

As for the client I do plan on releasing a version of the client that improvements and will also make it possible for people to mod the client as well. But the client is in the future, not now.



Seems like the right way to go.
I'm not quite sure what do you call networking being unstable or not, do you mean the threads synch ? ( CSemaphore'n shit ?)
aerocoke
Jelly Bean
Jelly Bean
 
Posts: 16
Joined: Wed Feb 24, 2016 2:31 am

Re: osIROSE Project Status [2/23/2016]

Postby Raven0123 on Fri Feb 26, 2016 4:37 pm

aerocoke wrote:Seems like the right way to go.
I'm not quite sure what do you call networking being unstable or not, do you mean the threads synch ? ( CSemaphore'n shit ?)


What I'm referring to is currently I believe there is a performance issue with how I open client connections. How it currently works is that each client has a thread dedicated to it, but that one thread ALSO spawns another thread for the network handler.

I had recently found out that creating a new io_service is unnecessary due to the fact that it has internal thread pools. All I would need is one io_service and then I could call io_service's run function on different threads causing it to handle all of the threading internally.

I also (very rarely) see a hang up somewhere in the networking code. If I change anything in the shutdown code, the server will hang on any thread that is attempting to shutdown.
User avatar
Raven0123
osiRose dev
osiRose dev
 
Posts: 379
Joined: Tue Sep 11, 2007 11:06 pm
Location: USA, NJ

Re: osIROSE Project Status [2/23/2016]

Postby Juan on Sat Feb 27, 2016 2:33 pm

Raven0123 wrote:What I'm referring to is currently I believe there is a performance issue with how I open client connections. How it currently works is that each client has a thread dedicated to it, but that one thread ALSO spawns another thread for the network handler.

I had recently found out that creating a new io_service is unnecessary due to the fact that it has internal thread pools. All I would need is one io_service and then I could call io_service's run function on different threads causing it to handle all of the threading internally.

I also (very rarely) see a hang up somewhere in the networking code. If I change anything in the shutdown code, the server will hang on any thread that is attempting to shutdown.


I am really impressed by your dedication Raven and the project looks very nice! You might already know this, but in case it can help you or anyone on that forum:

io_service has no thread pool, it's actually a context for an event loop, a loop that can be run by some threads using io_service::run! All your networking events could be run by one and only one thread. It's actually preferable to use only one thread, since asio::sockets are NOT thread safe, otherwise you can resort using asio::strands.

Since io_service uses locks internally (around the epoll call for instance on Linux), one can dispatch connections in a round-robin on N io_services ran by N threads, N being the number of cores of your CPU. You won't have lock-contentions and use all your cores!

If I were to write a new ROSE server, supposing 4 cores on my PC, I would use 4 threads for networking / ios as described previously, 1 thread for running the game loop = 5 threads in total. The game loop itself can be a io_service loop too. You could then submit events/works between these loop with io_service::post or io_service::dispatch. Another solution would be to use a good old while(true) loop and use some lock-free queues to pass some data between your network threads and your game loop. The loop would be as simple as 1) Fetching network events from the queue 2) For each map, for each player, for each entity, update their status according to the events and the delta-time 3) Submit new network events 4) Redo.

Finally, you could run different different game loop (== different threads) per maps, but certainly not per players! A design with a number of threads dependent on the number of players won't scale at all! See: http://www.kegel.com/c10k.html

Note: some async operations actually do use a thread-pool if not available "natively" on your operating system (like async file io on Linux). But this is another topic and not linked to io_service!
User avatar
Juan
Rackie
Rackie
 
Posts: 219
Joined: Fri Oct 10, 2008 6:25 pm

Re: osIROSE Project Status [2/23/2016]

Postby Raven0123 on Sat Feb 27, 2016 5:05 pm

Juan wrote:A design with a number of threads dependent on the number of players won't scale at all! See: http://www.kegel.com/c10k.html



That is exactly what I thought and why I haven't continued with the map impl.
User avatar
Raven0123
osiRose dev
osiRose dev
 
Posts: 379
Joined: Tue Sep 11, 2007 11:06 pm
Location: USA, NJ

Re: osIROSE Project Status [2/23/2016]

Postby aerocoke on Mon Feb 29, 2016 7:58 pm

Pretty cool that you enabled the AppVeyor, it is quite handy :p
Also i'm not much of a network man but the way the project is going seems pretty cool so far :D
aerocoke
Jelly Bean
Jelly Bean
 
Posts: 16
Joined: Wed Feb 24, 2016 2:31 am

Re: osIROSE Project Status [2/23/2016]

Postby Raven0123 on Mon Feb 29, 2016 8:24 pm

aerocoke wrote:Pretty cool that you enabled the AppVeyor, it is quite handy :p
Also i'm not much of a network man but the way the project is going seems pretty cool so far :D


Yeah I had disabled it when we added the database classes because there was an issue about library dependency. When ever we add a new external lib that doesn't use cmake, I have to manually compile it with Visual studio and upload it.
User avatar
Raven0123
osiRose dev
osiRose dev
 
Posts: 379
Joined: Tue Sep 11, 2007 11:06 pm
Location: USA, NJ

Re: osIROSE Project Status [2/23/2016]

Postby aerocoke on Mon Feb 29, 2016 8:33 pm

Raven0123 wrote:
aerocoke wrote:Pretty cool that you enabled the AppVeyor, it is quite handy :p
Also i'm not much of a network man but the way the project is going seems pretty cool so far :D


Yeah I had disabled it when we added the database classes because there was an issue about library dependency. When ever we add a new external lib that doesn't use cmake, I have to manually compile it with Visual studio and upload it.


So its good now ? The new libraries won't be a problem ?
I feel like appveyor is convenient but if its too much of a pain don't waste time on it, its not a must have either.

I don't really get how why it works now looking at the code but i won't complain ahah :p


edit : the typo fix for protobuff was the thing causing cmake to bugg ? i laughed when i saw it was just a dot
aerocoke
Jelly Bean
Jelly Bean
 
Posts: 16
Joined: Wed Feb 24, 2016 2:31 am

PreviousNext

Return to Support - OsiRose Emulator

Who is online

Users browsing this forum: No registered users and 5 guests