API Feedback and Suggestions

Discussion in 'Empyrion API' started by Jascha, Mar 8, 2017.

  1. Polnoch

    Polnoch Lieutenant

    Joined:
    Sep 26, 2017
    Messages:
    43
    Likes Received:
    9
    But current telnet doesn't support each commands which works inside in-game shell

    Looks like you're going to delete it support in the future, and you don't want to give an opportunity to use all in-games commands via telnet.
     
    #421
  2. Taelyn

    Taelyn Guest

    I dont know if it will be deleted. It just wont be expanded
     
    #422
  3. Polnoch

    Polnoch Lieutenant

    Joined:
    Sep 26, 2017
    Messages:
    43
    Likes Received:
    9
    Without all in-game console features it useless anyway
     
    #423
  4. Polnoch

    Polnoch Lieutenant

    Joined:
    Sep 26, 2017
    Messages:
    43
    Likes Received:
    9
    Could you please just add a new one console command like in-game-shell-command, or igsc? As argument it will receive in-game shell command. it should be very easy to implement it for your team.
     
    #424
  5. Taelyn

    Taelyn Guest

    No sorry, If you want advanced stuff you need to switch to the API
     
    #425
  6. Polnoch

    Polnoch Lieutenant

    Joined:
    Sep 26, 2017
    Messages:
    43
    Likes Received:
    9
    Why? Is it difficult to mantain it? If you worry about security, let's hardcode bind telnet into 127.0.0.1 (or don't provide advanced stuff to telnet access in non-loopback IP)
     
    #426
  7. Polnoch

    Polnoch Lieutenant

    Joined:
    Sep 26, 2017
    Messages:
    43
    Likes Received:
    9
    I can explain why you WANT to provide advanced telnet: https://empyriononline.com/threads/wishlist-for-npc-crews-and-npc-faction-members.28730/
    You want to bring fully-functional AI for a game. But default data science language is Python. Modders can want to write something advanced and interesting.
    So, I ready to commit to support REST API wrapper around your telnet if it will support all in-game console commands and you'll promise to not delete telnet from game.
     
    #427
  8. Taelyn

    Taelyn Guest

    I dont promise anything. The game is in Early Access and that means that anything can change or removed

    We wrote the API. As replacement of Telnet. Were not going to put time in an old thing when have a replacement.

    Either use the API or dont. Up to you...

    Have a nice evening..
     
    #428
  9. Polnoch

    Polnoch Lieutenant

    Joined:
    Sep 26, 2017
    Messages:
    43
    Likes Received:
    9
    So, I don't want to commit to support C# code. Write a telnet server in C# around official API is not a big deal, but later I don't want to support it. If owners of popular mods can it least commit to support, I can write a patch in C# (maybe code qualify will be bad, because usually I use other languages, but we can work together in my PR, and improve it) for your mod. Please contact me in this case.

    If we'll do this, than I write (in python or golang) REST API server. It should help to increase popularity of modding. This is a plan.
     
    #429
    Last edited: Aug 27, 2019
  10. Mortlath

    Mortlath Commander

    Joined:
    Jul 26, 2017
    Messages:
    49
    Likes Received:
    26
    C# is open source and works on many platforms. Unity, which many games including this one, uses C#. Asking the developers of the game to provide another API in a different language that is not native to the game is not reasonable.

    Branch out, and learn a new language!
     
    #430
    Taelyn likes this.
  11. Polnoch

    Polnoch Lieutenant

    Joined:
    Sep 26, 2017
    Messages:
    43
    Likes Received:
    9
    You're right

    You're right

    You're not right:

    I not asked to support another language. I asked to implement cheap(in support) feature in their existing telnet console, than I'll write for a game cross-platform REST API. And I bealive it will be very helpful cause they want to implement advanced AI. Default language for Data science is Python

    There is no problem to start learn new language. It will take an evening, or two (to start write in it code which can be compiled, and can done required task). But starting to write a good code is much more difficult task. It can take a year or two. I don't love to write bad code, how about you? Also in the market nobody will hire a C# coder. Usually employers want to hire C# Unity, or C# Unreal developer or something else. Same for cloud tech - you'll sell your framework experience. I don't understand how can I sell basic C# Unity experience together with advanced experience with cloud framework/tools, lol.
    You should to stay focus. If not, why game developers study C#/Unity, but not, I don't know, how to write exporters in Python or Rust for Prometheus?

    So, it's a game. Modders can't expect to receive money for this activity. And write a mods is volunteering activity. Believe me, developers outside gamedev can not want to use **alien** languages and frameworks.
     
    #431
    Last edited: Aug 28, 2019
  12. Myrmidon

    Myrmidon Rear Admiral

    Joined:
    Mar 26, 2016
    Messages:
    1,736
    Likes Received:
    2,066
    A good programmer should be able to adapt and writte code in any language, especially the most popular ones. And C# is very popular on Unity. Writting code does not always start by actually writting the code in the given language. One has to start with the logic behind the code that is needed for a specific task. And that is for starters only.

    I think @Polnoch needs to be more flexible and adaptive, any requests made are not feasable...
     
    #432
    Taelyn likes this.
  13. Polnoch

    Polnoch Lieutenant

    Joined:
    Sep 26, 2017
    Messages:
    43
    Likes Received:
    9
    It's not popular in clouddev. If you're in gamedev, yes, it's must have. But if you're in clouddev, it's just waste your time. So, current API is good only for gamedev, but clouddev much, much larger. And game needs a good developers/modders. Why don't improve their support?
     
    #433
    Last edited: Aug 28, 2019
  14. Keith Hovey

    Keith Hovey Captain

    Joined:
    May 11, 2016
    Messages:
    221
    Likes Received:
    74
    To be fair... Most devs have both a Remote Console, and some form of Modding API. Even in early access. Very few dev teams are so resistant to the idea. Its almost an unspoken standard. Almost lol. Polnoch. Just dont mod for the game if you dont like the options. Thats what most people do. The devs decided c# is good enough. Thats their decision to make. I promise you thats not going to change. They will however improve on it over time :) It just is what it is. Im sorry about that.
     
    #434
    Polnoch likes this.
  15. Artectek

    Artectek Ensign

    Joined:
    Feb 29, 2020
    Messages:
    1
    Likes Received:
    0
    Is there a way to send a message to the global channel? I Checked the ingamrequest but it only send the hud messages,i also checked the consolerequest,but it can only send to the faction/player/server channel,server channel is fine,but it constantly draw attention from other channels,and i want to send message to ingame players quietly,so is there any way to send msgs to the global channel? thx
     
    #435
  16. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Hey, I think one question is enough or? You posted that question now in 4 channels....
     
    #436
  17. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    So this is something that's made life difficult for a while:

    When the host processes (dedi server, pf server) are loading mods they aren't very clear about what problems they ran into. FOr instance, right now I'm working on trying to get a mod set up, and it's not loading. THe only things the logs say are,

    Code:
    2784/Dedicated_200324-111638-80.log-24-15:16:42.183 11_16 -LOG- Faction statistics enabled
    2784/Dedicated_200324-111638-80.log-24-15:16:40.587 11_16 -LOG- Args: DedicatedServer/EmpyrionDedicated.exe -logFile ../Logs/2784/Dedicated_200324-111638-80.log
    2784/Dedicated_200324-111638-80.log-24-15:16:40.606 11_16 -LOG- Dedi log path = C:\Program Files (x86)\Steam\steamapps\common\Empyrion - Dedicated Server\DedicatedServer\EmpyrionDedicated_Data\..\..\Logs\2784
    2784/Dedicated_200324-111638-80.log-24-15:16:40.695 11_16 -LOG- *************************************************************************
    2784/Dedicated_200324-111638-80.log-24-15:16:40.695 11_16 -LOG- Dedicated Server Empyrion - Galactic Survival
    2784/Dedicated_200324-111638-80.log-24-15:16:40.695 11_16 -LOG- Version: Alpha 11.5.7
    2784/Dedicated_200324-111638-80.log-24-15:16:40.695 11_16 -LOG- Build: 2784
    2784/Dedicated_200324-111638-80.log-24-15:16:40.695 11_16 -LOG- Platform: Win, 64 Bit
    2784/Dedicated_200324-111638-80.log-24-15:16:40.695 11_16 -LOG- OS: Windows 10  (10.0.0) 64bit
    2784/Dedicated_200324-111638-80.log-24-15:16:40.695 11_16 -LOG- DRAM: 32439
    2784/Dedicated_200324-111638-80.log-24-15:16:40.695 11_16 -LOG- CPU: Intel(R) Core(TM) i9-9900X CPU @ 3.50GHz
    2784/Dedicated_200324-111638-80.log-24-15:16:40.695 11_16 -LOG- Freq: 3504
    2784/Dedicated_200324-111638-80.log-24-15:16:40.696 11_16 -LOG- Cores: 20
    2784/Dedicated_200324-111638-80.log-24-15:16:40.696 11_16 -LOG- Gfx: Direct3D 11.0 [level 11.1]
    2784/Dedicated_200324-111638-80.log-24-15:16:40.696 11_16 -LOG- VRAM: 8079
    2784/Dedicated_200324-111638-80.log-24-15:16:40.696 11_16 -LOG- SL: 5
    2784/Dedicated_200324-111638-80.log-24-15:16:40.697 11_16 -LOG- Force DX9: False
    2784/Dedicated_200324-111638-80.log-24-15:16:40.697 11_16 -LOG- Instancing: False
    2784/Dedicated_200324-111638-80.log-24-15:16:40.697 11_16 -LOG- TimeZone: -04:00
    2784/Dedicated_200324-111638-80.log-24-15:16:40.697 11_16 -LOG- Culture: en-US
    2784/Dedicated_200324-111638-80.log-24-15:16:40.698 11_16 -LOG- Last build: 2784
    2784/Dedicated_200324-111638-80.log-24-15:16:40.698 11_16 -LOG- Dedicated server build
    2784/Dedicated_200324-111638-80.log-24-15:16:40.700 11_16 -LOG- Build: Release (urlHandle)
    2784/Dedicated_200324-111638-80.log-24-15:16:40.700 11_16 -LOG- *************************************************************************
    2784/Dedicated_200324-111638-80.log-***************************
    2784/Dedicated_200324-111638-80.log-24-15:16:40.987 11_16 -LOG- Loading file 'C:\Program Files (x86)\Steam\steamapps\common\Empyrion - Dedicated Server\DedicatedServer/../dedicated.yaml'
    2784/Dedicated_200324-111638-80.log-24-15:16:41.074 11_16 -LOG- Save game version Alpha 11.5.7, Build 2784
    2784/Dedicated_200324-111638-80.log-4
    2784/Dedicated_200324-111638-80.log-24-15:16:42.118 11_16 -LOG- Loaded sector file C:\Program Files (x86)\Steam\steamapps\common\Empyrion - Dedicated Server\DedicatedServer/../Saves/Games/DediGame/Sectors/Sectors.yaml with 205 playfields, needed 1041ms
    2784/Dedicated_200324-111638-80.log-24-15:16:42.143 11_16 -LOG- Game dat file loaded
    2784/Dedicated_200324-111638-80.log-24-15:16:42.162 11_16 -LOG- Loading override ecf file 'C:\Program Files (x86)\Steam\steamapps\common\Empyrion - Dedicated Server\DedicatedServer/../Content/Configuration/Config.ecf'
    2784/Dedicated_200324-111638-80.log-24-15:16:42.169 11_16 -WRN- Config.ecf file not used because of wrong version
    2784/Dedicated_200324-111638-80.log-24-15:16:42.183 11_16 -LOG- Faction statistics enabled
    2784/Dedicated_200324-111638-80.log-24-15:16:42.184 11_16 -LOG- Mode=outputMap, GameSeed=1011345, UniqueId=346053185, EntityId=58001
    2784/Dedicated_200324-111638-80.log-24-15:16:42.276 11_16 -LOG- Start Game
    2784/Dedicated_200324-111638-80.log-24-15:16:42.276 11_16 -LOG- Server started listening on port 30000
    2784/Dedicated_200324-111638-80.log-24-15:16:42.555 11_16 -LOG- Now listening for PfServers on port 30003
    2784/Dedicated_200324-111638-80.log-24-15:16:42.638 11_16 -ERR- Exception when instantiating Mod 'ExampleMod': Exception has been thrown by the target of an invocation.
    2784/Dedicated_200324-111638-80.log-Initializing with custom id:
    2784/Dedicated_200324-111638-80.log-
    2784/Dedicated_200324-111638-80.log-(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)
    2784/Dedicated_200324-111638-80.log-
    2784/Dedicated_200324-111638-80.log-h Line: 35)
    2784/Dedicated_200324-111638-80.log-
    
    IT tells me that the dedi server has been launched, and shows the startup output, it then tells me that there was an exceptionin loading my mod, but it doesn't tell me what the exception was.

    I appreciate not wanting to overuse the logs, but if you could offer a -v (for verbose) flag that would print the full exception detail, it would make it a lot easier to figure out what's going on.
     
    #437
  18. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Hey,

    you have to log it yourself. Check your initialization function and log exceptions there. Then you should find the issue faster.
     
    #438
  19. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    This is thrown before the initialization function is called

    Edit: I was wrong I need to do some more research
     
    #439
    Last edited: Apr 2, 2020
  20. Jascha

    Jascha Administrator

    • Moderator
    Joined:
    Jan 22, 2016
    Messages:
    1,141
    Likes Received:
    713
    Hey guys,

    with A12 a few things changed and a few more functions were implemented.
    Please make sure to check the documentation as well as the new dll's.

    Some of the changes:
    - No more Request_GlobalStructure_List, Request_GlobalStructure_Update, Event_GlobalStructure_List
    That means you have to use the new Database to get all the structure informations your got before over those requests/events.

    - New: block.SetColors / block.SetColorForWholeBlock
    - Fixed: Structure.GlobalToStructPos/StructToGlobalPos
    - New: Ability to change/set teleporter & portals (TargetData)
    - You now can access the GlobalDB with lots of data that were not available before. (but you have to build that manually. No functions given by empyrion)
    - ItemStack contains meta info in "Ammo" field. This will be renamed one day into "Meta" instead
    - New: Application.ShowDialogBox to send messages in a new scrollable message box which has the same formating options as the lcd displays have. It also contains links that will be saved for you to check.
    It will fire an event in the mod like: OnDialogClicked(int buttonIdx, string linkId, string inputContent, int playerId, int customValue)

    An early example (some things might have changed a bit)
    Code:
    {
    ....
    DialogConfig config = new DialogConfig
    {
    TitleText = "Title",
    CloseOnLinkClick = false,
    ButtonTexts = new string[] { "No", "", "Yes" },
    ButtonIdxForEsc = 0,
    MaxChars = 10,
    Placeholder = "Please write something here"
    };
    
    // generate some lines of content
    string body = "";
    int lines;
    if (args.Count == 0 || !int.TryParse(args[0], out lines))
    {
    lines = new Random().Next(10, 40);
    }
    
    for (int i = 0; i < lines; i++)
    {
    body += $"Line {i+1} with <link=\"ID_{i+1}\"><color=blue>Link</color></link>\n";
    }
    
    config.BodyText = body;
    modApi.Application.ShowDialogBox(player_Id, config, OnDialogClicked, seqNr);
    }
    
    void OnDialogClicked(int buttonIdx, string linkId, string inputContent, int playerId, int customValue)
    {
    modApi.Log($"dialogClick: Button {idx}, linkId {linkId}, InputField: '{inputFieldContent}'");
    }
     
    #440
    RexXxuS and Germanicus like this.

Share This Page