Pets Design: Difference between revisions

From PSwiki
Jump to navigation Jump to search
Magodra (talk | contribs)
No edit summary
 
(22 intermediate revisions by one other user not shown)
Line 1: Line 1:
= Functional Design =
= Functional Design =
The Functional Design show the functionality of the Pet system.


== States ==
== States ==
This is the states that a pet can be in.


<uml>
<uml>
[*] --> Dismissed : create_familiar
[*] --> Dismissed : create_familiar
Dismissed --> Summoned : /pet summon
Dismissed --> Summoned : /pet summon
Dismissed : Reset pet elapsed time
Summoned --> Depleted : max time reached
Summoned --> Depleted : max time reached
Depleted --> Dismissed : depleted lockout over
Depleted --> Dismissed : depleted lockout over
Summoned --> Dead: killed
Summoned --> Dead: killed
Dead --> Dismissed : death lockout over
Dead --> Dismissed : death lockout over
Summoned --> Dismissed : /pet dismiss
Summoned --> DismissedResting : /pet dismiss
DismissedResting --> Dismissed : dismiss lockout over
DismissedResting --> Summoned : /pet summon
state "Dismissed resting" as DismissedResting


state Summoned {
state Summoned {
Line 31: Line 39:


</uml>
</uml>
=== Dismissed resting ===
When dismissed the pet will be in a state where if resummoned the time lived will not be reset. After the DismissedLockoutTime the time lived is reset to 0. This penalty has to be taken either before logout or before summoning after login.


= Physical Design =
= Physical Design =
In the Physical Design the different parts of the functional design is allocated to different systems. Some are handled server side, other at the npcclient. Some in code and others in scripts.
== Database ==
<uml>
class character << (D,orchid) >> {
  +id
  +animal_affinity
  +pet_elapsed_time
}
class familiar_types << (D,orchid) >>{
  +id
  +name
  +type
  +lifecycle
  +attacktool
  +attacktype
  +magicalaffinity
  +vision
  +speed
  +hearing
}
class char_create_affinity << (D,orchid) >>{
  +attribute
  +category
}
class character_relationships << (D,orchid) >>{
  +character_id
  +related_id
  +relationship_type
  +spousename
}
note right of character_relationships
Relationship_type can be:
*familiar
*buddy
*spouse
*exploration
end note
character "2" -- "0..n" character_relationships : >
</uml>


== Classes ==
== Classes ==
Line 49: Line 110:


NPCManager "1" *-- "many" PetOwnerSession : ownerPetList
NPCManager "1" *-- "many" PetOwnerSession : ownerPetList
class psFamiliarType {
  -id
  -name
  -type
  -lifeCycle
  -attackTool
  -attackType
  -magicalAffinity
}
class EntityManager {
}
EntityManager "1" *-- "many" psFamiliarType : familiarTypeList
class psCharacter {
  -animalAffinity
  -ownerId
  -familiarsId[]
  -canSummonFamiliar
  +UpdatePetTime()
}
class gemActor {
}
class gemNPC {
}
gemNPC *-- gemActor : owner
note on link
Rely to a gemObject but that
doesn't say much. So we use
the gemActor.
end note
gemActor *-- psCharacter : psChar


</uml>
== Activities ==
=== Create ===
<uml>
(*) --> "Activity"
--> (*)
</uml>
</uml>


== Sequences ==
== Sequences ==
=== Create ===
<uml>
->> CreateFamiliarOP : Run
activate CreateFamiliarOP
CreateFamiliarOP ->> EntityManager : CreateFamiliar
activate EntityManager
EntityManager ->> psCharacter : GetMasterFamiliarID
activate psCharacter
EntityManager <<-- psCharacter
deactivate psCharacter
EntityManager ->> EntityManager : CopyNPCFromDatabase
activate EntityManager
deactivate EntityManager
EntityManager ->> EntityManager : CreateNPC
activate EntityManager
create gemNPC
EntityManager ->> gemNPC
deactivate EntityManager
EntityManager ->> gemNPC : SetOwner
activate gemNPC
deactivate gemNPC
EntityManager ->> Client : SetFamiliar
activate Client
deactivate Client
EntityManager ->> psCharacter : SetFamiliarID
activate psCharacter
deactivate psCharacter
EntityManager ->> NPCManager : AddEntity
activate NPCManager
deactivate NPCManager
EntityManager ->> NPCManager : ControlNPC
activate NPCManager
deactivate NPCManager
EntityManager ->> NPCManager : CreatePetOwnerSession
activate NPCManager
create PetOwnerSession
NPCManager ->> PetOwnerSession
EntityManager <<-- NPCManager
deactivate NPCManager
deactivate psCharacter
CreateFamiliarOP <<-- EntityManager
deactivate EntityManager
<<-- CreateFamiliarOP
deactivate CreateFamiliarOP
</uml>


=== Death ===
=== Death ===
Line 84: Line 250:
deactivate NPCManager
deactivate NPCManager
SpawnManager -\\ : psDespawnGameEvent
SpawnManager -\\ : psDespawnGameEvent
deactivate SpawnManager
deactivate SpawnManager
deactivate SpawnManager
... DeathRemainTime ...
... DeathRemainTime ...
Line 89: Line 256:
activate SpawnManager
activate SpawnManager
SpawnManager ->> SpawnManager : RemoveNPC
SpawnManager ->> SpawnManager : RemoveNPC
activate SpawnManager
deactivate SpawnManager
deactivate SpawnManager
deactivate SpawnManager
... Some time ...
... Some time ...
Line 102: Line 271:




=== PSUnreal ===
Ideas for Pets
Specific new information needed, will be stored in character_variables table associated to the pet:
* Energy
* Happiness
* Last time fed
Other fields used, but already available in the current database structure:
* Exp (available)
* Inventory (available)
* Knowledge area to speak (available)
For the Pet evolution and associated abilities we need to add two new tables:
* Pet Evolution table: ID, Name, size_scale, mesh_name, exp_required
* Pet Abilities table: evo_stage_id, name, pet_command, storage
where pet_command will determine access from the player to the specific command in the list below:
  /pet learn location forest
  /pet learn target Trepor
  /pet go location forest
  /pet go position 100 f
  /pet learn phrase Hello my name is...
  /pet learn answer "what is your name" "my name is xyz"
  /pet scout creatures <range?>
  /pet scout items <range>
  /pet grant yes/no <name>
  /pet scout traps <range?>
  /pet scout hidden <range?>
  /pet distract <target>
  /pet senses sight
To evolve your pet, you will give him food, which is providing energy, energy allows to execute tasks/abilities, this is increase the experience of the pet and the empathy of the owner, and at certain level of experience the pet evolves to a new stage.


  Food -> Energy -> Abilities -> Exp/Empathy -> Evolution stage


[[Category:Engine documents]] [[Category:Server Design]]
[[Category:Engine documents]] [[Category:Server Design]]

Latest revision as of 17:47, 28 February 2021

Functional Design

The Functional Design show the functionality of the Pet system.

States

This is the states that a pet can be in.

Dismissed resting

When dismissed the pet will be in a state where if resummoned the time lived will not be reset. After the DismissedLockoutTime the time lived is reset to 0. This penalty has to be taken either before logout or before summoning after login.

Physical Design

In the Physical Design the different parts of the functional design is allocated to different systems. Some are handled server side, other at the npcclient. Some in code and others in scripts.

Database

Classes

Activities

Create

Sequences

Create

Death


PSUnreal

Ideas for Pets

Specific new information needed, will be stored in character_variables table associated to the pet:

  • Energy
  • Happiness
  • Last time fed

Other fields used, but already available in the current database structure:

  • Exp (available)
  • Inventory (available)
  • Knowledge area to speak (available)

For the Pet evolution and associated abilities we need to add two new tables:

  • Pet Evolution table: ID, Name, size_scale, mesh_name, exp_required
  • Pet Abilities table: evo_stage_id, name, pet_command, storage

where pet_command will determine access from the player to the specific command in the list below:

 /pet learn location forest
 /pet learn target Trepor
 /pet go location forest
 /pet go position 100 f
 /pet learn phrase Hello my name is...
 /pet learn answer "what is your name" "my name is xyz"
 /pet scout creatures <range?>
 /pet scout items <range>
 /pet grant yes/no <name>
 /pet scout traps <range?>
 /pet scout hidden <range?>
 /pet distract <target>
 /pet senses sight

To evolve your pet, you will give him food, which is providing energy, energy allows to execute tasks/abilities, this is increase the experience of the pet and the empathy of the owner, and at certain level of experience the pet evolves to a new stage.

 Food -> Energy -> Abilities -> Exp/Empathy -> Evolution stage