Page 1 of 1

MeseconEdit - Version 1.6 (7/7/12)

PostPosted: Sat Mar 03, 2012 17:49
by Temperest
An external 2D layout and design environment for Mesecon circuits.

Features:

  • Infinite grid management and drawing.
  • Smooth panning and zooming, drawing only visible grid elements.
  • Power source connectivity counting mechanism allows fast circuit recalculation after adding/removing power sources or mesecon.
  • Custom drawing for each node type - mesecon connects to adjacent mesecon, and every node can have its own shape and behavior.
  • Save and open Mesecon schematics (*.mesecon)
  • Import/export WorldEdit schematics (*.we)

Screenshot:

Image

Details:

This program is written in AutoHotkey; you may download the latest AutoHotkey interpreter here. As a Windows-only language, I'm afraid this program is not available for users of other platforms, until I can get familiar enough with something like PyGame to do a port, or someone else does it.

So far the power source connectivity count mechanism works as follows:

  • Mesecon has a state, which is a positive number or 0. Any positive number means that the mesecon is on; 0 means the mesecon is off.
  • On placement, mesecon will find the sum of the states of all neighbor nodes, and then increment the states of the neighbor nodes such that they are all equal to the calculated sum. This means that the mesecon "conducts" power source connectivity counts when it connects two active power sources.
  • On incrementing or decrementing the current node's state, also increment the states of neighbor nodes to match. This means that mesecon "propagates" charges across to neighbors.
  • Whenever changing another node's state, to prevent infinite recursion, keep an "open set" of nodes that have already been operated on. Don't process any neighbors that are already in the open set.
  • On removal, a full recalculation is done.

This mechanism is powerful because it is localized: only nodes that need to be changed will be processed, otherwise no recalculation is needed. Although it means that more data needs to be stored with each node, it also allows faster circuit calculation.

Download:

Source:

GitHub Repository
Latest Development Version

Compiled:

Version 1.6 Stable
Version 1.5 Stable
Version 1.0 Stable

PostPosted: Sat Mar 03, 2012 17:56
by Death Dealer
faster mescons correct? and can they still be edited from in-game?

PostPosted: Sat Mar 03, 2012 18:18
by Temperest
Well this is an editor and simulator for mesecons, it's an external program and the mesecons mod uses a different algorithm for calculating circuits. When saving and loading are implemented, it will be possible to import your mesecons creations into the game using WorldEdit.

I'm hoping that by working out the issues in the algorithm, it will eventually be possible to implement the same thing in the actual mesecons mod, for faster circuit calculations.

PostPosted: Sat Mar 03, 2012 18:19
by Jordach
This will be helpful!

EDIT: Why not use Wine?

PostPosted: Sat Mar 03, 2012 18:22
by Death Dealer
Temperest wrote:Well this is an editor and simulator for mesecons, it's an external program and the mesecons mod uses a different algorithm for calculating circuits. When saving and loading are implemented, it will be possible to import your mesecons creations into the game using WorldEdit.

I'm hoping that by working out the issues in the algorithm, it will eventually be possible to implement the same thing in the actual mesecons mod, for faster circuit calculations.

very cool +1

PostPosted: Sat Mar 03, 2012 18:24
by Death Dealer
Jordach wrote:This will be helpful!

EDIT: Why not use Wine?


"This program is written in AutoHotkey; you may download the latest AutoHotkey interpreter here. As a Windows-only language, I'm afraid this program is not available for users of other platforms, until I can get familiar enough with something like PyGame to do a port, or someone else does it."
thats what he said. in his post

PostPosted: Sat Mar 03, 2012 18:52
by Temperest
Jordach wrote:This will be helpful!

EDIT: Why not use Wine?


I haven't tested it out in Linux yet, but I'm not too optimistic there...

If it works, that would be great!

PostPosted: Sat Mar 03, 2012 19:32
by Jordach
I have WINE, but I'm using Windows and I won't reboot for a while.

PostPosted: Sat Mar 03, 2012 19:58
by cosarara97
Jordach wrote:EDIT: Why not use Wine?


Because we want native programs...

I will check if it works in wine

EDIT: It works.

PostPosted: Mon Mar 12, 2012 00:19
by Temperest
Update: Working mesecon removal and circuit recalculation!

Next in line are the most commonly used circuit elements such as plugs and sockets, mesecon torches, and others.

PostPosted: Thu May 31, 2012 01:40
by Temperest
Quick update:

  • Working plugs
  • Working sockets
  • Working inverters
  • Working meselamps
  • Continuous panning (like in Blender)
  • Tons of bugs fixed - no more glitching on removal!

Bug reports welcome.

TODO: file saving/loading, more mesecon devices.

PostPosted: Thu May 31, 2012 10:31
by LolManKuba
So basically this is like a patch to Jeija's Mesecons.

PostPosted: Thu May 31, 2012 15:21
by Jordach
No, this is a Windows program that simulates mesecons in a 2d view.

PostPosted: Sat Jun 02, 2012 14:26
by LolManKuba
Why is this in mods then

PostPosted: Sat Jun 02, 2012 15:06
by Jordach
Because its a emulator for a mod - which works like the mod.

PostPosted: Tue Jun 05, 2012 21:18
by Temperest
Update: current git version supports a bunch of new things. Complete enough, in fact, that I made a half adder that simulated perfectly:

Image

Next up: undo/redo and file saving/loading!

PostPosted: Wed Jun 06, 2012 02:11
by SegFault22
cool

PostPosted: Tue Jun 19, 2012 00:52
by Temperest
Update:

Version 1.0 Stable has been released!

Here's a screenshot:

Image

And here's the half adder schematic seen in the image above:

Half Adder.mesecon

Download links in the first post!

PostPosted: Tue Jun 19, 2012 11:58
by sfan5
Nice!

PostPosted: Tue Jun 19, 2012 15:56
by Temperest
By the way, sfan5, would you happen to have a desription of the WorldEdit save format? I'm planning to add and "export to WorldEdit" menu option in the next version.

PostPosted: Tue Jun 19, 2012 18:09
by sfan5
Example WorldEdit Save Lua Code:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
{
  {
    {-2,6,0},
    {name="default:water_source",param1=5},
  }
}

That is Saved with http://lua-users.org/wiki/SaveTableToFile
Note: I disabled "file:write( "-- Table: {"..idx.."}"..charE )" because that is useless

PostPosted: Tue Jun 26, 2012 00:03
by Temperest
sfan5 wrote:Example WorldEdit Save Lua Code:


Unfortunately the example you gave did not seem to match what I had received as output from the mod:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
return {
{
   {2},
},
{
   {3},
   {4},
},
{
   ["y"]=0,
   ["x"]=0,
   ["z"]=0,
},
{
   ["param1"]=15,
   ["name"]="default:glass",
},
}


This was a single block of glass, which saved and loaded perfectly. I'm not quite sure what certain parts of the file are for.

PostPosted: Sat Jul 07, 2012 03:38
by Temperest
Update:

Version 1.5 stable!

  • File handling changes - confirm save on exit, keep file modified flags, etc.
  • Nasty power propagation bug now fixed.
  • Hotkey bug fixed.
  • New schematic format! Is forward compatible, but not backwards. See warning below.
  • New nodes! Signs for labelling stuff (text shows up on them!), and switches, for more convenient inputs. Punch to modify.

You will get a warning about a malformed file when opening schematics created by older versions of MeseconEdit. In this case simply select "Yes" and it will still load the file.

PostPosted: Sat Jul 07, 2012 05:33
by sfan5
Temperest wrote:
sfan5 wrote:Example WorldEdit Save Lua Code:


Unfortunately the example you gave did not seem to match what I had received as output from the mod:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
return {
{
   {2},
},
{
   {3},
   {4},
},
{
   ["y"]=0,
   ["x"]=0,
   ["z"]=0,
},
{
   ["param1"]=15,
   ["name"]="default:glass",
},
}


This was a single block of glass, which saved and loaded perfectly. I'm not quite sure what certain parts of the file are for.

The Thing i gave you was the raw array, which gets saved with http://lua-users.org/wiki/SaveTableToFile
That Code saves the Table
You must port the saving and loading logic of the savefiletotable.lua thing to autohotkey,
if you do that you get the raw array

PostPosted: Sat Jul 07, 2012 15:45
by Temperest
Ah thanks, I'll look into that.

WorldEdit support will land in one of the coming versions.

PostPosted: Sat Jul 07, 2012 22:36
by Temperest
Update:

Version 1.6 Stable!

  • WorldEdit import/export! Find it in File -> Import and File -> Export, respectively.
  • Fixed major serialization bug in v1.5 that prevented files from being properly saved.

PostPosted: Tue Jan 15, 2013 22:33
by jojoa1997
can you post updated pics

PostPosted: Tue Jan 15, 2013 22:35
by Temperest
That is an updated picture, jojoa1997.