Fix path in rpsystem contrib readme. Try to address unit test build issues for non-sqlite dbs

This commit is contained in:
Griatch 2023-12-10 21:03:09 +01:00
parent c37dde248e
commit 28a85368d6
4 changed files with 68 additions and 195 deletions

View file

@ -2,59 +2,25 @@
Contribution by Griatch, 2015 Contribution by Griatch, 2015
A full roleplaying emote system. Short-descriptions and recognition (only A full roleplaying emote system. Short-descriptions and recognition (only know people by their looks until you assign a name to them). Room poses. Masks/disguises (hide your description). Speak directly in emote, with optional language obscuration (words get garbled if you don't know the language, you can also have different languages with different 'sounding' garbling). Whispers can be partly overheard from a distance. A very powerful in-emote reference system, for referencing and differentiate targets (including objects).
know people by their looks until you assign a name to them). Room poses. Masks/disguises
(hide your description). Speak directly in emote, with optional language obscuration
(words get garbled if you don't know the language, you can also have different languages
with different 'sounding' garbling). Whispers can be partly overheard from a distance. A
very powerful in-emote reference system, for referencing and differentiate targets
(including objects).
The system contains of two main modules - the roleplaying emote system and the language The system contains of two main modules - the roleplaying emote system and the language obscuration module.
obscuration module.
## Roleplaying emotes ## Roleplaying emotes
This module contains the ContribRPObject, ContribRPRoom and This module contains the ContribRPObject, ContribRPRoom and ContribRPCharacter typeclasses. If you inherit your objects/rooms/character from these (or make them the defaults) from these you will get the following features:
ContribRPCharacter typeclasses. If you inherit your
objects/rooms/character from these (or make them the defaults) from
these you will get the following features:
- Objects/Rooms will get the ability to have poses and will report - Objects/Rooms will get the ability to have poses and will report the poses of items inside them (the latter most useful for Rooms).
the poses of items inside them (the latter most useful for Rooms). - Characters will get poses and also sdescs (short descriptions) that will be used instead of their keys. They will gain commands for managing recognition (custom sdesc-replacement), masking themselves as well as an advanced free-form emote command.
- Characters will get poses and also sdescs (short descriptions)
that will be used instead of their keys. They will gain commands
for managing recognition (custom sdesc-replacement), masking
themselves as well as an advanced free-form emote command.
In more detail, This RP base system introduces the following features In more detail, This RP base system introduces the following features to a game, common to many RP-centric games:
to a game, common to many RP-centric games:
- emote system using director stance emoting (names/sdescs). - emote system using director stance emoting (names/sdescs). This uses a customizable replacement noun (/me, @ etc) to represent you in the emote. You can use /sdesc, /nick, /key or /alias to reference objects in the room. You can use any number of sdesc sub-parts to differentiate a local sdesc, or use /1-sdesc etc to differentiate them. The emote also identifies nested says and separates case.
This uses a customizable replacement noun (/me, @ etc) to - sdesc obscuration of real character names for use in emotes and in any referencing such as object.search(). This relies on an SdescHandler `sdesc` being set on the Character and makes use of a custom Character.get_display_name hook. If sdesc is not set, the character's `key` is used instead. This is particularly used in the emoting system.
represent you in the emote. You can use /sdesc, /nick, /key or - recog system to assign your own nicknames to characters, can then be used for referencing. The user may recog a user and assign any personal nick to them. This will be shown in descriptions and used to reference them. This is making use of the nick functionality of Evennia.
/alias to reference objects in the room. You can use any
number of sdesc sub-parts to differentiate a local sdesc, or
use /1-sdesc etc to differentiate them. The emote also
identifies nested says and separates case.
- sdesc obscuration of real character names for use in emotes
and in any referencing such as object.search(). This relies
on an SdescHandler `sdesc` being set on the Character and
makes use of a custom Character.get_display_name hook. If
sdesc is not set, the character's `key` is used instead. This
is particularly used in the emoting system.
- recog system to assign your own nicknames to characters, can then
be used for referencing. The user may recog a user and assign
any personal nick to them. This will be shown in descriptions
and used to reference them. This is making use of the nick
functionality of Evennia.
- masks to hide your identity (using a simple lock). - masks to hide your identity (using a simple lock).
- pose system to set room-persistent poses, visible in room - pose system to set room-persistent poses, visible in room descriptions and when looking at the person/object. This is a simple Attribute that modifies how the characters is viewed when in a room as sdesc + pose.
descriptions and when looking at the person/object. This is a - in-emote says, including seamless integration with language obscuration routine (such as contrib/rplanguage.py)
simple Attribute that modifies how the characters is viewed when
in a room as sdesc + pose.
- in-emote says, including seamless integration with language
obscuration routine (such as contrib/rplanguage.py)
### Installation: ### Installation:
@ -81,7 +47,7 @@ the typeclasses in this module:
```python ```python
# in mygame/typeclasses/characters.py # in mygame/typeclasses/characters.py
from evennia.contrib.rpg import ContribRPCharacter from evennia.contrib.rpg.rpsystem import ContribRPCharacter
class Character(ContribRPCharacter): class Character(ContribRPCharacter):
# ... # ...
@ -91,7 +57,7 @@ class Character(ContribRPCharacter):
```python ```python
# in mygame/typeclasses/objects.py # in mygame/typeclasses/objects.py
from evennia.contrib.rpg import ContribRPObject from evennia.contrib.rpg.rpsystem import ContribRPObject
class Object(ContribRPObject): class Object(ContribRPObject):
# ... # ...
@ -101,7 +67,7 @@ class Object(ContribRPObject):
```python ```python
# in mygame/typeclasses/rooms.py # in mygame/typeclasses/rooms.py
from evennia.contrib.rpg import ContribRPRoom from evennia.contrib.rpg.rpsystem import ContribRPRoom
class Room(ContribRPRoom): class Room(ContribRPRoom):
# ... # ...
@ -119,44 +85,33 @@ Example for your character:
Examples: Examples:
> look > look
Tavern Tavern
The tavern is full of nice people The tavern is full of nice people
*A tall man* is standing by the bar. *A tall man* is standing by the bar.
Above is an example of a player with an sdesc "a tall man". It is also Above is an example of a player with an sdesc "a tall man". It is also an example of a static *pose*: The "standing by the bar" has been set by the player of the tall man, so that people looking at him can tell at a glance what is going on.
an example of a static *pose*: The "standing by the bar" has been set
by the player of the tall man, so that people looking at him can tell
at a glance what is going on.
> emote /me looks at /Tall and says "Hello!" > emote /me looks at /Tall and says "Hello!"
I see: I see:
Griatch looks at Tall man and says "Hello". Griatch looks at Tall man and says "Hello".
Tall man (assuming his name is Tom) sees: Tall man (assuming his name is Tom) sees:
The godlike figure looks at Tom and says "Hello". The godlike figure looks at Tom and says "Hello".
Note that by default, the case of the tag matters, so `/tall` will Note that by default, the case of the tag matters, so `/tall` will lead to 'tall man' while `/Tall` will become 'Tall man' and /TALL becomes /TALL MAN. If you don't want this behavior, you can pass case_sensitive=False to the `send_emote` function.
lead to 'tall man' while `/Tall` will become 'Tall man' and /TALL
becomes /TALL MAN. If you don't want this behavior, you can pass
case_sensitive=False to the `send_emote` function.
## Language and whisper obfuscation system ## Language and whisper obfuscation system
This module is intented to be used with an emoting system (such as This module is intented to be used with an emoting system (such as `contrib/rpg/rpsystem.py`). It offers the ability to obfuscate spoken words in the game in various ways:
`contrib/rpg/rpsystem.py`). It offers the ability to obfuscate spoken words
in the game in various ways:
- Language: The language functionality defines a pseudo-language map - Language: The language functionality defines a pseudo-language map to any number of languages. The string will be obfuscated depending on a scaling that (most likely) will be input as a weighted average of the language skill of the speaker and listener.
to any number of languages. The string will be obfuscated depending - Whisper: The whisper functionality will gradually "fade out" a whisper along as scale 0-1, where the fading is based on gradually removing sections of the whisper that is (supposedly) easier to overhear (for example "s" sounds tend to be audible even when no other meaning can be determined).
on a scaling that (most likely) will be input as a weighted average of
the language skill of the speaker and listener.
- Whisper: The whisper functionality will gradually "fade out" a
whisper along as scale 0-1, where the fading is based on gradually
removing sections of the whisper that is (supposedly) easier to
overhear (for example "s" sounds tend to be audible even when no other
meaning can be determined).
### Installation ### Installation
@ -194,13 +149,7 @@ result = rplanguage.obfuscate_whisper(whisper, level=1.0)
``` ```
To set up new languages, import and use the `add_language()` To set up new languages, import and use the `add_language()` helper method in this module. This allows you to customize the "feel" of the semi-random language you are creating. Especially the `word_length_variance` helps vary the length of translated words compared to the original and can help change the "feel" for the language you are creating. You can also add your own dictionary and "fix" random words for a list of input words.
helper method in this module. This allows you to customize the
"feel" of the semi-random language you are creating. Especially
the `word_length_variance` helps vary the length of translated
words compared to the original and can help change the "feel" for
the language you are creating. You can also add your own
dictionary and "fix" random words for a list of input words.
Below is an example of "elvish", using "rounder" vowels and sounds: Below is an example of "elvish", using "rounder" vowels and sounds:
@ -249,22 +198,11 @@ rplanguage.add_language(key="elvish", phonemes=phonemes, grammar=grammar,
``` ```
This will produce a decicively more "rounded" and "soft" language than the This will produce a decicively more "rounded" and "soft" language than the default one. The few `manual_translations` also make sure to make it at least look superficially "reasonable".
default one. The few `manual_translations` also make sure to make it at least
look superficially "reasonable".
The `auto_translations` keyword is useful, this accepts either a The `auto_translations` keyword is useful, this accepts either a list or a path to a text-file (with one word per line). This listing of words is used to 'fix' translations for those words according to the grammatical rules. These translations are stored persistently as long as the language exists.
list or a path to a text-file (with one word per line). This listing
of words is used to 'fix' translations for those words according to the
grammatical rules. These translations are stored persistently as long as the
language exists.
This allows to quickly build a large corpus of translated words This allows to quickly build a large corpus of translated words that never change. This produces a language that seem moderately consistent, since words like 'the' will always be translated to the same thing. The disadvantage (or advantage, depending on your game) is that players can end up learn what words mean even if their characters don't know the langauge.
that never change. This produces a language that seem moderately
consistent, since words like 'the' will always be translated to the same thing.
The disadvantage (or advantage, depending on your game) is that players can
end up learn what words mean even if their characters don't know the
langauge.
---- ----

View file

@ -619,13 +619,7 @@ This adds an LLMClient that allows Evennia to send prompts to a LLM server (Lar
_Contribution by Griatch, 2015_ _Contribution by Griatch, 2015_
A full roleplaying emote system. Short-descriptions and recognition (only A full roleplaying emote system. Short-descriptions and recognition (only know people by their looks until you assign a name to them). Room poses. Masks/disguises (hide your description). Speak directly in emote, with optional language obscuration (words get garbled if you don't know the language, you can also have different languages with different 'sounding' garbling). Whispers can be partly overheard from a distance. A very powerful in-emote reference system, for referencing and differentiate targets (including objects).
know people by their looks until you assign a name to them). Room poses. Masks/disguises
(hide your description). Speak directly in emote, with optional language obscuration
(words get garbled if you don't know the language, you can also have different languages
with different 'sounding' garbling). Whispers can be partly overheard from a distance. A
very powerful in-emote reference system, for referencing and differentiate targets
(including objects).
[Read the documentation](./Contrib-RPSystem.md) - [Browse the Code](evennia.contrib.rpg.rpsystem) [Read the documentation](./Contrib-RPSystem.md) - [Browse the Code](evennia.contrib.rpg.rpsystem)

View file

@ -2,59 +2,25 @@
Contribution by Griatch, 2015 Contribution by Griatch, 2015
A full roleplaying emote system. Short-descriptions and recognition (only A full roleplaying emote system. Short-descriptions and recognition (only know people by their looks until you assign a name to them). Room poses. Masks/disguises (hide your description). Speak directly in emote, with optional language obscuration (words get garbled if you don't know the language, you can also have different languages with different 'sounding' garbling). Whispers can be partly overheard from a distance. A very powerful in-emote reference system, for referencing and differentiate targets (including objects).
know people by their looks until you assign a name to them). Room poses. Masks/disguises
(hide your description). Speak directly in emote, with optional language obscuration
(words get garbled if you don't know the language, you can also have different languages
with different 'sounding' garbling). Whispers can be partly overheard from a distance. A
very powerful in-emote reference system, for referencing and differentiate targets
(including objects).
The system contains of two main modules - the roleplaying emote system and the language The system contains of two main modules - the roleplaying emote system and the language obscuration module.
obscuration module.
## Roleplaying emotes ## Roleplaying emotes
This module contains the ContribRPObject, ContribRPRoom and This module contains the ContribRPObject, ContribRPRoom and ContribRPCharacter typeclasses. If you inherit your objects/rooms/character from these (or make them the defaults) from these you will get the following features:
ContribRPCharacter typeclasses. If you inherit your
objects/rooms/character from these (or make them the defaults) from
these you will get the following features:
- Objects/Rooms will get the ability to have poses and will report - Objects/Rooms will get the ability to have poses and will report the poses of items inside them (the latter most useful for Rooms).
the poses of items inside them (the latter most useful for Rooms). - Characters will get poses and also sdescs (short descriptions) that will be used instead of their keys. They will gain commands for managing recognition (custom sdesc-replacement), masking themselves as well as an advanced free-form emote command.
- Characters will get poses and also sdescs (short descriptions)
that will be used instead of their keys. They will gain commands
for managing recognition (custom sdesc-replacement), masking
themselves as well as an advanced free-form emote command.
In more detail, This RP base system introduces the following features In more detail, This RP base system introduces the following features to a game, common to many RP-centric games:
to a game, common to many RP-centric games:
- emote system using director stance emoting (names/sdescs). - emote system using director stance emoting (names/sdescs). This uses a customizable replacement noun (/me, @ etc) to represent you in the emote. You can use /sdesc, /nick, /key or /alias to reference objects in the room. You can use any number of sdesc sub-parts to differentiate a local sdesc, or use /1-sdesc etc to differentiate them. The emote also identifies nested says and separates case.
This uses a customizable replacement noun (/me, @ etc) to - sdesc obscuration of real character names for use in emotes and in any referencing such as object.search(). This relies on an SdescHandler `sdesc` being set on the Character and makes use of a custom Character.get_display_name hook. If sdesc is not set, the character's `key` is used instead. This is particularly used in the emoting system.
represent you in the emote. You can use /sdesc, /nick, /key or - recog system to assign your own nicknames to characters, can then be used for referencing. The user may recog a user and assign any personal nick to them. This will be shown in descriptions and used to reference them. This is making use of the nick functionality of Evennia.
/alias to reference objects in the room. You can use any
number of sdesc sub-parts to differentiate a local sdesc, or
use /1-sdesc etc to differentiate them. The emote also
identifies nested says and separates case.
- sdesc obscuration of real character names for use in emotes
and in any referencing such as object.search(). This relies
on an SdescHandler `sdesc` being set on the Character and
makes use of a custom Character.get_display_name hook. If
sdesc is not set, the character's `key` is used instead. This
is particularly used in the emoting system.
- recog system to assign your own nicknames to characters, can then
be used for referencing. The user may recog a user and assign
any personal nick to them. This will be shown in descriptions
and used to reference them. This is making use of the nick
functionality of Evennia.
- masks to hide your identity (using a simple lock). - masks to hide your identity (using a simple lock).
- pose system to set room-persistent poses, visible in room - pose system to set room-persistent poses, visible in room descriptions and when looking at the person/object. This is a simple Attribute that modifies how the characters is viewed when in a room as sdesc + pose.
descriptions and when looking at the person/object. This is a - in-emote says, including seamless integration with language obscuration routine (such as contrib/rplanguage.py)
simple Attribute that modifies how the characters is viewed when
in a room as sdesc + pose.
- in-emote says, including seamless integration with language
obscuration routine (such as contrib/rplanguage.py)
### Installation: ### Installation:
@ -81,7 +47,7 @@ the typeclasses in this module:
```python ```python
# in mygame/typeclasses/characters.py # in mygame/typeclasses/characters.py
from evennia.contrib.rpg import ContribRPCharacter from evennia.contrib.rpg.rpsystem import ContribRPCharacter
class Character(ContribRPCharacter): class Character(ContribRPCharacter):
# ... # ...
@ -91,7 +57,7 @@ class Character(ContribRPCharacter):
```python ```python
# in mygame/typeclasses/objects.py # in mygame/typeclasses/objects.py
from evennia.contrib.rpg import ContribRPObject from evennia.contrib.rpg.rpsystem import ContribRPObject
class Object(ContribRPObject): class Object(ContribRPObject):
# ... # ...
@ -101,7 +67,7 @@ class Object(ContribRPObject):
```python ```python
# in mygame/typeclasses/rooms.py # in mygame/typeclasses/rooms.py
from evennia.contrib.rpg import ContribRPRoom from evennia.contrib.rpg.rpsystem import ContribRPRoom
class Room(ContribRPRoom): class Room(ContribRPRoom):
# ... # ...
@ -119,44 +85,33 @@ Example for your character:
Examples: Examples:
> look > look
Tavern Tavern
The tavern is full of nice people The tavern is full of nice people
*A tall man* is standing by the bar. *A tall man* is standing by the bar.
Above is an example of a player with an sdesc "a tall man". It is also Above is an example of a player with an sdesc "a tall man". It is also an example of a static *pose*: The "standing by the bar" has been set by the player of the tall man, so that people looking at him can tell at a glance what is going on.
an example of a static *pose*: The "standing by the bar" has been set
by the player of the tall man, so that people looking at him can tell
at a glance what is going on.
> emote /me looks at /Tall and says "Hello!" > emote /me looks at /Tall and says "Hello!"
I see: I see:
Griatch looks at Tall man and says "Hello". Griatch looks at Tall man and says "Hello".
Tall man (assuming his name is Tom) sees: Tall man (assuming his name is Tom) sees:
The godlike figure looks at Tom and says "Hello". The godlike figure looks at Tom and says "Hello".
Note that by default, the case of the tag matters, so `/tall` will Note that by default, the case of the tag matters, so `/tall` will lead to 'tall man' while `/Tall` will become 'Tall man' and /TALL becomes /TALL MAN. If you don't want this behavior, you can pass case_sensitive=False to the `send_emote` function.
lead to 'tall man' while `/Tall` will become 'Tall man' and /TALL
becomes /TALL MAN. If you don't want this behavior, you can pass
case_sensitive=False to the `send_emote` function.
## Language and whisper obfuscation system ## Language and whisper obfuscation system
This module is intented to be used with an emoting system (such as This module is intented to be used with an emoting system (such as `contrib/rpg/rpsystem.py`). It offers the ability to obfuscate spoken words in the game in various ways:
`contrib/rpg/rpsystem.py`). It offers the ability to obfuscate spoken words
in the game in various ways:
- Language: The language functionality defines a pseudo-language map - Language: The language functionality defines a pseudo-language map to any number of languages. The string will be obfuscated depending on a scaling that (most likely) will be input as a weighted average of the language skill of the speaker and listener.
to any number of languages. The string will be obfuscated depending - Whisper: The whisper functionality will gradually "fade out" a whisper along as scale 0-1, where the fading is based on gradually removing sections of the whisper that is (supposedly) easier to overhear (for example "s" sounds tend to be audible even when no other meaning can be determined).
on a scaling that (most likely) will be input as a weighted average of
the language skill of the speaker and listener.
- Whisper: The whisper functionality will gradually "fade out" a
whisper along as scale 0-1, where the fading is based on gradually
removing sections of the whisper that is (supposedly) easier to
overhear (for example "s" sounds tend to be audible even when no other
meaning can be determined).
### Installation ### Installation
@ -194,13 +149,7 @@ result = rplanguage.obfuscate_whisper(whisper, level=1.0)
``` ```
To set up new languages, import and use the `add_language()` To set up new languages, import and use the `add_language()` helper method in this module. This allows you to customize the "feel" of the semi-random language you are creating. Especially the `word_length_variance` helps vary the length of translated words compared to the original and can help change the "feel" for the language you are creating. You can also add your own dictionary and "fix" random words for a list of input words.
helper method in this module. This allows you to customize the
"feel" of the semi-random language you are creating. Especially
the `word_length_variance` helps vary the length of translated
words compared to the original and can help change the "feel" for
the language you are creating. You can also add your own
dictionary and "fix" random words for a list of input words.
Below is an example of "elvish", using "rounder" vowels and sounds: Below is an example of "elvish", using "rounder" vowels and sounds:
@ -249,19 +198,8 @@ rplanguage.add_language(key="elvish", phonemes=phonemes, grammar=grammar,
``` ```
This will produce a decicively more "rounded" and "soft" language than the This will produce a decicively more "rounded" and "soft" language than the default one. The few `manual_translations` also make sure to make it at least look superficially "reasonable".
default one. The few `manual_translations` also make sure to make it at least
look superficially "reasonable".
The `auto_translations` keyword is useful, this accepts either a The `auto_translations` keyword is useful, this accepts either a list or a path to a text-file (with one word per line). This listing of words is used to 'fix' translations for those words according to the grammatical rules. These translations are stored persistently as long as the language exists.
list or a path to a text-file (with one word per line). This listing
of words is used to 'fix' translations for those words according to the
grammatical rules. These translations are stored persistently as long as the
language exists.
This allows to quickly build a large corpus of translated words This allows to quickly build a large corpus of translated words that never change. This produces a language that seem moderately consistent, since words like 'the' will always be translated to the same thing. The disadvantage (or advantage, depending on your game) is that players can end up learn what words mean even if their characters don't know the langauge.
that never change. This produces a language that seem moderately
consistent, since words like 'the' will always be translated to the same thing.
The disadvantage (or advantage, depending on your game) is that players can
end up learn what words mean even if their characters don't know the
langauge.

View file

@ -263,6 +263,9 @@ class EvenniaTestMixin:
self.create_script() self.create_script()
self.setup_session() self.setup_session()
@override_settings(
PROTOTYPE_MODULES=["evennia.utils.tests.data.prototypes_example"], DEFAULT_HOME="#1"
)
def tearDown(self): def tearDown(self):
flush_cache() flush_cache()
try: try: