LiSE, the Life Simulator Engine
March 2, 2015 8:15 PM   Subscribe

LiSE, the Life Simulator Engine
A rules based engine for life simulation games. Draw some graphs for your world model, build rules out of "cards" representing functions, let it run for a while, then rewind time, change things, and do it again differently.

Since I was young I've thought life would be a lot easier to handle if I could game it out before doing anything. I mean, I kind of can -- that's what it means to make a project plan, after all, but they're so dull. If we can have video games about people doing totally normal things (The Sims, obviously, but there are others) why not make our planning software look and feel like that?

I do intend people to develop entertainments with this, but also to use it to handle logistics, or to make wee simulations of some moment in their life that they'd like to share with people.

The link is to github because I'm not a web designer and don't know what a LiSE website would look like. I'm getting around to where I can put out a test release; it'll appear under the Releases tab.
Role: programmer
posted by LogicalDash (22 comments total) 3 users marked this as a favorite

This sounds very promising! I've tried to do something like this more than once, but always wandered away to something else.

Some documentation would be nice, though. I looked at the examples, but I (and probably anyone that wants to try this) may also want to know, explicitly:

- In what order the rules are invoked
- How you attach them to a character
- Whether it's a good idea for them to modify another character or to instead ask that character to modify itself
- Are location and "collision" handled by LiSE, or are you to keep track of that yourself?
posted by ignignokt at 11:05 AM on March 3, 2015

Yeah, currently the "documentation" is a lot of comments distributed throughout the examples. I'll need something better, and I don't have enough docstrings either. To answer your questions:

- Rules for a given entity are invoked in the order they were written in the source code. Entities get polled in name-alphabetical order of Characters (graphs), then nodes (Things or Places), then edges (Portals).
- If you're writing in Python you "attach" rules to a Character (or anything else really) by using the rule decorator on that Character. If you've got some character "alice" you'd do it with @alice.rule
- I have not worked out what counts as good practice yet. The whole world state is being synchronized with a database, so it shouldn't make any difference which way you do it, apart from readability.
- Nodes that are instantiated as Things, rather than Places, have a location property that puts them within one Place at any given time; further, they have a next_location property, which may be None, but if it isn't, then the Thing is in transit to that place. I think it'll cause errors if you try to put something in transit where there isn't a Portal connecting location to next_location. You can check collisions by iterating over the contents property of a Place--that will get you all Things located there.
posted by LogicalDash at 12:07 PM on March 3, 2015 [1 favorite]

Ah--I suppose I should have specified that nodes and edges are grouped together under their graph, edges coming last.

The SQL for the rule poller is kind of horriffic, to be honest...
posted by LogicalDash at 12:14 PM on March 3, 2015

Aha. Sounds like graphs are big (and interesting) part of this. I somehow missed that.

Interesting that everything goes through the database, instead of the turns being processed in memory, then getting serialized at the end of each turn. That's a good way to ensure that persistence is never broken.
posted by ignignokt at 8:47 PM on March 3, 2015

First Windows build posted.

Everything runs on Mac and Linux, but the packaging tools aren't all there yet.
posted by LogicalDash at 3:45 AM on March 7, 2015

Alpha 2 posted, now with Mac and Linux support, and with the sim engine running in a different process from the GUI.
posted by LogicalDash at 6:53 AM on March 29, 2015

Nice! So, if I install Python 3, I should be good to run the `start` command and just go?
posted by ignignokt at 7:24 AM on March 29, 2015

You don't need to install anything, py3 is baked in.
posted by LogicalDash at 4:27 PM on March 29, 2015

I wrote some documentation that should clear things up for those who already understand Python. Sooner or later I need to write a tutorial, and thence some examples suitable for inline use in the manual as well.
posted by LogicalDash at 7:22 AM on April 19, 2015

I'm trying to put together another alpha release, but I don't have easy access to a Mac anymore. I can build for Windows and Linux, would someone else be willing and able to assemble a package for OSX?
posted by LogicalDash at 12:16 PM on August 6, 2015

Alpha 3 released for Windows, Mac, and Linux. Now available as wheels, for your convenience if you already have Python 3.
posted by LogicalDash at 6:04 PM on August 11, 2015

(took down the wheels due to bugs, sorry)
posted by LogicalDash at 4:18 AM on August 13, 2015

Alpha 4 released

The graphical rules editor seems to work under normal conditions now.
posted by LogicalDash at 8:13 AM on August 28, 2015

Alpha 5 released

A lot of under-the-hood improvements. If you code, tell me what you think of the world generation API.
posted by LogicalDash at 3:57 PM on January 5, 2016

I am very impressed that you've kept at it! I may have missed it, but is there a getting started guide or walkthrough?
posted by ignignokt at 4:40 PM on January 5, 2016

I also wrote a new example script for this release that's probably useful for getting started.
posted by LogicalDash at 7:43 AM on January 6, 2016

Thanks! So, I don't know what your target audience is, but I was thinking of something that explained how you start from scratch. The manual seems to start from after you've already installed LiSE. I'm not familiar with Python, beyond using it as a substitute for shell scripting. Do I run something like `pip install LiSE`? Or should I `git clone`, then run

I read the README and took a guess and clone the repo then tried to run `python` and got:

Traceback (most recent call last):
File "", line 2, in
from ELiDE.__main__ import elide
ImportError: No module named ELiDE.__main__

There may be some Python conventions here that I'm missing. If the audience is people that know these conventions, it's probably best to state that up front in the README. Otherwise, explicit instructions that list what command you need to run to get an example script going would be great.
posted by ignignokt at 8:25 AM on January 6, 2016

The idea was that I'd have some prepared distributions ready for all the platforms and you'd download those and run them. They'd be in the download links on the release page. Currently only the Windows one is up though.

Sounds like you're on Linux? This here script will get you started. I've updated the readme to indicate that.
posted by LogicalDash at 8:50 AM on January 6, 2016

And then updated it with what you actually asked for.
posted by LogicalDash at 10:27 AM on January 6, 2016

Alpha 6 released.

Fixed a really embarrassing bug that crashed the editor when you tried to open the part where you input code. Then wanted something more substantial before I went to the effort of putting together a bundle, so improved the generally terrible UI design around said code editor.

Other fixes too.
posted by LogicalDash at 9:13 PM on February 3, 2016

Alpha 7 released.

Improvements are mostly under the hood, which is probably just as well since I still don't recommend using it without a firm grasp of Python, for the time being.
posted by LogicalDash at 6:03 PM on May 6, 2017

« Older LimeGong...   |   A podcast about grief... Newer »

You are not currently logged in. Log in or create a new account to post comments.