1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Server variables in config file instead of in scripts

Discussion in 'Suggestions & Ideas' started by hierbo, Jan 6, 2015.

Mods: Rainbows
  1. hierbo

    hierbo Ballista Bolt Thrower
    1. The Young Blood Collective - [YB]

    Messages:
    190
    Hey everyone!

    I have a suggestion I'd like to offer up that I already alluded to in another ancient post, but I'd like to give it its own thread, as I feel it is a worthy proposal.

    Current Scenario
    Currently, there are tons of values for various game constants stored in the core game scripts. Values such as default # of hearts for each class, the amount of damage each different type of attack does, the amount of health a cheeseburger heals, the costs of placing various blocks, and on and on, are all stored in various places throughout the game's many core scripts.

    This method of assignment of these constants presents some non-trivial issues, as follows:

    Issue #1
    Anyone interested in hosting a server that would like to tweak even one of these values would have to modify one of these "core" game scripts. This trips the "modded" flag, and makes the server a public pariah, doomed never to get any significant traffic. Note that this "mod" simply cannot contain malicious code, as it would usually involve changing a single integer to a different integer, and therefore isn't really deserving of being considered a mod for public server list purposes.

    Issue #2
    Game updates overwrite all of the "core" game scripts, causing any of these tweaks to be overwritten and eliminated after every game update that is pushed out to servers. The hoster would then have to go re-do those modifications in order for them to come back; they're not preserved any other way. I realize that mods can be made that simply supersede the values in these "default" scripts, but for something as simple as, say, changing the heart drop rate from 100% to 50%, it seems like re-inventing the wheel.

    Issue #3
    Minor balance tweaks cannot be reliably tested in the public community, because even the most minor tweak puts the server into the dreaded "non-vanilla" category, ensuring that public traffic to the server is near 0. Since virtually all balance tweaks need real-world testing to be vetted properly, this simply does not happen to the degree it could. Game balance testing ends up only being done by a few seasoned veterans in closed tests, because this set of circumstances makes that the only way it can be done.


    New Proposed Scenario
    Create a new plaintext .cfg file in the server root directory that contains a list of all these variables that are presently in the core scripts, and re-write as many of these core game scripts as possible to break these out and reference that config file instead of a value hard-coded in each script. Then, changing those values would be a simple text edit and server re-load to create a change without the server ending up showing as "modded".

    Let's say I wanted to test out game balance by giving everyone twice as much health as the default. I could go into this proposed .cfg file and change 3 integers, kind of like this:

    default values in config file:
    builder_health=12
    archer_health=8
    knight_health=16

    new values in config file:
    builder_health=24
    archer_health=16
    knight_health=32

    Now, when I save this config and reload the server, everyone's got double health with no mods needed. This is kind of a silly example, but I think the potential is obvious when you see that I could change almost any "in-game" constants with a couple of keystrokes, no coding experience, and no mods/mod flags.

    To differentiate servers that don't have default values, this .cfg file could be checked against the default, and if it differs, there could be a little indicator that marks a server as using "house rules", without it needing to be filtered out as "non-vanilla". This indicator could even be click-able to contain a list of which values are different.

    I really hope you can all see the merits of this proposal. I believe it would open up a whole new world in servers, allowing for greater diversity and more fun, without being stifled by the "non-vanilla" situation. I'd love to hear your thoughts!
     
    kodysch, Hallic, 101i and 3 others like this.
  2. wilpin7

    wilpin7 Lewd~ Donator
    1. KAG Competitive League

    Messages:
    153
    Really like this idea, I feel that there's nothing else to say, Geti needs to make this happen.

    Even with me being completely clueless to scripting and whatnot, I think that this is simple enough for even admins that could've been living under a rock for the past 30 years. Would really love to see a bunch of servers with knights having a little more health, making 1 on 1 fights way more interesting ... or something like that.

    tl;dr version : +1
     
  3. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    It's a bigass job. If someone wants to go through every script and split out config vars of interest, feel free to do it and send me the files.
    Honestly I'm not convinced server owners would make use of this enough for it to be worth marching around adding in slower code (config access involves file access) to almost every script in the name of configurability. A more advanced setup involves loading and caching it in rules, every gamemode needing to have an added script and a moderately sized include in all the files that use it, increasing compile times for the scripts and complexity for new modders trying to understand how config variables work - adding more variables to that common structure mod-side would introduce mod compatibiliy issues quickly. Having a custom structure and script to add to the gamemode for each mod requires "bridging" mods that patch gamemode files to include both. There's no "free" solution here; if a good one is developed, however, I'm happy to do the engine-side work to get a "house rules" flag in, though probably not with exact changes specified (that can go in server info like usual).

    The reason I'm not convinced server owners would make use of it enough is that the last time I added cfg-side configurability to something (TDM config, with options to convert to rtdm, change costs, remove items, etc etc), I was the only one that made use of it, two builds later, to make RTDM the default as it was requested more by players and server owners weren't responding.

    I'm well aware you guys are the lifeblood of innovation and so on, but I feel like the whole "mods are instant server death" thing is dubious and counter-progressive. Players after 1 day of play can see modded servers, and the warning is a one time thing iirc. Doing these changes as an actual mod (in mods/) would prevent scripts getting patched over. As of right now, 2 of the top 8 servers by population are blue http://grab.by/DzfA

    Also, I know its a toy example but afaik the health example could be done just by changing their blob configs, no code needed. Not sure if it'd flag you as modded or not; classic mods worked this way though.
     
  4. hierbo

    hierbo Ballista Bolt Thrower
    1. The Young Blood Collective - [YB]

    Messages:
    190
    I definitely agree. In particular, the part about modifying all the scripts would be quite tedious and manual. However, I would be happy to contribute to that. I suspect it is quite repetitive to break out those variables in each script, so I could be shown once and then let loose.

    I can see your concern. There's always the risk that all of your hard work will be for naught. I can't speak for anyone else, but I know that I would use this feature, as I have used the solution proposed in "Issue #1" in my post above many times to achieve these same results. Unfortunately, though, I believe you're mistaken about the leniency of the "non-vanilla" flag. As far as I can tell, the connecting client does a checksum of pretty much every relevant game file with the server, and if ANYTHING is not exactly the same, including class health in the blob configs, you're "non-vanilla".

    I appreciate the kind words about us, but I'm afraid I must disagree with the premise of your point to some extent. I have first-hand experience with modded servers getting markedly lower traffic, if any. While they are visible now more than they once were, people must just be deterred by the notion of modded game content. To be honest, even I am in this camp with most games, and so can understand the aversion, despite it having little basis.

    The "non-vanilla" warning upon connecting to a modded server happens only one time per server, true, but only if the server continues to use the same mods. If I have a server where I have slashes set to do 3 hearts instead of 2, then decide to change it to 1.5 hearts, that will be regarded by the client as a new mod and they'll get the warning again. What's worse, sometimes manual file purges on the client side are required to get the revised mod to take hold and work (at least the last time I tried it with @Verrazano back in the day).

    I also think that the 2 non-vanilla servers you specified are outliers, and not an apt comparison to a balance tweak server or general house rules server. The servers you specify are quite niche, and have a loyal following that has been built up with time. I would bet that those servers consistently have the same core group coming back time and time again, with few if any pubs joining with any frequency. Also, since their mods are the same day in and day out, those warnings don't keep popping up.

    I had not considered this in my suggestion. As I am not much of a modder, I did not realize how entangled some of that is, which may throw a "spanner in the works", so to speak. I'll be happy to do a little research on my own time with some of my more knowledgeable friends in the community and get back to you if we can come up with a sound plan. Your willingness to cooperate is all the motivation I need; thank you!
     
    kodysch likes this.
  5. Verrazano

    Verrazano Flat Chested Haggy Old Souless Witchy Witch Witch THD Team Global Moderator Forum Moderator Tester
    1. Practitioners of War Extreme Revolution - POWER

    Messages:
    477
    The balance mod I made for hierbo's server a while back changed configs of characters to change their health and it tripped the modded flag.
     
  6. Fernegulus

    Fernegulus Bison Rider

    Messages:
    400
    Jesus fucking Christ this idea
    I mean yeah it's cool to have everything in one place, but it's even cooler to have it naturally sorted in a tree of folders
    ffs
    everything is where you suppose it to be
    and if it doesn't get sublime text and ctrl shift f
     
  7. hierbo

    hierbo Ballista Bolt Thrower
    1. The Young Blood Collective - [YB]

    Messages:
    190
    Dude. Yes, we know WHERE the variables are. We're talking about making them constants in a config file so that they can be changed without the game showing as having been modded. If the only issue was changing the values, we would already have gotten a chimp to take care of that. How trollish!
     
    Last edited: Jan 17, 2015
    FuzzyBlueBaron, kodysch and Verrazano like this.
Mods: Rainbows