Project Kibou: Server Development

07/10/2014 17:37 Spirited#46
Thanks, but as I've said multiple times now, I understand this. I work in a professional setting where this is the case, but we still do a good job because we follow this way of approaching software problems. In a community where time shouldn't be too large of a problem, not many people have excuses for the way they hack things together.
08/01/2014 18:20 Spirited#47
Woah, it's been a while. My apologies, getting a living situation together for transferring isn't easy. Neither is a full time job. Anyways, I have some things to report! Firstly, I got a packet structuring system going. I decided to use an abstract class, as I've released before in C#, paired with heavy method inlining. I'm pretty satisfied with it. It's simple, but works great. I used it just a few days ago to send the encryption code packet (the packet that used to initialize RC5 in patches 5176 and higher, but now just initializes packet exchange). Last night, I structured packet handling and received the first packet from the client (the username and server name). Now, I'm starting the exchange algorithm for receiving the password hash (so exciting!). More development is coming soon.

Regards,
Spirited

[Only registered and activated users can see links. Click Here To Register...]
08/02/2014 01:34 Best Coder 2014#48
Quote:
Originally Posted by Spirited View Post
paired with heavy method inlining.
It'd be interesting if you could elaborate a little on that.
08/02/2014 04:13 Spirited#49
Quote:
Originally Posted by Best Coder 2014 View Post
It'd be interesting if you could elaborate a little on that.
Sure. The concept is pretty simple, and I'm sure you're more than aware of the cost of calling a procedure (a function or method). For those who aren't aware, when you call a procedure, your current registers and flags are pushed onto the stack (including arguments to be called in the procedure). It's similar to shifting a small frame across a large picture (but in memory, if that makes sense). The method has its own frame to work in on the stack. Then, the code jumps to that procedure's address in memory, and pops arguments off the stack. The method is executed, then the registers and flags are popped back off the stack and the code jumps back to the return address. Aggressive inlining eliminates a lot of this by inserting a procedure's body into the parent function's body. Since all of my packet methods are one liners, I've told the compiler to forcefully inline the code into the parent method (which is in the derived class). This way, a derived class's method isn't just calling yet another method to waste time on.
08/02/2014 18:49 Best Coder 2014#50
Quote:
Originally Posted by Spirited View Post
Sure. The concept is pretty simple, and I'm sure you're more than aware of the cost of calling a procedure (a function or method). For those who aren't aware, when you call a procedure, your current registers and flags are pushed onto the stack (including arguments to be called in the procedure). It's similar to shifting a small frame across a large picture (but in memory, if that makes sense). The method has its own frame to work in on the stack. Then, the code jumps to that procedure's address in memory, and pops arguments off the stack. The method is executed, then the registers and flags are popped back off the stack and the code jumps back to the return address. Aggressive inlining eliminates a lot of this by inserting a procedure's body into the parent function's body. Since all of my packet methods are one liners, I've told the compiler to forcefully inline the code into the parent method (which is in the derived class). This way, a derived class's method isn't just calling yet another method to waste time on.
Oh, I know what method inlining is, I just meant that maybe you could explain why you had chosen to do this.

I mean, isn't this kind of what the optimizer is for? Compiling with /O2 (or something similar) should already inline these "one-liner functions", even without giving the compiler any hints to inline certain functions.

This really smells like unnecessary micro-optimization to me.
08/02/2014 19:17 Spirited#51
Quote:
Originally Posted by Best Coder 2014 View Post
Oh, I know what method inlining is, I just meant that maybe you could explain why you had chosen to do this.

I mean, isn't this kind of what the optimizer is for? Compiling with /O2 (or something similar) should already inline these "one-liner functions", even without giving the compiler any hints to inline certain functions.

This really smells like unnecessary micro-optimization to me.
Hm. Well firstly, I'm practicing concepts that would be used to handle thousands and thousands of players. Not saying I will process that many players, just practicing. Secondly, players are requesting that the server reads and writes packets all the time. It only makes sense to optimize what they do the most of. Lastly, if we can ditch the whole "unnecessary micro-optimizations" idea that keeps spawning in this thread, that would be great. I get it that people want to program incorrectly in this section, but I don't - and adding one keyword just to make sure the methods are compiled correctly is hardly unnecessary.
08/02/2014 20:52 Best Coder 2014#52
Quote:
Originally Posted by Spirited View Post
Hm. Well firstly, I'm practicing concepts that would be used to handle thousands and thousands of players. Not saying I will process that many players, just practicing.
Fine, that's a valid excuse, I guess.
Quote:
Originally Posted by Spirited View Post
Secondly, players are requesting that the server reads and writes packets all the time. It only makes sense to optimize what they do the most of.
Not really, since reading and writing packets is (/should be) so ridiculously fast anyways that skipping a couple of call instructions is going to make absolutely no noticable difference. And the optimizer will inline it anyways if it's worth it (cost/benefit analysis). I mean, that's what it's there for after all - so you don't have to worry about useless, unnecessary micro-optimizations like this.
Quote:
Originally Posted by Spirited View Post
Lastly, if we can ditch the whole "unnecessary micro-optimizations" idea that keeps spawning in this thread, that would be great. I get it that people want to program incorrectly in this section, but I don't - and adding one keyword just to make sure the methods are compiled correctly is hardly unnecessary.
Don't worry, your methods will be compiled correctly with or without an "inline" attribute attached to them :).
Actually, what kind of attribute are you using to make sure your methods are getting inlined? If you don't mind telling.
08/03/2014 05:50 Spirited#53
Quote:
Originally Posted by Best Coder 2014 View Post
Fine, that's a valid excuse, I guess.

Not really, since reading and writing packets is (/should be) so ridiculously fast anyways that skipping a couple of call instructions is going to make absolutely no noticable difference. And the optimizer will inline it anyways if it's worth it (cost/benefit analysis). I mean, that's what it's there for after all - so you don't have to worry about useless, unnecessary micro-optimizations like this.

Don't worry, your methods will be compiled correctly with or without an "inline" attribute attached to them :).
Actually, what kind of attribute are you using to make sure your methods are getting inlined? If you don't mind telling.
__forceinline
"The __forceinline keyword overrides the cost/benefit analysis and relies on the judgment of the programmer instead. "
05/19/2015 18:15 Spirited#54
Been a while. Junior year in undergrad is a bitch, let me tell you. I probably won't keep you updated here, but I would like to ask for your opinion since you'd be playing the server like everyone else. If you have time to complete a survey on features and ideas, please private message me and I'll send it over to you. It takes roughly 10 minutes, and can be done during commercial breaks while watching tv or what not. I would appreciate anyone's feedback. Thanks.
05/21/2015 18:45 Spirited#55
I made the survey online via Google Forms.
If you wish to participate, here you go:
[Only registered and activated users can see links. Click Here To Register...]
05/23/2015 07:53 Sani-#56
Lol, I completely finish reading the 6 pages thread, talking about programming, which makes me confuse, since I'm only doing web coding.

So, I just fniish your survey, and can't wait to this

Quote:
Originally Posted by Spirited View Post
....A public server will be created for beta testing...
and it's already pass fall 2014, it's already 2015, hope you didn't change your mind.

Good Luck Fang :)

P.S, As I am playing official CO right now, I have suggestion, I also put this on the survey.

I totally agree to you, CO is a good game, but became bad also because of the game, but right now, I find 2 big disappointment on CO, that is , 1. Purchases made using real money, which makes the game super unfair, if you are rich in real life you will be insta-rich on the game using your money, so I suggest, you don't do this in the game, unless you do Donation, but not items or whatsoever which will make the player who donated instant strong, that just sucks, I mean, someone play for 3 years, got full super 1 socket, while one played 1 month and get full +12 2 socket, don't you think that will bring discouragement to the old player? 2. This is related to no.1, it's all about Battle Power!!!!!
05/23/2015 09:48 Spirited#57
I've been dedicated to this project since I first started programming in 2009. It's not just a one-year thing. :p The problem is that most people don't see that here since most of my work is private and has remained private. Here's what the project has been over the past few years:

December 2009: Teaching myself C#.
March 2010: Started playing with game story ideas in public source. Friends-only server.
Sept 2010: Started learning networked programming through Elite-CoEmu involvement.
January 2011: Enrolled in the Computer Science program at my community college.
August 2011: After a lot of prototypes, started first custom source. Private server.
March 2012: Started new source based on previous and started learning software design.
September 2012: Project upgrade failed, started new source and gained student support.
January 2013: Project recognized as academic research under cs department chair.
March 2014: Project completed with functionality and dialog samples. Student-wide server.
May 2014: Project met its purpose by assisting in university & career opportunities.
July 2014: Server prototypes for new source in C++ for a public server.
February 2015: Started development on a C++ server source.

Unfortunately, my admission to a four-year university and my new job position has left me with little time to work on this project. This summer, I'll be working on the project, and after the primary systems have been programmed, I hope to keep up with development has I used to back in the day. ;p The survey is important though because I need to know what patch to target. Your feedback is very well received, thank you. :)
05/24/2015 08:10 Sani-#58
Quote:
Originally Posted by Spirited View Post
I've been dedicated to this project since I first started programming in 2009. It's not just a one-year thing. :p The problem is that most people don't see that here since most of my work is private and has remained private. Here's what the project has been over the past few years:

December 2009: Teaching myself C#.
March 2010: Started playing with game story ideas in public source. Friends-only server.
Sept 2010: Started learning networked programming through Elite-CoEmu involvement.
January 2011: Enrolled in the Computer Science program at my community college.
August 2011: After a lot of prototypes, started first custom source. Private server.
March 2012: Started new source based on previous and started learning software design.
September 2012: Project upgrade failed, started new source and gained student support.
January 2013: Project recognized as academic research under cs department chair.
March 2014: Project completed with functionality and dialog samples. Student-wide server.
May 2014: Project met its purpose by assisting in university & career opportunities.
July 2014: Server prototypes for new source in C++ for a public server.
February 2015: Started development on a C++ server source.

Unfortunately, my admission to a four-year university and my new job position has left me with little time to work on this project. This summer, I'll be working on the project, and after the primary systems have been programmed, I hope to keep up with development has I used to back in the day. ;p The survey is important though because I need to know what patch to target. Your feedback is very well received, thank you. :)
Honestly, there's no wrong with the latest patch, except for assassin wasting our HP POTS :D, just a little suggestion, just remove the Battle Points/Power for PvP factor. And the Purchasing Items using Real-Life money and you are good with your server.

Good Luck on your project thought.
05/25/2015 09:24 Spirited#59
Quote:
Originally Posted by Sani- View Post
Honestly, there's no wrong with the latest patch, except for assassin wasting our HP POTS :D, just a little suggestion, just remove the Battle Points/Power for PvP factor. And the Purchasing Items using Real-Life money and you are good with your server.

Good Luck on your project thought.
No use in going with the latest when I don't want or need what it offers, but thank you for your advice. :p
07/09/2015 09:39 Spirited#60
Finally, the project has been reborn! You can follow my progress on my blog (check my signature). I won't be posting progress on forums anymore, just my blog. Cheers, and thank you so much for your support over the years. This thread may be closed.