Page 1 of 2

Writing Ages for Shards

PostPosted: Wed Jul 08, 2015 4:22 am
by diafero
For your age to work fine on Shards, there are some precautions that you should take. Unfortunately, many of the issues that Shards like to expose cannot be observed if you test your age offline, on your single-player installation. So you have to be extra careful here. I started collecting such issues in the wiki: Writing Ages for Shards.

If you are an age writer, please go through that list before releasing the age, to make sure people can enjoy it online just as well as offline. (And even more so, since their friends are around!)
Also, that's a wiki, so feel free to extend the documentation if you think there's something missing! If you have questions, this forum is the right place to ask :)

Re: Writing Ages for Shards

PostPosted: Wed Jul 08, 2015 6:27 am
by Karkadann
On the subject of Max/Plasma and linking.
Would I use kBasicLink If I wanted to link from one place to another in the same age?

Re: Writing Ages for Shards

PostPosted: Wed Jul 08, 2015 7:39 am
by diafero
If you want to link within the same age, you should not link at all, but rather use a fake link like Ahra Pahts does - that avoids the waiting time for clients. You can do this in Python:

Code: Select all
def fakelink(agename, spawnpoint):
    print ('fakelink to %s in %s' % (spawnpoint, agename))
    avatar = PtGetLocalAvatar()
    sp = PtFindSceneobject(spawnpoint, agename)
    PtFakeLinkAvatarToObject(avatar.getKey(), sp.getKey())


If you do want to do an actual link (to any age), you should do it in Python as well:
Code: Select all
import xLinkMgr
xLinkMgr.LinkToAge('AgeNameHere')

There's Python scripts by Sirius to help you doing this for linking books.
The xLinkMgr is part of Offline KI, and it knows all the things to get linking right.

Note that CWE shards will probably also want you to be very careful with linking, but I have no idea idea if they have something like xLinkMgr.

Re: Writing Ages for Shards

PostPosted: Wed Jul 08, 2015 11:05 am
by Tsar Hoikas
kBasicLink is a bad idea on CWE unless you know what you're doing... Especially on MOULa. It generates an entirely new age vault :roll: . On UU/PotS, kBasic link worked as a sort of load balancing technique that would take you to an already created age.

Talk to the shard admin.

Re: Writing Ages for Shards

PostPosted: Wed Jul 08, 2015 3:11 pm
by diafero
Alcugs pretty much entirely ignores the linking rule, and does what it wants. For kBasicLink, the client does pretty much nothing, so no harm is done. For the other linking rules, the client starts to make assumptions, and it starts to mess with the vault, so bad things can happen.

Re: Writing Ages for Shards

PostPosted: Sat Jul 11, 2015 9:18 pm
by Ehren
diafero wrote:Alcugs pretty much entirely ignores the linking rule, and does what it wants. For kBasicLink, the client does pretty much nothing, so no harm is done. For the other linking rules, the client starts to make assumptions, and it starts to mess with the vault, so bad things can happen.


Now I'm curious, is Alcugs somehow set to ignore the linking rule specified in Responder Modifiers? Because almost every Cyan link in CC is kOriginalBook, and it seems hard to believe the same client assumptions would work for all of the places (both public and private) that are set for that rule. I mean kOriginalBook normally links to or creates a private instance right?

Re: Writing Ages for Shards

PostPosted: Sun Jul 12, 2015 3:50 am
by diafero
The Shard's part in linking is to decide which concrete age instance (identified by its GUID) the player links to. All the vault manipulation is handled by the client, the Shard has no say there.
In the case of Alcugs, this (GUID) decision is based solely on the name of the age. There's a configuration variable telling Alcugs which ages to create per-player instances for. All the rest gets global instances. The GUID are formed systematically, encoding the sequence prefix of the age, and the KI number of the owner (in case of per-player instances). Thus the server can reliably send the player to the same instance again and again, without any persistent state. All of this stems from the fact that the Alcugs game servers do not ever access the vault themselves. They just forward the vault access of the client. This avoids the need for implementing a vault *client*, but it results in some hacks and weirdnesses. (The other one being the lack of synchrinization between the vault-stored SDL, and the game-server-managed SDL.)
I changed this a bit compared to the original Alcugs, in that the GUID generation is indeed now handled by the vault server - but I never went on to actually touch the database there, currently it's just a kind of pointless roundtrip.

Re: Writing Ages for Shards

PostPosted: Sun Jul 19, 2015 7:13 pm
by Karkadann
Code: Select all
def fakelink(agename, spawnpoint):
    print ('fakelink to %s in %s' % (spawnpoint, agename))
    avatar = PtGetLocalAvatar()
    sp = PtFindSceneobject(spawnpoint, agename)
    PtFakeLinkAvatarToObject(avatar.getKey(), sp.getKey())



Can someone please help me to get this working in Max, Im still a bit coder incompetent.

progress

OK I got it to show up in the drop down menu but there are no setting

Re: Writing Ages for Shards

PostPosted: Mon Jul 20, 2015 1:36 am
by Sirius
I assume the link is done automatically on entering a region or clicking something ? (not a book, I mean)
Then you could try using this script:
Show Spoiler

Don't forget to add the Python glue at the end of the file, and it should work in Max. I didn't test the script, though. Hopefully it will work without problem... :P
It will even handle the screen fadein/fadeout when linking.

Oh, and don't forget fakelinking doesn't reset the camera position. Meaning when linking the third person view will fly all across your Age. This can be solved by setting up a camera region where you link to, and set it to cut position, IIRC.

Re: Writing Ages for Shards

PostPosted: Mon Jul 20, 2015 2:57 am
by Karkadann
Thank you both, I just might get this thing done yet. although im wondering what would have to be done to get the other one to show up with settings in Max. Im assuming it was more of a Blender python