GithubHelp home page GithubHelp logo

researchcore's Introduction

ResearchCore

Extensible item unlocking system for Space Engineers

This mod allows you to setup a custom research system on a per world basis, share your system with others as a Steam Workshop Mod, and include modded blocks in your research trees without fear.

Steam Workshop Page

Features

  • Lock blueprints (assembler recipes and ore refining) behind long and complicated tech trees
  • Make people suffer through gathering millions of kilograms of Silicon ore before they can build a programmable block.
  • Impose your own, custom, arbitrary limits on players who join your world without publishing a mod
  • Mix and match the most evil research trees on the Steam Workshop so only the truly dedicated have a chance of survival

Configuration - Importing Workshop Mods

To get a mod pack providing research into your world its as easy as subscribing to this (ResearchCore) mod and the research pack from the Steam Workshop.

Configuration - Making Custom Rules

Making custom rules requires an understanding of XML and a passing familiarity with navigating the SE Content files (Primarily Blueprints.sbc, BlueprintClasses.sbc, and CubeBlocks.sbc) to determine the definition ID of the items you want to block. Then, following the research definition reference you create your own research tree, or amend another tree. To load this file into your world it's as simple as naming it aux_research.xml, and placing it in this mod's world storage folder (YourSaveFolder/Storage/1227335743.sbm_ResearchCore/aux_research.xml). Reload the world and your research should be in use, and those overpowered blocks you added locked behind hours of progression.
If it isn't there you can view the ResearchCore.log file located in the same folder for information about the error.

So now you want to publish your truly diabolical research tree on the Steam Workshop?
Sadly SE doesn't have support for easy cross-mod definition sharing, so some tricks are needed.
This mod will take any prefab that has a name starting with EqResearch_, find all the programmable blocks in the prefab, and load the information located in the Program field as Base64 coded byte array, parse it into a UTF8 string, and convert it to the XML found in the reference document. Example coming soon.

researchcore's People

Contributors

equinox- avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

cybersys

researchcore's Issues

Consume="false" doesn't work

aux_research.xml

<HasItem Type="PhysicalGunObject" Subtype="WelderItem" Count="1" Consume="false" />

But item is still consumed. It defaults to true. Should it be written in some other way?

Locked blueprints aren't hidden within assembler menu

aux_research.xml

            ...
            <Unlock Type="BlueprintDefinition" Subtype="UltimateAutomaticRifle" />
            <Unlock Type="BlueprintDefinition" Subtype="Welder4" />
            <Unlock Type="BlueprintDefinition" Subtype="AngleGrinder4" />
            <Unlock Type="BlueprintDefinition" Subtype="HandDrill4" />
            ...

Locking BlueprintDefinition effectively "auto-removes" them from assembler and thus can't be created, so far so good. But they show up in assembler menu nevertheless. How to hide them also from within assembler menu?

I tried also this in aux_research.xml

            <Unlock Type="PhysicalGunObject" Subtype="UltimateAutomaticRifleItem" />
            <Unlock Type="PhysicalGunObject" Subtype="Welder4Item" />
            <Unlock Type="PhysicalGunObject" Subtype="AngleGrinder4Item" />
            <Unlock Type="PhysicalGunObject" Subtype="HandDrill4Item" />

but PhysicalGunObject assembler is not affected, nor it produces any warnings. Does these lines have any effect?

False positive warning

SpaceEngineers.log

2018-05-01 16:36:48.221 - Thread:   1 ->  No definition 'MyObjectBuilder_BlueprintDefinition/StoneOreToIngot'. Maybe a mistake in XML?

Got this but works as expected - refinery accepts but doesn't process stone before unlock, and processes stone after unlock. It even reshuffles queue to put processable ores in front.

Unlock "No definition" warnings are logged 5x each

SpaceEngineers.log

2018-05-01 16:36:48.221 - Thread:   1 ->  No definition 'MyObjectBuilder_BlueprintDefinition/StoneOreToIngot'. Maybe a mistake in XML?
2018-05-01 16:36:48.221 - Thread:   1 ->  No definition 'MyObjectBuilder_BlueprintDefinition/StoneOreToIngot'. Maybe a mistake in XML?
2018-05-01 16:36:48.221 - Thread:   1 ->  No definition 'MyObjectBuilder_BlueprintDefinition/StoneOreToIngot'. Maybe a mistake in XML?
2018-05-01 16:36:48.221 - Thread:   1 ->  No definition 'MyObjectBuilder_BlueprintDefinition/StoneOreToIngot'. Maybe a mistake in XML?
2018-05-01 16:36:48.221 - Thread:   1 ->  No definition 'MyObjectBuilder_BlueprintDefinition/StoneOreToIngot'. Maybe a mistake in XML?

Unlock "No definition" warnings are logged 5 times each. If there are more than one problem, those warnings seem to overlap randomly

SE crash on Type="giberrish" of Unlock within aux_research.xml

SpaceEngineers.log

2018-05-01 19:24:38.238 - Thread:   1 ->  Exception occured: System.Exception: Failed to parse definition ID asdf/AutomaticRifle
   at Equinox.ResearchCore.Utils.Utilities.Convert(String type, String subtype)
   at Equinox.ResearchCore.Utils.NullableDefinitionId.get_Id()
   at Equinox.ResearchCore.Definition.ResearchDefinition.<>c.<.ctor>b__8_0(NullableDefinitionId x)
   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at System.Collections.Generic.HashSet`1.UnionWith(IEnumerable`1 other)
   at System.Collections.Generic.HashSet`1..ctor(IEnumerable`1 collection, IEqualityComparer`1 comparer)
   at Equinox.ResearchCore.Definition.ResearchDefinition..ctor(Ob_ResearchDefinition ob)
   at Equinox.ResearchCore.Definition.ResearchDefinitionManager.DefinitionBuilder.Build()
   at Equinox.ResearchCore.Definition.ResearchDefinitionManager.FinishLoading()
   at Equinox.ResearchCore.ResearchManager.LoadResearchData()
   at Equinox.ResearchCore.ResearchManager.Attach()
   at Equinox.ResearchCore.ResearchCore.DoInit()
   at Equinox.ResearchCore.ResearchCore.UpdateAfterSimulation()
   at Sandbox.Game.World.MySession.UpdateComponents()
   at Sandbox.Game.World.MySession.Update(MyTimeSpan updateTime)
   at Sandbox.MySandboxGame.Update()
   at Sandbox.Engine.Platform.Game.UpdateInternal()
   at Sandbox.Engine.Platform.Game.RunSingleFrame()
   at Sandbox.Engine.Platform.FixedLoop.<>c__DisplayClass1.<Run>b__0()
   at Sandbox.Engine.Platform.GenericLoop.Run(VoidAction tickCallback)
   at Sandbox.Engine.Platform.Game.RunLoop()
   at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen)
   at SpaceEngineers.MyProgram.Main(String[] args)

But if subtype is wrong, then it logs warning and doesn't crash.

Unlock large/small block seperately

Currently if I unlock large or small block version but not other one, none of them are available to. Once I unlock both of them, only then both of them are available. Most likely that's the same cause as in another research mod here.

Please make it work so that large and small blocks could be unlocked separately.

random SE crash after ~1min while configuring `aux_research.xml`

SpaceEngineers.log

2018-05-01 10:35:29.771 - Thread:   1 ->  Exception occured: System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at Equinox.Utils.PlayerCollection.<Refresh>b__14_0(IMyPlayer x)
   at Sandbox.Game.Multiplayer.MyPlayerCollection.VRage.Game.ModAPI.IMyPlayerCollection.GetPlayers(List`1 players, Func`2 collect)
   at Equinox.Utils.PlayerCollection.Refresh()
   at Equinox.Utils.PlayerCollection.<>c__DisplayClass13_0.<PlayerConnected>b__0()
   at Sandbox.MySandboxGame.ProcessInvoke()
   at Sandbox.MySandboxGame.Update()
   at Sandbox.Engine.Platform.Game.UpdateInternal()
   at Sandbox.Engine.Platform.Game.RunSingleFrame()
   at Sandbox.Engine.Platform.FixedLoop.<>c__DisplayClass1.<Run>b__0()
   at Sandbox.Engine.Platform.GenericLoop.Run(VoidAction tickCallback)
   at Sandbox.Engine.Platform.Game.RunLoop()
   at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen)
   at SpaceEngineers.MyProgram.Main(String[] args)

Unfortunately I can't reproduce it anymore.

Crash in multiplayer

SpaceEngineers.log

2018-05-05 16:39:09.081 - Thread:   1 ->  Exception occured: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
   at Equinox.ResearchCore.Modules.InventoryScanModule.OnComponentRemoved(Type type, MyEntityComponentBase cmp)
   at Equinox.ResearchCore.Modules.InventoryScanModule.UnwatchEntity(IMyControllableEntity entity)
   at Equinox.ResearchCore.Modules.InventoryScanModule.UnwatchPlayer(PlayerResearchState data, String key)
   at Equinox.ResearchCore.Modules.InventoryScanModule.OnStatefulStorageAddRemove(PlayerResearchState research, String key, Boolean removed)
   at Equinox.ResearchCore.ResearchManager.DelPlayerResearchStatefulStorageAddRemove.Invoke(PlayerResearchState research, String key, Boolean removed)
   at Equinox.ResearchCore.ResearchManager.RaisePlayerResearchStatefulStorageAddRemove(PlayerResearchState research, String key, Boolean remove)
   at Equinox.ResearchCore.State.PlayerResearchState.RemoveStatefulStorage(String key)
   at Equinox.ResearchCore.Modules.QuestLifetimeModule.UpdateStatefulStorage(PlayerResearchState research)
   at Equinox.ResearchCore.Modules.QuestLifetimeModule.OnPlayerResearchStateChanged(PlayerResearchState research, ResearchState old, ResearchState new)
   at Equinox.ResearchCore.ResearchManager.DelPlayerResearchStateChanged.Invoke(PlayerResearchState research, ResearchState old, ResearchState new)
   at Equinox.ResearchCore.ResearchManager.RaisePlayerResearchStateChanged(PlayerResearchState research, ResearchState old, ResearchState new)
   at Equinox.ResearchCore.State.PlayerResearchState.set_State(ResearchState value)
   at Equinox.ResearchCore.Modules.QuestLifetimeModule.CheckCompletion(PlayerResearchState research)
   at Equinox.ResearchCore.Modules.QuestLifetimeModule.OnPlayerStatefulStorageUpdate(PlayerResearchState research, String key, Boolean old, Boolean new)
   at Equinox.ResearchCore.ResearchManager.DelPlayerResearchStatefulStorageUpdate.Invoke(PlayerResearchState research, String key, Boolean old, Boolean new)
   at Equinox.ResearchCore.ResearchManager.RaisePlayerResearchStatefulStorageUpdate(PlayerResearchState research, String key, Boolean old, Boolean new)
   at Equinox.ResearchCore.State.PlayerResearchState.UpdateStatefulStorage(String key, Boolean val)
   at Equinox.ResearchCore.Modules.InventoryScanModule.Update()
   at Equinox.ResearchCore.ResearchManager.Update()
   at Equinox.ResearchCore.ResearchCore.UpdateAfterSimulation()
   at Sandbox.Game.World.MySession.UpdateComponents()
   at Sandbox.Game.World.MySession.Update(MyTimeSpan updateTime)
   at Sandbox.MySandboxGame.Update()
   at Sandbox.Engine.Platform.Game.UpdateInternal()
   at Sandbox.Engine.Platform.Game.RunSingleFrame()
   at Sandbox.Engine.Platform.FixedLoop.<>c__DisplayClass1.<Run>b__0()
   at Sandbox.Engine.Platform.GenericLoop.Run(VoidAction tickCallback)
   at Sandbox.Engine.Platform.Game.RunLoop()
   at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen)
   at SpaceEngineers.MyProgram.Main(String[] args)

At that moment I was starting this research:

    <Ob_ResearchDefinition Id="Logistics" >
        <DisplayName>Logistics</DisplayName>
        <Description>TBD</Description>
        <Trigger>
            <Research Id="Start" State="Completed" />

            <HasItem Type="Component" Subtype="SpiderEgg" Count="1" Consume="false" />
        </Trigger>

        <Unlock Type="BatteryBlock" Subtype="SmallBlockBatteryBlock" />
        <Unlock Type="BatteryBlock" Subtype="LargeBlockBatteryBlock" />

        <Unlock Type="InteriorLight" Subtype="SmallLight" />
        <Unlock Type="InteriorLight" Subtype="SmallBlockSmallLight" />

        <Unlock Type="InteriorLight" Subtype="LargeBlockLight_1corner" />
        <Unlock Type="InteriorLight" Subtype="LargeBlockLight_2corner" />
        <Unlock Type="InteriorLight" Subtype="SmallBlockLight_1corner" />
        <Unlock Type="InteriorLight" Subtype="SmallBlockLight_2corner" />
    </Ob_ResearchDefinition>

Conficts with mod "Build Info" (while looking at block that has locked component)

514062285.sbm_BuildInfo/info.log

[10:27:59] ERROR: System.NullReferenceException: Object reference not set to an instance of an object.
   at Digi.BuildInfo.Extensions.AppendMaxLength(StringBuilder s, String text, Int32 maxLength)
   at Digi.BuildInfo.Extensions.ModFormat(StringBuilder s, MyModContext context)
   at Digi.BuildInfo.BuildInfo.GenerateBlockText(MyCubeBlockDefinition def)

I was just wondering if that's easy to solve, and should be solved on this side at all.

Can't unlock research

Today I started a new modded world with aux_research.xml copied from your reference example. Medical Room didn't show up in G-menu as expected, so far so good.

Then I switch to creative, paste into some blueprint that has Medical Room in it, and switch back to survival mode. After grinding down Medical Room I realized that my inventory can't hold 10 Medical components. Exit world, edit aux_research.xml from 10 down to 2 components, and start world again. After grinding and welding back Medical station components are not consumed, and Medical Room doesn't show up in G-menu. Can't see anything in logs either, only that research has initiated and recognized my player. Exited world again, tried editing and commenting out various requirements for Medical Room in aux_research.xml but no success.

I really like the idea and would like to help this to work (as well easy to configure and debug). But how to proceed?

!research completed

Please add command to list completed researches. They can already be looked up via !research info <id> but it requires to remember all of them that's cumbersome.

That way research mod could be used as a tutorial where engineers could lookup tips in already completed quests.

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.