A downloadable tool for Windows and Linux

Download NowName your own price

What is Logika?

Logika (Logic in Esperanto) is a FSM (finite state machine) implementation for Ren’Py, FSM have a draw (graphic) that is a representation of the logic and the flow of process (label for Ren’Py).FSM draw

This is a FSM draw

Why to use?

Well, when your history/game have very complex paths, is more easy only change the logic, with that you can concentrate in the writing process. For example you need to add a new scene between two scenes, that need to check the code and validate that don’t break the code, but with FSM (Logika) you only change the logic add a new line and change one.

The logic before change:

IF scene_old1 SEND next GOTO scene_old2
IF scene_old2 SEND next GOTO scene_old3

The logic after change:

IF scene_old1 SEND next GOTO scene_new1
IF scene_new1 SEND next GOTO scene_old2
IF scene_old2 SEND next GOTO scene_old3

How to use?

First, circle in the figure is a script (label and its content), arrows are how they move (flow) and the pharse to continue (return value), for exmple "CH1" is.

label ch1:
a "bla bla bla"
return "next"

In the "script.rpy" write this.

Label start:
 $ logic_game=FSM_logic()
     $ state=logic_game.logic("")
     call expression state
     while (_return!="gracias"): #key phrase to finish
         $ state=logic_game.logic(_return)
         call expression state
         # $ print logic_game.read_logger()
     return

Logika, create the rpy class with the logic you write it.


The logic for the FSM draw is:

START Prologue
IF Prologue SEND next GOTO ch1
IF ch1 SEND next GOTO ch2_beginnig
IF ch2_beginng SEND next GOTO path1a
IF ch2_beginng SEND next2 GOTO path2a
IF ch2_beginng SEND next3 GOTO path3a
IF path1a SEND next GOTO path1b
IF path1b SEND back GOTO path1a
...
...

for this you can use:

START "start scene name"
IF "scene name" SEND "transition condition1" OR "transition condition2" GOTO "scene name2"
START, start
IF, if
SEND, send
GOTO, goto

License

This work is under a Creative Commons Attribution 4.0 International License.

Version 1.0

  • Binary
  • Source code (python3)

Version 1.0.2

Download

Download NowName your own price

Click download now to get access to the following files:

Logika FSM 1.0 (binary,source code, example rpy) 26 MB
Logika_EN.pdf 323 kB
Logika FSM 1.0.2 9 MB

Development log

Comments

Log in with itch.io to leave a comment.

This looks like it could be really useful for even moderately complex RenPy VNs. Shame that use seems unclear and was work in progress a year ago.  Any update?

fix lexer problem see code here https://github.com/badanni/Logika

(1 edit) (+1)

is there a way for this to work on mac?

(1 edit)

yes i think, use version 1.0 and install python3
later in console (sorry i dont know the name in mac) write:

pip install PyQt5

If you what to use version 1.0.1, do the same and you need to change the code in FSM_logic.py

import graphviz_standalone as gv

to

import graphviz as gv

then install graphviz with pip

pip install graphviz

and maybe  download this https://graphviz.gitlab.io/download/


for run go to the path where is the file FSM_logic.py or FSM_logic.pyw all in console and write 

python FSM_logic.py

or

python FSM_logic.pyw

i dont know if macos admit double click in FSM_logic.pyw

Fantastic! Thank you so much for this, it'll be useful for the community.

Thank you, I hope it