Re: Single Player Experience

239 views
Skip to first unread message

Griatch Art

unread,
Sep 4, 2012, 3:11:00 PM9/4/12
to eve...@googlegroups.com

Hi and welcome to Evennia!

Sure, as long as you are okay with using one of the connection protocols available out of the box (telnet, ssh, ssl, webclient), you can use Evennia as a single-player game just fine. You don't need an internet connection or anything like that. Single-player mode is actually how most MUD developers work when developing their games.

Actually, there is a small single-player quest coming with Evennia out of the box. It showcases some of the possibilities in a small number of rooms. Take a look. :)
.
Griatch



On Tuesday, September 4, 2012 2:33:47 PM UTC+2, Jonathan Dobson wrote:
Hi folks,

For the past year and a half I've been working (part-time) on a single-player interactive fiction/RPG. Have been using Twisted & Python for dev.  Then I stumbled across this project. It looks fantastic. I haven't had the opportunity to peruse any of the code yet, but I do know that Evennia seems to have a lot of core functionality already built that I haven't even bothered to start on yet. Would love to switch over my project to take advantage of what Evennia has to offer.

Question: despite being developed for a multi-player, real-time experience, can Evennia be used (easily, or with moderate effort) for a single-player, turn-based experience? 

Jonathan Dobson

unread,
Sep 5, 2012, 2:49:09 PM9/5/12
to eve...@googlegroups.com
Great - thanks. Will definitely be checking this out in detail.

Griatch Art

unread,
Sep 6, 2012, 4:33:52 AM9/6/12
to eve...@googlegroups.com
Glad to have you. Out of curiosity, which 'core functionality' in Evennia was it that caught you fancy in particular? Always interesting to hear what people are interested in. :-)
.
Griatch

Jonathan Dobson

unread,
Sep 6, 2012, 4:14:34 PM9/6/12
to eve...@googlegroups.com
The abstraction for the persistence layer mostly, and user logins. Haven't done this before. I suppose a little Django for the logins and I'd be set. The persistence in particular would be a time-saver. I was going to go with a no sql database, such as MongoDB - would have just persisted all class definitions as dicts, and tied that to a user account. I've vever used MongoDB, so there would be some learning there. And I would have to write some sort of custom serializer for classes (guess that wouldn't be too hard - but I might be naive.)

This brings up another question, though: typically single-player interactive fiction allows the player to undo their actions. In order to accomplish this, one would need to track all state changes. I don't suppose Evennia has something like that built in? (I'm aware that if I employ any form of randomness in a game, that undo functionality is essentially a deal-breaker. However, I am hoping to build traditional IF games as well as more gamist, RPG-like games.)

Starkiel

unread,
Sep 6, 2012, 5:04:32 PM9/6/12
to eve...@googlegroups.com
Yes, the database abstraction is very useful, and Twisted+Django helps to both handle logins as well as making it easy to offer a web presence (playable from the web browser, that kind of thing).
I've never used MongoDB myself either, but it does sound like an interesting concept in principle.

Evennia does not offer a rollback function, no. It would make little sense in a multiplayer environment, after all. There is of course nothing stopping you from somehow implementing this - but I fear it would probably be a rather hefty project. To be honest I'm not sure how you could ever backtrack dynamic changes in the world unless your IF input is very, very limited. It's probably not impossible but it would certainly require some serious thinking. I'm sorry to say that for rollbacks at least, a more limited game system specialized for IF is probably better rather than rebuilding Evennia.
.
Griatch

George Oliver

unread,
Sep 6, 2012, 10:29:02 PM9/6/12
to eve...@googlegroups.com


On Thursday, September 6, 2012 1:14:34 PM UTC-7, Jonathan Dobson wrote:
 
 (I'm aware that if I employ any form of randomness in a game, that undo functionality is essentially a deal-breaker. 

Not if you're OK with 'deterministic randomness' :). 

Jonathan Dobson

unread,
Sep 7, 2012, 10:42:00 AM9/7/12
to eve...@googlegroups.com
To be honest I'm not sure how you could ever backtrack dynamic changes in the world unless your IF input is very, very limited. 

Can you elaborate? I've semi-successfully implemented rollback (undo, what-have-you), and the input (user commands) don't seem to affect the implementation at all. The only significant road block I faced was Python's mutable types (in particular, dicts and lists). Those can change in-place, and could not be neatly hooked into the mechanism I had going. The solution was to magically replace them with wrapped versions behind the scenes. So I had ImmutableDict and ImmutableList classes. Not sure if that was the best way to go, but it worked. In any case, I'm interested to know if I've missed something as regards to the user input affecting rollback.

I'm sorry to say that for rollbacks at least, a more limited game system specialized for IF is probably better rather than rebuilding Evennia.  

For sure. I haven't had time to check out the source, but I will definitely be doing so in the near future. Will see if there's a possibility for me to hack in a working example (for a single-player, turn-based instance of Evennia).

Jonathan Dobson

unread,
Sep 7, 2012, 10:45:45 AM9/7/12
to eve...@googlegroups.com
Not if you're OK with 'deterministic randomness' :).  

As in, pre-roll all the dice ahead of time?

Griatch Art

unread,
Sep 24, 2012, 5:35:11 AM9/24/12
to eve...@googlegroups.com
Hi again, 

Having thought about this, it's probably not quite as hard as I pictured. Not used to thinking single-player, turn-based. :)

The main problem with rollbacks are how you save the state of objects as they were before. It's not impossible but a rollback mechanism (undo) relies on progressing through well-defined states. Evennia by default is a fully asynchronous system (since it's multi-user) which makes it unsuitable for this out of the box. But setting it to be turn-based would make it a completely different ballgame. As far as Evennia's concerned I guess it would simply mean not running any global scripts but just idle doing nothing waiting for input from the single user.

Rollback needs to be handled carefully. Imagine walking into a room, picking up an object and reading it. Maybe a future puzzle depends on you having read this text so a flag is put on the player to mark this. You need to store all aspects of this if you want to rollback - the read command, the pick up command, the move command, all with their equivalent reversals (so the inverse of this particular read would have to know that it must unset that read-flag behind the scenes). 

To do this, your every command must be highly specialized and come paired with its "reverse" (probably as a method). These commands must then be stored on the Character in a stack so that they can be stepped back through in the reverse direction with your rollback command. 

It's not impossible to do and single-player turn-based mode simplifies this considerably. But it needs to be thought through carefully.
.
Griatch
Reply all
Reply to author
Forward
0 new messages