New items possible?

Discussion in 'Empyrion API' started by Preston, Jun 24, 2020.

  1. Preston

    Preston Commander

    Joined:
    Jul 6, 2017
    Messages:
    123
    Likes Received:
    25
    I read the examples and explanations in all the new accessable .ecf files and I was wondering if its possible now to define additional/new items.

    For Example a additional/fourth "high level fuelcell" with rare ingredients and a higher fuel value. Even maybe with custom icon.

    Am I right? Do I interpret the hints and explanations right?
    I'm not sure if I understand the new files correctly.
     
    #1
  2. Lyceq

    Lyceq Ensign

    Joined:
    Mar 13, 2020
    Messages:
    21
    Likes Received:
    12
    So far I have been able to create new templates, such as synthesizing eggs from protein in the food processor. Haven't found a way to add the template to the food processor UI, but it does get used as part of making waffles or plasma. Putting this template on my server allowed all players to use it without changing their own clients. (Massive thanks for this Eleon!)

    Regarding graphical elements such as icons. You will have to use existing icons. Look around the files to see what resources they use. Custom icons, textures, models, animations, etc will require editing the Unity resource packs. Not exactly easy and will be lost with every update. On top of that, servers are not likely to be streaming such resources, so every player would have to apply the mod. CoQs would be very likely I imagine. Haven't tried this yet though.
     
    #2
    Myrmidon likes this.
  3. Vermillion

    Vermillion Rear Admiral

    Joined:
    Jul 15, 2018
    Messages:
    3,286
    Likes Received:
    8,956
    Yes, you can add new items, recipes, blocks and devices. As long as there's enough source in existing configs to be cannibalized to make new stuff.
    Items aren't much of a problem if they're removed later, but blocks will corrupt your game or take giant chunks out of whatever they were used in.
     
    #3
  4. Lyceq

    Lyceq Ensign

    Joined:
    Mar 13, 2020
    Messages:
    21
    Likes Received:
    12
    I interpret this as meaning that you have to change an existing item to make a new item, thus losing the original item. Let me know if I got that wrong.

    I think this is only the case with config.ecf. If you change the new config files you can create something entirely new without cannibalizing an existing object. In my example, I changed Templates.ecf and added an entirely new template without changing an existing one.

    This part is definitely applicable and well worth paying close attention to. It will be very difficult to remove some things that have been added with out requiring a new game. Be sure to carefully think through whether you want to add something to a multiplayer game because you may not be able to take it back.
     
    #4
  5. Preston

    Preston Commander

    Joined:
    Jul 6, 2017
    Messages:
    123
    Likes Received:
    25
    I'm not talking about altering an existing item in config.ecf.
    I'm asking because of the content of the new accessable itemsConfig.ecf file.

    All the different "basic media settings" like "Meshfile" or "SfxJammed" compared to the little "+" in the syntax of the item id in this file
    makes me guessing that this file could maybe indicate a possibility to "generate" complete new items.

    Of course i'm not assuming to generate items with whole new properties, handles or animations like "handgranates".
    This file can probably only use in code implemented super-classes.
    But a derived item from an existing/implemented "item-supertype" like "fuelcell" sounds possible to me.
     
    #5
  6. Vermillion

    Vermillion Rear Admiral

    Joined:
    Jul 15, 2018
    Messages:
    3,286
    Likes Received:
    8,956
    No, you can make entirely new items without overwriting existing items. But you can't just put in random lines of code that aren't used by the game.

    For example, Preston wants a fourth, high-tier fuel cell.
    In the itemsconfig.ecf it would look like this:
    Code:
    { +Item Id: 1199, Name: AntimatterCell, Ref: ComponentsTemplate
      Mass: 100, type: float, display: true, formatter: Kilogram
      Volume: 15, type: float, display: true, formatter: Liter
      FuelValue: 750, type: int, display: true, formatter: WattHour
      MarketPrice: 5000
      ShowUser: Yes
      Info: bkiEnergyCell, display: true
      CustomIcon: EnergyCellHydrogen
      UnlockCost: 35, display: true
      UnlockLevel: 25, display: true
      TechTreeParent: FusionCell
      TechTreeNames: Misc
    }
    
    You'd also need to make a new recipe for it in the Templates.ecf and go to each fuel tank in the BlocksConfig.ecf and add the new fuel cell to the FuelAccept line so that it's accepted by the fuel tank.
    You could probably use that code as-is and it would work.
     
    #6
    Lyceq likes this.
  7. Lyceq

    Lyceq Ensign

    Joined:
    Mar 13, 2020
    Messages:
    21
    Likes Received:
    12
    Ah, I understand what you're saying now. Yes, not only do you have to code in the thing, you have to hook it into everything else as well.
     
    #7
  8. Lyceq

    Lyceq Ensign

    Joined:
    Mar 13, 2020
    Messages:
    21
    Likes Received:
    12
    So far my testing has shown that this it entirely possible. You can even hook up the item into the tech tree so there is more stuff to spend those unlock points on.
     
    #8
  9. Preston

    Preston Commander

    Joined:
    Jul 6, 2017
    Messages:
    123
    Likes Received:
    25
    One last question came to my mind.
    The item-id is the unique key to identify the item, right?
    Every id must only be used once, right?

    Is there a possibility like a table or similar to identify the occupied ids?
    How do I find a free id and how can I check after a patch that my occupied id is still free?
    What's the easiest way?
     
    #9
  10. Khazul

    Khazul Rear Admiral

    Joined:
    Jan 15, 2020
    Messages:
    825
    Likes Received:
    1,445
    The table to identify the IDs is effectively the config files. Mostly they are well ordered so it is quite easy to identify the gaps.

    Also something to consider is that updates to the game may well use the ID that you are using forcing you to have to change. Often you can see this coming as the ID often gets reassigned to a new definition several patches before the new feature becomes available. Also there are a bunch of assigned IDs for new equipment that is not yet functional.

    As for identifying updated items - use a good diff tool.
     
    #10
    Lyceq likes this.
  11. Preston

    Preston Commander

    Joined:
    Jul 6, 2017
    Messages:
    123
    Likes Received:
    25
    Thanks to all. I will give it a try at the weekend and see what interesting items I'm able to create.
     
    #11
    Lyceq likes this.
  12. Preston

    Preston Commander

    Joined:
    Jul 6, 2017
    Messages:
    123
    Likes Received:
    25
    I had a closer look at the link between the config.ecf , itemconfig.ecf and templates.ecf for one specific item.
    I'm confused about the principle.

    From "itemconfig.ecf":

    { +Item Id: 218, Name: EnergyCell, Ref: ComponentsTemplate
    //...//
    }

    From "config_example.ecf":

    { Item Id: 2266, Name: EnergyCell, Ref: ComponentsTemplate
    //...//
    }

    From "templates.ecf":

    { +Template Name: EnergyCell
    //...//
    }

    The file "config_example.ecf" does not contain id 218.
    The file "itemconfig.ecf" does not contain id 2266.
    The file "templates.ecf does not use any of this two ids.

    So what are the ids good for? The "name" seems to be the "primary key" for item identification.
    But when at least two ids are needed how is this structure easily maintained?
    Even with a good file compare tool it looks unecessary complicated/double-handled
     
    #12
    Last edited: Jun 27, 2020
    Lyceq likes this.
  13. Preston

    Preston Commander

    Joined:
    Jul 6, 2017
    Messages:
    123
    Likes Received:
    25
    I used in itemconfig.ecf a id-range far away from the original ones to avoid overlap.
    But the game seems to limit the range very narrow.
    id 5000 game crashed,
    id 4000 game crashed,
    id 3000 game crashed,
    id 2500 game crashed (asspecially wierd because ids in config.ecf are above this limit)
    id 2000 game loads new item

    A entry for this item in "config.ecf" seems not necessary.
    All needed settings are loaded from itemconfig.ecf.
    The inheritance structure is really wierd.

    I want to use the icon of the FusionCell but both files "config_example.ecf" and "itemconfig.ecg" are not allocate any icon to the FusionCell to copy from. The example "CustomIcon: DetectorSVT1" from the Head of the file "itemconfig.ecf" converted to "CustomIcon: FusionCell" does not load any icon.

    Where can i define decriptions and located names? The file for this informations seems not to be in the "..\configuration\" directory.
     
    #13
  14. Khazul

    Khazul Rear Admiral

    Joined:
    Jan 15, 2020
    Messages:
    825
    Likes Received:
    1,445
    There is a limit that I suspect comes down to a hard coded static array or perhaps an enum in the game engine. It seems you have narrow that down. I guess the limit might be up to 2047 (inclusive), but I have never tested this.

    config.ecf is the old config system (pre alpha 12). I am not sure that it is still used in any way, however it is obviously still part of their release process. I just ignore it now. I suspect it may come back to have another use in future, or maybe not.

    Displayed names and messages are in extras/localizations.csv.
    In the end, if you want to mess with this stuff, then welcome to the same voyage of discovery the rest of us are on :)
     
    #14
  15. Preston

    Preston Commander

    Joined:
    Jul 6, 2017
    Messages:
    123
    Likes Received:
    25
    Of cause is this early access and the api and customisation is not documented until now.
    But i'm a coder and its seems that eleon gives themselve a very hard time on different code parts.
    They could have their mechanics much easier handleable(for them, not for us) :)
     
    #15
  16. Samoja

    Samoja Commander

    Joined:
    Jun 6, 2019
    Messages:
    43
    Likes Received:
    62
    Well, from what i know Eleon devs are at least in part self taught, so if you have a suggestion on how to clean up the code i am sure they would be more then happy to hear it, as someone who is just learning to code it can be very counter intuitive sometimes.
     
    #16
  17. Preston

    Preston Commander

    Joined:
    Jul 6, 2017
    Messages:
    123
    Likes Received:
    25
    Assuming they use a high level language like C# I would suggest to use a dynamic object dictionary.
    Read in the itemconfig.ecf file and generate the item dictionary from that at game startup time. No static array or limited number range.
    Who cares about numbers? Let the object library do the work and just take one primary key (the "name" for example) from the file to identify the item.

    If an exception (name doubling, parse error, data format error or what else) occurs on the file interpretation because of a user mistake in the file just hold a code internal fallback settings set which provide basical functionalty of loading procedure and send a "you are an idiot" message on loading screen.
     
    #17
  18. Preston

    Preston Commander

    Joined:
    Jul 6, 2017
    Messages:
    123
    Likes Received:
    25
    Today I had a look and a bunch of tries with localization.csv with no luck.
    The game shows the variable names in the popup of my new item but not the localized values.

    The item setting:
    { +Item Id: 2000, Name: AntiMatterCell, Ref: ComponentsTemplate
    ...
    Info: bkiAntiMatterCell, display: true
    ...
    }

    The Localisation.csv setting:
    bkiAntiMatterCell,A experimental module purging energy from the subspace,Eine experimentelle
    Speicherzelle die Energie aus dem Subraum abzieht,,,,,,,,,,,,,,,
    AntiMatterCell,Anti-matter cell,Antimaterie Modul,,,,,,,,,,,,,,,

    I put the entries at the end of the file. I put entries at the second line of the file.
    I used Excel. I used Notepad++.
    I put the CrLf behind the german part. I add empty entries for other languages and put the CrLf after the last possible language.

    The game loads every time without error message and loads its standard values
    but custom entries seems not to be used.:confused:
     
    #18
  19. Vermillion

    Vermillion Rear Admiral

    Joined:
    Jul 15, 2018
    Messages:
    3,286
    Likes Received:
    8,956
    Custom localizations don't work anymore. They will work if attached to a scenario, but editing the game's main localization always throws an error.
    It's been reported, but ignored.
     
    #19
  20. Murthy Bhavaraju

    Murthy Bhavaraju Ensign

    Joined:
    Aug 22, 2019
    Messages:
    16
    Likes Received:
    4
    I was able to create a new WarpDrive with 60 LY range on it, but I am unable to get the its icon picture in the menu. Has anyone tried to play with explosives ? I was able to increase its range on the default block in EClass.config, but couldn't repeat it when I tried to create a new block for an enhanced explosive
     
    #20

Share This Page