nanoMMO 0.97.8
Building an MMO: The Engineering Series
Loading...
Searching...
No Matches
nanommo Namespace Reference

Namespaces

namespace  messages_internal
namespace  testing
namespace  colors
namespace  cinema

Classes

class  FrameReader
struct  Part
struct  Sentence
class  Parts
struct  Content
struct  Features
struct  ItemTable
 The items in the items file, by id. More...
struct  MonsterTable
 The kinds of monster, by id, and where they spawn. More...
struct  NpcTable
 The kinds of NPC, by id, and where each NPC stands. More...
struct  SkillTable
struct  Place
 In metres from the middle of a land. More...
struct  Land
struct  Gate
 A ring of stones in a land, which takes players to another. More...
class  Paths
class  Grid
struct  Tree
class  Terrain
struct  Account
class  Accounts
class  Characters
struct  WorldRegistration
 A world, as it registers with Consul. More...
struct  WorldInstance
 A world instance as players reach it, and as the servers do. More...
class  Consul
struct  Copy
 A land, running: a World of it, with its NPCs in their cells. More...
class  Copies
struct  CloseStatement
 Closes a statement that's been prepared, as a unique_ptr goes. More...
struct  Result
struct  MysqlTimeouts
class  Database
class  Duels
class  Events
struct  Membership
 The guild a character is in, and its rank there. More...
struct  Left
 What leaving a guild did. More...
struct  Changed
 What a change to another member of a guild did, for the news. More...
class  Guilds
class  History
class  Inputs
struct  Cell
struct  View
 What the players in a cell get: the players, monsters and NPCs near it. More...
class  Inventory
struct  Level
class  LoginServer
class  Metrics
class  LoginMetrics
struct  Progress
 What we keep of a player from one session to the next. More...
struct  Traded
class  Players
class  Recorder
struct  RedisTimeouts
class  Redis
class  Server
class  Session
class  Storyteller
class  TokenBucket
class  Tokens
struct  SpanContext
class  Span
class  Trades
struct  War
struct  WarKill
class  Scoring
struct  Stats
struct  Player
struct  Monster
struct  Npc
struct  Notice
struct  Event
class  World
struct  Upstream
class  Gateway
struct  Handshake
 What a client's opening handshake asks for. More...
struct  Message
 A whole message, or a ping, a pong or a close. More...
class  FrameDecoder
struct  ListedWorld
class  WorldList
class  Bot
class  BotMetrics
struct  Errand
struct  Trip
 Somewhere a bot heads for, across the island. More...
struct  Side
 A bot at war is in one of two guilds, and fights the other's players. More...
struct  Hearing
class  Ambience
struct  Figure
class  Animator
struct  Atmosphere
 The sky and the light, which the shaders read each frame. More...
struct  Liquid
 What a land's sea is made of: its colours, its waves and its light. More...
struct  Look
 A land's colours: its atmosphere, and the colours that go into its meshes. More...
class  AudioDevice
class  Track
class  Clip
class  Stream
class  BagWindow
class  FollowCamera
 Follows your player around, from behind and above. More...
class  CharacterScreen
class  ChatWindow
struct  Chunk
struct  Popup
class  CombatText
struct  CompassMark
 Something the compass shows the way to. More...
class  Connection
 A world server, over TLS, with the worlds over UDP or TCP. More...
class  CraftWindow
struct  Cube
struct  Showing
 What turns on and off: the time of day, and the weather. More...
class  DeathScreen
class  DuelWindow
struct  LandSound
class  Fx
struct  GraphicsSettings
class  Gui
class  GuildWindow
class  HelpWindow
class  HeraldWindow
class  Hotbar
class  Inbox
class  Interpolation
class  Jukebox
class  Loading
class  LocalConnection
class  LoginScreen
class  LandMap
class  Menu
struct  Bend
struct  Noticed
struct  Pixel
class  Offscreen
struct  Outline
class  PlayerFrame
class  PostProcess
class  PredictedBag
class  Prediction
class  QuestWindow
class  QuestLog
class  Reactions
class  Renderer
class  RoundTrip
class  Sea
 The sea around a land, in the land's look, which moves on its own. More...
class  Servers
struct  NameplateSettings
struct  InterfaceSettings
 How the interface looks, as the player sets it. More...
struct  Settings
 What the player sets, which the client keeps between runs. More...
class  Sky
struct  SoundSettings
 How loud the game is, as the player sets it in the settings window. More...
class  Soundboard
struct  Heard
class  Variety
struct  Gait
class  Footsteps
class  Casts
class  Passage
class  Noise
class  Filter
class  Oscillator
class  TalkWindow
struct  Telegraph
class  Telegraphs
struct  Fonts
class  TradeWindow
class  TrainerWindow
class  PluralRule
class  Catalog
struct  Language
struct  Face
class  Triangles
struct  Bolt
 Where a bolt of lightning struck, for its thunder to come from. More...
class  Weather
class  WebSocket
class  Window
class  Speedometer
class  Hits

Typedefs

using TlsStream = asio::ssl::stream<asio::ip::tcp::socket>
using Statement = std::unique_ptr<MYSQL_STMT, CloseStatement>
using Cells = std::map<Cell, std::vector<uint32_t>>
 The ids of what's in each cell.
using SendSpans = std::function<absl::Status(const std::string& json)>
 Sends a batch of spans, written as OTLP's JSON, and says whether it went.
using Route = std::function<absl::StatusOr<Upstream>(std::string_view path)>
 Where a page's path leads, or why nowhere.
using WorldAddress
 Finds a world's own address by the host and port players reach it at.
using Joints = std::array<int, kJointBones.size()>
 Where a model's bones are, by joint, or -1 for one it doesn't have.
using Samples = std::vector<float>
 One channel of sound, at kRate.

Enumerations

enum class  SpanKind {
  kInternal = 1 , kServer = 2 , kClient = 3 , kProducer = 4 ,
  kConsumer = 5
}
enum class  Motion {
  kIdle , kWalk , kRun , kAttack ,
  kDead , kSkill
}
enum class  Opcode : uint8_t {
  kContinuation = 0x0 , kText = 0x1 , kBinary = 0x2 , kClose = 0x8 ,
  kPing = 0x9 , kPong = 0xA
}
enum class  Shape { kBox , kDisc , kSpire }
enum class  Pointing { kNothing , kNpc , kMonster }
 What the mouse is over in the world. More...
enum class  Ground {
  kGrass , kSand , kRock , kSnow ,
  kAsh , kStone , kWater
}
 What a foot comes down on, which is how the step sounds. More...
enum class  Surface { kSand , kGrass , kRock , kSnow }
enum class  MinimapTurn { kNorthUp , kWithCamera }

Functions

std::optional< std::string > CleanChat (std::string_view text)
int64_t NowMicros ()
std::string Header (std::size_t size)
std::string Frame (const google::protobuf::MessageLite &message)
 The size goes in front, as four bytes in network byte order.
absl::StatusOr< protocol::LoginReply > LogIn (const std::string &host, uint16_t port, asio::ssl::context &tls, const protocol::LoginRequest &request, std::chrono::milliseconds deadline)
std::string Fill (std::string_view text, std::span< const std::string > args)
Part Number (uint64_t number)
 A number, as it is.
Part Name (std::string_view name)
std::pair< std::string, std::string > Counted (const items::Item &item)
std::pair< std::string, std::string > Counted (const monsters::Kind &kind)
Part Of (const items::Item &item, uint32_t count)
Part Of (const ItemTable &items, uint32_t item, uint32_t count)
Part Of (const monsters::Kind &kind, uint32_t count)
Part Of (const npcs::Kind &kind)
Part Of (const quests::Quest &quest)
Part Of (const skills::Skill &skill)
Part Of (const factions::Faction &faction)
Part Of (items::Slot slot)
Part Of (Sentence phrase)
 A sentence inside another, which is translated on its own.
absl::Status Refusal (absl::StatusCode code, const Sentence &why)
Sentence SentenceOf (const absl::Status &status)
std::string English (const protocol::Message &message, const Content &content)
template<typename... Parts>
Sentence Msg (std::string_view text, Parts... parts)
template<typename... Parts>
Sentence MsgN (std::string_view one, std::string_view many, uint64_t count, Parts... parts)
std::string Piece (const protocol::Player &player)
std::string Piece (const protocol::Monster &monster)
std::string Piece (const protocol::Npc &npc)
std::vector< std::string > Split (const std::vector< std::string_view > &pieces, int64_t sent, std::size_t max_size)
protocol::Place InBag (uint32_t slot)
 A place in the bag, by its slot from zero.
protocol::Place Worn (items::Slot slot)
 A slot that's worn.
std::string FileSetting (const char *name, const std::string &path)
std::string Setting (const char *name, const std::string &fallback)
absl::StatusOr< asio::ssl::context > ServerTls (const std::string &certificate, const std::string &key)
absl::StatusOr< asio::ssl::context > ClientTls (const std::string &authority)
void ExpectName (TlsStream &stream, const std::string &host)
std::string HandshakeError (TlsStream &stream, const std::string &host, const std::error_code &error)
 Why a client's handshake with host failed, and what to do about it.
bool Compatible (std::string_view client, std::string_view server)
template<typename Entry>
absl::StatusOr< std::map< uint32_t, Entry > > ById (const google::protobuf::RepeatedPtrField< Entry > &entries)
template<typename Kind, typename Spawn>
absl::Status CheckSpawn (const std::map< uint32_t, Kind > &kinds, const Spawn &spawn)
 Whether a spawn names a kind we have, in a land we have.
absl::StatusOr< Content > ReadContent (const std::string &folder)
 Reads each file in the folder, or says which file is wrong, and where.
absl::Status CheckContent (const Content &content)
uint64_t ClientHash (const Content &content)
absl::StatusOr< std::map< uint32_t, factions::Faction > > ParseFactions (std::string_view text)
const factions::Faction * HeraldOf (const std::map< uint32_t, factions::Faction > &factions, uint32_t kind)
absl::Status CheckPart (const figures::Part &part)
absl::StatusOr< figures::Figures > ParseFigures (std::string_view text)
Features FeaturesOf (const figures::Figures &figures, uint32_t id)
std::vector< figures::Part > Unfold (const google::protobuf::RepeatedPtrField< figures::Part > &parts)
absl::Status AddContentGraph (const Content &content, smollergraph::Graph &graph)
absl::StatusOr< std::vector< std::string > > Unreachable (const smollergraph::Graph &graph)
absl::StatusOr< std::vector< std::string > > Cycles (const smollergraph::Graph &graph)
absl::StatusOr< ItemTable > ParseItems (std::string_view text)
uint32_t StackSize (const items::Item &item)
 How many of the item go in one slot of a bag.
uint32_t CountOf (const items::Stack &stack)
 How many are in the stack, which is one when it doesn't say.
std::string_view SlotName (items::Slot slot)
 The slot's name, as a player would say it, such as "main hand".
absl::StatusOr< MonsterTable > ParseMonsters (std::string_view text)
bool InShape (const monsters::Skill &skill, Place from, float yaw, Place place)
absl::StatusOr< NpcTable > ParseNpcs (std::string_view text)
absl::StatusOr< std::map< uint32_t, quests::Quest > > ParseQuests (std::string_view text)
absl::StatusOr< std::map< uint32_t, recipes::Recipe > > ParseRecipes (std::string_view text)
absl::StatusOr< rig::Rig > ParseRig (std::string_view text)
std::vector< rig::Joint > Skeleton (const rig::Rig &rig, int build)
absl::StatusOr< SkillTable > ParseSkills (std::string_view text)
float Eased (skills::Ease ease, float t)
float AheadAt (const skills::Effect &effect, float ms)
absl::Status ParseText (std::string_view text, google::protobuf::Message &message)
absl::StatusOr< std::string > ReadFile (const std::string &path)
int LandNamed (std::string_view name)
 Its place in the list, or the first land's for a name that isn't there.
bool IsLand (std::string_view name)
bool InGate (const Gate &gate, float x, float z)
const Gate & Twin (const Gate &gate)
 The gate in the land this one takes you to, which leads back.
const Gate & WayOut (int dungeon)
 The dungeon's way out: its first gate.
Place Arrival (const Gate &gate, float yaw)
constexpr bool GatesLeadBack ()
uint32_t Hash (uint32_t seed, int32_t x, int32_t z)
float Noise (uint32_t seed, float x, float z)
 Value noise: from -1 to 1, random at whole numbers, and smooth between them.
float Fractal (uint32_t seed, float x, float z, int octaves)
absl::Status CheckUsername (std::string_view username)
 An InvalidArgument error says what's wrong, in words for the player.
absl::Status CheckPassword (std::string_view password)
std::string InstanceId (const WorldRegistration &world)
std::string Row (const Event &event, const Content &content, std::string_view world, absl::Time time)
bool ForAnalytics (Event::Kind kind)
absl::Status CheckGuildName (std::string_view name)
absl::StatusOr< Left > LeaveGuild (Database &database, uint32_t player)
absl::Status DoItem (World &land, uint32_t id, const protocol::ItemAction &action)
absl::Status DoCraft (World &land, uint32_t id, const protocol::CraftAction &action)
Cell CellOf (float x, float z)
bool Near (Cell from, Cell to)
std::map< Cell, View > Views (const std::map< uint32_t, Player > &players, const std::map< uint32_t, Monster > &monsters, const Cells &npcs)
template<typename Unit>
Cells CellsOf (const std::map< uint32_t, Unit > &units)
uint64_t NewSerial ()
Level LevelFor (uint32_t experience)
int MaxHealth (int level)
int ExtraDamage (int level)
 What a level adds to the damage of the weapon a player holds.
absl::Status Listen (asio::ip::tcp::acceptor &acceptor, uint16_t port)
 Opens the acceptor on the port, on all addresses, and starts listening.
absl::Status Bind (asio::ip::udp::socket &socket, uint16_t port)
 Opens the socket on the port, on all addresses, for datagrams.
absl::Status ListenAndBind (asio::ip::tcp::acceptor &acceptor, asio::ip::udp::socket &socket, std::span< const uint16_t > ports)
const char * Outcome (const absl::StatusOr< protocol::LoginReply > &handled)
absl::StatusOr< protocol::LoginReply > HandleLogin (const protocol::LoginRequest &request, Accounts &accounts, Tokens &tokens, Characters &characters)
Monster MonsterOf (const monsters::Kind &kind, float x, float z)
void SpawnMonsters (World &land, int index, const MonsterTable &table)
std::vector< std::pair< float, float > > Camps (const Terrain &terrain, int count)
std::chrono::nanoseconds RandomRest (std::mt19937 &random)
void Wander (Monster &monster, const Terrain &terrain, std::chrono::nanoseconds time, std::mt19937 &random)
uint32_t Spot (const Monster &monster, const std::map< uint32_t, Player > &players)
void Hunt (Monster &monster, const std::map< uint32_t, Player > &players, const Terrain &terrain, std::chrono::nanoseconds time, std::mt19937 &random)
void Revive (Monster &monster, std::chrono::nanoseconds time, std::mt19937 &random)
void SpawnNpcs (World &land, int index, const NpcTable &table)
absl::StatusOr< std::string > HashPassword (std::string_view password)
bool VerifyPassword (const std::string &hash, std::string_view password)
protocol::Motion ToProtocol (Motion motion)
protocol::Player ToProtocol (uint32_t id, const Player &player)
protocol::Monster ToProtocol (uint32_t id, const Monster &monster)
protocol::Npc ToProtocol (uint32_t id, const Npc &npc)
protocol::World YouIn (uint32_t id, const Player &player, uint32_t seed, int land, std::optional< uint32_t > acked)
protocol::World BagOf (const Player &player)
 Their bag, and their quests, each as it goes when it's changed.
protocol::World QuestsOf (const Player &player)
std::optional< protocol::Event > ForPlayers (const Event &event)
std::optional< std::string > StoryPrompt (std::string_view words)
std::vector< std::string > StoryLines (std::string_view story)
absl::StatusOr< std::chrono::nanoseconds > TickInterval (int ticks_per_second)
std::chrono::steady_clock::time_point NextTick (std::chrono::steady_clock::time_point due, std::chrono::steady_clock::time_point now, std::chrono::nanoseconds interval)
std::string RandomHex ()
std::string Traceparent (const SpanContext &context)
absl::StatusOr< SpanContext > ParseTraceparent (std::string_view traceparent)
SendSpans PostTo (const std::string &endpoint)
void StartTracing (std::string service, SendSpans send, prometheus::Registry *registry)
void StopTracing ()
Span StartSpan (std::string_view name, SpanKind kind)
Span StartSpan (std::string_view name, SpanKind kind, const SpanContext &parent, absl::Time start)
std::string TraceField ()
bool InTrace ()
Span StartChildSpan (std::string_view name, SpanKind kind)
void Walk (const Terrain &terrain, float &x, float &z, float to_x, float to_z)
void WalkAlong (const Terrain &terrain, float &x, float &z, float direction_x, float direction_z, bool run, float seconds)
protocol::Sky SkyAt (int land, int64_t unix_ms)
int64_t UnixMs ()
 Now, by the wall clock, in milliseconds since 1970.
int MaxHealthOf (const Player &player)
Part Of (const Npc &npc)
 An NPC, by its kind, for a sentence, with its English name.
uint32_t MainHandOf (const Player &player)
std::vector< uint32_t > WornOf (const Player &player)
Route Routes (Upstream login, WorldAddress world_address)
absl::StatusOr< Handshake > ParseHandshake (std::string_view request)
std::string AcceptKey (std::string_view key)
std::string Accept (std::string_view key)
 The server's answer that switches the connection over to WebSocket.
std::string Refuse (int status, std::string_view why)
 An HTTP answer that turns the connection down, with why in its body.
std::string ServerFrame (Opcode opcode, std::string_view payload)
 A frame as the server sends it: whole, and never masked.
std::string ClientFrame (Opcode opcode, std::string_view payload, uint32_t mask, bool fin)
std::chrono::milliseconds Backoff (int failed, std::mt19937 &random)
std::optional< protocol::ItemAction > Tend (const ItemTable &items, const protocol::Inventory &bag, int health, int max_health, bool can_drink)
uint32_t FactionFor (const Content &content, uint32_t seed)
std::optional< Errand > Oath (const Content &content, uint32_t faction, const protocol::World &seen, int land)
bool Sworn (const protocol::World &seen)
std::optional< Errand > NextErrand (const Content &content, const protocol::Quests &quests, const protocol::World &seen, float x, float z)
bool Dead (const protocol::World &seen, uint32_t monster)
protocol::Input RandomDirection (std::mt19937 &random)
std::chrono::milliseconds RandomHold (std::mt19937 &random)
Place RandomGate (std::mt19937 &random, int land)
 One of the land's gates, at random, as players go through each of them.
Trip RandomTrip (std::mt19937 &random, const Place &gate)
std::optional< protocol::Input > Travel (Trip &trip, float x, float z)
std::optional< protocol::Input > StepOut (const MonsterTable &table, const protocol::World &world, float x, float z)
std::optional< protocol::GuildAction > Enlist (const Side &side, const protocol::Guild &guild, std::size_t &next)
uint32_t NearestEnemy (const Side &side, const protocol::World &seen, float x, float z)
Samples ThunderSound (float metres, uint32_t seed)
 A bolt's thunder: a crack when it's near, then a long low roll.
Hearing HearingOf (int land, const protocol::Sky &sky, bool by_water, bool weather)
uint64_t Who (const Figure &figure)
Features FeaturesOf (const figures::Figures &figures, const protocol::Looks &looks)
std::string MusicFolder ()
std::optional< Samples > LoadMono (const std::string &path)
 The same, with its two channels as one.
void UseRecordings (Ambience &ambience)
std::string SoundsFolder ()
 Where the recorded sounds are, beside the music.
std::optional< std::pair< Samples, Samples > > LoadStereo (const std::string &path)
std::vector< std::string > ItemLines (const ItemTable &items, const items::Stack &stack)
std::optional< uint32_t > FirstEmptySlot (const protocol::Inventory &bag)
 The first slot of the bag with nothing in it, if it has one.
std::optional< protocol::ItemAction > QuickAction (const ItemTable &items, const protocol::Inventory &bag, const protocol::Place &place)
std::optional< protocol::ItemAction > ItemSlot (const ItemTable &items, const protocol::Inventory &bag, const protocol::Place &place, float size, bool locked)
bool StackSlot (const ItemTable &items, const items::Stack *stack, float size, uint32_t edge)
std::optional< protocol::Place > AcceptItem ()
const Figure * ShownBoss (const std::vector< Figure > &figures, uint32_t target)
void DrawBossBar (const Figure &boss, const MonsterTable &monsters)
Camera3D GameCamera ()
 Looking down at the middle of the board, from above and behind.
std::string MonstersFolder ()
std::string WeaponsFolder ()
std::string ContentFolder ()
std::optional< std::string > GuildLine (std::string_view typed)
std::optional< std::string > TradeName (std::string_view typed)
std::optional< std::string > WarName (std::string_view typed)
std::optional< protocol::DuelAction > DuelLine (std::string_view typed)
std::vector< Chunk > LoadChunks (const Terrain &terrain, const Look &look, const std::vector< Face > &tree, Shader shader)
void UnloadChunks (std::vector< Chunk > &chunks)
bool InSight (const BoundingBox &box, Vector3 eye, const Matrix &view_projection, float farthest)
void DrawCombatText (const CombatText &text, const std::vector< Figure > &figures, const Camera3D &camera)
 Draws each over the figure it's about, rising and fading as it ages.
float Bearing (Vector3 from, Vector3 to)
 Which way a place is from another, the same way.
float Heading (const Camera3D &camera)
std::optional< float > CompassAt (float heading, float bearing, float span)
std::vector< CompassMark > CompassMarks (const std::vector< Figure > &figures, int land, uint32_t target, std::optional< Vector3 > destination)
void DrawCompass (float heading, const std::vector< CompassMark > &marks)
uint32_t HowMany (const protocol::Inventory &bag, uint32_t item)
bool CanMake (const recipes::Recipe &recipe, const protocol::Inventory &bag, int level)
float MadeShare (const recipes::Recipe &recipe, uint32_t done)
Triangles Disc ()
 A disc a unit across and a unit tall, around its middle, with flat sides.
Triangles Spire ()
void UpdateCursor (Pointing pointing)
float Darkness (float day)
std::array< float, 3 > SunAt (float day)
Atmosphere AtmosphereUnder (int land, const protocol::Sky &sky, const Showing &showing)
uint32_t CountdownSeconds (uint32_t milliseconds)
void Dress (Model &model, const std::vector< figures::Part > &parts, float metre)
Mesh Parts (const Model &model, const std::vector< figures::Part > &parts, float metre)
Mesh Hull (const Model &model, const std::vector< figures::Part > &parts, float metre)
Ground GroundAt (const Terrain &terrain, int land, float x, float z)
 What's underfoot there: the water we wade in, or the land's surface.
Samples Step (Ground ground, uint32_t seed)
float Coldness (uint32_t color)
Samples FxSound (const skills::Fx &fx, uint32_t seed)
 The sound of one of a skill's fx, from when it starts.
Samples SkillSound (const skills::Look &look, uint32_t seed, bool target)
Samples Departure (uint32_t seed)
 Going through a gate: a rush up, as the screen covers the world.
Samples Arrival (int land)
 Coming out into a land: its chord, struck like bells.
std::vector< Cube > GateCubes (const Terrain &terrain, int land)
Shader LoadGlsl (const char *vertex, const char *fragment)
Surface SurfaceAt (float height, float up)
Color GroundColor (const Look &look, float height, float up)
 The surface's colour in the look.
void AddGround (Triangles &triangles, const Terrain &terrain, const Look &look, int left, int top, int cells)
const char * RankName (protocol::Rank rank)
 What a rank is called: Leader, Officer or Member.
std::string TimeLeft (uint32_t seconds)
 How long a war has left, in minutes and seconds, such as 29:05.
std::string Icon (uint32_t code)
bool Typing ()
Vector3 Movement ()
 x is to the right and z is towards the camera, each -1, 0 or 1.
bool Running ()
bool Attacking ()
std::optional< int > HotbarKey ()
bool ClickedWorld ()
float CameraTurn (float seconds)
float CameraTilt ()
float CameraZoom ()
void DrawLoadingScreen (float cover, const std::array< float, 3 > &sky, const std::string &title, const std::string &line)
Image DrawLand (const Terrain &terrain, int land)
void BuildKeys ()
std::string Translated (const protocol::Message &message, const Content &content)
std::string Translated (const protocol::Message &message)
 One from the login server, which names nothing of the content's.
Joints FindJoints (const Model &model)
Bend BendAt (const skills::Move &move, float ms)
 The move, ms into it, between the keys either side.
void Turn (const Bend &bend, const Joints &joints, float metre, const ModelSkeleton &skeleton, Transform *pose)
void Apply (const Bend &bend, const Joints &joints, float metre, Model &model)
float Above (const Figure &figure)
 In metres above a figure's feet, where its nameplate goes.
std::optional< Color > FactionMark (const Figure &figure)
bool HasNameplate (const Figure &figure)
bool ShowsName (const Figure &figure, const Noticed &noticed)
void DrawNameplates (const std::vector< Figure > &figures, const Camera3D &camera, const std::map< uint32_t, Telegraph > &telegraphs, std::string_view enemy, const Noticed &noticed)
const char * NameOf (const items::Item &item)
const char * NameOf (const skills::Skill &skill)
const char * NameOf (const monsters::Kind &kind)
const char * NameOf (const npcs::Kind &kind)
const char * NameOf (const quests::Quest &quest)
const char * NameOf (const recipes::Recipe &recipe)
const char * NameOf (const factions::Faction &faction)
const char * NameOf (const figures::Hair &hair)
const char * NameOf (const rig::Build &build)
const char * NameOf (uint32_t kind, const monsters::Skill &skill)
 A monster's skill, which is numbered among its kind's: "monster 4 skill 1".
const char * TextOf (const quests::Quest &quest)
 What a quest's giver says, giving it.
const char * NameOf (items::Slot slot)
std::string NameOf (const monsters::Kind &kind, uint32_t count)
std::string NameOf (const items::Item &item, uint32_t count)
std::string LandName (std::string_view land)
std::ostream & operator<< (std::ostream &out, const Pixel &pixel)
void DrawOutline (const Model &model, const Matrix &transform, Shader shader)
const Figure * PickNpc (const std::vector< Figure > &figures, const Ray &ray, Vector3 you)
bool Enemy (const Figure &figure, std::string_view enemy)
const Figure * PickMonster (const std::vector< Figure > &figures, const Ray &ray, uint32_t opponent, std::string_view enemy)
const Figure * PickAnyone (const std::vector< Figure > &figures, const Ray &ray)
bool Picked (const Figure &figure, uint32_t target, uint32_t target_player)
std::optional< Vector3 > PickGround (const Terrain &terrain, const Ray &ray)
void DrawTargetFrame (const std::vector< Figure > &figures, uint32_t target, uint32_t target_player)
protocol::World Predicted (const protocol::World &world, const Prediction &prediction, float direction_x, float direction_z, bool run)
void MarkQuestGivers (std::vector< Figure > &figures, const Content &content, const protocol::Quests &yours)
void DrawQuestTracker (const Content &content, const protocol::Quests &yours, float top)
Model RigModel (const std::vector< rig::Joint > &joints)
ModelAnimation * Bake (const rig::Rig &rig, const Model &model, int *count)
float DrawRoundTrip (float milliseconds, float top)
Color ShirtColor (uint32_t shirt)
Color PlayerColor (uint32_t id)
bool CanReachServers ()
 Whether this build can reach the servers at all: a browser's can't.
std::string SettingsPath ()
absl::StatusOr< Settings > LoadSettings (const std::string &path)
absl::Status SaveSettings (const std::string &path, const Settings &player)
float Gain (float slider)
Heard Hear (Vector3 source, Vector3 ears, Vector3 right)
std::array< float, 2 > Footfalls (const ModelAnimation &clip, int left, int right)
float Envelope (float t, float attack, float decay)
int SamplesIn (float seconds)
 The seconds, as a count of samples.
void Mix (Samples &mix, const Samples &sound, float at, float gain)
float Peak (const Samples &samples)
 The loudest sample, whichever way it goes.
void Normalize (Samples &samples, float peak)
 Louder or quieter, so that the loudest sample is at the peak.
void FadeOut (Samples &samples)
void Limit (Samples &samples)
ImU32 Faded (ImU32 color, float share)
 The same colour, with its alpha times the share.
const Fonts & GetFonts ()
void LoadFonts (const std::string &folder)
std::string FontFolder ()
 Where the client's fonts are, next to it.
float InterfaceScale (float height, float player)
float UiScale ()
void ApplyTheme (float scale)
 ImGui's style in our colours, with its sizes and its text at the scale.
void PathPanel (ImDrawList *draw, ImVec2 min, ImVec2 max, float cut)
 A panel's shape: a rectangle with its corners cut off.
void DrawDiamond (ImDrawList *draw, ImVec2 centre, float radius, ImU32 fill, ImU32 outline)
 A diamond, filled, with an outline.
void DrawPanel (ImDrawList *draw, ImVec2 min, ImVec2 max, float alpha)
void DrawDivider (ImDrawList *draw, ImVec2 left, float width)
void DrawShadowedText (ImDrawList *draw, ImFont *font, float size, ImVec2 at, ImU32 color, const char *text)
 Text with a shadow under it.
void DrawGradientText (ImDrawList *draw, ImFont *font, float size, ImVec2 at, ImU32 top, ImU32 bottom, const char *text)
void DrawTitle (ImDrawList *draw, ImVec2 top_centre, float size, const char *text)
 A title in carved gold capitals, centred on the point at its top.
std::string Shown (const char *label)
 The part of an ImGui label that's shown: what's before any "##".
bool BeginPanel (const char *name, bool *open, ImGuiWindowFlags flags, float alpha)
void EndPanel ()
bool GameButton (const char *label, ImVec2 size, bool primary, bool enabled)
void DrawBar (ImDrawList *draw, ImVec2 min, ImVec2 max, float share, ImU32 color, ImU32 dark, const char *text)
void DrawSlot (ImDrawList *draw, ImVec2 min, ImVec2 max, ImU32 edge)
void DrawRoundButton (ImDrawList *draw, ImVec2 centre, float radius, const char *icon, bool hovered, bool on)
void DrawSlotIcon (ImDrawList *draw, ImVec2 min, ImVec2 max, const char *icon, ImU32 color, float alpha=1.0f)
 An icon in the middle of a slot, in its colour, on a glow of that colour.
void DrawDragged (const char *icon, ImU32 color, float size, ImVec2 grab)
void DrawBackdrop (ImDrawList *draw, ImVec2 size, float time)
void DrawLogo (ImDrawList *draw, ImVec2 top_centre, float size)
float Ui (float points)
ImVec2 Ui (ImVec2 points)
protocol::TradeOffer OfferOf (const protocol::TradeSide &side)
std::string Pseudo (std::string_view english)
 The English made over for the pseudo-language: "[Șéțțîñgș ~~~]".
std::string LanguageFolder ()
 Where the PO files are, next to the client.
absl::Status UseLanguage (std::string_view code, const std::string &folder)
const char * Tr (const char *text)
const char * Tr (std::string_view context, const char *text)
const char * TrN (const char *one, const char *many, uint64_t n)
 The form for the count: in English, one for 1 and many for the rest.
const char * TrN (std::string_view context, const char *one, const char *many, uint64_t n)
const char * TrLabel (const char *label)
constexpr const char * N_ (const char *text)
constexpr const char * N_ (const char *, const char *text)
std::string TreesFolder ()
std::vector< Face > LoadFaces (const std::string &path)
Matrix TreeTransform (const Tree &tree, const Terrain &terrain)
 Sizes the model, turns it, and stands it on the ground.
void AddFaces (Triangles &triangles, const std::vector< Face > &faces, const Matrix &transform, Color tint)
Vector3 FaceNormal (Vector3 a, Vector3 b, Vector3 c)
absl::StatusOr< protocol::LoginReply > AskOverWebSocket (const std::string &url, const protocol::LoginRequest &request)
 The login server's answer to the request, through the gateway at url.

Variables

constexpr std::size_t kMaxChatLength = 200
constexpr std::size_t kHeaderSize = 4
constexpr std::size_t kMaxMessageSize = 64 * 1024
 Anything bigger is garbage. Without a cap, we might buffer up to 4 GB.
constexpr int kCharactersPerWorld = 4
constexpr std::chrono::seconds kLoginDeadline {5}
constexpr std::size_t kMaxDatagramSize = 1200
constexpr std::chrono::seconds kNpcTimeout {3}
constexpr char kNewPlayer [] = "A new player"
constexpr uint32_t kBagSlots = 24
 How many slots each player's bag has.
constexpr std::chrono::milliseconds kShortestTelegraph {500}
constexpr float kTalkReach = 4.0f
constexpr std::array< Land, 3 > kLands
constexpr std::array< Gate, 4 > kGates
constexpr float kGateRadius = 1.0f
 In metres from the middle of a gate.
constexpr float kArrival = 3.0f
 Past the edge of a gate, so that players don't arrive inside it.
constexpr char kEventStream [] = "events"
constexpr float kCellSize = 32.0f
 In metres, like the client's chunks.
constexpr int kInterestCells = 2
 Cells each way, so that a player gets everyone within 64 metres.
constexpr std::chrono::milliseconds kShortestRest {2000}
constexpr std::chrono::milliseconds kLongestRest {6000}
constexpr float kCampSpacing = 30.0f
 In metres between the middles of two camps, at least.
constexpr std::size_t kStoryWords = 3
 How many words mvGPT learned to write a story from.
constexpr std::chrono::seconds kMostBehind {1}
constexpr std::size_t kMostWaitingSpans = 4096
constexpr float kWalkSpeed = 1.8f
 In tiles a second. A tile is a metre, and walking is the walk clip's speed.
constexpr float kRunSpeed = 3.1f
constexpr int64_t kDayMs = 40 * 60 * 1000
 From one midnight to the next, in milliseconds of the wall clock.
constexpr int64_t kSlotMs = 15 * 60 * 1000
constexpr int64_t kShortestSpellMs = 6 * 60 * 1000
constexpr int64_t kRampMs = 90 * 1000
 How long a spell takes to come, and to go, in milliseconds.
constexpr std::chrono::milliseconds kPushTime {200}
 How long a blow's push takes, fast at first and slowing, as a shove does.
constexpr float kGravity = 14.0f
constexpr float kPop = 2.5f
constexpr std::chrono::milliseconds kMostInAir {2000}
constexpr std::chrono::milliseconds kSteady {2000}
constexpr float kJoinTheFight = 60.0f
constexpr float kClear = 1.0f
constexpr Look kMeadows
constexpr Look kAshlands
constexpr Look kCrypt
constexpr std::array< Look, 3 > kLooks = {kMeadows, kAshlands, kCrypt}
 In the order of the lands.
constexpr float kBossBarReach = 30.0f
constexpr int kChunkCells = 16
 In cells along each side: 32 metres.
constexpr std::array< Ground, 7 > kGrounds
constexpr std::array< LandSound, 3 > kLandSounds
constexpr std::array< const char *, 13 > kJointBones
 Each joint's bone in the rig, in the order of the joints.
constexpr int kShirtColors = 6
 How many colours there are to dye a player's clothes in.
constexpr float kNear = 4.0f
 In metres: full volume this near, and nothing past far.
constexpr float kFar = 40.0f
constexpr int kRate = 44100
constexpr float kTextSize = 18.0f
 In points, at a scale of one.
constexpr std::string_view kPseudo = "pseudo"
 The pseudo-language's code: it's made from the template, nanommo.pot.
constexpr std::array< Language, 3 > kLanguages
constexpr float kTreeHeight = 5.0f
 In metres, before each tree's own scale.

Typedef Documentation

◆ Cells

using nanommo::Cells = std::map<Cell, std::vector<uint32_t>>

The ids of what's in each cell.

Definition at line 33 of file interest.h.

◆ Joints

using nanommo::Joints = std::array<int, kJointBones.size()>

Where a model's bones are, by joint, or -1 for one it doesn't have.

Definition at line 19 of file moves.h.

◆ Route

using nanommo::Route = std::function<absl::StatusOr<Upstream>(std::string_view path)>

Where a page's path leads, or why nowhere.

Definition at line 26 of file gateway.h.

◆ Samples

using nanommo::Samples = std::vector<float>

One channel of sound, at kRate.

Definition at line 14 of file synth.h.

◆ SendSpans

using nanommo::SendSpans = std::function<absl::Status(const std::string& json)>

Sends a batch of spans, written as OTLP's JSON, and says whether it went.

Definition at line 93 of file tracing.h.

◆ Statement

using nanommo::Statement = std::unique_ptr<MYSQL_STMT, CloseStatement>

Definition at line 26 of file database.h.

◆ TlsStream

using nanommo::TlsStream = asio::ssl::stream<asio::ip::tcp::socket>

Definition at line 14 of file tls.h.

◆ WorldAddress

Initial value:
std::function<absl::StatusOr<std::string>(
std::string_view public_host, uint16_t port)>

Finds a world's own address by the host and port players reach it at.

Definition at line 29 of file gateway.h.

Enumeration Type Documentation

◆ Ground

enum class nanommo::Ground
strong

What a foot comes down on, which is how the step sounds.

Enumerator
kGrass 
kSand 
kRock 
kSnow 
kAsh 
kStone 
kWater 

Definition at line 15 of file foley.h.

◆ MinimapTurn

enum class nanommo::MinimapTurn
strong

How the minimap's view is turned: north up, or with what's ahead of the camera up, as the player chooses.

Enumerator
kNorthUp 
kWithCamera 

Definition at line 23 of file map.h.

◆ Motion

enum class nanommo::Motion
strong
Enumerator
kIdle 
kWalk 
kRun 
kAttack 
kDead 
kSkill 

Definition at line 36 of file world.h.

◆ Opcode

enum class nanommo::Opcode : uint8_t
strong
Enumerator
kContinuation 
kText 
kBinary 
kClose 
kPing 
kPong 

Definition at line 40 of file websocket.h.

◆ Pointing

enum class nanommo::Pointing
strong

What the mouse is over in the world.

Enumerator
kNothing 
kNpc 
kMonster 

Definition at line 7 of file cursor.h.

◆ Shape

enum class nanommo::Shape
strong

What a cube is drawn as, at its size: a box, a round slab, or a standing stone that comes to a point.

Enumerator
kBox 
kDisc 
kSpire 

Definition at line 12 of file cube.h.

◆ SpanKind

enum class nanommo::SpanKind
strong

What a span's work is, numbered as OpenTelemetry numbers them: work inside a process, a server's answer to a request, a client's call to another service, and a message put on a queue, and taken off it.

Enumerator
kInternal 
kServer 
kClient 
kProducer 
kConsumer 

Definition at line 44 of file tracing.h.

◆ Surface

enum class nanommo::Surface
strong

What the ground is at the height, where the y of the ground's normal is up: sand by the sea, snow up high, rock where it's high or steep, and grass elsewhere.

Enumerator
kSand 
kGrass 
kRock 
kSnow 

Definition at line 15 of file ground.h.

Function Documentation

◆ Above()

float nanommo::Above ( const Figure & figure)

In metres above a figure's feet, where its nameplate goes.

Definition at line 87 of file nameplates.cc.

◆ Accept()

std::string nanommo::Accept ( std::string_view key)

The server's answer that switches the connection over to WebSocket.

Definition at line 132 of file websocket.cc.

◆ AcceptItem()

std::optional< protocol::Place > nanommo::AcceptItem ( )

Within a drag and drop target: where the item that's let go of over it was dragged from, in the bag or worn, once it's let go of.

Definition at line 396 of file bag_window.cc.

◆ AcceptKey()

std::string nanommo::AcceptKey ( std::string_view key)

The value of Sec-WebSocket-Accept for the client's key: the SHA-1 of the key and the protocol's GUID, in base 64, which shows the client that the server read its handshake.

Definition at line 123 of file websocket.cc.

◆ AddContentGraph()

absl::Status nanommo::AddContentGraph ( const Content & content,
smollergraph::Graph & graph )

Adds the content to a graph in smollerGraph: a node for each land, kind of monster, kind of NPC, quest, item, skill and faction, labelled with what it is, and a relationship for each way a player gets from one to the next, from a new player to their land, through its gates, to who's in each land, and on to what they drop, give and teach, and the factions their heralds swear players to. Each recipe is a node too, which what goes into it goes INTO, and which leads to what it makes, and a new player CRAFTS it once they reach all it takes. A quest also asks for its monster, which is what it takes to finish it, not a way to get anywhere. Or says why it can't: two things with one name, which would be one node, a name too long for a node, or a query's error.

Definition at line 142 of file graph.cc.

◆ AddFaces()

void nanommo::AddFaces ( Triangles & triangles,
const std::vector< Face > & faces,
const Matrix & transform,
Color tint )

Adds the faces, moved by the transform, with their colours multiplied by the tint.

Definition at line 78 of file trees.cc.

◆ AddGround()

void nanommo::AddGround ( Triangles & triangles,
const Terrain & terrain,
const Look & look,
int left,
int top,
int cells )

The two triangles in each cell of a square of cells, from the cell at left and top, in the look's colours, by height and slope.

Definition at line 69 of file ground.cc.

◆ AheadAt()

float nanommo::AheadAt ( const skills::Effect & effect,
float ms )

How far the skill's strides have taken the player, in metres, ms into it: from none at its start, eased towards each stride in turn, and the last's once it's done.

Definition at line 115 of file skills.cc.

◆ Apply()

void nanommo::Apply ( const Bend & bend,
const Joints & joints,
float metre,
Model & model )

Turns a model's bones, as a clip posed them, by the bend, and works out the matrices the GPU skins it with.

Definition at line 107 of file moves.cc.

◆ ApplyTheme()

void nanommo::ApplyTheme ( float at)

ImGui's style in our colours, with its sizes and its text at the scale.

Definition at line 102 of file theme.cc.

◆ Arrival() [1/2]

Place nanommo::Arrival ( const Gate & gate,
float yaw )

Where a player who goes through the gate comes out: past the middle of its twin, the way they were facing, so that they walk on out of it.

Definition at line 43 of file lands.cc.

◆ Arrival() [2/2]

Samples nanommo::Arrival ( int land)

Coming out into a land: its chord, struck like bells.

Definition at line 610 of file foley.cc.

◆ AskOverWebSocket()

absl::StatusOr< protocol::LoginReply > nanommo::AskOverWebSocket ( const std::string & url,
const protocol::LoginRequest & request )

The login server's answer to the request, through the gateway at url.

Definition at line 106 of file websocket_link.cc.

◆ AtmosphereUnder()

Atmosphere nanommo::AtmosphereUnder ( int land,
const protocol::Sky & sky,
const Showing & showing )

The land's atmosphere under the sky the server sent: its day, dawn, dusk or night, with the sun or the moon where the time puts it, and darker, greyer and nearer under the weather. A land without days, the Crypt, keeps its own night, and takes only the weather. Without the time of day, it's the land's own look.

Definition at line 237 of file daylight.cc.

◆ Attacking()

bool nanommo::Attacking ( )

Definition at line 52 of file input.cc.

◆ Backoff()

std::chrono::milliseconds nanommo::Backoff ( int failed,
std::mt19937 & random )

How long a bot waits to log in again, after failed tries that failed in a row: a second, twice that after each failure, up to thirty, and of that a random part, from half to all of it, so that bots dropped together don't all come back together, each time.

Definition at line 9 of file backoff.cc.

◆ BagOf()

protocol::World nanommo::BagOf ( const Player & player)

Their bag, and their quests, each as it goes when it's changed.

Definition at line 136 of file shown.cc.

◆ Bake()

ModelAnimation * nanommo::Bake ( const rig::Rig & rig,
const Model & model,
int * count )

The rig's motions, worked out for a model of it, as raylib's clips: the idle, the walk, the run and the death, in the protocol's order of motions, sixty frames a second. A loop's last frame is its first again, and the death's last two are where it lies. A model with its body keeps the body out of the ground as it falls. UnloadModelAnimations frees them.

Definition at line 504 of file rig.cc.

◆ Bearing()

float nanommo::Bearing ( Vector3 from,
Vector3 to )

Which way a place is from another, the same way.

Definition at line 107 of file compass.cc.

◆ BeginPanel()

bool nanommo::BeginPanel ( const char * name,
bool * open,
ImGuiWindowFlags flags = 0,
float alpha = 0.96f )

Begins a window drawn as one of our panels, with its title at the top, in the player's language, and a close button that sets open to false, if open isn't null. Always call EndPanel after it, as ImGui's End.

Definition at line 320 of file theme.cc.

◆ BendAt()

Bend nanommo::BendAt ( const skills::Move & move,
float ms )

The move, ms into it, between the keys either side.

Definition at line 49 of file moves.cc.

◆ Bind()

absl::Status nanommo::Bind ( asio::ip::udp::socket & socket,
uint16_t port )

Opens the socket on the port, on all addresses, for datagrams.

Definition at line 33 of file listen.cc.

◆ BuildKeys()

void nanommo::BuildKeys ( )

The keys, and what each does, as a table, for the settings' keys and the help.

Definition at line 82 of file menu.cc.

◆ ById()

template<typename Entry>
absl::StatusOr< std::map< uint32_t, Entry > > nanommo::ById ( const google::protobuf::RepeatedPtrField< Entry > & entries)

Items, or kinds of monster or NPC, by id, or what's wrong with an id: an id of zero, which is what protobuf gives a field we leave out, or one that two of them have.

Definition at line 19 of file checks.h.

◆ CameraTilt()

float nanommo::CameraTilt ( )

How far to tilt the camera this frame, in radians, up over the player or down towards the ground: with the mouse, dragged with the right button down.

Definition at line 89 of file input.cc.

◆ CameraTurn()

float nanommo::CameraTurn ( float seconds)

How far to turn the camera this frame, in radians: with Q and E, or the mouse, dragged with the right button down.

Definition at line 73 of file input.cc.

◆ CameraZoom()

float nanommo::CameraZoom ( )

How much closer to bring the camera this frame, as a share of its distance, from the mouse wheel.

Definition at line 97 of file input.cc.

◆ Camps()

std::vector< std::pair< float, float > > nanommo::Camps ( const Terrain & terrain,
int count )

Places for camps of monsters, which the terrain's seed picks: between the beach and the rock, well away from the middle, where the players start, and spread out over the land, kCampSpacing apart at least. As many as count, or as many as it finds room for in its tries.

Definition at line 131 of file monsters.cc.

◆ CanMake()

bool nanommo::CanMake ( const recipes::Recipe & recipe,
const protocol::Inventory & bag,
int level )

Whether a player of the level can start making the recipe, as the server would let them: it's of their level or below, and the bag has all it takes. The server checks for room, and for what's offered in a trade.

Definition at line 56 of file craft_window.cc.

◆ CanReachServers()

bool nanommo::CanReachServers ( )

Whether this build can reach the servers at all: a browser's can't.

Definition at line 73 of file servers.cc.

◆ CellOf()

Cell nanommo::CellOf ( float x,
float z )

Definition at line 20 of file interest.cc.

◆ CellsOf()

template<typename Unit>
Cells nanommo::CellsOf ( const std::map< uint32_t, Unit > & units)

Definition at line 36 of file interest.h.

◆ CheckContent()

absl::Status nanommo::CheckContent ( const Content & content)

What the whole folder can tell is wrong, and no single file can: a monster that drops an item the items file doesn't have, a trainer that teaches a skill the skills file doesn't have, a quest whose giver, monster or prize isn't in its file, a recipe that takes or makes an item that isn't, or more of one than go in a slot, a part of a figure or of an item on a joint the rig doesn't have, or a faction whose herald isn't in the NPCs file.

Definition at line 103 of file content.cc.

◆ CheckGuildName()

absl::Status nanommo::CheckGuildName ( std::string_view name)

Whether a guild may be called that: 3 to 24 letters, with single spaces between words, or an InvalidArgument error that says what's wrong.

Definition at line 138 of file guilds.cc.

◆ CheckPart()

absl::Status nanommo::CheckPart ( const figures::Part & part)

What's wrong with a part, if anything: no shape, no bone to move with, a limb with no end or no thickness, or a ball with no size.

Definition at line 24 of file figures.cc.

◆ CheckPassword()

absl::Status nanommo::CheckPassword ( std::string_view password)

Definition at line 28 of file accounts.cc.

◆ CheckSpawn()

template<typename Kind, typename Spawn>
absl::Status nanommo::CheckSpawn ( const std::map< uint32_t, Kind > & kinds,
const Spawn & spawn )

Whether a spawn names a kind we have, in a land we have.

Definition at line 37 of file checks.h.

◆ CheckUsername()

absl::Status nanommo::CheckUsername ( std::string_view username)

An InvalidArgument error says what's wrong, in words for the player.

Definition at line 13 of file accounts.cc.

◆ CleanChat()

std::optional< std::string > nanommo::CleanChat ( std::string_view text)

The line as the other players get it: control characters, such as a new line, become spaces, and the spaces at either end go. Nothing if that leaves nothing, or if the line is longer than kMaxChatLength.

Definition at line 11 of file chat.cc.

◆ ClickedWorld()

bool nanommo::ClickedWorld ( )

Whether the left button went down this frame on the world, and not on one of the GUI's windows.

Definition at line 68 of file input.cc.

◆ ClientFrame()

std::string nanommo::ClientFrame ( Opcode opcode,
std::string_view payload,
uint32_t mask,
bool fin = true )

A frame as a client sends it, masked with the mask: the tests', and anything else that talks to the gateway as a browser would.

Definition at line 154 of file websocket.cc.

◆ ClientHash()

uint64_t nanommo::ClientHash ( const Content & content)

A fingerprint of what the clients read, so that a client can tell whether a world has its content. What only the server reads, such as a weapon's damage, stays out, so that changing it doesn't need a new client.

Definition at line 232 of file content.cc.

◆ ClientTls()

absl::StatusOr< asio::ssl::context > nanommo::ClientTls ( const std::string & authority)

TLS 1.3 for a client, which trusts the certificates our authority signed, and no others.

Definition at line 41 of file tls.cc.

◆ Coldness()

float nanommo::Coldness ( uint32_t color)

How cold the fx's colour is, from -1 for red to 1 for blue: a cold one rings higher, and a warm one lower.

Definition at line 302 of file foley.cc.

◆ CompassAt()

std::optional< float > nanommo::CompassAt ( float heading,
float bearing,
float span )

Where a bearing is across the compass, while the camera looks along the heading: from -1 at the compass's left end to 1 at its right, with the heading in the middle, or none when it's further round than half the span.

Definition at line 115 of file compass.cc.

◆ CompassMarks()

std::vector< CompassMark > nanommo::CompassMarks ( const std::vector< Figure > & figures,
int land,
uint32_t target,
std::optional< Vector3 > destination )

What the compass shows the way to, from you: the monster you picked, the NPCs with a quest for you, the land's gates, each in the sky of the land it goes to, and where you're walking to.

Definition at line 125 of file compass.cc.

◆ Compatible()

bool nanommo::Compatible ( std::string_view client,
std::string_view server )

Definition at line 32 of file version.cc.

◆ ContentFolder()

std::string nanommo::ContentFolder ( )

Definition at line 114 of file characters.cc.

◆ CountdownSeconds()

uint32_t nanommo::CountdownSeconds ( uint32_t milliseconds)

The countdown's whole seconds, rounded up, so that it says 1 until the duel starts.

Definition at line 16 of file duel_window.cc.

◆ Counted() [1/2]

std::pair< std::string, std::string > nanommo::Counted ( const items::Item & item)

The two forms in English of so many of an item or of a kind of monster, a plural's, for one and for more, which the client's template has too: "a Bone" and "$0 Bones", and "$0 Skeleton" and "$0 Skeletons".

Definition at line 119 of file messages.cc.

◆ Counted() [2/2]

std::pair< std::string, std::string > nanommo::Counted ( const monsters::Kind & kind)

Definition at line 134 of file messages.cc.

◆ CountOf()

uint32_t nanommo::CountOf ( const items::Stack & stack)

How many are in the stack, which is one when it doesn't say.

Definition at line 102 of file items.cc.

◆ Cycles()

absl::StatusOr< std::vector< std::string > > nanommo::Cycles ( const smollergraph::Graph & graph)

Each item that goes back into itself through recipes, a line each, with the way round, such as "Bone goes back into itself: (Bone)-[:INTO]->...". A recipe that makes more of an item than went into it, round and round, makes it from nothing. Or the query's error.

Definition at line 293 of file graph.cc.

◆ Darkness()

float nanommo::Darkness ( float day)

How dark it is at that time of day, from 0 all day to 1 all night, going between the two at dawn and dusk.

Definition at line 227 of file daylight.cc.

◆ Dead()

bool nanommo::Dead ( const protocol::World & seen,
uint32_t monster )

Whether the world shows the monster dead, by its id. One the world doesn't have isn't, as it may be out of sight.

Definition at line 89 of file quests.cc.

◆ Departure()

Samples nanommo::Departure ( uint32_t seed)

Going through a gate: a rush up, as the screen covers the world.

Definition at line 583 of file foley.cc.

◆ Disc()

Triangles nanommo::Disc ( )

A disc a unit across and a unit tall, around its middle, with flat sides.

Definition at line 39 of file cube.cc.

◆ DoCraft()

absl::Status nanommo::DoCraft ( World & land,
uint32_t id,
const protocol::CraftAction & action )

Starts making a recipe, or stops, as the action asks, or says why not, in words for the player.

Definition at line 101 of file inputs.cc.

◆ DoItem()

absl::Status nanommo::DoItem ( World & land,
uint32_t id,
const protocol::ItemAction & action )

Moves, uses or throws away an item, as the action asks, or says why not, in words for the player.

Definition at line 85 of file inputs.cc.

◆ DrawBackdrop()

void nanommo::DrawBackdrop ( ImDrawList * draw,
ImVec2 size,
float time )

The screens before the world: the dark of a fire gone low, red at the bottom, with embers rising through it, and darker at the edges. Time is in seconds, which the embers rise by.

Definition at line 563 of file theme.cc.

◆ DrawBar()

void nanommo::DrawBar ( ImDrawList * draw,
ImVec2 min,
ImVec2 max,
float share,
ImU32 color,
ImU32 dark,
const char * text )

A bar that's full by the share, in its colour, in a dark trough with brass round it and its words in the middle.

Definition at line 452 of file theme.cc.

◆ DrawBossBar()

void nanommo::DrawBossBar ( const Figure & boss,
const MonsterTable & monsters )

The boss's bar, across the top of the screen, under the target's frame: its name, its health, with a mark where each phase after the first starts, and the phase it's in.

Definition at line 54 of file boss_bar.cc.

◆ DrawCombatText()

void nanommo::DrawCombatText ( const CombatText & text,
const std::vector< Figure > & figures,
const Camera3D & camera )

Draws each over the figure it's about, rising and fading as it ages.

Definition at line 73 of file combat_text.cc.

◆ DrawCompass()

void nanommo::DrawCompass ( float heading,
const std::vector< CompassMark > & marks )

The compass along the top of the screen: the half of the world in front of the camera, with its points, and the marks on it. The monster you picked and the quests stay at its ends while they're behind you, so that you know which way to turn.

Definition at line 166 of file compass.cc.

◆ DrawDiamond()

void nanommo::DrawDiamond ( ImDrawList * draw,
ImVec2 centre,
float radius,
ImU32 fill,
ImU32 outline )

A diamond, filled, with an outline.

Definition at line 213 of file theme.cc.

◆ DrawDivider()

void nanommo::DrawDivider ( ImDrawList * draw,
ImVec2 left,
float width )

A line that fades in from its ends, with a diamond in its middle, under a title.

Definition at line 257 of file theme.cc.

◆ DrawDragged()

void nanommo::DrawDragged ( const char * icon,
ImU32 color,
float size,
ImVec2 grab )

What the player's dragging, under the mouse, over everything else: its icon in a slot of the size, where the mouse took hold of it.

Definition at line 536 of file theme.cc.

◆ DrawGradientText()

void nanommo::DrawGradientText ( ImDrawList * draw,
ImFont * font,
float size,
ImVec2 at,
ImU32 top,
ImU32 bottom,
const char * text )

Text that goes from one colour at its top to another at its bottom, with a shadow, as titles have in gold.

Definition at line 283 of file theme.cc.

◆ DrawLand()

Image nanommo::DrawLand ( const Terrain & terrain,
int land )

The land from above, north up, a pixel a metre: its ground in the land's colours, shaded by its slopes, its sea and its trees.

Definition at line 269 of file map.cc.

◆ DrawLoadingScreen()

void nanommo::DrawLoadingScreen ( float cover,
const std::array< float, 3 > & sky,
const std::string & title,
const std::string & line )

Draws the cover over everything else, as much of it as cover says, in the sky's colour, with the title in the middle and a line under it.

Definition at line 83 of file loading.cc.

◆ DrawLogo()

void nanommo::DrawLogo ( ImDrawList * draw,
ImVec2 top_centre,
float size )

The game's name, in gold capitals, with a glow behind it, centred on the point at its top, as tall as the size.

Definition at line 606 of file theme.cc.

◆ DrawNameplates()

void nanommo::DrawNameplates ( const std::vector< Figure > & figures,
const Camera3D & camera,
const std::map< uint32_t, Telegraph > & telegraphs = {},
std::string_view enemy = {},
const Noticed & noticed = {} )

Over each figure whose name shows, its name, and its level and health, but for an NPC's, as the settings say. Under a monster's health, its skill on its way, if it has one: a bar that fills as its shape does, in its colour, and its name. The names of the players in the guild at war with yours, by its name, are red, and a player's faction, or a herald's, is a diamond of its colour before the name.

Definition at line 120 of file nameplates.cc.

◆ DrawOutline()

void nanommo::DrawOutline ( const Model & model,
const Matrix & transform,
Shader shader )

Draws a model with an outline's shader, inside out: with its front faces culled, its back faces show, behind the model.

Definition at line 11 of file outline.cc.

◆ DrawPanel()

void nanommo::DrawPanel ( ImDrawList * draw,
ImVec2 min,
ImVec2 max,
float alpha = 0.96f )

A panel, as every window has: dark, in a shape with its corners cut, a red glow under its title, and trimmed in brass with a thin light inside it.

Definition at line 223 of file theme.cc.

◆ DrawQuestTracker()

void nanommo::DrawQuestTracker ( const Content & content,
const protocol::Quests & yours,
float top )

The quests the player's on, on the right, from top down, under the minimap, with how many they've killed for each.

Definition at line 289 of file quest_window.cc.

◆ DrawRoundButton()

void nanommo::DrawRoundButton ( ImDrawList * draw,
ImVec2 centre,
float radius,
const char * icon,
bool hovered,
bool on = false )

A round button, as the chat's in the bottom left and the windows' in the bottom right are: a wine-red disc in brass, with its icon, lit while the mouse is over it, and ringed in ember while what it opens is open. Its rim reaches a little past the radius, so its window wants room round it.

Definition at line 503 of file theme.cc.

◆ DrawRoundTrip()

float nanommo::DrawRoundTrip ( float milliseconds,
float top )

The round trip, in the top right, at the top given, right-aligned, under the minimap. Returns how tall it is, for what goes under it.

Definition at line 39 of file round_trip.cc.

◆ DrawShadowedText()

void nanommo::DrawShadowedText ( ImDrawList * draw,
ImFont * font,
float size,
ImVec2 at,
ImU32 color,
const char * text )

Text with a shadow under it.

Definition at line 272 of file theme.cc.

◆ DrawSlot()

void nanommo::DrawSlot ( ImDrawList * draw,
ImVec2 min,
ImVec2 max,
ImU32 edge )

A slot, as the bag's and the hotbar's are: a dark well in brass, which a colour lights round its edge, such as gold while the mouse is over it, or green or red while something dragged over it would go there or not.

Definition at line 480 of file theme.cc.

◆ DrawSlotIcon()

void nanommo::DrawSlotIcon ( ImDrawList * draw,
ImVec2 min,
ImVec2 max,
const char * icon,
ImU32 color,
float alpha )

An icon in the middle of a slot, in its colour, on a glow of that colour.

Definition at line 519 of file theme.cc.

◆ DrawTargetFrame()

void nanommo::DrawTargetFrame ( const std::vector< Figure > & figures,
uint32_t target,
uint32_t target_player = 0 )

The monster you picked, by its id, or in a duel, the player, by theirs: its name, level and health, at the top in the middle, under the compass, while there's one.

Definition at line 182 of file player_frame.cc.

◆ DrawTitle()

void nanommo::DrawTitle ( ImDrawList * draw,
ImVec2 top_centre,
float size,
const char * text )

A title in carved gold capitals, centred on the point at its top.

Definition at line 299 of file theme.cc.

◆ Dress()

void nanommo::Dress ( Model & model,
const std::vector< figures::Part > & parts,
float metre )

Puts the parts in place of the model's meshes, each bound to its own bone alone, where the bone rests in the model's bind pose, so the model's clips pose the parts as they posed its mesh. metre is a metre in the model's units. A part on a bone the model doesn't have is left out.

Definition at line 253 of file figures.cc.

◆ DuelLine()

std::optional< protocol::DuelAction > nanommo::DuelLine ( std::string_view typed)

What a line typed in the chat does about a duel, when it starts with /duel and a space: yes or no to the one who asked, yield, or, with a name, asks that player. Nothing, for any other line.

Definition at line 76 of file chat_window.cc.

◆ Eased()

float nanommo::Eased ( skills::Ease ease,
float t )

How far from one key to the next the ease has got, t of the way there in time, both from 0 to 1.

Definition at line 104 of file skills.cc.

◆ EndPanel()

void nanommo::EndPanel ( )

Definition at line 379 of file theme.cc.

◆ Enemy()

bool nanommo::Enemy ( const Figure & figure,
std::string_view enemy )

Whether the figure is another player in the guild at war with yours, by its name, or none for no war.

Definition at line 68 of file picking.cc.

◆ English()

std::string nanommo::English ( const protocol::Message & message,
const Content & content )

A message as a client shows it in English, with the content's names from the content: what the servers' tests read of what a player hears.

Definition at line 235 of file messages.cc.

◆ Enlist()

std::optional< protocol::GuildAction > nanommo::Enlist ( const Side & side,
const protocol::Guild & guild,
std::size_t & next )

What the side's leader does about its guild next, one thing at a time: founds it, asks the enemy to war until they're at war, and then asks in the first of its side who isn't in it yet, from the recruit after the one it asked last, next, round the list. Nothing for the rest of the side, or once everyone's in.

Definition at line 15 of file war.cc.

◆ Envelope()

float nanommo::Envelope ( float t,
float attack,
float decay )

How loud a sound is, t seconds in: up from nothing over attack, then down by about two thirds each decay seconds.

Definition at line 55 of file synth.cc.

◆ ExpectName()

void nanommo::ExpectName ( TlsStream & stream,
const std::string & host )

Has a client's handshake check that the server's certificate names host, a domain name or an address, in a way HandshakeError can tell apart.

Definition at line 52 of file tls.cc.

◆ ExtraDamage()

int nanommo::ExtraDamage ( int level)

What a level adds to the damage of the weapon a player holds.

Definition at line 17 of file levels.cc.

◆ FaceNormal()

Vector3 nanommo::FaceNormal ( Vector3 a,
Vector3 b,
Vector3 c )

Pointing out of the side where the corners go anticlockwise, which is the side OpenGL draws.

Definition at line 22 of file triangles.cc.

◆ FactionFor()

uint32_t nanommo::FactionFor ( const Content & content,
uint32_t seed )

The faction a bot swears to, by its id in the factions file: each in turn, by the bot's seed, so that a crowd of bots wears all their colours. 0 for content without any.

Definition at line 12 of file factions.cc.

◆ FactionMark()

std::optional< Color > nanommo::FactionMark ( const Figure & figure)

The mark before a player's name, or a herald's, in their faction's colour, or none for one in no faction, or in one this client's content hasn't got.

Definition at line 91 of file nameplates.cc.

◆ Faded()

ImU32 nanommo::Faded ( ImU32 color,
float share )

The same colour, with its alpha times the share.

Definition at line 59 of file theme.cc.

◆ FadeOut()

void nanommo::FadeOut ( Samples & samples)

Brings the last few milliseconds down to nothing, as a sound cut off mid-wave clicks.

Definition at line 97 of file synth.cc.

◆ FeaturesOf() [1/2]

Features nanommo::FeaturesOf ( const figures::Figures & figures,
const protocol::Looks & looks )

What a player looks like, from the looks they chose: the skin, the hair colour and the hair at those places in the figures' lists, each wrapped round to what there is, so that any looks draw as someone, and the build, which the rig's builds wrap round the same way as they're drawn.

Definition at line 129 of file animator.cc.

◆ FeaturesOf() [2/2]

Features nanommo::FeaturesOf ( const figures::Figures & figures,
uint32_t id )

Definition at line 74 of file figures.cc.

◆ FileSetting()

std::string nanommo::FileSetting ( const char * name,
const std::string & path )

A file or a folder a program reads: the setting called name, if it's set, or else path in the repository the program was built from, so it runs from any folder. Where the repository hasn't got it, as in a Docker image, which leaves the repository behind, path is from the folder it runs in. A path in neither comes back from the repository, where an error should send you.

Definition at line 22 of file settings.cc.

◆ Fill()

std::string nanommo::Fill ( std::string_view text,
std::span< const std::string > args )

The text with each placeholder, $0 to $9, filled in with its arg, as absl::Substitute does, and $$ as a dollar. A placeholder without an arg comes out as nothing, as a sentence from a server can have any number.

Definition at line 87 of file messages.cc.

◆ FindJoints()

Joints nanommo::FindJoints ( const Model & model)

Definition at line 34 of file moves.cc.

◆ FirstEmptySlot()

std::optional< uint32_t > nanommo::FirstEmptySlot ( const protocol::Inventory & bag)

The first slot of the bag with nothing in it, if it has one.

Definition at line 178 of file bag_window.cc.

◆ FontFolder()

std::string nanommo::FontFolder ( )

Where the client's fonts are, next to it.

Definition at line 89 of file theme.cc.

◆ Footfalls()

std::array< float, 2 > nanommo::Footfalls ( const ModelAnimation & clip,
int left,
int right )

How far into the clip each foot comes down, from 0 to 1: where each foot's bone, left and right, drops to near its lowest. A clip without them steps at its start and halfway.

Definition at line 57 of file soundscape.cc.

◆ ForAnalytics()

bool nanommo::ForAnalytics ( Event::Kind kind)

Whether the analytics keep events of the kind. A fight is a hit a second or so for each player in it, and what the analytics count is the kills.

Definition at line 101 of file events.cc.

◆ ForPlayers()

std::optional< protocol::Event > nanommo::ForPlayers ( const Event & event)

The event as the players near it get it, or nothing for a kind they don't see, such as a quest taken.

Definition at line 151 of file shown.cc.

◆ Fractal()

float nanommo::Fractal ( uint32_t seed,
float x,
float z,
int octaves )

Octaves of noise, each twice as fine and half as strong as the one before. From -1 to 1.

Definition at line 47 of file noise.cc.

◆ Frame()

std::string nanommo::Frame ( const google::protobuf::MessageLite & message)

The size goes in front, as four bytes in network byte order.

Definition at line 14 of file framing.cc.

◆ FxSound()

Samples nanommo::FxSound ( const skills::Fx & fx,
uint32_t seed )

The sound of one of a skill's fx, from when it starts.

Definition at line 308 of file foley.cc.

◆ Gain()

float nanommo::Gain ( float slider)

The gain for a slider at that position. We hear loudness on a logarithmic scale, so the slider goes through 40 decibels, and its bottom is silence.

Definition at line 13 of file sound.cc.

◆ GameButton()

bool nanommo::GameButton ( const char * label,
ImVec2 size,
bool primary = false,
bool enabled = true )

A button with its corners cut, in a dark red, or, for what a screen is there for, such as entering the world, in the colours of a fire, with its label in the player's language. Returns whether it was clicked. A width of zero fits the label, and one below zero takes the rest of the line.

Definition at line 381 of file theme.cc.

◆ GameCamera()

Camera3D nanommo::GameCamera ( )

Looking down at the middle of the board, from above and behind.

Definition at line 23 of file camera.cc.

◆ GateCubes()

std::vector< Cube > nanommo::GateCubes ( const Terrain & terrain,
int land )

A ring of standing stones, each on a flat base and coming to a point, around each of the land's gates, and a round platform in the middle, in the colour of the sky where it takes you.

Definition at line 35 of file gate.cc.

◆ GatesLeadBack()

bool nanommo::GatesLeadBack ( )
constexpr

Each gate has a twin in the land it takes you to, which leads back, and each dungeon has a gate, which is the way out.

Definition at line 56 of file lands.h.

◆ GetFonts()

const Fonts & nanommo::GetFonts ( )

Definition at line 66 of file theme.cc.

◆ GroundAt()

Ground nanommo::GroundAt ( const Terrain & terrain,
int land,
float x,
float z )

What's underfoot there: the water we wade in, or the land's surface.

Definition at line 97 of file foley.cc.

◆ GroundColor()

Color nanommo::GroundColor ( const Look & look,
float height,
float up )

The surface's colour in the look.

Definition at line 34 of file ground.cc.

◆ GuildLine()

std::optional< std::string > nanommo::GuildLine ( std::string_view typed)

What a line typed in the chat says to the guild, when it starts with /g and a space, even if that's nothing, which the server drops, or nothing at all, for a line to the world.

Definition at line 52 of file chat_window.cc.

◆ HandleLogin()

absl::StatusOr< protocol::LoginReply > nanommo::HandleLogin ( const protocol::LoginRequest & request,
Accounts & accounts,
Tokens & tokens,
Characters & characters )

Answers a request: a login, or a new account, with a session and the account's characters, and then, with that session, a new character, a deleted one, or a token to enter a world as one, with the characters as they are after it. A player's mistake, such as a wrong password or a name that's taken, comes back as an error they can read. Returns an error status when the servers it uses can't answer, such as MySQL or Redis being down.

Definition at line 112 of file login_server.cc.

◆ HandshakeError()

std::string nanommo::HandshakeError ( TlsStream & stream,
const std::string & host,
const std::error_code & error )

Why a client's handshake with host failed, and what to do about it.

Definition at line 64 of file tls.cc.

◆ Hash()

uint32_t nanommo::Hash ( uint32_t seed,
int32_t x,
int32_t z )

A number for each point of a grid, which looks random, but is the same for the same seed and point, on any machine.

Definition at line 22 of file noise.cc.

◆ HashPassword()

absl::StatusOr< std::string > nanommo::HashPassword ( std::string_view password)

Definition at line 22 of file password.cc.

◆ HasNameplate()

bool nanommo::HasNameplate ( const Figure & figure)

Whether a figure has a nameplate over it: once its name has come, as names come once a second, and not while it's a dead monster, which there's nothing left to fight.

Definition at line 98 of file nameplates.cc.

◆ Header()

std::string nanommo::Header ( std::size_t size)

Definition at line 8 of file framing.cc.

◆ Heading()

float nanommo::Heading ( const Camera3D & camera)

Which way the camera looks, as a compass has it: in radians, clockwise from north, which is up the map, along minus z, so that east, along plus x, is a quarter turn.

Definition at line 111 of file compass.cc.

◆ Hear()

Heard nanommo::Hear ( Vector3 source,
Vector3 ears,
Vector3 right )

A sound at the source, heard by the player, at the ears, with the camera's right to their right. Past near, it falls as one over the distance, and it fades out to nothing at far.

Definition at line 21 of file soundscape.cc.

◆ HearingOf()

Hearing nanommo::HearingOf ( int land,
const protocol::Sky & sky,
bool by_water,
bool weather )

What a land sounds like under its sky: the Meadows' rain, wind, birds and crickets, the Ashlands' lava and fire, the Crypt's drips. By the sea, the rain falls on the water. Off, the weather's quiet, and the rest keeps to the time of day.

Definition at line 340 of file ambience.cc.

◆ HeraldOf()

const factions::Faction * nanommo::HeraldOf ( const std::map< uint32_t, factions::Faction > & factions,
uint32_t kind )

The faction a kind of NPC is the herald of, by the kind's id, or nullptr for one that's no herald.

Definition at line 46 of file factions.cc.

◆ HotbarKey()

std::optional< int > nanommo::HotbarKey ( )

Which of the number keys, from 1 to 9, went down this frame, as a slot from zero, or, with Shift held, from nine, for the row above.

Definition at line 54 of file input.cc.

◆ HowMany()

uint32_t nanommo::HowMany ( const protocol::Inventory & bag,
uint32_t item )

How many of the item are in the bag, in all its slots, and not worn, as a recipe takes from the bag alone.

Definition at line 46 of file craft_window.cc.

◆ Hull()

Mesh nanommo::Hull ( const Model & model,
const std::vector< figures::Part > & parts,
float metre )

The same parts for the outline, which pushes each corner out along its normal: each corner has its shape's smooth normal, so the corners where faces meet move out together, where with each face's own they'd come apart.

Definition at line 273 of file figures.cc.

◆ Hunt()

void nanommo::Hunt ( Monster & monster,
const std::map< uint32_t, Player > & players,
const Terrain & terrain,
std::chrono::nanoseconds time,
std::mt19937 & random )

Goes for the player Spot finds, and once nobody who's hurt the monster is left within its leash, forgets them. A boss goes home then, at full health and in its first phase, and nothing hurts it on its way.

Definition at line 228 of file monsters.cc.

◆ Icon()

std::string nanommo::Icon ( uint32_t code)
inline

A Font Awesome icon, by its code point, as text for ImGui. The icons are in Unicode's private use area, between U+E000 and U+F8FF, which UTF-8 writes in three bytes.

Definition at line 12 of file icon.h.

◆ InBag()

protocol::Place nanommo::InBag ( uint32_t slot)

A place in the bag, by its slot from zero.

Definition at line 7 of file places.cc.

◆ InGate()

bool nanommo::InGate ( const Gate & gate,
float x,
float z )

Definition at line 28 of file lands.cc.

◆ InShape()

bool nanommo::InShape ( const monsters::Skill & skill,
Place from,
float yaw,
Place place )

Whether the place is in the skill's shape, aimed from where the monster stood, the way it faced, as a yaw: what it lands on, and what a player steps out of.

Definition at line 172 of file monsters.cc.

◆ InSight()

bool nanommo::InSight ( const BoundingBox & box,
Vector3 eye,
const Matrix & view_projection,
float farthest )

Whether any of the box is closer to the eye than the farthest we see, and inside the view: past none of its six sides.

Definition at line 55 of file chunks.cc.

◆ InstanceId()

std::string nanommo::InstanceId ( const WorldRegistration & world)

A world runs as two instances for a moment, while one hands its players over to the other, so each instance registers under a name of its own, its world's and its port's.

Definition at line 76 of file consul.cc.

◆ InterfaceScale()

float nanommo::InterfaceScale ( float height,
float player )

How much bigger than on a screen 1080 points high the interface is drawn, for a screen this high, times the player's own scale: twice as big on a 4K screen, so that it's the same share of the screen on each, but never so small that it can't be read.

Definition at line 93 of file theme.cc.

◆ InTrace()

bool nanommo::InTrace ( )

Whether the thread has a current span: whether a call made now is made for a traced request. The tick's calls aren't, and stop at this check.

Definition at line 402 of file tracing.cc.

◆ IsLand()

bool nanommo::IsLand ( std::string_view name)

Definition at line 19 of file lands.cc.

◆ ItemLines()

std::vector< std::string > nanommo::ItemLines ( const ItemTable & items,
const items::Stack & stack )

What a tooltip says of the stack: its item's name, where it's worn, what it adds, what this one rolled, what using one does, and how many stack.

Definition at line 148 of file bag_window.cc.

◆ ItemSlot()

std::optional< protocol::ItemAction > nanommo::ItemSlot ( const ItemTable & items,
const protocol::Inventory & bag,
const protocol::Place & place,
float size,
bool locked = false )

Draws a slot of the bag, or one that's worn, of the size: the item's icon in its tint, with how many there are. A player drags an item from one slot onto another to move it, wear it or take it off, with Shift for half the stack: it follows the mouse, and each slot it's over lights green if the server would let it go there, and red if not. They double-click it to use, wear or take it off, and right-click it for a menu that throws it away too. Returns what they ask for, which the server does or refuses. A slot that's locked, as one offered in a trade is, does none of that, and shows its item faint.

Definition at line 213 of file bag_window.cc.

◆ LandName()

std::string nanommo::LandName ( std::string_view land)

A land's name, by its English one, which the servers and kLands use: one this client doesn't know stays as it is.

Definition at line 92 of file names.cc.

◆ LandNamed()

int nanommo::LandNamed ( std::string_view name)

Its place in the list, or the first land's for a name that isn't there.

Definition at line 10 of file lands.cc.

◆ LanguageFolder()

std::string nanommo::LanguageFolder ( )

Where the PO files are, next to the client.

Definition at line 570 of file translations.cc.

◆ LeaveGuild()

absl::StatusOr< Left > nanommo::LeaveGuild ( Database & database,
uint32_t player )

The character leaves their guild. When they led it, the one who's been in it longest leads it now, an officer before a member, and the last one out ends it. A NotFound error says they're in none, and FailedPrecondition that it's at war, which nobody leaves until it's over. It runs in a transaction the caller has begun: Leave's own, or a character's deletion, which calls it too, so that a guild never goes without a leader, and only if the character goes.

Definition at line 634 of file guilds.cc.

◆ LevelFor()

Level nanommo::LevelFor ( uint32_t experience)

Definition at line 5 of file levels.cc.

◆ Limit()

void nanommo::Limit ( Samples & samples)

Rounds off the loudest parts, so that a mix doesn't go past 1, where the speaker can't follow it and it crackles.

Definition at line 105 of file synth.cc.

◆ Listen()

absl::Status nanommo::Listen ( asio::ip::tcp::acceptor & acceptor,
uint16_t port )

Opens the acceptor on the port, on all addresses, and starts listening.

Definition at line 11 of file listen.cc.

◆ ListenAndBind()

absl::Status nanommo::ListenAndBind ( asio::ip::tcp::acceptor & acceptor,
asio::ip::udp::socket & socket,
std::span< const uint16_t > ports )

Listens on TCP and binds UDP on one port number, the first of ports that is free for both, where 0 is a port the system picks for TCP. What it opened for a port that didn't work, it closes again, and with none that did, it says why the last one didn't.

Definition at line 47 of file listen.cc.

◆ LoadChunks()

std::vector< Chunk > nanommo::LoadChunks ( const Terrain & terrain,
const Look & look,
const std::vector< Face > & tree,
Shader shader )

Definition at line 14 of file chunks.cc.

◆ LoadFaces()

std::vector< Face > nanommo::LoadFaces ( const std::string & path)

The model's triangles, standing on y = 0 and a metre tall, each in the colour of its texture under the middle of the face. None if the file isn't there.

Definition at line 30 of file trees.cc.

◆ LoadFonts()

void nanommo::LoadFonts ( const std::string & folder)

Loads the faces from the folder, in ImGui's font loading, with Font Awesome's icons merged into the text face after them.

Definition at line 75 of file theme.cc.

◆ LoadGlsl()

Shader nanommo::LoadGlsl ( const char * vertex,
const char * fragment )

A shader from our GLSL 3.30 sources. WebGL 2 takes GLSL ES 3.00, which has a version line of its own and needs a precision for floats and ints, so in a browser, each source gets those first. A null source is raylib's own, as with LoadShaderFromMemory.

Definition at line 32 of file glsl.cc.

◆ LoadMono()

std::optional< Samples > nanommo::LoadMono ( const std::string & path)

The same, with its two channels as one.

Definition at line 25 of file audio.cc.

◆ LoadSettings()

absl::StatusOr< Settings > nanommo::LoadSettings ( const std::string & path)

The settings in the file, with the defaults for what it doesn't have. With no file, as on a first run, they're all the defaults.

Definition at line 44 of file settings.cc.

◆ LoadStereo()

std::optional< std::pair< Samples, Samples > > nanommo::LoadStereo ( const std::string & path)

A sound file's two channels, at our rate, or nothing if there's no such file. It needs no audio device, so a film can read one too.

Definition at line 53 of file audio.cc.

◆ LogIn()

absl::StatusOr< protocol::LoginReply > nanommo::LogIn ( const std::string & host,
uint16_t port,
asio::ssl::context & tls,
const protocol::LoginRequest & request,
std::chrono::milliseconds deadline = kLoginDeadline )

Sends the request to the login server over TLS, and waits for its reply, or returns why it couldn't: DeadlineExceeded when the reply didn't come within the deadline, as from a login server that's hung.

Definition at line 26 of file login_client.cc.

◆ MadeShare()

float nanommo::MadeShare ( const recipes::Recipe & recipe,
uint32_t done )

How far what's being made has got, from 0 to 1, from how long it's been at, in milliseconds, of its recipe's seconds.

Definition at line 65 of file craft_window.cc.

◆ MainHandOf()

uint32_t nanommo::MainHandOf ( const Player & player)

What the player holds in their main hand, by its id in the items file, or zero.

Definition at line 189 of file world.cc.

◆ MarkQuestGivers()

void nanommo::MarkQuestGivers ( std::vector< Figure > & figures,
const Content & content,
const protocol::Quests & yours )

Marks each NPC who has a quest for the player: '?' for one they've done, to turn in, over '!' for one they can take.

Definition at line 269 of file quest_window.cc.

◆ MaxHealth()

int nanommo::MaxHealth ( int level)

Definition at line 15 of file levels.cc.

◆ MaxHealthOf()

int nanommo::MaxHealthOf ( const Player & player)

The most health the player can have: their level's, and what they wear adds.

Definition at line 148 of file world.cc.

◆ Mix()

void nanommo::Mix ( Samples & mix,
const Samples & sound,
float at,
float gain = 1.0f )

Adds the sound into the mix, starting at that time and at that gain, making the mix longer, if it needs to be.

Definition at line 69 of file synth.cc.

◆ MonsterOf()

Monster nanommo::MonsterOf ( const monsters::Kind & kind,
float x,
float z )

Definition at line 86 of file monsters.cc.

◆ MonstersFolder()

std::string nanommo::MonstersFolder ( )

Definition at line 106 of file characters.cc.

◆ Movement()

Vector3 nanommo::Movement ( )

x is to the right and z is towards the camera, each -1, 0 or 1.

Definition at line 24 of file input.cc.

◆ Msg()

template<typename... Parts>
Sentence nanommo::Msg ( std::string_view text,
Parts... parts )

A server's sentence, by its English, with a part for each of its placeholders, in order: a number, a Name, the content's Of, or a sentence of its own. It marks the English for the template too, as N_ marks the client's.

Definition at line 92 of file messages.h.

◆ MsgN()

template<typename... Parts>
Sentence nanommo::MsgN ( std::string_view one,
std::string_view many,
uint64_t count,
Parts... parts )

A plural: its English for one, and for any other count, which picks the form, in the client's language as TrN does.

Definition at line 100 of file messages.h.

◆ MusicFolder()

std::string nanommo::MusicFolder ( )

Definition at line 21 of file audio.cc.

◆ N_() [1/2]

const char * nanommo::N_ ( const char * ,
const char * text )
constexpr

Definition at line 120 of file translations.h.

◆ N_() [2/2]

const char * nanommo::N_ ( const char * text)
constexpr

Marks a string for the template without translating it, as gettext's N_ does, for a table that's translated where it's shown, and in a context, which Tr is given there too.

Definition at line 119 of file translations.h.

◆ Name()

Part nanommo::Name ( std::string_view name)

A name a player gave, a character's, a guild's or a world's, or a version, which stays as it is in every language.

Definition at line 113 of file messages.cc.

◆ NameOf() [1/13]

const char * nanommo::NameOf ( const factions::Faction & faction)

Definition at line 38 of file names.cc.

◆ NameOf() [2/13]

const char * nanommo::NameOf ( const figures::Hair & hair)

Definition at line 42 of file names.cc.

◆ NameOf() [3/13]

const char * nanommo::NameOf ( const items::Item & item)

The content's names, and its quests' words, in the language in use. The content keeps them in English, as ClientHash hashes them and the servers say them, so each is translated as it's shown, in a context that says what it names: by its kind and its id, such as "item 8", or, for those that have no id, its kind alone, such as "hair".

Definition at line 14 of file names.cc.

◆ NameOf() [4/13]

std::string nanommo::NameOf ( const items::Item & item,
uint32_t count )

So many of an item, "a Bone" or "3 Bones", which the template has as a plural of its own, as the English does.

Definition at line 85 of file names.cc.

◆ NameOf() [5/13]

const char * nanommo::NameOf ( const monsters::Kind & kind)

Definition at line 22 of file names.cc.

◆ NameOf() [6/13]

std::string nanommo::NameOf ( const monsters::Kind & kind,
uint32_t count )

So many of a kind of monster, "3 Skeletons", which the template has as its name after the count, with an s for more than one, as the English does.

Definition at line 78 of file names.cc.

◆ NameOf() [7/13]

const char * nanommo::NameOf ( const npcs::Kind & kind)

Definition at line 26 of file names.cc.

◆ NameOf() [8/13]

const char * nanommo::NameOf ( const quests::Quest & quest)

Definition at line 30 of file names.cc.

◆ NameOf() [9/13]

const char * nanommo::NameOf ( const recipes::Recipe & recipe)

Definition at line 34 of file names.cc.

◆ NameOf() [10/13]

const char * nanommo::NameOf ( const rig::Build & build)

Definition at line 46 of file names.cc.

◆ NameOf() [11/13]

const char * nanommo::NameOf ( const skills::Skill & skill)

Definition at line 18 of file names.cc.

◆ NameOf() [12/13]

const char * nanommo::NameOf ( items::Slot slot)

A slot of the bag, which the content's SlotName says in English, as the servers do.

Definition at line 59 of file names.cc.

◆ NameOf() [13/13]

const char * nanommo::NameOf ( uint32_t kind,
const monsters::Skill & skill )

A monster's skill, which is numbered among its kind's: "monster 4 skill 1".

Definition at line 50 of file names.cc.

◆ Near()

bool nanommo::Near ( Cell from,
Cell to )

Whether the players in one cell see what happens in the other: within kInterestCells of it each way, as they get the units there.

Definition at line 25 of file interest.cc.

◆ NearestEnemy()

uint32_t nanommo::NearestEnemy ( const Side & side,
const protocol::World & seen,
float x,
float z )

The nearest player of the enemy guild the bot at x and z can see, alive, by their id, or 0 for none.

Definition at line 43 of file war.cc.

◆ NewSerial()

uint64_t nanommo::NewSerial ( )

A serial for one of an item that doesn't stack: 64 random bits from the system, so that two items share one by chance about once in 2^64 for each pair, which is never.

Definition at line 84 of file inventory.cc.

◆ NextErrand()

std::optional< Errand > nanommo::NextErrand ( const Content & content,
const protocol::Quests & quests,
const protocol::World & seen,
float x,
float z )

What a bot does next, from what it sees: goes after the nearest boss within kJoinTheFight, as players flock to one, or else, for its quests, turns in a quest it's done, if its giver's here, or goes after the nearest monster a quest it's on asks for, or takes a quest it hasn't done from an NPC here who gives it. Nothing, if none of them is here.

Definition at line 30 of file quests.cc.

◆ NextTick()

std::chrono::steady_clock::time_point nanommo::NextTick ( std::chrono::steady_clock::time_point due,
std::chrono::steady_clock::time_point now,
std::chrono::nanoseconds interval )

When the tick after the one that was due at due is due, once that one's over, at now: an interval after it, so that the ticks don't drift, and a tick that ran late is caught up on. A world that's more than kMostBehind behind, as when it waited for Redis, doesn't run the ticks it missed back to back, which would play the stall over at many times the speed: those are gone, and the next is an interval from now.

Definition at line 16 of file tick.cc.

◆ Noise()

float nanommo::Noise ( uint32_t seed,
float x,
float z )

Value noise: from -1 to 1, random at whole numbers, and smooth between them.

Definition at line 34 of file noise.cc.

◆ Normalize()

void nanommo::Normalize ( Samples & samples,
float peak )

Louder or quieter, so that the loudest sample is at the peak.

Definition at line 87 of file synth.cc.

◆ NowMicros()

int64_t nanommo::NowMicros ( )
inline

The system clock, not the steady one, so that a client can compare it with its own, as long as their clocks agree.

Definition at line 11 of file clock.h.

◆ Number()

Part nanommo::Number ( uint64_t number)

A number, as it is.

Definition at line 107 of file messages.cc.

◆ Oath()

std::optional< Errand > nanommo::Oath ( const Content & content,
uint32_t faction,
const protocol::World & seen,
int land )

A trip to the faction's herald, to swear to it, where the bot sees them, or, in the land the bot's in, by its place in kLands, to where the NPCs file stands them, with no herald to swear at until it sees them there. Nothing in a land without them.

Definition at line 21 of file factions.cc.

◆ Of() [1/10]

Part nanommo::Of ( const factions::Faction & faction)

Definition at line 178 of file messages.cc.

◆ Of() [2/10]

Part nanommo::Of ( const items::Item & item,
uint32_t count = 0 )

An item, by its id: its name alone, "Bone", or, with a count, so many of it, "a Bone", "an Ash Blade" or "3 Bones".

Definition at line 139 of file messages.cc.

◆ Of() [3/10]

Part nanommo::Of ( const ItemTable & items,
uint32_t item,
uint32_t count )

So many of the item by its id, or "something" for one the table hasn't got.

Definition at line 147 of file messages.cc.

◆ Of() [4/10]

Part nanommo::Of ( const monsters::Kind & kind,
uint32_t count = 0 )

A kind of monster: its name alone, "Skeleton", or so many of it, "3 Skeletons".

Definition at line 152 of file messages.cc.

◆ Of() [5/10]

Part nanommo::Of ( const Npc & npc)

An NPC, by its kind, for a sentence, with its English name.

Definition at line 183 of file world.cc.

◆ Of() [6/10]

Part nanommo::Of ( const npcs::Kind & kind)

The rest of the content, by its id, and a slot of the bag, which have their names alone.

Definition at line 160 of file messages.cc.

◆ Of() [7/10]

Part nanommo::Of ( const quests::Quest & quest)

Definition at line 166 of file messages.cc.

◆ Of() [8/10]

Part nanommo::Of ( const skills::Skill & skill)

Definition at line 172 of file messages.cc.

◆ Of() [9/10]

Part nanommo::Of ( items::Slot slot)

Definition at line 184 of file messages.cc.

◆ Of() [10/10]

Part nanommo::Of ( Sentence phrase)

A sentence inside another, which is translated on its own.

Definition at line 190 of file messages.cc.

◆ OfferOf()

protocol::TradeOffer nanommo::OfferOf ( const protocol::TradeSide & side)

What a side of a trade offers, as an offer that asks for it again: its places in the bag, in order, and its gold.

Definition at line 46 of file trade_window.cc.

◆ operator<<()

std::ostream & nanommo::operator<< ( std::ostream & out,
const Pixel & pixel )

Definition at line 5 of file offscreen.cc.

◆ Outcome()

const char * nanommo::Outcome ( const absl::StatusOr< protocol::LoginReply > & handled)

What came of a request, for the metrics: "ok", "refused" when the reply says why not, as for a wrong password, which is the player's mistake, or "failed" when the servers couldn't answer it.

Definition at line 105 of file login_server.cc.

◆ ParseFactions()

absl::StatusOr< std::map< uint32_t, factions::Faction > > nanommo::ParseFactions ( std::string_view text)

The factions in text format, by id, or what's wrong with them: a field factions.proto doesn't have, a faction with no id or with another's, one with no colour or no herald, or two with one herald.

Definition at line 14 of file factions.cc.

◆ ParseFigures()

absl::StatusOr< figures::Figures > nanommo::ParseFigures ( std::string_view text)

The figures in text format, or what's wrong with them: a field figures.proto doesn't have, or a part of the body or of a way to wear the hair that's wrong.

Definition at line 50 of file figures.cc.

◆ ParseHandshake()

absl::StatusOr< Handshake > nanommo::ParseHandshake ( std::string_view request)

The client's opening handshake, an HTTP GET up to its blank line, or why it isn't one: the upgrade to websocket, version 13 and a key, as RFC 6455 has them.

Definition at line 77 of file websocket.cc.

◆ ParseItems()

absl::StatusOr< ItemTable > nanommo::ParseItems ( std::string_view text)

The items in text format, or what's wrong with them: a field items.proto doesn't have, an item with no id or with another's, or with parts that don't go together, such as a weapon that isn't held in the main hand, or a kit with an item the file doesn't have.

Definition at line 61 of file items.cc.

◆ ParseMonsters()

absl::StatusOr< MonsterTable > nanommo::ParseMonsters ( std::string_view text)

The monsters in text format, or what's wrong with them: a field monsters.proto doesn't have, a kind with no id or with another's, loot with a chance of nothing or more than one, or from more to fewer, gold from more to less, a skill with no id or with another's, with no size, a range past its size, a telegraph shorter than kShortestTelegraph, or a cooldown shorter than its telegraph, a boss whose first phase isn't from full health, or whose phases don't go down its health, use a skill it doesn't have, or call up a kind that isn't there, or none, a spawn or camps of a kind or in a land that isn't there, or a spawn whose leash reaches the middle of its land.

Definition at line 103 of file monsters.cc.

◆ ParseNpcs()

absl::StatusOr< NpcTable > nanommo::ParseNpcs ( std::string_view text)

The NPCs in text format, or what's wrong with them: a field npcs.proto doesn't have, a kind with no id or with another's, or a spawn of a kind or in a land that isn't there.

Definition at line 15 of file npcs.cc.

◆ ParseQuests()

absl::StatusOr< std::map< uint32_t, quests::Quest > > nanommo::ParseQuests ( std::string_view text)

The quests in text format, by id, or what's wrong with them: a field quests.proto doesn't have, a quest with no id or with another's, one with no giver, one that asks for no kills, or a prize of none of an item.

Definition at line 13 of file quests.cc.

◆ ParseRecipes()

absl::StatusOr< std::map< uint32_t, recipes::Recipe > > nanommo::ParseRecipes ( std::string_view text)

The recipes in text format, by id, or what's wrong with them: a field recipes.proto doesn't have, a recipe with no id or with another's, one with no level, one that takes no time, or nothing, or none of an item, or makes none.

Definition at line 14 of file recipes.cc.

◆ ParseRig()

absl::StatusOr< rig::Rig > nanommo::ParseRig ( std::string_view text)

The rig in text format, or what's wrong with it: a field rig.proto doesn't have, a joint with no name, or the name of another, a joint whose parent isn't listed before it, a second joint without one, a build that moves a joint the rig doesn't have, a walk or a run with no speed or no cycle, or whose feet are down for none of it or all of it, or an idle or a death whose keys go back in time.

Definition at line 49 of file rig.cc.

◆ ParseSkills()

absl::StatusOr< SkillTable > nanommo::ParseSkills ( std::string_view text)

The skills in text format, or what's wrong with them: a field skills.proto doesn't have, a skill with no id or with another's, one with no level, one that lands after it's over, blows, strides or a move whose keys go back in time or run on after it's over, or a starting skill, a swing or a swing it goes on into that isn't there.

Definition at line 15 of file skills.cc.

◆ ParseText()

absl::Status nanommo::ParseText ( std::string_view text,
google::protobuf::Message & message )

Parses protobuf's text format into the message, or says on which line it went wrong, such as at a field the message doesn't have.

Definition at line 32 of file text.cc.

◆ ParseTraceparent()

absl::StatusOr< SpanContext > nanommo::ParseTraceparent ( std::string_view traceparent)

The context a traceparent names, or an InvalidArgument error for one that isn't written as the standard says, or names no trace or no span.

Definition at line 274 of file tracing.cc.

◆ Parts()

Mesh nanommo::Parts ( const Model & model,
const std::vector< figures::Part > & parts,
float metre )

The parts' mesh, bound to the model's bones the way Dress binds them, for something that goes over the model's own, such as the hair.

Definition at line 268 of file figures.cc.

◆ PathPanel()

void nanommo::PathPanel ( ImDrawList * draw,
ImVec2 min,
ImVec2 max,
float cut )

A panel's shape: a rectangle with its corners cut off.

Definition at line 202 of file theme.cc.

◆ Peak()

float nanommo::Peak ( const Samples & samples)

The loudest sample, whichever way it goes.

Definition at line 79 of file synth.cc.

◆ PickAnyone()

const Figure * nanommo::PickAnyone ( const std::vector< Figure > & figures,
const Ray & ray )

The nearest figure along the ray but you, of any kind, alive or not, such as the one under the mouse, whose name shows while it's there: or nullptr.

Definition at line 82 of file picking.cc.

◆ Picked()

bool nanommo::Picked ( const Figure & figure,
uint32_t target,
uint32_t target_player )

Whether the figure is the one the player picked: the monster, by its id, or the player, in a duel or at war, by theirs, as each has ids of their own.

Definition at line 86 of file picking.cc.

◆ PickGround()

std::optional< Vector3 > nanommo::PickGround ( const Terrain & terrain,
const Ray & ray )

Where the ray first meets the ground, if it does within the farthest anyone sees, such as the spot under the mouse.

Definition at line 93 of file picking.cc.

◆ PickMonster()

const Figure * nanommo::PickMonster ( const std::vector< Figure > & figures,
const Ray & ray,
uint32_t opponent = 0,
std::string_view enemy = {} )

The nearest living monster along the ray, or in a duel, the opponent, by their id, or a player in the guild at war with yours, whom the player picks as they would a monster. Or nullptr, if there's none of them.

Definition at line 73 of file picking.cc.

◆ PickNpc()

const Figure * nanommo::PickNpc ( const std::vector< Figure > & figures,
const Ray & ray,
Vector3 you )

The nearest NPC along the ray that the player, standing at you, is near enough to talk to, learn from or take a quest from, such as the one under the mouse, or nullptr if there's none.

Definition at line 57 of file picking.cc.

◆ Piece() [1/3]

std::string nanommo::Piece ( const protocol::Monster & monster)

Definition at line 64 of file parts.cc.

◆ Piece() [2/3]

std::string nanommo::Piece ( const protocol::Npc & npc)

Definition at line 70 of file parts.cc.

◆ Piece() [3/3]

std::string nanommo::Piece ( const protocol::Player & player)

A player, a monster or an NPC in a world of its own, serialized. Protobuf reads worlds that follow each other as one, so pieces put one after another make a world.

Definition at line 58 of file parts.cc.

◆ PlayerColor()

Color nanommo::PlayerColor ( uint32_t id)

The colour a player's id picks for their clothes, when they didn't choose one: a character from before there was a colour to choose.

Definition at line 24 of file scene.cc.

◆ PostTo()

SendSpans nanommo::PostTo ( const std::string & endpoint)

Posts each batch to an OpenTelemetry collector at the endpoint, such as http://alloy:4318, at /v1/traces.

Definition at line 351 of file tracing.cc.

◆ Predicted()

protocol::World nanommo::Predicted ( const protocol::World & world,
const Prediction & prediction,
float direction_x,
float direction_z,
bool run )

The world as the server sent it, with you where the prediction draws you, and walking, running or standing as your keys say, facing the way they go, unless the server has you doing something else, such as a swing, or it steers you, when you move as it says.

Definition at line 60 of file prediction.cc.

◆ Pseudo()

std::string nanommo::Pseudo ( std::string_view english)

The English made over for the pseudo-language: "[Șéțțîñgș ~~~]".

Definition at line 520 of file translations.cc.

◆ QuestsOf()

protocol::World nanommo::QuestsOf ( const Player & player)

Definition at line 142 of file shown.cc.

◆ QuickAction()

std::optional< protocol::ItemAction > nanommo::QuickAction ( const ItemTable & items,
const protocol::Inventory & bag,
const protocol::Place & place )

What double-clicking the stack at the place does: in the bag, using it if it's used, or else wearing it if it's worn, and taking it off if it's worn now, into the first empty slot of the bag.

Definition at line 187 of file bag_window.cc.

◆ RandomDirection()

protocol::Input nanommo::RandomDirection ( std::mt19937 & random)

Definition at line 20 of file wander.cc.

◆ RandomGate()

Place nanommo::RandomGate ( std::mt19937 & random,
int land )

One of the land's gates, at random, as players go through each of them.

Definition at line 35 of file wander.cc.

◆ RandomHex()

std::string nanommo::RandomHex ( )

32 random bytes, in hex, which nobody can guess or make again: a token, a session, or a trade's id. Tokens initialises libsodium, which it needs.

Definition at line 24 of file tokens.cc.

◆ RandomHold()

std::chrono::milliseconds nanommo::RandomHold ( std::mt19937 & random)

Definition at line 30 of file wander.cc.

◆ RandomRest()

std::chrono::nanoseconds nanommo::RandomRest ( std::mt19937 & random)

Definition at line 156 of file monsters.cc.

◆ RandomTrip()

Trip nanommo::RandomTrip ( std::mt19937 & random,
const Place & gate )

A place within 170 metres of the middle, where most of the island is, or on one trip in five, the middle of the gate, which takes the bot to another land, as players go there too.

Definition at line 47 of file wander.cc.

◆ RankName()

const char * nanommo::RankName ( protocol::Rank rank)

What a rank is called: Leader, Officer or Member.

Definition at line 27 of file guild_window.cc.

◆ ReadContent()

absl::StatusOr< Content > nanommo::ReadContent ( const std::string & folder)

Reads each file in the folder, or says which file is wrong, and where.

Definition at line 64 of file content.cc.

◆ ReadFile()

absl::StatusOr< std::string > nanommo::ReadFile ( const std::string & path)

Definition at line 43 of file text.cc.

◆ Refusal()

absl::Status nanommo::Refusal ( absl::StatusCode code,
const Sentence & why )

A status that says why something was refused: in English as its message, and as a sentence, its payload, for the client to say in its player's language.

Definition at line 218 of file messages.cc.

◆ Refuse()

std::string nanommo::Refuse ( int status,
std::string_view why )

An HTTP answer that turns the connection down, with why in its body.

Definition at line 139 of file websocket.cc.

◆ Revive()

void nanommo::Revive ( Monster & monster,
std::chrono::nanoseconds time,
std::mt19937 & random )

Definition at line 293 of file monsters.cc.

◆ RigModel()

Model nanommo::RigModel ( const std::vector< rig::Joint > & joints)

A model of the joints, with no mesh yet: a bone for each joint, parent first, resting where the joint is, in metres, unturned. Dress gives it its body.

Definition at line 469 of file rig.cc.

◆ Routes()

Route nanommo::Routes ( Upstream login,
WorldAddress world_address )

The gateway's two routes: /login to the login server, and /world/<host>/<port> to a world, only where the lookup finds one, so the gateway connects pages to our servers and nothing else.

Definition at line 359 of file gateway.cc.

◆ Row()

std::string nanommo::Row ( const Event & event,
const Content & content,
std::string_view world,
absl::Time time )

An event as a row for ClickHouse: a line of JSON, as its JSONEachRow format reads them, with when it happened and in which world, and the name of what it's about, from the content.

Definition at line 77 of file events.cc.

◆ Running()

bool nanommo::Running ( )

Definition at line 48 of file input.cc.

◆ SamplesIn()

int nanommo::SamplesIn ( float seconds)

The seconds, as a count of samples.

Definition at line 65 of file synth.cc.

◆ SaveSettings()

absl::Status nanommo::SaveSettings ( const std::string & path,
const Settings & player )

Writes the settings next to the path, and renames them over it, as a rename replaces a file in one step: a crash halfway through leaves the old file whole.

Definition at line 118 of file settings.cc.

◆ SentenceOf()

Sentence nanommo::SentenceOf ( const absl::Status & status)

What a status says: a Refusal's sentence, or, from a status that isn't one, its message as it is.

Definition at line 224 of file messages.cc.

◆ ServerFrame()

std::string nanommo::ServerFrame ( Opcode opcode,
std::string_view payload )

A frame as the server sends it: whole, and never masked.

Definition at line 145 of file websocket.cc.

◆ ServerTls()

absl::StatusOr< asio::ssl::context > nanommo::ServerTls ( const std::string & certificate,
const std::string & key )

TLS 1.3 for a server, with its certificate and its private key, from PEM files.

Definition at line 26 of file tls.cc.

◆ Setting()

std::string nanommo::Setting ( const char * name,
const std::string & fallback )
inline

Definition at line 9 of file settings.h.

◆ SettingsPath()

std::string nanommo::SettingsPath ( )

Where the player's settings go: in Application Support on macOS, and in the XDG config folder elsewhere, which is ~/.config unless set.

Definition at line 34 of file settings.cc.

◆ ShirtColor()

Color nanommo::ShirtColor ( uint32_t shirt)

The colour a player chose for their clothes, the shirt-th of the players' colours, wrapped round to what there is.

Definition at line 20 of file scene.cc.

◆ Shown()

std::string nanommo::Shown ( const char * label)

The part of an ImGui label that's shown: what's before any "##".

Definition at line 308 of file theme.cc.

◆ ShownBoss()

const Figure * nanommo::ShownBoss ( const std::vector< Figure > & figures,
uint32_t target )

The boss whose bar is up: the monster you picked, if it's a boss, or else the nearest boss within kBossBarReach, while it's alive. Or nullptr.

Definition at line 29 of file boss_bar.cc.

◆ ShowsName()

bool nanommo::ShowsName ( const Figure & figure,
const Noticed & noticed )

Whether the figure's name shows: while it's pointed at or picked, and otherwise as the settings say for its kind, or for you. Over an NPC with a quest for you, its mark shows anyway, so that it can be found.

Definition at line 103 of file nameplates.cc.

◆ Skeleton()

std::vector< rig::Joint > nanommo::Skeleton ( const rig::Rig & rig,
int build )

The joints of one of the rig's builds: each mirrored one followed by its twin on the right, so each still comes after its parent, and where the build moves them.

Definition at line 101 of file rig.cc.

◆ SkillSound()

Samples nanommo::SkillSound ( const skills::Look & look,
uint32_t seed,
bool target )

All the sounds of a skill's fx, each at its time: those at the target with a monster picked, as the fx are drawn.

Definition at line 540 of file foley.cc.

◆ SkyAt()

protocol::Sky nanommo::SkyAt ( int land,
int64_t unix_ms )

The sky over a land, by its place in the lands, at a moment of the wall clock, in milliseconds since 1970. It's worked out from those two alone, so every server that runs the land agrees, even after a restart, and there's nothing to save.

Definition at line 87 of file weather.cc.

◆ SlotName()

std::string_view nanommo::SlotName ( items::Slot slot)

The slot's name, as a player would say it, such as "main hand".

Definition at line 106 of file items.cc.

◆ SoundsFolder()

std::string nanommo::SoundsFolder ( )

Where the recorded sounds are, beside the music.

Definition at line 49 of file audio.cc.

◆ SpawnMonsters()

void nanommo::SpawnMonsters ( World & land,
int index,
const MonsterTable & table )

Spawns the land's monsters from the table's spawns and camps. The index is the land's place in kLands.

Definition at line 108 of file monsters.cc.

◆ SpawnNpcs()

void nanommo::SpawnNpcs ( World & land,
int index,
const NpcTable & table )

Spawns the land's NPCs from the table, where the ground is walkable. The index is the land's place in kLands.

Definition at line 9 of file npcs.cc.

◆ Spire()

Triangles nanommo::Spire ( )

A square stone a unit across and a unit tall, around its middle, a little narrower towards the top, where it comes to a point.

Definition at line 59 of file cube.cc.

◆ Split()

std::vector< std::string > nanommo::Split ( const std::vector< std::string_view > & pieces,
int64_t sent,
std::size_t max_size = kMaxDatagramSize )

The parts of a world sent at a time, each a datagram of up to max_size bytes, packed from pieces.

Definition at line 76 of file parts.cc.

◆ Spot()

uint32_t nanommo::Spot ( const Monster & monster,
const std::map< uint32_t, Player > & players )

The player the monster goes for: the one who's hurt it most, seen or not, or else the nearest it can see, either way within its leash of its home.

Definition at line 194 of file monsters.cc.

◆ StackSize()

uint32_t nanommo::StackSize ( const items::Item & item)

How many of the item go in one slot of a bag.

Definition at line 98 of file items.cc.

◆ StackSlot()

bool nanommo::StackSlot ( const ItemTable & items,
const items::Stack * stack,
float size,
uint32_t edge = 0 )

Draws a stack, or nothing, in a slot of the size that doesn't drag: its icon, how many, and its lines when the mouse is over it, with the edge lit in the colour, if there's one. Returns whether it was clicked.

Definition at line 356 of file bag_window.cc.

◆ StartChildSpan()

Span nanommo::StartChildSpan ( std::string_view name,
SpanKind kind )

A span under the thread's current span, or one that records nothing when there's none. For calls to Redis and MySQL, which are traced when they're made for a traced request, and not when the tick makes them.

Definition at line 404 of file tracing.cc.

◆ StartSpan() [1/2]

Span nanommo::StartSpan ( std::string_view name,
SpanKind kind )

A span under the thread's current span, or the first of a new trace when there's none.

Definition at line 389 of file tracing.cc.

◆ StartSpan() [2/2]

Span nanommo::StartSpan ( std::string_view name,
SpanKind kind,
const SpanContext & parent,
absl::Time start = absl::Now() )

A span under one from another process, or the first of a new trace when the parent's no span, from start: a request's work can start before we know which trace it's part of.

Definition at line 393 of file tracing.cc.

◆ StartTracing()

void nanommo::StartTracing ( std::string service,
SendSpans send,
prometheus::Registry * registry = nullptr )

Turns tracing on for this process: from now on, its spans are the service's, and a thread of their own sends them, once a second, or as soon as there's a batch of them. With a registry, it counts the spans it drops there. Tracing is off until this is called, so tests, and a server run without a collector, record nothing.

Definition at line 371 of file tracing.cc.

◆ Step()

Samples nanommo::Step ( Ground ground,
uint32_t seed )

One footstep: the heel, then the rest of the foot. Each seed makes one a little different from the others.

Definition at line 122 of file foley.cc.

◆ StepOut()

std::optional< protocol::Input > nanommo::StepOut ( const MonsterTable & table,
const protocol::World & world,
float x,
float z )

Running out of the shape of a monster's skill on its way, while the bot at x and z is in it, or within kClear of its end, as players learn to: straight away from the monster, or out of a cone's side, where that's nearer, as it is in a narrow one. Or nothing, while it's clear of them all.

Definition at line 80 of file wander.cc.

◆ StopTracing()

void nanommo::StopTracing ( )

Sends the spans that are left, within two seconds, drops the rest, and turns tracing off. Call it once the threads that start spans have stopped.

Definition at line 387 of file tracing.cc.

◆ StoryLines()

std::vector< std::string > nanommo::StoryLines ( std::string_view story)

The story as lines of chat, each of at most kMaxChatLength bytes, broken after the last sentence that fits, or between words in a sentence that doesn't. A word longer than a line gets lines of its own, cut between two of its characters. A story that ran out of tokens stops in the middle of a sentence, so the story ends at its last full stop, or question or exclamation mark, when it has one.

Definition at line 60 of file stories.cc.

◆ StoryPrompt()

std::optional< std::string > nanommo::StoryPrompt ( std::string_view words)

mvGPT's prompt for a story with the words in it, the way it learned them: "Words: dragon, castle, gold\nStory:". It takes the first kStoryWords words, split at spaces and commas, in lowercase. Nothing if there are none.

Definition at line 44 of file stories.cc.

◆ SunAt()

std::array< float, 3 > nanommo::SunAt ( float day)

Towards the sun at that time of day: up from the east at 0.25, overhead, though a little to the south, at noon, and down in the west at 0.75.

Definition at line 232 of file daylight.cc.

◆ SurfaceAt()

Surface nanommo::SurfaceAt ( float height,
float up )

Definition at line 21 of file ground.cc.

◆ Sworn()

bool nanommo::Sworn ( const protocol::World & seen)

Whether the world shows the bot sworn to a faction, which comes with its name, once a second.

Definition at line 46 of file factions.cc.

◆ Tend()

std::optional< protocol::ItemAction > nanommo::Tend ( const ItemTable & items,
const protocol::Inventory & bag,
int health,
int max_health,
bool can_drink )

What a bot does with its bag, if anything: drinks something that heals, once it's down to half its health and can drink again, or else wears something that's worn in a slot it has free.

Definition at line 10 of file bag.cc.

◆ TextOf()

const char * nanommo::TextOf ( const quests::Quest & quest)

What a quest's giver says, giving it.

Definition at line 55 of file names.cc.

◆ ThunderSound()

Samples nanommo::ThunderSound ( float metres,
uint32_t seed )

A bolt's thunder: a crack when it's near, then a long low roll.

Definition at line 311 of file ambience.cc.

◆ TickInterval()

absl::StatusOr< std::chrono::nanoseconds > nanommo::TickInterval ( int ticks_per_second)

Returns the time between two simulation ticks, accurate to the nanosecond, when the world is updated ticks_per_second times a second. Returns an InvalidArgument error if ticks_per_second isn't positive.

Definition at line 9 of file tick.cc.

◆ TimeLeft()

std::string nanommo::TimeLeft ( uint32_t seconds)

How long a war has left, in minutes and seconds, such as 29:05.

Definition at line 38 of file guild_window.cc.

◆ ToProtocol() [1/4]

protocol::Motion nanommo::ToProtocol ( Motion motion)

Definition at line 11 of file shown.cc.

◆ ToProtocol() [2/4]

protocol::Monster nanommo::ToProtocol ( uint32_t id,
const Monster & monster )

Definition at line 58 of file shown.cc.

◆ ToProtocol() [3/4]

protocol::Npc nanommo::ToProtocol ( uint32_t id,
const Npc & npc )

Definition at line 84 of file shown.cc.

◆ ToProtocol() [4/4]

protocol::Player nanommo::ToProtocol ( uint32_t id,
const Player & player )

Definition at line 29 of file shown.cc.

◆ Tr() [1/2]

const char * nanommo::Tr ( const char * text)

The text in the language in use, or the text itself where there's no translation, which is all of them in English. The pointer lasts until the language changes, or, untranslated, as long as the text does.

Definition at line 596 of file translations.cc.

◆ Tr() [2/2]

const char * nanommo::Tr ( std::string_view context,
const char * text )

In a context, for a string that could mean one of two things, or one of the content's names, such as "item 8".

Definition at line 598 of file translations.cc.

◆ TraceField()

std::string nanommo::TraceField ( )

" trace_id=" and the trace of the thread's current span, for the end of a log line, which Grafana links to the trace, or nothing when there's none.

Definition at line 398 of file tracing.cc.

◆ Traceparent()

std::string nanommo::Traceparent ( const SpanContext & context)

The context as W3C Trace Context's traceparent writes it: 00-<trace id>--01.

Definition at line 269 of file tracing.cc.

◆ TradeName()

std::optional< std::string > nanommo::TradeName ( std::string_view typed)

Who a line typed in the chat asks to trade with, by their name, when it starts with /trade and a space, or nothing, for any other line.

Definition at line 60 of file chat_window.cc.

◆ Translated() [1/2]

std::string nanommo::Translated ( const protocol::Message & message)

One from the login server, which names nothing of the content's.

Definition at line 113 of file messages.cc.

◆ Translated() [2/2]

std::string nanommo::Translated ( const protocol::Message & message,
const Content & content )

A server's sentence in the language in use: its English translated, and what goes in it filled in, the content's names in the language too, and the names that players gave as they are. In English, it's the English the server has for it.

Definition at line 108 of file messages.cc.

◆ Travel()

std::optional< protocol::Input > nanommo::Travel ( Trip & trip,
float x,
float z )

Running towards the end of the trip, from x and z, or nothing once the bot is there, or has stopped getting closer.

Definition at line 60 of file wander.cc.

◆ TreesFolder()

std::string nanommo::TreesFolder ( )

Definition at line 26 of file trees.cc.

◆ TreeTransform()

Matrix nanommo::TreeTransform ( const Tree & tree,
const Terrain & terrain )

Sizes the model, turns it, and stands it on the ground.

Definition at line 71 of file trees.cc.

◆ TrLabel()

const char * nanommo::TrLabel ( const char * label)

An ImGui label in the language in use, with the English one as its ID after "###", so that a widget stays itself in every language.

Definition at line 618 of file translations.cc.

◆ TrN() [1/2]

const char * nanommo::TrN ( const char * one,
const char * many,
uint64_t n )

The form for the count: in English, one for 1 and many for the rest.

Definition at line 604 of file translations.cc.

◆ TrN() [2/2]

const char * nanommo::TrN ( std::string_view context,
const char * one,
const char * many,
uint64_t n )

Definition at line 608 of file translations.cc.

◆ Turn()

void nanommo::Turn ( const Bend & bend,
const Joints & joints,
float metre,
const ModelSkeleton & skeleton,
Transform * pose )

Turns the bones of a pose, as the skeleton's bones, by the bend: each joint takes the bones below it round with it. A metre is this many of the model's units.

Definition at line 76 of file moves.cc.

◆ Twin()

const Gate & nanommo::Twin ( const Gate & gate)

The gate in the land this one takes you to, which leads back.

Definition at line 32 of file lands.cc.

◆ Typing()

bool nanommo::Typing ( )

Whether the player is typing into a text field, such as the chat's, which takes the keys from the game.

Definition at line 22 of file input.cc.

◆ Ui() [1/2]

float nanommo::Ui ( float points)
inline

Definition at line 67 of file theme.h.

◆ Ui() [2/2]

ImVec2 nanommo::Ui ( ImVec2 points)
inline

Definition at line 68 of file theme.h.

◆ UiScale()

float nanommo::UiScale ( )

The scale the theme was last applied at, which points in the interface's layouts are multiplied by.

Definition at line 100 of file theme.cc.

◆ Unfold()

std::vector< figures::Part > nanommo::Unfold ( const google::protobuf::RepeatedPtrField< figures::Part > & parts)

The parts, each mirrored one followed by its twin on the right, on the right's bones, with its offsets the other way across.

Definition at line 96 of file figures.cc.

◆ UnixMs()

int64_t nanommo::UnixMs ( )

Now, by the wall clock, in milliseconds since 1970.

Definition at line 130 of file weather.cc.

◆ UnloadChunks()

void nanommo::UnloadChunks ( std::vector< Chunk > & chunks)

Definition at line 48 of file chunks.cc.

◆ Unreachable()

absl::StatusOr< std::vector< std::string > > nanommo::Unreachable ( const smollergraph::Graph & graph)

What's wrong with the content as a graph, a line each: what no path from a new player reaches, such as "Leather Cap, an item", and each quest whose monster is out of reach, which nobody can finish. Or the query's error.

Definition at line 257 of file graph.cc.

◆ UpdateCursor()

void nanommo::UpdateCursor ( Pointing pointing)

Sets the mouse cursor for the frame: over the GUI, the GUI's own; over the world, a hand on someone to talk to, and a crosshair on a monster to pick. The GUI leaves the cursor to us (see Gui), so this runs each frame, once the GUI is built.

Definition at line 35 of file cursor.cc.

◆ UseLanguage()

absl::Status nanommo::UseLanguage ( std::string_view code,
const std::string & folder )

Puts the interface in the language, by its code, from its PO file in the folder: none for English. One that can't be read leaves it in English.

Definition at line 574 of file translations.cc.

◆ UseRecordings()

void nanommo::UseRecordings ( Ambience & ambience)

Gives the ambience the recordings in the sounds folder, of the rain, the fire and a gust of wind, in place of what it makes from numbers, for each that's there.

Definition at line 37 of file audio.cc.

◆ VerifyPassword()

bool nanommo::VerifyPassword ( const std::string & hash,
std::string_view password )

Definition at line 36 of file password.cc.

◆ Views()

std::map< Cell, View > nanommo::Views ( const std::map< uint32_t, Player > & players,
const std::map< uint32_t, Monster > & monsters,
const Cells & npcs )

Players and monsters move, so they go into their cells each time. NPCs stand still, so the server puts them in theirs once, when they spawn.

Definition at line 30 of file interest.cc.

◆ Walk()

void nanommo::Walk ( const Terrain & terrain,
float & x,
float & z,
float to_x,
float to_z )

Moves to the place, or if the terrain's in the way there, as far as it can along x or along z alone, so that it slides along a coast.

Definition at line 8 of file walking.cc.

◆ WalkAlong()

void nanommo::WalkAlong ( const Terrain & terrain,
float & x,
float & z,
float direction_x,
float direction_z,
bool run,
float seconds )

Walks from x, z for that many seconds, along the direction, at the walk's speed or the run's, no faster on a diagonal, inside the land's edge and on land. The server walks a player with it each tick, and the client walks you with it before the server answers, so both have to come out the same.

Definition at line 19 of file walking.cc.

◆ Wander()

void nanommo::Wander ( Monster & monster,
const Terrain & terrain,
std::chrono::nanoseconds time,
std::mt19937 & random )

Definition at line 162 of file monsters.cc.

◆ WarName()

std::optional< std::string > nanommo::WarName ( std::string_view typed)

The guild a line typed in the chat asks to war, by its name, when it starts with /war and a space, or nothing, for any other line.

Definition at line 68 of file chat_window.cc.

◆ WayOut()

const Gate & nanommo::WayOut ( int dungeon)

The dungeon's way out: its first gate.

Definition at line 39 of file lands.cc.

◆ WeaponsFolder()

std::string nanommo::WeaponsFolder ( )

Definition at line 110 of file characters.cc.

◆ Who()

uint64_t nanommo::Who ( const Figure & figure)

Which figure is which, as players, monsters and NPCs each count their ids from one.

Definition at line 124 of file animator.cc.

◆ Worn()

protocol::Place nanommo::Worn ( items::Slot slot)

A slot that's worn.

Definition at line 13 of file places.cc.

◆ WornOf()

std::vector< uint32_t > nanommo::WornOf ( const Player & player)

What else the player wears, in each slot from the off hand to the feet that has something in it, by its ids in the items file.

Definition at line 194 of file world.cc.

◆ YouIn()

protocol::World nanommo::YouIn ( uint32_t id,
const Player & player,
uint32_t seed,
int land,
std::optional< uint32_t > acked )

What a player's own client is told about them each tick, beside the world near them: who they are, their experience and the next level's, their skills and how long each has left to cool down, how long until they rise again, what they're making and how far it's got, the land and its ground's seed, the last of their numbered inputs applied, if any, and where they are with it applied.

Definition at line 94 of file shown.cc.

Variable Documentation

◆ kArrival

float nanommo::kArrival = 3.0f
constexpr

Past the edge of a gate, so that players don't arrive inside it.

Definition at line 84 of file lands.h.

◆ kAshlands

Look nanommo::kAshlands
constexpr
Initial value:
= {
.atmosphere = {.sky = {0.46f, 0.22f, 0.13f},
.fog_near = 35.0f,
.fog_far = 130.0f,
.sun = {0.6f, 0.45f, -0.4f},
.sunlight = {1.0f, 0.55f, 0.3f},
.ambient = {0.36f, 0.28f, 0.28f},
.zenith = {0.22f, 0.1f, 0.08f},
.disc = {4.0f, 1.4f, 0.5f},
.disc_size = 5.0f,
.clouds = {0.42f, 0.33f, 0.3f},
.cloudiness = 0.8f},
.sand = {60, 54, 52, 255},
.grass = {124, 112, 104, 255},
.rock = {84, 74, 72, 255},
.snow = {196, 84, 40, 255},
.sea = {.deep = {255, 130, 30, 255},
.shallow = {190, 60, 20, 255},
.edge = {40, 24, 22, 255},
.height = 0.3f,
.wavelength = 12.0f,
.pace = 0.25f,
.emission = 0.35f},
.trees = {58, 46, 42, 255},
}

Definition at line 106 of file atmosphere.h.

◆ kBagSlots

uint32_t nanommo::kBagSlots = 24
constexpr

How many slots each player's bag has.

Definition at line 15 of file items.h.

◆ kBossBarReach

float nanommo::kBossBarReach = 30.0f
inlineconstexpr

In metres from you: a boss this near has its bar up, as you're in its fight, or about to be. Its leash is less.

Definition at line 14 of file boss_bar.h.

◆ kCampSpacing

float nanommo::kCampSpacing = 30.0f
constexpr

In metres between the middles of two camps, at least.

Definition at line 27 of file monsters.h.

◆ kCellSize

float nanommo::kCellSize = 32.0f
constexpr

In metres, like the client's chunks.

Definition at line 14 of file interest.h.

◆ kCharactersPerWorld

int nanommo::kCharactersPerWorld = 4
inlineconstexpr

How many characters an account can have in each world. The login server turns one more away, and the client doesn't offer to make it.

Definition at line 8 of file limits.h.

◆ kChunkCells

int nanommo::kChunkCells = 16
constexpr

In cells along each side: 32 metres.

Definition at line 15 of file chunks.h.

◆ kClear

float nanommo::kClear = 1.0f
inlineconstexpr

How far past the edge of a monster's skill on its way a bot keeps, in metres, so that it doesn't step back in as the skill lands.

Definition at line 43 of file wander.h.

◆ kCrypt

Look nanommo::kCrypt
constexpr
Initial value:
= {
.atmosphere = {.sky = {0.13f, 0.11f, 0.18f},
.fog_near = 20.0f,
.fog_far = 90.0f,
.sun = {0.3f, 0.9f, 0.2f},
.sunlight = {0.45f, 0.42f, 0.6f},
.ambient = {0.26f, 0.24f, 0.32f},
.zenith = {0.04f, 0.03f, 0.08f},
.disc = {1.6f, 1.7f, 2.2f},
.disc_size = 2.5f,
.clouds = {0.24f, 0.22f, 0.3f},
.cloudiness = 0.35f},
.sand = {70, 66, 74, 255},
.grass = {88, 92, 84, 255},
.rock = {104, 98, 112, 255},
.snow = {150, 146, 160, 255},
.sea = {.deep = {40, 200, 150, 255},
.shallow = {30, 120, 90, 255},
.edge = {150, 240, 190, 255},
.height = 0.3f,
.wavelength = 8.0f,
.pace = 0.4f,
.glint = 0.3f,
.emission = 0.3f},
.trees = {70, 64, 80, 255},
}

Definition at line 134 of file atmosphere.h.

◆ kDayMs

int64_t nanommo::kDayMs = 40 * 60 * 1000
inlineconstexpr

From one midnight to the next, in milliseconds of the wall clock.

Definition at line 11 of file weather.h.

◆ kEventStream

char nanommo::kEventStream[] = "events"
inlineconstexpr

The Redis stream the worlds add the game's events to, and the recorder takes them from, into ClickHouse.

Definition at line 20 of file events.h.

◆ kFar

float nanommo::kFar = 40.0f
constexpr

Definition at line 27 of file soundscape.h.

◆ kGateRadius

float nanommo::kGateRadius = 1.0f
constexpr

In metres from the middle of a gate.

Definition at line 81 of file lands.h.

◆ kGates

std::array<Gate, 4> nanommo::kGates
constexpr
Initial value:
= {{
{.land = 0, .place = {0.0f, -10.0f}, .to = 1},
{.land = 1, .place = {0.0f, -10.0f}, .to = 0},
{.land = 0, .place = {12.0f, 0.0f}, .to = 2},
{.land = 2, .place = {0.0f, -10.0f}, .to = 0},
}}

Definition at line 45 of file lands.h.

◆ kGravity

float nanommo::kGravity = 14.0f
inlineconstexpr

What pulls a monster that a blow's thrown up back down, in metres a second each second: more than the Earth's, so that it doesn't float.

Definition at line 140 of file world.h.

◆ kGrounds

std::array<Ground, 7> nanommo::kGrounds
constexpr

◆ kHeaderSize

std::size_t nanommo::kHeaderSize = 4
constexpr

Definition at line 14 of file framing.h.

◆ kInterestCells

int nanommo::kInterestCells = 2
constexpr

Cells each way, so that a player gets everyone within 64 metres.

Definition at line 17 of file interest.h.

◆ kJointBones

std::array<const char*, 13> nanommo::kJointBones
inlineconstexpr
Initial value:
= {
"Hips", "Spine", "Spine2", "Head", "RightArm",
"RightForeArm", "RightHand", "LeftArm", "LeftForeArm", "RightUpLeg",
"RightLeg", "LeftUpLeg", "LeftLeg"}

Each joint's bone in the rig, in the order of the joints.

Definition at line 13 of file moves.h.

◆ kJoinTheFight

float nanommo::kJoinTheFight = 60.0f
inlineconstexpr

How near a living boss has to be for a bot to join its fight, in metres: from the middle of its land, the Bone Colossus is.

Definition at line 32 of file quests.h.

◆ kLands

std::array<Land, 3> nanommo::kLands
constexpr
Initial value:
= {{
{.name = "Meadows", .seed = 0, .wading = Terrain::kWading},
{.name = "Ashlands", .seed = 1000, .wading = 0.0f},
{.name = "Crypt", .seed = 2000, .wading = 0.0f, .dungeon = true},
}}
static constexpr float kWading
Players wade into the sea up to their knees.
Definition terrain.h:53

Each world has these lands. The server tells a client which one it's in by its place in the list, so the server and the client list them in one order.

Definition at line 31 of file lands.h.

◆ kLandSounds

std::array<LandSound, 3> nanommo::kLandSounds
constexpr
Initial value:
= {{
{.sand = Ground::kSand,
.grass = Ground::kGrass,
.rock = Ground::kRock,
.snow = Ground::kSnow,
.chord = {523.25f, 659.26f, 783.99f}},
{.sand = Ground::kAsh,
.grass = Ground::kAsh,
.rock = Ground::kRock,
.snow = Ground::kAsh,
.chord = {220.0f, 261.63f, 329.63f}},
{.sand = Ground::kStone,
.grass = Ground::kStone,
.rock = Ground::kStone,
.snow = Ground::kStone,
.chord = {196.0f, 233.08f, 277.18f}},
}}

In the order of the lands: the Meadows in C major, the Ashlands in A minor, and the Crypt on a diminished chord, which doesn't settle.

Definition at line 33 of file foley.h.

◆ kLanguages

std::array<Language, 3> nanommo::kLanguages
inlineconstexpr
Initial value:
= {{
{"", "English"},
{"ro", "Română"},
{"pseudo", "Pseudo"},
}}

English, which is the code's own, Romanian, from ro.po, and the pseudo-language.

Definition at line 85 of file translations.h.

◆ kLoginDeadline

std::chrono::seconds nanommo::kLoginDeadline {5}
inlineconstexpr

How long a login waits for the login server's answer, once it has the server's address: connecting, shaking hands, asking and the reply. A login that takes longer is one a player's given up on. Looking the address up can take longer, as asio waits for the system's lookup to end.

Definition at line 18 of file login_client.h.

◆ kLongestRest

std::chrono::milliseconds nanommo::kLongestRest {6000}
constexpr

Definition at line 18 of file monsters.h.

◆ kLooks

std::array<Look, 3> nanommo::kLooks = {kMeadows, kAshlands, kCrypt}
constexpr

In the order of the lands.

Definition at line 164 of file atmosphere.h.

◆ kMaxChatLength

std::size_t nanommo::kMaxChatLength = 200
constexpr

The longest line a player can say, in bytes. A character takes one to four bytes in UTF-8, so that's at least fifty characters.

Definition at line 13 of file chat.h.

◆ kMaxDatagramSize

std::size_t nanommo::kMaxDatagramSize = 1200
constexpr

Most networks carry 1500 bytes a packet, less what tunnels and VPNs take, so IP never has to split a datagram this size.

Definition at line 19 of file parts.h.

◆ kMaxMessageSize

std::size_t nanommo::kMaxMessageSize = 64 * 1024
constexpr

Anything bigger is garbage. Without a cap, we might buffer up to 4 GB.

Definition at line 17 of file framing.h.

◆ kMeadows

Look nanommo::kMeadows
constexpr
Initial value:
= {
.atmosphere = {.sky = {0.6f, 0.77f, 0.92f},
.fog_near = 45.0f,
.fog_far = 150.0f,
.sun = {0.55f, 0.75f, 0.35f},
.sunlight = {0.75f, 0.68f, 0.55f},
.ambient = {0.4f, 0.44f, 0.52f},
.zenith = {0.3f, 0.5f, 0.84f},
.disc = {4.0f, 3.7f, 3.1f},
.disc_size = 3.0f,
.clouds = {1.0f, 1.0f, 1.0f},
.cloudiness = 0.55f},
.sand = {214, 196, 140, 255},
.grass = {106, 162, 70, 255},
.rock = {128, 120, 112, 255},
.snow = {238, 240, 245, 255},
.sea = {.deep = {48, 118, 178, 210},
.shallow = {95, 168, 195, 116},
.edge = {237, 245, 250, 242},
.height = 0.45f,
.wavelength = 10.0f,
.pace = 1.0f,
.glint = 0.6f},
.trees = WHITE,
}

Definition at line 80 of file atmosphere.h.

◆ kMostBehind

std::chrono::seconds nanommo::kMostBehind {1}
inlineconstexpr

The most a world catches up on, by running the ticks it's behind back to back.

Definition at line 17 of file tick.h.

◆ kMostInAir

std::chrono::milliseconds nanommo::kMostInAir {2000}
inlineconstexpr

However many players take turns at it, a monster's thrown up for this long at most, before it falls whatever hits it, and then it stands its ground for a while, so that it gets to fight back.

Definition at line 149 of file world.h.

◆ kMostWaitingSpans

std::size_t nanommo::kMostWaitingSpans = 4096
inlineconstexpr

The most spans that wait to be sent. A span that ends while that many are waiting is dropped.

Definition at line 101 of file tracing.h.

◆ kNear

float nanommo::kNear = 4.0f
constexpr

In metres: full volume this near, and nothing past far.

Definition at line 26 of file soundscape.h.

◆ kNewPlayer

char nanommo::kNewPlayer[] = "A new player"
inlineconstexpr

The node each path starts from: someone who's just made a character, with the land, the kit and the skills a new player gets.

Definition at line 16 of file graph.h.

◆ kNpcTimeout

std::chrono::seconds nanommo::kNpcTimeout {3}
constexpr

NPCs come once a second, so a client keeps each for this long after it last heard of it, and one lost datagram doesn't make them blink out.

Definition at line 23 of file parts.h.

◆ kPop

float nanommo::kPop = 2.5f
inlineconstexpr

How fast a blow without a lift of its own sends up a monster that's already in the air, in metres a second: enough to keep it there a moment longer.

Definition at line 144 of file world.h.

◆ kPseudo

std::string_view nanommo::kPseudo = "pseudo"
inlineconstexpr

The pseudo-language's code: it's made from the template, nanommo.pot.

Definition at line 81 of file translations.h.

◆ kPushTime

std::chrono::milliseconds nanommo::kPushTime {200}
inlineconstexpr

How long a blow's push takes, fast at first and slowing, as a shove does.

Definition at line 136 of file world.h.

◆ kRampMs

int64_t nanommo::kRampMs = 90 * 1000
inlineconstexpr

How long a spell takes to come, and to go, in milliseconds.

Definition at line 20 of file weather.h.

◆ kRate

int nanommo::kRate = 44100
constexpr

Sound, as numbers: where the speaker's cone is, from -1 to 1, this many times a second.

Definition at line 11 of file synth.h.

◆ kRunSpeed

float nanommo::kRunSpeed = 3.1f
inlineconstexpr

Definition at line 10 of file walking.h.

◆ kShirtColors

int nanommo::kShirtColors = 6
inlineconstexpr

How many colours there are to dye a player's clothes in.

Definition at line 11 of file scene.h.

◆ kShortestRest

std::chrono::milliseconds nanommo::kShortestRest {2000}
constexpr

Definition at line 17 of file monsters.h.

◆ kShortestSpellMs

int64_t nanommo::kShortestSpellMs = 6 * 60 * 1000
inlineconstexpr

Definition at line 17 of file weather.h.

◆ kShortestTelegraph

std::chrono::milliseconds nanommo::kShortestTelegraph {500}
inlineconstexpr

The shortest a monster's skill shows before it lands: long enough to see it coming, and step out.

Definition at line 25 of file monsters.h.

◆ kSlotMs

int64_t nanommo::kSlotMs = 15 * 60 * 1000
inlineconstexpr

The weather comes in spells, at most one in each slot of this many milliseconds, starting at the slot's start and lasting from the shortest to the whole slot. The rest of the slot is clear.

Definition at line 16 of file weather.h.

◆ kSteady

std::chrono::milliseconds nanommo::kSteady {2000}
inlineconstexpr

Definition at line 150 of file world.h.

◆ kStoryWords

std::size_t nanommo::kStoryWords = 3
constexpr

How many words mvGPT learned to write a story from.

Definition at line 13 of file stories.h.

◆ kTalkReach

float nanommo::kTalkReach = 4.0f
constexpr

In metres, from the middle of an NPC, as you'd talk to someone: how near a player has to be to talk to one, learn from it or take its quests. The server holds them to it, and the client lets them click only that near.

Definition at line 17 of file npcs.h.

◆ kTextSize

float nanommo::kTextSize = 18.0f
inlineconstexpr

In points, at a scale of one.

Definition at line 56 of file theme.h.

◆ kTreeHeight

float nanommo::kTreeHeight = 5.0f
constexpr

In metres, before each tree's own scale.

Definition at line 15 of file trees.h.

◆ kWalkSpeed

float nanommo::kWalkSpeed = 1.8f
inlineconstexpr

In tiles a second. A tile is a metre, and walking is the walk clip's speed.

Definition at line 9 of file walking.h.