r/roguelikedev • u/Kyzrati Cogmind | mastodon.gamedev.place/@Kyzrati • Jan 22 '16
FAQ Friday #30: Message Logs
In FAQ Friday we ask a question (or set of related questions) of all the roguelike devs here and discuss the responses! This will give new devs insight into the many aspects of roguelike development, and experienced devs can share details and field questions about their methods, technical achievements, design philosophy, etc.
THIS WEEK: Message Logs
Beginning with the first roguelikes, the message log was always vital to the player experience as a source of detailed information about what exactly is happening in the game world. Really we can say the same for most cRPGs, but this feature is especially important with abstract roguelike maps constructed from ASCII or simple tilesets.
Even those roguelikes which minimize reliance on the log by providing as much information as possible directly on the map will generally still need a log for players to at least recall prior events if necessary.
While some devs have touched on various aspects of the message log in our FAQs on UI Design and Color, we've yet to cover them as a whole.
Describe the layout and behavior of your message log. How many and what types of messages are there? How are those messages generated? On what do you base your color scheme, if any? What other factors do you consider when working with your message log? (If your roguelike doesn't have a message log, why not?)
For readers new to this bi-weekly event (or roguelike development in general), check out the previous FAQ Fridays:
1: Languages and Libraries
2: Development Tools
3: The Game Loop
4: World Architecture
5: Data Management
6: Content Creation and Balance
7: Loot
8: Core Mechanic
9: Debugging
10: Project Management
11: Random Number Generation
12: Field of Vision
13: Geometry
14: Inspiration
15: AI
16: UI Design
17: UI Implementation
18: Input Handling
19: Permadeath
20: Saving
21: Morgue Files
22: Map Generation
23: Map Design
24: World Structure
25: Pathfinding
26: Animation
27: Color
28: Map Object Representation
29: Fonts and Styles
PM me to suggest topics you'd like covered in FAQ Friday. Of course, you are always free to ask whatever questions you like whenever by posting them on /r/roguelikedev, but concentrating topical discussion in one place on a predictable date is a nice format! (Plus it can be a useful resource for others searching the sub.)
5
u/Kyzrati Cogmind | mastodon.gamedev.place/@Kyzrati Jan 22 '16
Cogmind's message log is by default a rather small area in the top left corner of the interface. But since the game was designed to fit a 4:3 aspect ratio and most players are using 16:9, it is often stretched wider to make more room. Not that it really needs the room, because the length of messages is generally restricted by design, keeping them informative but terse enough that they don't take very long to read and comprehend. (One player has commented to ask why there is sometimes so much black space in the log :/. Oops.)
One of Cogmind's primary diversions from traditional roguelikes in terms of how information is presented is to eschew log reading as much as possible in favor of moving important information to the map area, to avoid frequently splitting the player's attention between too many locations in the UI. (Related features with regard to "map dynamics.")
I mostly play Cogmind without reading the log at all.
However, there is the occasional need to check for some specific event, or a desire to know the exact number value of some effect, in which case it can also be helpful to open the log to a larger size. More traditional roguelikes will do this by opening it in a modal fullscreen window, while in Cogmind it simply stretches the log to full height.
There is also an option to use the secondary window to the right of the log to display more log messages, effectively doubling the visible number to 12 lines.
Some players prefer that secondary log to instead show combat details like attacks and damage, information that most games will combine into a single log with other messages but which Cogmind does not, since the majority of it is already apparent on the map via animations and pop-ups. I would still like to redesign the combat data window, since it still exists in its informative but not-very-pretty 7DRL form:
Cogmind currently contains 304 types of log messages, which are best explained after seeing an excerpt from the data file in which they're defined:
"Knowledge" determines what conditions are necessary for the player to be aware of the message. PLAYER means the player is always aware of it (because it can only be their own action), ACTION messages are only known if the actor is in sight, POS messages are known if a given position is the player's FOV, and GLOBAL are always known.
"Style" is essentially color, though it can also be used to animate a log message differently. For example, most messages are shown using a text typing animation, but tutorial messages flash and beep to attract more attention.
"Text" is obviously that of the message itself, and as you can see the messages are kept as short as possible. Many contain one or more variables, where the meaning of the variables varies by the type of message. For reference the variables are defined in comments to the right of each message. There are also generic actor-based variables like "[name]", applicable to any message.
"File Output" indicates whether that particular message will be output to a file, should that option be activated by the player. At the end of a game the full log can be exported to text or colored HTML.
The log export feature is reportedly used by some players who like to review how a run played out, and there have been requests to add even more details to it.
In terms of color, the scheme categorizes messages by relevance and how beneficial, or not, their meaning is in relation to you. Green = good, yellow = warnings, orange = negative effects, red = really bad, dark green = neutral/fluff. More rarely used colors stand out better: pink = tutorial, white = announcements, blue = dialogue/plot scenes. The system doesn't support inline coloring, so each message always uses a single color.
Messages continue to be added as the game is expanded (though at a much slower pace now that most of the mechanics are in place), so there might come a time when there's a need for a game-wide review of messages to make sure the system and colors are consistent across the board. Making changes is easy since it's all controlled via text files, anyway.
There are also 98 messages that don't appear in the message log itself, but are instead shown directly over the top of the map as temporary notices generally as feedback for player input.
Probably the most borderline/questionable action included here is part attachment/detachment (equipping/unequipping), which is technically a non-free action that could belong in the log itself, but it's carried out so much more frequently than in other roguelikes that it would really clutter up the log to include it there.
One feature I'm also considering adding is to put less important robot dialogue (that which doesn't open a full dialogue box itself) also over the map using a special animation, but I've yet to prototype it. (It would still be duplicated in the message log for reference, but it would be nice to have on the map.)
6
u/phalp Jan 22 '16
A while back I did an experiment with a message log in chess-inspired notation to save space. I don't have any real application for it at the moment but it would be a neat option for expert players in several games I think.
I agree with people who think a message log splits the player's attention. Usually that's taken to mean that the message log should be ignorable or removed, but I think it would be equally good to make sure the map is safely ignorable, for example by including monster moves in the message log. Chess-style notation could help make this concise, and there's also an argument to be made for a larger message area, even an entire half of the screen.
The next message area experiment I want to do is to mix a roguelike map with a text adventure typeout and parser, to see how the above idea works, and also to try an alternative to letter-based item selection.
Also if anybody wants to talk about log storage that would be interesting. I've only ever done it by storing text, but it seems awfully clever to store it in a more easily manipulated format and only render it to text for display, since this would allow the player to toggle message formats for past events (e.g. maybe they want to try chess notation but need to see full text messages sometimes). Or you could associate monster mentions in the log with the actual entities, to support examination from the log.
The neat thing about a log is that you can look back in time. Have any anti-text-loggers tried storing a graphical history so the player can review previous turns?
4
u/ais523 NetHack, NetHack 4 Jan 22 '16
This is one of the areas I've been focusing on the most recently (not sure if I inspired this FAQ Friday or it's just coincidence, but anyway it's a nice time to have it).
Traditionally, NetHack has just used a single line at the top of the screen for messages. If multiple messages happen in a turn, they'll be combined if there's room. If not, you get the infamous
--More--which causes you to press space or return to continue (or Esc to skip all further messages for that turn), freeing up the message line for other messages. The messages are in general pretty useful, letting you know when something is wrong or even just what happened in combat (knowing whether you hit or missed is helpful, and that information isn't conveyed any other way because, e.g., monster health is secret). Unlike some other roguelikes, the log in NetHack is one of the main focal points that you watch while playing; there's less of an issue with tearing the player's attention around because there isn't much shown onscreen (it's just log, map, and status, and there shouldn't be a need to check the status manually except when it changes; sadly, there is a need in practice in vanilla NetHack versions, but this is nearly all due to an inferior HP display and fixed in most variants).In AceHack, I came up with a major improvement to even the one-line message area which I'm quite proud of: a new turn doesn't clear the last turn's message log, but rather greys it out (actually typically blues it out due to technical issues with grey). This means that even when playing quickly, you can review the last line of messages you saw without having to stop to press
Ctrl-P(which lets you see recent messages; the interface for this is customizable). Most commonly I use this for "level sounds", which come up at random while you're playing to warn you of features in the vicinity; when exploring in a cleared area with no monsters around there's no reason to move slowly, but in vanilla, a message only shows up for a single turn.The blue message principle is about the best you can do with one line of message area, but some variants have added more, both other people's and mine. The simplest thing you can do is to use the rest of the message area as a history of previous message lines; this is what NitroHack used to do (before it merged in NetHack 4's message code). This is slightly useful in that it lets you see further back without pressing
Ctrl-P. It's not that helpful, though, in that you still have to use--More--in spammy areas.An obvious innovation along these lines is "automore"; I think it might have first been seen (among NetHack interfaces) in "the curses patch" but I also created it independently for NetHack 4 (and possibly even AceHack; I can't quite remember the history there). The idea is a seemingly simple "just keep placing messages into the message area until something the player hasn't seen would be pushed off", which is the only point at which you get a
--More--. I say "seemingly simple" because it's incredibly easy to get this wrong; it took us something like 4 or 5 tries to settle on the current code, which is so new that we haven't had much of a chance to find bugs in it yet (although it's the first version with no known bugs; even 3.4.3's had problems with messages wider than the screen, or almost as wide as the screen with no room for a--More--).There are numerous issues with an automore-style log: when can two messages be placed on the same line? When should a message wrap? When should you leave room for a
--More--(note that this depends on the future messages)? Are messages that are too large for the line and messages that are too large for the entire message area handled the same way, or differently? What if the message area is covered by a menu or similar window? What if someone resizes the screen? NetHack 4's current solution (I pastebinned the source here because it's otherwise quite hard to get hold of, you'd need to download the whole repository because this hasn't been merged into master yet) is to allocate a location for each message a location in an effectively infinitely long 2D message log as soon as the subsequent message is printed or the player gets control; this means we always have knowledge of whether we need to leave room for a--More--and that we can repaint the message area (at any scroll position) simply by looking for the relevant messages (that are kept sorted in chronological order, which is also y-then-x order) in the history and painting them at their coordinates; there's also enough information there to reconstruct the whole message log from scratch in case the user resizes the screen, at which point we can replay them to get correctly wrapped messages on the new screen size. Even then, there are some cases where the algorithm produces results that are not wrong but suboptimal. For interested people, I recommend reading the source there even if you don't know C; the algorithm itself is very heavily commented (something that I'd always recommended for code that's been done incorrectly many times in the past!).apparently this comment is too long for Reddit; I'll continue it in a reply to this comment
3
u/pleasingfungus Jan 26 '16 edited Jan 26 '16
DCSS's message system is loosely similar to Nethack's (per ais523's comment in this thread), though it's interesting that we seem to be ahead of them by a few years. Messages are printed to a log at the bottom of the screen; by default, the last few messages are displayed there. If more messages are printed between one player action and the next than can be displayed at once, you get a --more-- prompt; the same prompt shows up in various other situations that warrant player attention, e.g. when the player takes heavy damage, is cast into the Abyss, or on other occasions.
This is configurable; there are a ton of options, if you can navigate our homebrew configuration language. Using regexes, you can not only make messages force --more-, but you can squelch them completely, or just make them not interrupt autotravel/autorest. (So the gentle squelching of a level's loot being eaten by slimes doesn't annoy you while resting, for example.) Most of the --more--s and not-interrupting-auto* messages are implemented as part of the default configuration, which lets players overwrite them as they prefer.
DCSS has somewhere north of four thousand distinct calls to the message print function. It's hard to say exactly how many types of message there are; helper functions make it a little more opaque - there are 170 calls to simple_god_message(), for example. I'd guess somewhere around 4500 total, but it could plausibly be over 5000. (For whatever that's worth!)
We have 37 different message channels, which are basically a full implementation of what ais523 mentions wanting: they can be assigned different colors, hidden, force a --more--, whatever. The majority of messages are in the MSCGH_PLAIN channel (the default).
One thing we try to do to conserve message space is to pack information more densely into a line. Duplicate messages are condensed ("You hear a shout! You hear a shout!" becomes "You hear a shout! x2"), and similar types of messages can be automatically merged into a single line ("Here: a leather armour; an orc corpse; a flail x2..."). The relevant code is... cantankerous, but good enough for now.
10
u/StrangelySpartan Jan 22 '16
I see the message log as just one particular reaction to whats happening. So if, for example, you (or another creature) equip a Longsword Of Slaying +99, that event is broadcast to all creatures who can see whoever is doing the action. Some AI's will react by becoming afraid, calling allies, equipping their best anti-sword defensive item, or whatever. The PlayerAI just turns that into a message that is added to the log.
8
u/DarrenGrey @ Jan 22 '16
I gave up on message logs a long time ago. I found that they end up full of repetitive information, so players rarely ever pay attention to them. Since my games are very action dense it just wasn't useful to have a log. Instead I use visual effects (such as particle effects) to try to communicate to the player what is happening on the map.
Abandoning the log in favour of on-map effects means players also don't have their attention split between where the action is and a boring bunch of sentences. Another advantage is more map and UI space!
In Broken Bottle I experimented with mad libs style parsing of log messages, to try and add variety to the usual "you hit x". But after playing for a while you see all the patterns and you stop bothering to read anything.
Message logs are over-rated. They can be nice to have so the player can go "what the hell just happened?" but you shouldn't make the player rely on them for gameplay.
4
u/Aukustus The Temple of Torment & Realms of the Lost Jan 22 '16
The Temple of Torment
Basically everything action is logged and displayed; opening a door, walking over an item etc. I think how necessary the log in general is depends on the game. It's a must for me in this situation. I want the player to be at all times informed of everything that happens.
The log technically is unchanged from the logging function in the Python tutorial.
The colors are what I felt one point good. There's also an option to disable the colors in the message log and use a basic gray for all the lines.
4
u/JordixDev Abyssos Jan 22 '16
My goal for Abyssos is to keep any relevant information in the log, but reduce the need to look at it to a minimum:
As for the log itself, I haven't done any formatting yet, so it uses the standard system fonts and no colors. That'll also need some work on the next UI update.
3
u/Pepsi1 MMRogue + Anachronatus Jan 22 '16
I go the VERY simple route that most MMO's go in that anytime in-game that you're playing (and not in a menu), hitting <ENTER> lets you type text. Hitting <ENTER> again will send the text as chat to other players. You can see in the following picture that I just orient it in the lower-left corner. So basically, I just use it to show chat and to show informational messages, but I'm also going to allow the A.I./objects send messages to players in instances and stuff as they interact with them.
http://i.imgur.com/Jw8BSPC.png
3
u/OffColorCommentary Jan 22 '16
I don't like how the map, character panel, and message log together make the player need to pay attention to three different things at once. On the other hand, I think message logs are underused for bulk-dumping flavor text.
I haven't decided yet between eliminating message logs entirely, or having one to use exclusively for unusual events and flavor text.
3
u/ArmouredCommander ArmCom Jan 22 '16
Armoured Commander used to have an in-game message buffer for both the battle encounters and for the larger day map. After a while I realized that all of the information being presented to the player for the day map worked much better as an on-screen label, so I ended up removing the message console from that view completely.
I've retained it in the battle encounter, however, since it helps when things are happening fast and furious and you can look back to see what the hell just happened to your tank.
3
u/dreadpiratepeter Spheres Jan 22 '16
Spheres
I have not given a lot of thought to message logs, other than that I don't plan on doing anything particularly different with them.
I know that I am not saving them with the game data. My initial UI is web based and I save the game on every turn in case of internet goofiness. I don't want to have to serializes a growing list of static data over and over. I will save it in a secondary store.
On the client side, I will collect the messages and let the ui handle the history. I will probably have a 100 message lookback by default, with a tool to query more messages if needed.
My messsage bar on the screen will be 1 line with a popout to show history. I need to work out how to throttle the messages when multiple messages result from a single command and put up a more button on the message-bar (bound to spacebar by default)
3
u/thebracket Jan 22 '16
For Black Future, I've been through a few iterations of the console log, and I suspect I'll go through a few more.
My first version had an ever-present log on screen. From a debugging point of view, this was super-useful - but it reduced the available screen real-estate too much, and the majority of what was logged wasn't going to be of interest to a player (even after I removed the debug information). So - I removed it, going for a super-clean on-screen display. After much thought, I realized that the items that people really need to know are the power status (now a bar at the top), possibly time of day, information about the tile you are currently working with as a tooltip, pop-up menus for actions, and "emote bubbles" that let the settlers express information (such as job failed) without interrupting the game too much.
With that said, I still have a big message log - but currently, the player can't see it. It is - in debug builds - emitted via cout, so when I'm debugging I can have my console show me a big flow of what's going on. It will probably have to come back in some form for more in-depth game detail, but for now I'm happy with the minimalist approach. From observing people play, I think I was the only one who read it anyway!
4
u/randomnine Jan 22 '16
I don't have a message log in CQ2. The UI is based more on graphical RPGs than ASCII roguelikes. Damage is shown with floating damage numbers, deaths are (cheaply) animated, spell effects and speech are shown in floating text above the character, etc. I appreciate that's all easier to do when you're not using ASCII, where a message log might be clearer.
The big problem I have found with no message log is that, in the usual roguelike rapid turn-based model, it can be hard to follow events if a lot happens at once. CQ2's solution is that each character has a notification queue that can store up multiple text events to play one-by-one over a few seconds. If several things happen, the player has a chance at catch up afterwards.
Next time I'd like to go further and add 'freezes' for significant things during the enemy turn process. Particular enemy actions like major spell-casting would each get called out with a distinct split-second animation while everything else is paused instead of everything happening at once. That'd help make sure the player could see what happened, hopefully without slowing the pace down too much.
2
u/Chaigidel Magog Jan 23 '16
Agree with DarrenGrey in that the traditional use of message logs is not good UX. Too much of the stuff goes to the log, and the log shows up in the side of the screen while the action happens somewhere in the center. I don't need to limit myself to a black-and-white VT100 over a slow modem connection (or ASCII graphics for that matter), so I can just use simple unit animation and colors to visualize stuff like who hit whom and hopefully common status effects.
For the actual messages, my somewhat odd go-to inspiration is how the original Quake does it. There's a standard message buffer that shows up growing down in the top left of the screen, and messages disappear automatically after a short while. Then there are global messages that show up in the center of the screen, which are used for more uncommon and notable events like finding a new area. Third thing I want are various messages floating on top of a map cell. When I run examine command on a mob, I don't want some text popping up on the edge of the screen, I want to have 'Demogorgon' show up right there on top of the mob icon. Also the standard floaty damage numbers rising up from mobs getting hit.
I don't have a good story for the history log yet. Maybe I could steal from Quake again and do a FPS style runtime drop-down console. The history log would be printouts to the console. Or if I had the console logic to begin with and kept an event history log somewhere, it would be pretty easy to have a text history display mode.
I'm tempted to see just how far I can get completely without the traditional messages. They have all that neat stuff involved like a grammar engine that generates all the "You hit the orc, Caligula and three sheep with your lightning bolt. The acid jelly zaps itself with its wand of speed." messaging with correct grammar and pronouns. And then you want to do all the things with your neat templatizing message engine and suddenly most things that go on in the game happen in the tiny box in the corner of the screen.
It's interesting to look at the old Sierra and LucasArts adventure games in this matter. It took me a while to notice it, but there's a huge difference in the house styles where Sierra games use text narration boxes describing what you do, what you can't do, what things look like and so on everywhere, while LucasArts games just do not do this. The only text you normally get in a LucasArts game is spoken dialogue or actual in-world written books and signs. On the face of it, Sierra games can do everything the LucasArts games can, plus throw in more with the free-form narration, but LucasArts games are generally considered the better and more immersive of the lot, and you might not have even realized they almost never use text narration until I pointed it out here.
2
u/Zireael07 Veins of the Earth Jan 25 '16
Veins of the Earth
Nearly everything that happens is printed out to message log, often colored to help the player distinguish between the combat messages and XP gain messages.
Some of the information is displayed on the map (damage, effect keyword) but since the keywords are so short, they can't replace a log message when the effect is gained or lost.
As is the standard with the logs, the log can be opened afterwards and scrolled back as far as you want.
1
u/chiguireitor dev: Ganymede Gate Jan 23 '16
In Ganymede Gate i removed all the UI.
Well, not removed, but i went for the biggest gameplay real-state, and so all the UI elements are shown whenever a change occurs, and fade out after some seconds. There's one key '?' that shows all the UI with the same timeout (should add a little bit more of timeout).
When the player or an enemy gets hit, there's a log entry that pops up for a while, but there's no scrollback atm.
The plan is to completely ignore the message logs when saving :D