Giter VIP home page Giter VIP logo

spaceengineers's Introduction

ARCHIVED VERSION OF Space Engineers. This version is not up-to-date version of the game.

If you find some issue with the game please report on https://support.keenswh.com/.

Space Engineers

Welcome to the Space Engineers source code!

From this repository you can build Space Engineers. To play Space Engineers you need to own the game on Steam. Assets (audio, models, textures) are not included in this repository.

Before downloading the source code please read the EULA carefully - End User License Agreement.

See the Change log for latest changes.
Have you found a problem related to the source code? Report an Issue.
Discuss source code on our source code sub-forum.

Prerequisities

Quickstart

Space Engineers must be installed on your computer, Steam must be running.

  • Clone or download and unpack the repository.
  • Open SpaceEngineers.sln in Visual Studio.
  • Open file global.props (it's in configuration folder).
  • Make sure ContentPath tag contains path to SpaceEngineers Content directory in Steam folder.
  • Start debugging by pressing F5 or select Debug - Start Debugging in main menu

Instead of modifying global.props, you can create user.props, more information here.

How to contribute

One way to contribute changes is to send a GitHub Pull Request.

To get started using GitHub:

  • Create your own Space Engineers fork by clicking the Fork button in the top right of this page.
  • Install a Git client on your computer.
  • Use the GitHub program to Sync the project's files to a folder on your computer.
  • Open up SpaceEngineers.sln in Visual Studio.
  • Modify the source codes and test your changes.
  • Using the GitHub program, you can easily submit contributions back up to your fork.
  • Do not commit to master, for each feature create new branch.
  • When you're ready to send the changes to the Keen Software House for review, simply create a Pull Request.
  • Following Coding rules will help us lower the time needed to process the PR and merge it thus increase the amount of PRs that can be merged

Advanced topics:

Common issues

Build error: The command "..\3rd\Utils\RunTemplate.bat "....\MyEnumToStringsGenerated"" exited with code 1. This is common when using old versions of Visual Studio, see Visual Studio support. It can also happen when TextTemplating.exe was not found for some reason (it should be installed with Visual Studio).

Assert: unable to find audio/model/texture file: 'xxxxxx'. This happens because repository is slightly ahead of content in Steam folder. Definitions (Content/Data) are taken from repository and may contain new definitions referencing assets which are not yet in Steam content folder. We decided to use definitions from repository by default, so you can easily modify it. You can edit global.props to use definitions from Steam (that should fix the issue). When running on Release asserts won't be shown; missing assets won't crash the game. More info here.

Where is the 64-bit version?

We're unable to provide a 64-bit version of all 3rd party libraries because of licensing. We're working on this and trying to negotiate a better license which will allow us to do that.

spaceengineers's People

Contributors

aaraujo666 avatar aaronfranke avatar andrew-w avatar codehamster avatar cwc avatar danatkinson avatar dodexahedron avatar eikester avatar emilsayahi avatar fujtajblik avatar geneticus avatar gwindalmir avatar harag-on-steam avatar joemorin73 avatar joethedestroyer avatar leonidascz avatar mexmer avatar midspace avatar mmaster avatar ondrejpetrzilka avatar rexxar-tc avatar rossm avatar sibz avatar sjsoft2015 avatar thdigi avatar tyrsis avatar vxsote avatar yajiedesign avatar zorg-kirill avatar zrisher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spaceengineers's Issues

Add ExplosionDamage to WarheadDefinition

Allow the MyObjectBuilder_WarheadDefinition to have a configurable WarheadExplosionDamage, the same as the MissileAmmoDefinition.

This way, the damage could be either toned down, or boosted.
An internal Maximum could be imposed if there is a physics limitation on applying damage.

Assembler queue access with ingame script

One of this ingame PB pb is missing is access to assembler queue.

It seems not hard to make current queue visible, but i'm not sure if it will be safe (well i'm pretty sure, it will not), therefore queue will need to be accessed either by functions (addtoqueue, removefrom queue), or using interface (IMyQueue), like is for IMyInvetory.

I'm more inclined to IMyQueue (or whatever we will call it) as safe access to queue

ideas welcome

Joints break unexpectedly in multiplayer (landing gears, pistons, rotors, connectors, etc)

The "landing gear" bug.

Sometimes there are vibrations/wobbling at joints heralding impending doom. Detaching the joint (e.g. detaching a landing gear) would then cause sudden velocity change of one/both attached grids resulting in catastrophic collision damage to what it's attached to/anything close by.

Landing gears, rotors, pistons and connectors all seem to be affected by this issue, but I nickname it the landing gear bug as it's the easiest to reproduce and most dramatic during failure. Having multiple joints attached to a grid increases the probability/strength of the issue. Merge blocks are not affected as far as I can tell.

In-game the joint looks like it is accumulating energy, sometimes instantly or sometimes over time. I suspect a rounding error or similar possibly in the netcode (it happens very frequently in MP/DS, not sure about SP).

Until the root issue is resolved a possible workaround for shattering gears/connectors: during joint detachment, check relative velocity between grids and ensure they are sane. If not, forcibly set it to something reasonable before calling Physics.RemoveConstraint. Things are likely to keep wobbling but at least they don't shatter when you press p.

Hoping with source visibility the mod community may have advantage in eyeballs to finally close this out.

Make simple enable/disable block in configuration.

On many multiplayer and especially modded servers there is a big need for simple mechanism to disable vanilla blocks for many reasons. Repeating entire entry and adding false seems to be very over-bloated way to deal with it.

Wouldn't entry like this:

Assembler LargeAssembler false

be enough?

or even introduce
false
Since public might be handy to keep pre-build stuff on the server.

Question: Is it possible to have on-demand reloading of skybox?

I have yet to dig through the source code to find my answer, but just in-case anyone else has the same thought as me, here's my question:

Does anyone see that it might be possible for the server to periodically send a new skybox to all connected clients and have the client change to the newly uploaded skybox? This would pave the way for some really interesting things:

  1. Animated skyboxes... i.e, the nearest star or planet rotating. Or the Star Trek "Warp drive" effect that uses distant stars and debris to show movement. This would basically be a small movie in loop.
  2. Scenario scenes... Show an approaching gigantic asteroid that gets bigger and bigger, you have to build an asteroid killer and launch it off... when the asteroid is destroyed the animation changes to that of destruction. This
  3. ??? Probably some other cool things that I don't have time on my lunch break to think of

Only one LCD/text panel renders at a time

Reproduce by placing multiple panels that are set to display text, close enough to each other that you can see both of them. Turn so that only one LCD is in view. When turning back to view both LCDs, the other will read OFFLINE. Affects singleplayer as well as multiplayer.

This one's been bugging me for awhile, so I looked into it. The GetRenderTexture method is responsible for returning the texture to which the text is rendered. The method successfully returns one texture, but subsequent calls fail and return null, due to the m_currentFreeResources >= textureResourceSize check failing. The initial value for free resources doesn't seem very large to me. If I just change it, multiplying it by N, I'm capable of rendering N text panels at a time, with no apparent problems.

I think the resource limit should be set dynamically, somewhere. I'm not really sure where that should happen or what the calculation should look like.

Add DoorLocation to Sandbox.ModAPI.Ingame.IMyDoor

Add the readonly property OpenPosition
to Sandbox.ModAPI.Ingame.IMyDoor

in reality it's m_currOpening.
Primarily for use in the MyAirtightDoor.

Edit:
Renamed from DoorLocation to OpenPosition for consistency with current API.

Turret AI Improvements

Putting this in to let people know I'm working on it. I've identified a couple of possible improvements for turret AI.

I intend to address the first two items immediately; the third will require a bit more familiarity with how communication between blocks is handled.

Aimpoint calculation: Current algorithm only considers velocity. Reworking the algorithm to also consider acceleration should increase turret utility, particularly against astronauts and missiles.

Target prioritization: Current algorithm is a simple "closest first" for all target types. For certain target types (missiles, meteors), targets where the sum of the normalized relative position and normalized relative velocity of the target is close to zero (IE: it's coming right for us, Cap'n!) should really have the highest priority, though distance should remain a factor. This is the highest priority item; currently, meteor defense is very unreliable, which is frustrating.

EDIT: See pull request #65 .
EDIT: No longer considering the following part of the same issue:
Distribution of targets between turrets: Ideally, we should have a way of spreading the targets out a little between the turrets on an individual ship. One way of doing this is adjusting each target priority by a random amount, so that the more alike the priorities of two targets are, the more likely it is that the turrets will pick a different target at random. A better (but harder) way is to arrange for a shared target list between turrets on the same ship, or somehow partitioning the space around the ship into different fields of responsibility assigned to different turrets. This is a lower priority item than the above two, though.

Provide External access to IMyStorage methods

Access to the IMyStorage CreateStorage(byte[] data) from an external point other than IMyVoxelMaps. This will require specifying VoxelMaterials.

This is to provide access to externals tools like SEToolbox or from within Keen's own VRageEditor tool as another plugin, to building custom Voxel Asteroids.

This unnamed class should not be white-listed for use in the Mod API.

Expected methods:
IMyStorage CreateStorage(byte[] data);
LoadMaterialData(IEnumerable voxelMaterials)

Additional details:
Would like to also be able to use some of the MyVoxelShapes.
IMyStorage will naturally provide the method; Save(out byte[] outCompressedData)

Perceived issues:
The low level classes may be too intertwined with live game data syncing to allow use without having to load the entire game engine.

This is a sample application to test what is available at the moment, and the issues I'm running into.

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using Sandbox.Engine.Voxels;
using VRage.FileSystem;

class Program
{
    static void Main(string[] args)
    {
        // Make sure the following are available/copied into the bin path:
        // Be aware if you are running x86 or x64 to use the appropriate .dll's.

        // HavokWrapper.dll
        // Sandbox.Common.dll
        // Sandbox.Common.XmlSerializers.dll
        // Sandbox.Game.dll
        // Sandbox.Graphics.dll
        // SharpDX.DirectInput.dll
        // SharpDX.dll
        // SharpDX.XAudio2.dll
        // SteamSDK.dll
        // steam_api.dll
        // steam_api64.dll
        // VRage.Audio.dll
        // VRage.dll
        // VRage.Input.dll
        // VRage.Library.dll
        // VRage.Math.dll
        // VRage.Native.dll


        // Game Content path.
        var contentPath = @"C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Content";

        // base User path.
        var userPath = Environment.ExpandEnvironmentVariables(@"%AppData%\SpaceEngineers");

        // Our test asteroid.
        var filename = Path.Combine(contentPath, @"VoxelMaps\Arabian_Border_7.vx2");

        try
        {
            // Force loading of the SteamSDK into memory, so the remaining Types in Sandbox.Game are available when MyOctreeStorage is initialized.
            //var ass = Assembly.Load(new AssemblyName("SteamSDK"));

            // Initilize the FileSystem. This is required for MyDefinitionManager to call LoadData().
            MyFileSystem.Reset();
            MyFileSystem.Init(contentPath, userPath);
            MyFileSystem.InitUserSpecific((string)null);

            // Call LoadData() to load up all the base definitions.
            // ##### static MyDefinitionManager.ctor() calls MyObjectFactory.RegisterFromAssembly(). This will forcefully load all the Types in Sandbox.Game.dll.
            // ##### There are a lot of dependant Types that need to be loaded.

            // #####
            // Here is where it all breaks down, as MySandboxGame has to be created in memory to be able to 
            // load Voxel Material Definitions. Other definitions will load, but the Voxel Material is dependant on the game engine.
            Sandbox.Definitions.MyDefinitionManager.Static.LoadData(new List<Sandbox.Common.ObjectBuilders.MyObjectBuilder_Checkpoint.ModItem>());

            // Check that materials exist.
            var materials = Sandbox.Definitions.MyDefinitionManager.Static.GetVoxelMaterialDefinitions();

            // Attempt to load the Voxel file.
            // If the specific Voxel materials that the asteroid requires are in the MyDefinitionManager memory, the voxel will load.


            // ##### static MyOctreeStorage.ctor() calls MyOctreeStorage.RegisterTypes(). This will forcefully load all the Types in Sandbox.Game.dll.
            // ##### There are a lot of dependant Types that need to be loaded.
            var storage = MyStorageBase.LoadFromFile(filename);

            Debugger.Break();
        }
        catch (Exception ex)
        {
            // Check your exception.
            // "The given key was not present in the dictionary." will mean, you are missing a required VoxelMaterialDefinition.
            Debugger.Break();
        }
    }
}

Mod API MyBlueprintDefinitionBase to expose ShipBlueprint defintions

Add Access to the MyObjectBuilder_ShipBlueprintDefinition player repository in the MyBlueprintDefinitionBase.

Much the same way GetPrefabDefinitions() and GetPrefabDefinition(string id) work.
return a list, and return the CubeGrids in the Player's personal Ship Blue prints.

ShipBluePrints are not static like Prefabs, and can change during game play.

[Modding] Can't weld/grind blocks that have their collission outside of the cube

In modding, if you make a block that has its collission model placed outside of the block's grid position, you won't be able to weld/grind it if another block is next to it (in the gridspace where the collission would be).

To explain better:
example
The red block is my custom block, the black block next to it is a button panel and the green things are their respective collission boxes.

If you have just the red block you can aim at it only by aiming through the collission box towards its placement box, but if the button panel (or any block) is there, aiming at the red block's collission selects the button panel instead.

MyPowerReceiver accessibility

i would like to be able to access PowerConsumer with ingame api, so we can write power management scripts without need parsing data from detailed info (which is also incomplete)

values what i think we need
IsPowered
IsAdaptible
MaxRequiredInput
RequiredInput
CurrentInput

PersistentFlags's CastShadows flag is ignored

MyRenderComponentBase has a PersistentFlags field which can have a CastShadows flag, removing that flag does not disable the shadows on the object.

In case there's doubt about how I use it:

        private IMyEntity SpawnPrefab(string name)
        {
            PrefabBuilder.CubeBlocks[0].SubtypeName = name;

            MyAPIGateway.Entities.RemapObjectBuilder(PrefabBuilder);
            var ent = MyAPIGateway.Entities.CreateFromObjectBuilder(PrefabBuilder);
            ent.Flags &= ~EntityFlags.Sync; // don't sync on MP
            ent.Flags &= ~EntityFlags.Save; // don't save this entity
            ent.PersistentFlags &= ~MyPersistentEntityFlags2.CastShadows;
            ent.CastShadows = false;

            MyAPIGateway.Entities.AddEntity(ent, true);
            return ent;
        }

That spwans all my custom entities which all have shadows, the other flags with no sync and no save work fine.

I have no real clue how to fix this myself though.

MyDirectXInput.GetJoystickAxisStateForGameplay()

MyDirectXInput.GetJoystickAxisStateForGameplay() says it returns 0 to 1 but it actually returns even higher than 1 if you have sensitivity high enough.

EDIT: Hmm, on further looking around I belive it works as intended but the comment is misleading instead.

Upgrade modules will not function when loading a world if only using a MySessionComponent script

Due to conflicts inherent to using MyGameLogicComponent scripts, using them is not always ideal.
This is especially an issue with upgrade modules and the fact we can't create our own block types.

If you have a custom block script using MySessionComponent, and load a world with already placed upgrades, they will not get refreshed and loaded.
They require an event, like block placement, to trigger again.

I propose triggering this refresh event during a more common operation as well, such as power changes.
I have a proposed patch I will attach to this defect.

Allow all blocks to have On/Off switch

There are few blocks, that are not devived from MyFunctionalBlock, but from MyTerminalBlock,
as a result these blocks cannot be turned off. (this of course applies also to their I interface for PB/modapi)

It's following blocks
MySolarPanel
MyOxygenFarm
MyShipController
MyButtonPanel
MyControlPanel
MyWarhead

MySolarPanel, suppose it's not an issue, there is no benefit in turning solar off ... but it's inconsistency

MyOxygenFarm, you most likely will not find situation when you will want to turn it off, except times when you will want to conserver energy (there are construction, which put oxygen behind blastdoor/hangar door, so why they should consume energy, when they don't produce oxygen ???)

MyShipController, MyButtonPanel, MyControlPanel - there might be times, when you want to disable them, but you can't there is no way (for ship controller at least main cockpit disables it partialy) - if they were inherited from MyFunctionalBlock, they will have enable action, like other blocks

MyWarhead - here might be inheritance intentional, so you will not be able easily disable warhead, but then again, inconsistency

just for consistency it would be better, if all functional blocks are inherited from same class without exception.

Possibility of adding ModAPI support to expose more drill properties for boosters

I looked at both the script for the drill booster as well as the drill code in the SE source and it looks like the drill definition already contains 2 properties;

SensorRadius
SensorOffset

These directly control the drill's area of effect on the asteroids mined by the drill. I think it would be very useful if these two could be exposed via ModAPI so that the scripting for the booster could modify these as well as the effectiveness of the drill as well. Do you think this is a valid addition to ModAPI or should these properties remain as part of the drill definition only?

Markam67

Idea about upgrading LCDs

There is some idea for improving LCD screens :

  • Able to choose a monospacing font
  • Able to set colors (background/foreground) of each characters (and not only screen)
  • Access to the display matrix of the screen

Definition Error Missing Audio File

I keep getting a definition error after running or debugging the project.

Unable to find audio file: 'RealWepPlayRifleImpMetal', 'REAL\IMP\RealWepPlayRifleImpMetal3d01.wav'.

I looked for the wav file myself in the game directory and was unable to find it. I did find the .xwm file though. In the audio.sbc file, I tried deleting the entry for the xwm file but I still received the error.

"gizmo" drawing for sensors with modified range

When we increase the max range of the sensors, per KionX's contribution, the "gizmo" drawing (Show Sensor Range Fields), doesn't show beyond the hardcoded 200m in Sources\Sandbox.Game\Game\Entities\Blocks\MySensorBlock.cs

   private const float m_maxGizmoDrawDistance = 200.0f;

Event system for scripts

First version of programming block had an unintentional but useful feature - terminal blocks had events (the very same events that you can find in ModAPI - for example IMyDoor.DoorStateChanged). Back in those days you could wire up an event handler from a programming block and execute a piece of code every time someone opens or closes the door, without any delays , workarounds or custom mod scripts. Of course this event handler would never get unsuscribed so it lived as long as the game session.

I propose to create some kind of event system for terminal blocks that we can use from programming block scripts. Below I give some code examples that illustrate the whole idea:

void Main()
{
   IMyTerminalBlock block = FindDoor("My Door 1");
   const string EventName = "Opened";

   // Subscribe to an event named "Opened" on block "My Door 1"
   AddEventHandler(block, EventName, EventHandler);
}

void EventHandler(IMyTerminalBlock block, string eventName)
{
    // Handle an event

    // Remove event subscription
    RemoveEventHandler(block, EventName, EventHandler); 
}

These AddEventHandler and RemoveEventHandler should perform invokation with respect to programming block state and should not prevent any garbage collection issues.

In my opiniom, this feature will allow players to create complex interactive scripts that work without any timer-based solutions and can process different kinds of events.

Let's discuss this idea, shall we?

Add documentation

As title says, please add documentation on the most important and most used methods and classes. That would be very helpful.

Thanks.

Error loading SteamSdk.dll assembly

Hi,

after several tedious hours just to download VS Community, I managed to successfully build the solution with no errors.
However, when launching, I get an Exception checking for Enum duplicities. Check it out:

static void TestEnumNotDuplicitiesInAssembly(Assembly assembly, HashSet<object> hashSet)
{
    foreach (Type type in assembly.GetTypes())

    MyEnumDuplicitiesTester.cs Line 76
    An unhandled exception of type 'System.Reflection.ReflectionTypeLoadException' occurred in mscorlib.dll
    Additional information: Unable to load one or several required types.

'assembly.ExportedTypes' threw an exception of type System.IO.FileNotFoundException
Unable to load file or assembly 'SteamSDK.dll' or one of its dependencies. Unable to find specified module.

File is not missing anywhere, so I don't get what's the problem.

Thanks in advance.

Turret/weapon improvement requests

  1. AI engagement range is currently moddable but does not function beyond the default 800m

  2. Missile turrets have a burst count and reload time assigned here:https://github.com/KeenSoftwareHouse/SpaceEngineers/blob/07519235308594be64a1a96254897942206899bf/Sources/Sandbox.Game/Game/Weapons/Guns/Barrels/MyLargeMissileBarrel.cs
    as m_burstFireCount and m_burstFireTimeLoadingIntervalConst_ms
    Modding of these values would be very helpful (adding them to the base turret could be good as well with a -1 burst count option for gatlings)

  3. I haven't found it in the code yet but the AI aiming point is based off the next barrel to fire but the check against shooting its own ship/grid is drawn from the center of the block instead of from the barrel causing many turrets to shoot their own ship even when the ship is not moving.

Two or more scripts can't tag the same objects, even from different mods

Two mods having scripts that are attached to a block type will not both run.

And it's a 'notice' in F11 when playing offline:

Entity script overwritten: MyObjectBuilder_MyProgrammableBlock

when both are using:

[MyEntityComponentDescriptor(typeof(MyObjectBuilder_MyProgrammableBlock))]

Programmable block being an example.

This is a serious issue that breaks mods by having other mods installed, most of the time they won't even collide since scripts are filtering specific subtypeids too.

Issues with starting game in Windowed Mode

Hello All,

I have noticed 3 issues with Windowed Mode. I normally play in Windowed Mode with a resolution of 1600x900.

Issue 1: On startup, SE remembers to set itself to Windowed mode, but does not set the resolution to what was previously set.

Issue 2: Additionally, SE will set the window size to the highest supported, however it will only render at whatever was set in the video settings.

Issue 3 (Really 2.1): If you now go to the video settings, it will read as your last supported resolution, however you will be rendering at whatever is in your config file.

The easiest way to reproduce this is to set SE to Windowed Mode and at the lowest possible setting. After you save this config, if you restart SE you will notice SE taking up most of your screen, but drawing at a very low resolution.

After digging in the source code, it looks like SE is running the following logic:

  1. Check if requested DisplaySetting (width, height, refresh rate) exists in list of SupportedDisplayModes. If so, we return with this value.
  2. If not, we setup a fallback mode using the last in the list of supported display modes
  3. Otherwise (and I'm skipping some logic here), we create a screen mode with fallback settings (800x600).

The easiest way I am finding to fix this is to force modeExists = true either by removing the foreach loop in vrage.render\myrender-device.CreateDevice() or simply setting modeExists = true after the end of the loop. This solves both issues 1 and 2, however it then bypasses the whole logic of checking if we have a supported resolution.

After MyRender-Device.CreateDevice, if we don't use the easy fix above, it then returns the last supported display mode from the list. It is then after this code that creates the window using this setting, but uses our preferred render settings for the actual rendering.

Any ideas?

Improve production process.

Currently 95% of network traffic is being generated by working Refineries and Assemblers. I know there is a hope for new multiplier that will greatly improve this situation. However even so, this optimization is needed because our host servers are blowing up.

I propose to batch a production queue and depends on amount of material to refine * time needed to do it, the result is coming out only when whole lot is completed. Spitting out results in near real time is not necessary. If you want your result quick, just add smaller amount of input resources. Also I wish to see refinery management under production tab to unify with all production blocks. Experimenting with refinery that is based on assembler block works just fine.

Error while loading Audio.sbc when starting debug

seems Audio.sbc definition contains sounds, that are not in SE content directory.

for now (as workaround) i have copied from my game folder audio.sbc into Sources\SpaceEngineers\Content\Data\

filesize diffence is roughly 10k

Cannot Debug. dll files could not be found

Just downloaded the files & followed instructions on on github page (same as readme file).

I get errors all telling me that these dlls are missing:
Sanbox.game.dll (located SpaceEngineers-master\Sources\Sandbox.Game\bin\x86\Debug). I checked and there is no such file in there.

The next one is SpaceEngineers.Game.dll (located in the same directory above).
I have tried rebuilding the project but no success.

Error 1 The command "....\3rd\Utils\RunTemplate.bat "C:\Users\KuroodoD\Desktop\Programming\SpaceEngineers-master\Sources\Sandbox.Game\Engine\Utils\MyEnumToStringsGenerated"" exited with code 1. C:\Users\KuroodoD\Desktop\Programming\SpaceEngineers-master\Sources\Sandbox.Game\Sandbox.Game.csproj 1223 5 Sandbox.Game
Error 2 Metadata file 'C:\Users\KuroodoD\Desktop\Programming\SpaceEngineers-master\Sources\Sandbox.Game\bin\x86\Debug\Sandbox.Game.dll' could not be found C:\Users\KuroodoD\Desktop\Programming\SpaceEngineers-master\Sources\SpaceEngineers.Game\CSC SpaceEngineers.Game
Error 3 Metadata file 'C:\Users\KuroodoD\Desktop\Programmin\SpaceEngineers-master\Sources\Sandbox.Game\bin\x86\Debug\Sandbox.Game.dll' could not be found C:\Users\KuroodoD\Desktop\Programming\SpaceEngineers-master\Sources\SpaceEngineers\CSC SpaceEngineers
Error 4 Metadata file 'C:\Users\KuroodoD\Desktop\Programming\SpaceEngineers-master\Sources\SpaceEngineers.Game\bin\x86\Debug\SpaceEngineers.Game.dll' could not be found C:\Users\KuroodoD\Desktop\Programming\SpaceEngineers-master\Sources\SpaceEngineers\CSC SpaceEngineers

Block Placement Allowed - refactoring and mod access

Currently, if a mod wanted to limit the placement of blocks on grids via certain conditions (i.e. no more than 15 turrets and 5000 blocks), they have to delete the blocks after getting to the BlockAdded event on their grid. It would be better if we could stop the block from being placed at all. We could easily pass the explanation to our users already. But actually stopping the block is a bit complicated.

Currently it seems there are two places where SE checks if a block can be placed:

  • Using the hand placer tool - MyBlockPlacerBase.Shoot() checks for MySession.Static.CreativeMode OR some internal game logic and then MyCubeBuilder.Static.CanStartConstruction(character). This check on the cube builder looks for copy/pasting OR MySession.Static.SimpleSurvival (not sure what that is) OR finally character.CanStartConstruction(blockDefinition) to see if the Character has the necessary items to place in their inventory.

  • Welding a projection - MyWelder.Shoot() checks MySession.Static.CreativeMode OR development mode OR Owner.CanStartConstruction(info.hitCube.BlockDefinition))

    As a modder, I'd love to be able to insert a check of my own before character.CanStartConstruction(blockDefinition) in these, and possibly alongside the CreativeMode check (if someone is using my mod in creative mod, they're probably testing out ships that will be allowed).

If I was just going straight in, I'd add something along the lines of CanStartConstruction(character, block) to MyCubeGrid and put checks for it next to Owner.CanStartConstruction() and CreativeMode in the above two places. Grid, character, and block would all be needed.

But I see a few places that seem ripe for refactoring, so I'm hesitant to include these here until I get some feedback on how to proceed.

  • character.CanStartConstruction is called in a lot of places and makes a lot of sense as a method to check inventory (although I might rename it along those lines).
  • MyCubeBuilder.Static.CanStartConstruction is only ever called in MyWelder.Shoot()and includes the call to character.CanStartConstruction - perhaps its logic should be mostly moved to MyWelder, with the check for the paste grid remaining in MyCubeBuilder.Static under a different name?
  • The series of checks in MyWelder and MyBlockPlacerBase share a lot of logic, which it might make sense to decompose to its various atomic areas (i.e. checks for various game modes to Session).

Could some other devs and/or Keen provide some thoughts on how to proceed here?

cannot sync created ships to clients. game/Mod API bug

Ongoing bug which means spawning prefab ships on a server/hosted game, doesn't work as only the host sees the spawned ship. This applies to Mod API calls, and to Exploration ship spawns.

I'm not able to debug this myself, so I'll document what I discovered so far. Not sure if this is a client or server problem. Also questions over if this is a design flaw relating to entity.Save = false creating a paradox (ship not saved to map, nor broadcast when clients first connect).

Let me know if you need an example mod to test this against.

MyAPIGateway.Multiplayer.SendEntitiesCreated(entitiesList);
which ends up calling
MySyncCreate.SendEntitiesCreated(entitiesList);
which calls
MySyncCreate.BuildCompressedMessage(...)

SpaceEngineers project won't load

As in the title, the SpaceEngineers project won't load. All the others work fine. It just says "load failed" next to the name in the Solution Explorer and gives me the following error:

\git\SpaceEngineers\Sources\SpaceEngineers\SpaceEngineers.csproj : error : The expression "[System.IO.Directory]::GetDirectories(c:\Program Files (x86)\Steam\SteamApps\common\SpaceEngineers\Content)" cannot be evaluated. Could not find a part of the path 'c:\Program Files (x86)\Steam\SteamApps\common\SpaceEngineers\Content'. \git\SpaceEngineers\Sources\SpaceEngineers\SpaceEngineers.csproj

Btw, my Steam folder is on another drive and not in the default location, so obviously it won't find the game's content folder there.

Wrapping terminal actions and -properties in the ingame interfaces?

[This is a question for the devs]

What are your thoughts about adding "real" functions and properties to the interfaces to wrap terminal actions and -properties? Because they are far more convenient to use than string-based actions and properties, and if you would consider including the intellisense xml in the release, it would provide inline help to those using Visual Studio or other IDEs supporting these.

I am speaking of full wrapping, including both getters and setters for properties. An example is providing a

Color Color { get; set; }

to the light interface.

What, if any, are your reasoning for not doing this?

Field manipulation in programming block control pannel

It would be great to have annotated fields declared within an in game script show up as a input field of the programming block control panel. (Similar to unity's inspector if you are familiar)

For instance the following

[Slider(0, 1)]
float value;

would display a slider named "Value" within the programming block control panel.

Some more examples:

[ToggleGroup]
bool value1, value2, value3;

Would have a set of check boxes where only one could be true

[Selection("a", "b", "c", ...)]
string[] list;

Would create a list of options to add and remove similar to the sorting block item filter

[GridBlock]
IMyThruster thruster;

Would create an input field to select an add a thruster from the control pannel to reference in the script

[GridBlock]
IMyThruster[] thruster;

Same as above but as a re sizable array to insert more than one thruster

DS On/Off switches text and values

can any of devs please shed some light to this part of code
if i comment out that "TEMPORAL HACK" line, it solves problem with some of my script on DS

Sources\Sandbox.Game\Game\Screens\Terminal\Controls\MyTerminalControlOnOffSwitch.cs, line 49

    public MyTerminalControlOnOffSwitch(string id, MyStringId title, MyStringId tooltip = default(MyStringId), MyStringId? on = null, MyStringId? off = null)
        : base(id)
    {
        if (MySandboxGame.IsDedicated) return; // Temporal hack 

        Title = title;
        OnText = on ?? MySpaceTexts.SwitchText_On;
        OffText = off ?? MySpaceTexts.SwitchText_Off;
        Tooltip = tooltip;
    }

this line of code prevents DS from loading on/off switches decription, and also on/off text value, which results in returning empty string, therefore you cannot check if something is switched On or Off, this is problem, since not all On/Off switches have coresponding Property exposed on interface.

Add an asteroid using an existing MyVoxelMapStorageDefinition.

Currently, calling ...
Sandbox.Definitions.MyDefinitionManager.GetVoxelMapStorageDefinitions()
will return a list of ...
public ListReader

We need a method on IMyVoxelMaps, that will allow us to specify a MyVoxelMapStorageDefinition to create a voxel map in game.
CreateVoxelMap(string id, Vector3D position);

or....

allow us clone the Storage on the MyVoxelMapStorageDefinition, to use in the existing CreateVoxelMap() method.

In-game scripting API (re)design

So I read @lord-devious's comments in #4, and I am also of the opinion that the API used for in-game scripting could use some refactoring so as to be more immersive. Names like IMyCubeGrid could be changed to e.g. IVessel or something that fits the game's flavor. The actual implementation classes could keep their current names, as I believe they are used directly by modders, so it makes sense for those names to be more in touch with the real world. Or perhaps it'd be better to completely duplicate the interfaces into a separate in-game-only namespace? Then there's no overlap, and it would be easier for the game designers to control what's available to players in-game, while giving the modders lots of freedom.

Expanding on that, there are other design improvements (#29) that people would like to see in the in-game API, that would need to be taken into account in any redesign. As another example, I'm not really a fan of the extension methods on IMyTerminalBlock. These exist so that scripters don't have to cast from e.g. IMyCargoContainer to IMyInventoryOwner in order to look at contained items. Personally, I would have just made the cargo container/assembler/refinery interfaces extend from IMyInventoryOwner, so neither casting nor type checking would be needed.

Anyway, I'd like to hear others' opinions. I know @Spartan322 had some comments in the original thread. Maybe we could get a general feel of what the community thinks the scripting APIs should look like.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.