Simulating Power Systems in Minetest

ElectriCraft will simulate power station control to help students learn power systems. This will be done by allowing students to create DC, AC, and three phase circuits with accompanying objects. Objects that ElectriCraft will support are digital multi-meter (which may also measures current but can also measure resistance and voltage), generators, wires, and lights. Wires will allow electricity to travel (from generators to lights). Lights will use that energy to and light up. Generators will be the source of electricity and will be configurable by the students (an in-game graphical user interface (GUI) will be present to adjust current, voltage, and power).
=Problem Definition=
Currently, there is a distinct lack of learning programs and tools available to students of all ages to learn about electricity. Most programs available are geared toward high school to college level students, and are rather bland in presentation. This leaves a gap for an all age range learning tool that gamifies the learning paradigm to increase user retention. 
==Background==
Minetest is a free and open source voxel game. A voxel video game is a game that has a 3d world that consists of ​voxels​. It was chosen as it has extensive support for creating modifications, mods, to the game. It’s straightforward to write mods that modify game behavior and add new elements to the game. Such as power systems, measurements tools, generators, etc... There exists a broad modding community to Minetest, ensuring that problems faced during the development of ElectriCraft may be solved by either reaching out to members of the community to ask questions or by finding reference material online to aid in the development and testing of Minetest.
==Deliverables==
Our objective is to develop a video game modification to assist future students in learning and experimenting with power systems, DC circuits, AC circuits, and three phase circuits - all with accompanying tools and objects for the circuits to interact with.
Generators 
*AC
*DC
*Three Phase
Tools
*Multi-meter 
Objects
*Wires 
*Lights
=Value Proposition Statement=
ElectriCraft’s goal will be to aid students in creating and learning power systems. This will be accomplished by providing facilities in-game to create several different types of circuits. DC circuits, AC circuits,and three phase circuits. Students will be exposed to the concepts of electricity and circuits at an earlier age than was previously possible. This will increase interest in the STEM field through the use of game elements to portray the real world mechanics of electricity.
=Design Considerations=
*The ElectriCraft mod will run on all platforms supported by Minetest. 
**This includes both 32 and 64-bit versions of Windows 7, windows 10, macOS, various GNU/Linux distributions, and FreeBSD. 
**The installation of ElectriCraft will not differ from Minetest’s supported mod installation process.
*The Mod will use an industry standard electricity electric power Distribution System Simulator such as Python DSS or OpenDSS.
*The mod should range from simple to complex to support all ages for learning electrical circuits.
Other considerations include ensuring the codebase is extendable and modular, so that future work on this project can be done quickly and easily.
=Project Learning=
 
*Understanding Power generation from AC, DC, and three phase generators
*Create a web framework using flask to communicate between 
*Create a communication link between the LUA running scripts and the Python running server.
=Final Design=
Example	Explanation
 	This diagram shows the systems involved in our project. Our project consists of a client and a server. The client is minetest running and executing the LUA scripts related to ElectriCraft. The LUA scripts will make an HTML request carrying with it the objects from the game in JSON format. The server running flask will receive this packet, unencode it and pass it along to OpenDSS and Networkx. OpenDSS takes the location data of the generator, wire, and light objects and determines if a circuit is created or not. If a circuit is created a JSON encoded table is passed back. The data sent to Networkx is used to create an undirected graph of connections for future processing
 	The Multimeter tool will display many values computed by OpenDSS on a completed circuit to the user. These values are listed as they are within OpenDSS and as such will require knowledge of what they represent. However this means that the users can have a skill level of beginning to advanced when studying the outputs.
 	Every generator is user configurable with resistance, voltage, currant and power. Given two of these values, the generator will auto fill the rest of the fields. In addition three total generators exist and they use the same fields as the one on the right.
 	In ElectriCraft, Circuits are considered "connected" when the input from the game is processed by OpenDSS and it gives the green light. Circuits will dynamically turn on or off based on the load being read from OpenDSS and even blow up a light if there is too much input to the light. Currently there are AC,DC, and 3 phase generators. With wires connecting lights and generators respectively.
=Validation=
Validation is done through OpenDSS, as it is vetted and industry standard simulation tool. If the circuit is considered connected, then the values are assumed to be correct as they are pulled directly from the OpenDSS API from the most recent simulation.
=Team Members=
Name: Evan Jones
Major: Computer Science
Graduation Date: Fall 2020 
Email: jone6466@vandals.uidaho.edu
Name: Jacob Friedberg
Major: Computer Science
Graduation Date: Spring 2021
Email: frie2142@vandals.uidaho.edu
=Additional Documentation=
Github: Link