Why COH will not get a server emulator.

Started by Leandro, January 03, 2013, 03:37:38 PM

TonyV

Quote from: Codewalker on January 03, 2013, 04:13:39 PM
Boo.

1. Query the database for characters that match the desired account name,
   sorted by last logon date (descending), limit 1. Cause finding needles in
   haystacks is what SQL servers have been doing for ages and they're really
   good at it.
2. Profit!


Boo.

1. Since this is a VERY commonly used functionality, create a column per account for last logged in character.
2. Access that column when the person logs in, and update it whenever they choose a character.  You don't need a separate query to find this information.
3. Dance like it's Christmas and you were drawn by Charles Shultz.

Manga

Quote from: Codewalker on January 03, 2013, 04:13:39 PM

1. Query the database for characters that match the desired account name,
   sorted by last logon date (descending), limit 1. Cause finding needles in
   haystacks is what SQL servers have been doing for ages and they're really
   good at it.
2. Profit!


If only the database query was THAT simple...  :)


Manga

Quote from: Leandro on January 04, 2013, 02:16:14 AM
It's no longer a hint if you point it out like that, but people on the Multimedia forum know very well that I intend for us to be able to make our own maps, and finish the incomplete bits that the devs left in the i24 Beta client. Their creations deserve to see the light of day as they intended.

See, now you're talking reverse engineering the client as well as the server.  The pair are designed so that the server contains as little data as possible, and sends as little traffic as possible to the client, and the client uses its massive archive of objects and data to build a world in real time.  Without the client side stuff, the "map" on the server is just garbage data.


Starsman

Quote from: TonyV on January 04, 2013, 02:52:29 AM
Boo.

1. Since this is a VERY commonly used functionality, create a column per account for last logged in character.
2. Access that column when the person logs in, and update it whenever they choose a character.  You don't need a separate query to find this information.
3. Dance like it's Christmas and you were drawn by Charles Shultz.

Now sort the character list by last played. :)
For the sake of the community: please stop the cultural "research" in your attempt to put blame on the game's cancelation.

It's sickening to see the community sink that low. It's worse to see the community does not get it.

I'm signing off and taking a break, blindly hope things change.

Tenzhi

This is probably important information from a technical viewpoint, but from the POV of a layperson it seems that hairs are being split.
When you insult someone by calling them a "pig" or a "dog" you aren't maligning pigs and dogs everywhere.  The same is true of any term used as an insult.

Victoria Victrix

Quote from: Tenzhi on January 04, 2013, 05:16:02 AM
This is probably important information from a technical viewpoint, but from the POV of a layperson it seems that hairs are being split.

https://images.weserv.nl/?url=farm4.static.flickr.com%2F3240%2F2772221688_2866dc49bf.jpg
I will go down with this ship.  I won't put my hands up in surrender.  There will be no white flag above my door.  I'm in love, and always will be.  Dido

Tenzhi

Quote from: Victoria Victrix on January 04, 2013, 05:19:28 AM
https://images.weserv.nl/?url=farm4.static.flickr.com%2F3240%2F2772221688_2866dc49bf.jpg

That is an interesting sculpture.  And I find it a particularly funny response because I nearly went with "hares" myself. :)
When you insult someone by calling them a "pig" or a "dog" you aren't maligning pigs and dogs everywhere.  The same is true of any term used as an insult.

Angelus Animi

Quote from: Victoria Victrix on January 04, 2013, 05:19:28 AM
https://images.weserv.nl/?url=farm4.static.flickr.com%2F3240%2F2772221688_2866dc49bf.jpg


I find this disturbing on many levels... ???

Victoria Victrix

It's literally called "Split Hare," it is in the Yorkshire Sculpture Park in the UK, and it is by an artist named Sophie Ryder.  She does a lot of monumental Sculptures featuring Lady Hares.  http://www.sophieryder.net/
I will go down with this ship.  I won't put my hands up in surrender.  There will be no white flag above my door.  I'm in love, and always will be.  Dido

Arnabas

You know, I don't care what it is called or how it works. If something lets me play again , I want it.

I would even be happy if the game was somehow made single-player.

dwturducken

Quote from: TonyV on January 04, 2013, 02:52:29 AM
1. Since this is a VERY commonly used functionality, create a column per account for last logged in character.

I had to read this three times before it stopped sounding like some kind of programmer punishment. Right up there with, "Copy this seven pages of code from this old copy of COMPUTE! Gazette."

Also,

Quote from: Victoria Victrix on January 04, 2013, 05:19:28 AM
https://images.weserv.nl/?url=farm4.static.flickr.com%2F3240%2F2772221688_2866dc49bf.jpg

Can anyone spare some Brain Bleach?
I wouldn't use the word "replace," but there's no word for "take over for you and make everything better almost immediately," so we just say "replace."

Starsman

Quote from: Victoria Victrix on January 04, 2013, 05:52:07 AM
It's literally called "Split Hare," it is in the Yorkshire Sculpture Park in the UK, and it is by an artist named Sophie Ryder.  She does a lot of monumental Sculptures featuring Lady Hares.  http://www.sophieryder.net/

A furry that is actually respected as an artist by society?!  :o
For the sake of the community: please stop the cultural "research" in your attempt to put blame on the game's cancelation.

It's sickening to see the community sink that low. It's worse to see the community does not get it.

I'm signing off and taking a break, blindly hope things change.

Tenzhi

Quote from: Starsman on January 04, 2013, 06:12:45 AM
A furry that is actually respected as an artist by society?!  :o

Such art is historically highly sought after.  In ancient Egypt, for instance.
When you insult someone by calling them a "pig" or a "dog" you aren't maligning pigs and dogs everywhere.  The same is true of any term used as an insult.

Victoria Victrix

Quote from: Starsman on January 04, 2013, 06:12:45 AM
A furry that is actually respected as an artist by society?!  :o

Here's the lady herself.

https://images.weserv.nl/?url=gerryco23.files.wordpress.com%2F2008%2F06%2Fsophie-ryder.jpg%3Fw%3D640%26amp%3Bh%3D508

I think she's more about mythic images.  I could go on at some length about the hare in celtic, greek, and other myth, but I don't want to bore you.
I will go down with this ship.  I won't put my hands up in surrender.  There will be no white flag above my door.  I'm in love, and always will be.  Dido

krtbuni


Reiraku

Quote from: Arnabas on January 04, 2013, 06:11:01 AM
You know, I don't care what it is called or how it works. If something lets me play again , I want it.

I would even be happy if the game was somehow made single-player.

This is me, right here.

For anyone working on it, you have my thanks.

The Fifth Horseman

Quote from: Starsman on January 04, 2013, 05:15:06 AM
Now sort the character list by last played. :)
0. Since you already have a field storing last activity date for each character, you can add an index on it to speed up the query.
1. SELECT * FROM characters WHERE account=<account ID> ORDER BY last_active DESC

Quote from: TheManga on January 04, 2013, 04:59:18 AMIf only the database query was THAT simple...  :)
Yes, it is. If you're selecting by account name and not ID, it will need an extra JOIN and that's that.
1. SELECT <fields> FROM characters JOIN accounts ON characters.account=accounts.id WHERE accounts.name=<account name> ORDER BY last_active DESC LIMIT 1
We were heroes. We were villains. At the end of the world we all fought as one. It's what we did that defines us.
The end occurred pretty much as we predicted: all servers redlining until midnight... and then no servers to go around.

Somewhere beyond time and space, if you look hard you might find a flash of silver trailing crimson: a lone lost Spartan on his way home.

Codewalker

Quote from: The Fifth Horseman on January 04, 2013, 01:15:21 PM
0. Since you already have a field storing last activity date for each character, you can add an index on it to speed up the query.

And since the character table will be the most used table in the database, then indexes on it will very likely be in the memory cache at any time other than right after server startup. So index queries against it are very, very cheap.

Quote
1. SELECT * FROM characters WHERE account=<account ID> ORDER BY last_active DESC
Yes, it is. If you're selecting by account name and not ID, it will need an extra JOIN and that's that.
1. SELECT <fields> FROM characters JOIN accounts ON characters.account=accounts.id WHERE accounts.name=<account name> ORDER BY last_active DESC LIMIT 1

That's assuming the accounts are in the same database, which they wouldn't be -- there's no reason for every shard to have the master account list in its own database, and it would be a security risk for it to have direct access to that table anyway. Presumably the dbserver would already have the account ID on hand, probably passed in a token from the authentication server.

Leandro

Quote from: TheManga on January 04, 2013, 05:04:00 AM
See, now you're talking reverse engineering the client as well as the server.

Actually, the client has a built-in map editor mode, so there was no reverse engineering involved. The map format is human readable (as you can see in the linked thread), and the client reads maps from .txt files from the "data" overrides folder. We don't need to disassemble the client or touch one byte on it in order to create and include new maps; the COH client is very, very, very mod-friendly.

It's true that Codewalker posted a binary patch so people could load maps right now, but that was just a case of "gimme NAO!" and not a necessity. With the server in place, the client doesn't need to be touched in order to create new maps; it's one of the things it can naturally do.

Codewalker

Quote from: Leandro on January 04, 2013, 02:15:06 PM
It's true that Codewalker posted a binary patch so people could load maps right now, but that was just a case of "gimme NAO!" and not a necessity. With the server in place, the client doesn't need to be touched in order to create new maps; it's one of the things it can naturally do.

Maps load just fine without that patch. The only thing the patch is needed for is if you want to create new scenes (skyfiles), or add new meshes (which we don't yet have a tool for doing).