Read by Council Block Editor - Copy and paste existing blocks

    Benevolent27

    Join the Dark Side
    Joined
    Aug 21, 2015
    Messages
    585
    Reaction score
    327
    • Purchased!
    So, currently I think there is already a good basis for block creation and custom server settings. However, I think there can be be some work done on these, and I think a few additions of usability would really go a long way toward opening up their use. This is by no means a complete write-up on suggestions for improving the Block Editor. But all things must start somewhere.

    Here's what I propose:

    1. In the block editor, add a "copy" option when right clicking. This would be in addition to the existing "Remove" option. Now, I know there is a "edit -- blocks" menu that has options, such as "duplicate," but as far as I can tell, they either aren't working or they do something different than what I think they are supposed to do. That said, when "copying" a block, it would create a duplicate of the same block. This duplicate would appear in the same category of the original. It would retain all of the same properties and it would automatically create a new block ID for the block. For example, a copied cannon computer might be renamed to "Super Cannon". The player could then copy cannon modules, making "Super Cannon Modules." Players could then customize and use their new "Super Cannon" in game, as a fully functional weapon, using it right away.


    2. Allow players to add new textures when editing the textures of a block. It would copy the selected image file over to the appropriate starmade folder, and a new tab would show up (like the t000 tab).


    3. Allow easy assigning of settings/blocks to a world. You would do this by opening the World Manager, pressing a "Assign Custom Settings File to world" button, then selecting a zip file which contained all the custom settings and custom textures for blocks. This would make it a lot easier to create a new world and test some custom settings. Right now, it's a bit wonky creating backups of these files and trying to manage different groups of settings/blocks is difficult at best. This would be done here:


    Now, you might be thinking, "sure these would be nice additions, but why would it 'unleash creativity'?" Well, here's why. Because when creating is easy, people create. This is a necessary baseline for modding. If I had this functionality, I'd be making all sorts of variants of weapons, testing different speeds, damage values, etc. I'd be trying out different settings files and balancing acts. Servers could easily share their settings if they wanted, so that players could play in single player using them. But, as it stands, I have been sitting here for hours now trying to create a new weapon.. and.. I'm at a loss here. I've been googling all over the place, searching the forums.. not finding answers.. talking in the chat room.. Looking over all the settings manually, trying to edit them.. and I got nothin. Simple "copy/paste" functionality would be awesome right about now.

    Well, that's all the time I got for today. Thoughts and suggestions are welcome. :)
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    There is an xml file where you can change this behaviour, just only for all worlds (except online servers).
    But you have to open it in a text editor - no nice graphical user interface.

    I think it is blockBehaviour.xml, the file which declares the damage of weapons etc.
    If an option isn't there, it is likely either in the server-config or not available or in the source (which isn't editable or readable by us).

    But "Because when creating is easy, people create." is still true.
     

    Benevolent27

    Join the Dark Side
    Joined
    Aug 21, 2015
    Messages
    585
    Reaction score
    327
    • Purchased!
    There is an xml file where you can change this behaviour, just only for all worlds (except online servers).
    But you have to open it in a text editor - no nice graphical user interface.

    I think it is blockBehaviour.xml, the file which declares the damage of weapons etc.
    If an option isn't there, it is likely either in the server-config or not available or in the source (which isn't editable or readable by us).

    But "Because when creating is easy, people create." is still true.
    Oh, I'm well familiar with blockBehaviorConfig.xml, BlockConfig.xml, and the server.cfg. I edit these on a regular basis. I use the Block Editor to create new blocks and skin them though. I have also looked through the source code a bit, but it's obfuscated and I don't particularly want to break the TOS by reverse decompiling it and creating a Frankenstein game.

    The issue I have run into, is that there seems to be no way to make a new block into a type of weapon. It seems like there is a missing component in the block editor and configs (or I'm just not knowledgeable to figure it out, and nobody seems to know the answer), so all I can do is is create new decorative blocks, lol. They look like weapons.. but they don't act like weapons. It seems like Shine made the tools to open up a lot of possibilities for new blocks, but stopped JUST SHORT of them actually being really useful. But even if it is already possible to copy weapons/radar jammers/cloakers/etc., I have not been able to figure it out. I'm knowledgeable about computers, running servers, scripting in java, editing configs.. And if I can't figure it out, then something can be done to make this easier. :)

    Here's an example of a universe I'm trying to create. I'd like to make copies of all the weapons and give them different base attributes. Some would be very slow, but very powerful weapons, designed for fighters. Others would be upgraded versions of existing weapons. For example, an "Advanced Cannon," which takes 20 cannon modules, but does 10 times more damage and uses 10 times more power. Also it's blocks have some armor and more life than regular cannon blocks. I'd also like to make 2 types of power capacitors. One that is extremely heavy but inexpensive (for use on stations), and an expensive but very light version for ships that carries a lot more capacity (let's say 100 times the amount). Then for power reactors, one version would be be extremely heavy, so they would only be useable on bases, and another version would have a small amount of power regen that has no stacking. Thrusters and jump drives would have reduced energy cost, while weapons would have much increased power usage. The goal is to make a universe where ships can have a lot of energy stored up and upgraded weapons, but they have to go back to the home base to replenish their energy when depleted after attacking. People would need to build energy efficient systems to attack effectively. And this would be possible I could simply make copies of existing blocks/weapons and edit their values.
     
    Last edited:
    Joined
    Sep 1, 2015
    Messages
    188
    Reaction score
    37
    Very interesting idea. I imagine that this is already in the works. If not then it definitely makes sense to add this functionality. I'm just not sure how difficult that would be. It would be nice if the custom behavior would work for servers though.
     

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    /StarMade/data/config/BlockTypes.properties

    There you can assign IDs to a funktion. But I think you can only assign one ID to each function.

    Multiple blocks like with different effect modules have different hooks into the program.
    [DOUBLEPOST=1455156657,1455155987][/DOUBLEPOST]NOTES
    When if you re-assign the ID, it will not behave as expected on other servers.
    I don't know if there is a user-file for that jet.

    Personally I'd like SM to use instead of default~name or custom~name equally named files in different root-folders.
    folder "starmadedock.net" would be the default
    folder "internet-address.us" or "server.de" would be examples for local caches of public servers.
    folder "custom.user" or "custom.local" could contain files for the own server / single-player.
    file "folder.config" would have entries like "folder.name = default-folder.name, display name"
     

    Benevolent27

    Join the Dark Side
    Joined
    Aug 21, 2015
    Messages
    585
    Reaction score
    327
    • Purchased!
    /StarMade/data/config/BlockTypes.properties

    There you can assign IDs to a funktion. But I think you can only assign one ID to each function.

    Multiple blocks like with different effect modules have different hooks into the program.
    [DOUBLEPOST=1455156657,1455155987][/DOUBLEPOST]NOTES
    When if you re-assign the ID, it will not behave as expected on other servers.
    I don't know if there is a user-file for that jet.
    Well, just to demonstrate the current difficulty I am having, and why I think a simply "copy" function is needed...

    Here's what I did in my venture to copy a weapons system. I made a new block called the "SuperCannon Module" and another one called "SuperCannon module", using the Block Editor. The computer is set to "CUSTOM_ID_000" and the module is "CUSTOM_ID_001". They both have unique item numbers, as shown below (Excerpt from BlockTypes.properies):
    CUSTOM_ID_000=1792
    CUSTOM_ID_001=1793

    I duplicated all of the block settings from the cannon computer and module to the respective "SuperCannon" blocks. I then set the "SuperCannon" computer to controlled by the core and controlling the "SuperCannon Module" (as it is with the Cannon computer). I set the "SuperCannon module" to be controlled by the "SuperCannon Computer" (again, as it is with the Cannon computer/module). I then added a section into the blockBehaviorConfig.xml, duplicating the cannon settings there, named "SuperCannon Computer." This did not work. So I tried simply "SuperCannon" (even though I know this would not work, since I was unable to define the weapon's name as such anywhere). This did not work. I then tried naming the section, "CUSTOM_ID_000," which did not work.

    So, I decided to try and find where the name for weapons in the blockBehaviorConfig.xml comes from. Example:
    Code:
    <DumbMissile>
                    <BasicValues>
                            <Damage>300</Damage>
                            <Distance>1.6</Distance> <!-- 1 is equal to 100% sector radius -->
                            <Radius>12</Radius>                       <!--this a maximum blast radius -->
                            <Speed>2.48</Speed>             
                            <ReloadMs>15000</ReloadMs>
                            <PowerConsumption>1500</PowerConsumption> <!-- deviates from 10 power/1damage formula, missiles can easily be shot down -->
                            <AdditionalPowerConsumptionPerUnitMult>0.025</AdditionalPowerConsumptionPerUnitMult> <!-- Nerf based on amount of groups connected to the same controller: powerConsumption * (1+countGroups*thisValue); 0 tu turn off nerf-->
                            <ChasingTurnSpeedWithTargetInFront>1.0</ChasingTurnSpeedWithTargetInFront>
                            <ChasingTurnSpeedWithTargetInBack>0.5</ChasingTurnSpeedWithTargetInBack>
                         
                    </BasicValues>
                    <Combination>
                            <Cannon>
                                    <Damage style="nerf" value="15" linear="true" />
                                    <Reload style="buff" inverse="true" value="15" />
                                    <Distance style="skip" />
                                    <BlastRadius style="nerf" value="2" />
                                    <Speed style="buff" value="2.0"/>
                                    <Split style="skip" />
                                    <Mode style="set" value="0"/> <!-- Dumb Missile -->
                                    <PowerConsumption style="nerf" value="15" linear="true" />
                            </Cannon>
                            <Missile>
                                    <Damage style="skip" linear="true" />
                                    <Reload style="skip" />
                                    <Distance style="skip" />
                                    <BlastRadius style="nerf" value="3" />
                                    <Speed style="nerf" value="2" />
                                    <Split style="buff" value="9" />
                                    <Mode style="set" value="1"/><!-- Heat Seeker Missile -->
                                    <PowerConsumption style="skip" linear="true" />
                            </Missile>
                            <Beam>
                                    <Damage style="buff" linear="true" value="2" />
                                    <Reload style="nerf" inverse="true" value="2" />
                                    <Distance style="buff" value="2" />
                                    <BlastRadius style="skip" />
                                    <Speed style="buff" value="1" />
                                    <Split style="skip" />
                                    <Mode style="set" value="2" /><!-- Smart Missile -->
                                    <PowerConsumption style="nerf" inverse="true" linear="true" value="2" />
                            </Beam>
                            <Pulse>
                                    <Damage style="buff" linear="true" value="5"/>
                                    <Reload style="nerf" inverse="true" value="5" />
                                    <Distance style="skip" />
                                    <BlastRadius style="buff" value="3" />
                                    <Speed style="nerf" value="3" />
                                    <Split style="skip" />
                                    <Mode style="set" value="2" /><!-- Smart Missile -->
                                    <PowerConsumption style="nerf" inverse="true" linear="true" value="5"/>
                            </Pulse>
                    </Combination>
            </DumbMissile>
    So the question is, where does "DumbMissile" come from?

    The line in the BlockConfig.xml for missiles is:
    "<Block icon="10" name="Missile Computer" textureId="375, 308, 371, 377, 309, 309" type="MISSILE_DUMB_CONTROLLER_ID">"
    No match for "DumbMissile," though they use the word "dumb" when setting the type.
    So, in the BlockTypes.properties, missiles are given their ID as "MISSILE_DUMB_ID=32" and "MISSILE_DUMB_CONTROLLER_ID=38." Ok, so still no match. Again, I see the word "dumb" there, but it is not "DumbMissile." So I did a deep search using a program, NotePad+, to search the contents of every file in the StarMade folder for "DumbMissile," to try and figure out how these settings are actually being linked to the "MISSILE_DUMB_CONTROLLER_ID" block. This was a search through ALL config files, database files, and executables, everything. This exhaustive search resulted in.. 25,127 hits. I looked through the entire list.. and these were all from log files, the blockBehaviorConfig.xml (and the versions for other servers), the revertBehaviorConfig.xml, and several hits within the StarMade.jar file ("org/schema/game/common/data/element/ship/ShipDumbMissileElement.class" being one of them). So I attempted to navigate to this folder within the StarMade.jar (which opens as a zip file), but it was not there, leading me to believe this class is within the obfuscated code. (so, since I'm not willing to attempt to reverse decompile and deobfuscate the code to edit it, and then recompile it), this is a dead end.

    So, somewhere in the game's compiled code, there is a link from item number's 32 and 38 (or perhaps MISSILE_DUMB_ID or MISSILE_DUMB_CONTROLLER_ID), which pairs the block to the name "DumbMissile" and that is what enables the block to be further configured in "blockBehaviorConfig.xml", fire missiles in game, show up in the weapon screen, show up in the hotbar, etc. If I am right, then there is simply no way to duplicate or create a new weapon type presently. We are limited to creating decorative blocks or modifying existing weapons in the game.

    Now, how to proceed in introducing this functionality? I think editing configs is great and all, but for most users, a GUI is a big help. This is why I think a simple "copy" function (and whatever is entailed to get that working), would result in a modding explosion. It would then become clear what the next step is in implementing the modding API. (Give the ability to create new projectiles, setting up how certain projectiles affect a ship or blocks they hit, allowing configuration of passive abilities, giving the ability to add new graphical effects of blocks - like the thruster's heatwave effect, etc.) Ultimately, the reason for my post here is that modding is the backbone for sandbox games, and if StarMade is to be successful, I see it as a critical component. And the sooner it is implemented, the sooner StarMade will hit the mainstream. I feel the steps I mentioned in my post above are a simple, and logical next step.
     
    Last edited:
    • Like
    Reactions: Smoke

    NeonSturm

    StormMaker
    Joined
    Dec 31, 2013
    Messages
    5,110
    Reaction score
    617
    • Wired for Logic
    • Thinking Positive
    • Legacy Citizen 5
    "<Block icon="10" name="Missile Computer" textureId="375, 308, 371, 377, 309, 309" type="MISSILE_DUMB_CONTROLLER_ID">"

    So the question is, where does "DumbMissile" come from?
    Apparently SM uses MISSILE_DUMB_CONTROLLER_ID to identify the blockConfig.xml entry for Dumb-Missiles.
    And it uses "<DumbMissile>" to identify the blockBehaviourConfig,xml entry for Dumb-Missiles.

    One is for the appearance, the other for effects.
    HP + armour are in blockConfig, damage and reload in blockBehaviourConfig
     

    Benevolent27

    Join the Dark Side
    Joined
    Aug 21, 2015
    Messages
    585
    Reaction score
    327
    • Purchased!
    Apparently SM uses MISSILE_DUMB_CONTROLLER_ID to identify the blockConfig.xml entry for Dumb-Missiles.
    And it uses "<DumbMissile>" to identify the blockBehaviourConfig,xml entry for Dumb-Missiles.

    One is for the appearance, the other for effects.
    HP + armour are in blockConfig, damage and reload in blockBehaviourConfig
    Ok. But how would one copy the weapon to have 2 types of missiles? As I see it, there is no way to create a <DumbMissile2> weapon type. I can create the blocks, but not duplicate the weapon functionality. That part of weapons systems is buried deep in the StarMade code and is static. As it stands, it seems all I can do is create decorative blocks or modify existing blocks. I am not trying to edit the existing block.