PDA

View Full Version : TunerZ (a project in development)



Angelo
26-06-2007, 04:31 PM
Hello!

It's a shame that PGD (the best forum) is dieing.
Aside that I'm proud to pronounce my new project, "TunerZ".

The game will be a variation of Racing, Simulation, Tuning and RPG.

Currently all the attention is going to the documentation which can be downloaded here (http://www.streetglowgame.nl/TunerZ/TunerZ_documentation_project_plan.pdf) (still in progress as you might have noticed).

The project will be a multiplayer game, with all the race-factors within it.
TunerZ will use the Network Library written by myself.

The server is currently in the following state:
- multithreaded
- can handle 1471 online players (when there are 1472 players online the server will crash)
- can handle up to 200 players that connect to the server at once (this is at my pc, my computer runs out of memory)
- saves/loads data from a SQL database Server

The client (the game) is currently in the following state:
- can connect to the server
- can login

What needs to be done within a short period:
- Carphysics (50% done so far)
- Optimize the Network Library

What needs to be archieved within a short period:
- Server must be able to handle around 10.000 online players
- Server must be able to handle up to 1.000 players that connects at once.*

* = Archieved yet.

Further information will be shown.

Angelo.

WILL
26-06-2007, 05:09 PM
It's a shame that PGD (the best forum) is dieing.

:lol: How did you determine this? The site goes through quiet periods, it's nothing new.


So is your game going to be focused more on realism or on gameplay?

Angelo
26-06-2007, 05:12 PM
Yes, whatever :P , well I noticed that my post of 2 days ago was still in the recent topics ;)
And it seems to happen more and more, so my conclusion is dieing :P


So is your game going to be focused more on realism or on gameplay?

There will be a balance between these 2 elements.
I think the realism shouldn't suppress the gameplay.
This balance can only be found by testing and testing and testing...

savage
26-06-2007, 05:46 PM
What SQL database are you using?

Angelo
26-06-2007, 05:51 PM
Microsoft, I think it's the most userfriendly and easiest database.

Angelo
26-06-2007, 06:00 PM
I got new results from my server, fresh results.
And I must say, I'm very satisfied with it!!!

The previous results (1471 players online) were made 1 week ago.

Today I'm glad to announce my new results:

- Maximum players online: 6837
- Maximum players that can connect at once: 623

These results are archieved by the same pc, under same circumstances.
There are a few things I've changed:
- The interval for every check-thread: the more users, the higher this interval should be. By doing this there will be lag, but the server will be able to handle more players. I've made it variable from 0ms to 100ms. These results are archieved by a interval of 100ms.
- The priority of the server is set to highest, instead of normal.
So with a variable thread interval the server is capable to handle more players.

EDIT:

After a retry (the server just finished the simulation) there were 7016 players online, then the server started refusing connections.
The maximum players that were able to connect was 652.

The improvements are coming!

Angelo
27-06-2007, 11:33 AM
After a long night tweaking my server, I've been able to archieve one of my goals.
The server can handle 1.000+ connections at once now.

But I'm wondering, at the moment my server is multithreaded.
When a player connects, a thread is been created.
This means, 1.000 players = 1.000 threads.
In my opinion this is overkill, isn't it much better to create a singlethreaded server?
Please let me know all your opinions...

technomage
27-06-2007, 11:38 AM
Modern operating systems can handle lots and lots of threads, Webservers use multithreading so I don't see it being a problem for your system. :D

Angelo
27-06-2007, 11:44 AM
Okay, thanks for your reply.

But, wouldn't the multithreading suppress the speed of the server?

JSoftware
27-06-2007, 11:47 AM
I guess you are using windows in which case your only realistic option would be to use threads. I don't think that asynchronous operation would be realistic on a scale like that.

And blocking seems to me like the root of all evils..

1000 threads is nothing. I've tried to have a program running which would spawn 25000 freerunning threads at once. Granted, I didn't use schemes like synchronization or the like, but it ran without any problems

Angelo
27-06-2007, 11:48 AM
Okay, I just wanted to know for sure.

Thanks for the replies, now I can finally continue my server with a good feeling, that I'm not doing something wrong.
Thanks.

FNX
27-06-2007, 12:18 PM
Microsoft, I think it's the most userfriendly and easiest database. :lol:

You should try MySQL my friend :D

JSoftware
27-06-2007, 12:21 PM
Microsoft, I think it's the most userfriendly and easiest database. :lol:

You should try MySQL my friend :D

MySQL is horrible on a windows box. To do anything worthwhile with it you would still have to use it through ADO or ODBC. Userfriendliness is pretty bad also.

I haven't tried MSSQL though, but I would presume it atleast has an official visual GUI

FNX
27-06-2007, 12:28 PM
[OT mode on]

Well i used it for many years now, with direct access both by Java and Delphi with no problems at all. It used to be tricky before MySQL 5 but
is a great option from that release on. One of the biggest game portals in
Italy (alive and working) i worked on is based on MySQL 5 :)

[OT mode off]

The important thing is that we wait to see this game working! 8)

technomage
27-06-2007, 01:00 PM
I have to agree, I use MS SQL (2000 and 2005) every day, and I find MySQL allot easiers to work with it's also a little more consistent, with MS SQL, you have to do some real messing around to get things working really fast.

savage
27-06-2007, 01:03 PM
I was going to suggest MySQL as well. MS SQL Server has better UI interface to the DB, but for speed and robustness I would look at MySQL and switch to the Unix based OS.

Setharian
27-06-2007, 01:27 PM
I guess you are using windows in which case your only realistic option would be to use threads. I don't think that asynchronous operation would be realistic on a scale like that.
wrong, asynchronous operations allow tenths of thousands of simulatnous connections using only a few threads (user-spawned threads, kernel may spawn more threads to handle the requests but those are hidden)...never heard of I/O Completion Ports? :) you just associate a handle (or a socket) with a completion port (that is you may associate hundreds of handles/sockets with the same completion port), issue a thread to wait for a completion packet to be enqueued in the port's queue and when one or more entries are enqueued, the thread is awoken, completion packet is dequeued and you know what sort of event has happened :) your description matches definition of a MMO game and under windows IOCP is the way, under linux epoll, under freebsd kqueue elsewhere threads or fork :)

JSoftware
27-06-2007, 01:57 PM
Oh, I thought of asynchronous sockets as being handled by the message queue of the main window handle alone. I've never looked into IOCP before but I certainly will now

Angelo
27-06-2007, 02:14 PM
The important thing is that we wait to see this game working!

I'm working almost 24/7 on it, so doing the best I can :P
Altho, this project will be huge for me, I've planned the release for in 2008.
So, just to let you know, it will take a while.

I must start organise things, this can not continue any longer.
Now I'm working on the physics (on a standalone) while I know the server must be right first.
So, at this moment I'm creating a schedule, a tight schedule.
When and what should be finished, I'll keep everyone up-to-date with this thread.


I was going to suggest MySQL as well. MS SQL Server has better UI interface to the DB, but for speed and robustness I would look at MySQL and switch to the Unix based OS.
Thanks for the advice (everyone that adviced MySQL) I'll certainly take a look at it.
I only use MySQL for PHP and I've never used it in Pascal.
What component would you suggest, or should I write one myself?!

Thanks for the enthusiasm everyone :D

Angelo.

FNX
27-06-2007, 02:27 PM
What component would you suggest, or should I write one myself?!

Have a look to ZeosLib, i used them in Delphi but if i do remember well
they should work with other languages aswell. They are quick, stable and
opensource, so you don't have to write a driver yourself (it would take
more than to write the game itself :P)

technomage
27-06-2007, 03:47 PM
For MySQL access I use http://sourceforge.net/projects/directsql

It's a very quick not VCL dependent set of components :)

Angelo
27-06-2007, 05:57 PM
I've had enough for today.
Tomorrow I have to learn [ Yes, school ].
After that I can continue working on my server.
I think Ill use directsql

Here's a list that needs to be done ASAP:

- Stable threads (threads are being free'd too soon)
- MSSQL should be MySQL (shouldn't be too hard, I know how to work with MySQL in PHP, and in the examples I've seen its almost the same)
- Database Structure (I think I can draw/write this on paper tonight)

wodzu
28-06-2007, 07:48 AM
Hi Angelo and good luck with your application :)

In some previous posts people said that MySQL is faster than MS SQL. I wonder from where they have such informations since in every comparison which I saw the situation was different. Also even on some MySQL related sites its written that MS SQL is known to be the fastest database. Exception might be in case of GUI. MS SQL 2005 GUI is so damn slow.. in comparison to 2000 :| IMHO I think MS SQL is much more powerful database especially when it comes to the SQL dialect. Transact SQL is something that really makes life easier. However in case of hardware requirements MySQL has upper hand here.

I would recommend you to check internet for databases comparison before you make any steps.

Regards.

Angelo
28-06-2007, 09:12 AM
Hello Wodzu,

I thought the same thing as you have written here.
But if they all say exactly the same thing... Well, I'll take a look on the internet.
What MS SQL component would you suggest to use/try ?

Angelo.

wodzu
28-06-2007, 11:51 AM
Hello Wodzu,

What MS SQL component would you suggest to use/try ?

Angelo.

Hello mate.

I am working every day with ADO components. Never had any problems with them. Also I haven't noticed any significant performance drop between running complex queries on server and through ADO in my applications. This is a really good technology as far as I can tell after writing ~20 apps for my company with their usage.

Regards,

Wodzu

Angelo
28-06-2007, 01:39 PM
I am currently using the same system as you describe here.
With ADO components that come along with Delphi.
Currently I'm satisfied with the results of ADO, but it might get slow if the server will execute 1.000 queries at the same moment.

What are the limits (in your experience or found on the internet) of ADO?

Thanks in advance,

Angelo.

wodzu
28-06-2007, 02:32 PM
What are the limits (in your experience or found on the internet) of ADO?



I haven't found any but I wasn't working on the case you refer to. I would suggest you to do some stress tests and see how ADO will behave. Also, I've found a lot articles over the net about ADO and its performance. For example:

http://msdn2.microsoft.com/en-us/library/aa496013(SQL.80).aspx

Quite old but still valuable ;)