Add spring environment variables

Add spring environment variables

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Add spring environment variables

Post by Forboding Angel »

It occurred to me that a lot of things could be made easier if there were environment variables for them. It wouldn't be hard to add and could make things easier for installers, scripts, etc.

For example, in evo installs I set EVOLUTIONRTS as evo's install dir. That way, instead of having to do anything fancy to figure out where the user installed evo, I already know where it is.

Just a thought, but it could make various game/mappack/addon installers a lot easier to create/do cool stuff with.

It should be noted, that the env vars would only be set by people installing spring via the spring installer.

Portable, being what it is, there is nothing to be gained by setting env vars for those installs as the location might change at any given moment.

I know that this is already done via the registry. As in, you can find the spring install dir by looking up the reg key, but an env var is a lot easier to use.

Just a thought. Of course it wouldn't be useful all the time, but it would be useful some of the time, and having SPRING_INSTALLDIR env var set isn't going to hurt anything.

Edit because people can't string 2 paragraphs together to form a single thought: Obviously ticking portable in the spring installer would nullify an env var.
Last edited by Forboding Angel on 21 Jun 2012, 22:15, edited 2 times in total.
varikonniemi
Posts: 451
Joined: 03 Jul 2011, 11:54

Re: Add spring environment variables

Post by varikonniemi »

You don't let the user choose what directory spring/evorts is installed in? That alone would cause huge amounts of grief on my part.

Installing is a thing of the past, in my opinion. Extracting and creating the necessary stuff in /~ at first run should suffice.
User avatar
Peet
Malcontent
Posts: 4383
Joined: 27 Feb 2006, 22:04

Re: Add spring environment variables

Post by Peet »

Good idea, make multiple spring installs useless.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Add spring environment variables

Post by Forboding Angel »

Ya know, nothing annoys me more than people who can't read, so let me help you out with that.
It should be noted, that the env vars would only be set by people installing spring via the spring installer.

Portable, being what it is, there is nothing to be gained by setting env vars for those installs as the location might change at any given moment.
varikonniemi wrote:You don't let the user choose what directory spring/evorts is installed in? That alone would cause huge amounts of grief on my part.
Desura (just like steam) gives you the option of where to install.

Whenever evo is started, an env is set to point to evo's install location. That way, no matter where it is, any time evo is run, it will point to it's install location (usually (But not always) c:/program files(x86)/desura/common/evolution rts).

The main reason I did this is so I can do clever shit with error reporting (and other things too, just error reporting always ends up being the most common). For example, when I tell someone to go poking around for their evo install, I can just so open up windows explorer and where it says "My Documents, erase that shit and put %EVOLUTIONRTS% and press enter.

VIOLA!!! Evo install folder. Now gimmie the infolog.

Or later, I can write a program that automatically uploads an infolog to my server when a user does something or another. The uses of the env var are to make it very easy on game devs. I do not need it for myself, but for the rest of the gamedevs, it could help make their lives much easier.
Last edited by Forboding Angel on 21 Jun 2012, 23:56, edited 1 time in total.
User avatar
Peet
Malcontent
Posts: 4383
Joined: 27 Feb 2006, 22:04

Re: Add spring environment variables

Post by Peet »

I rescind my previous objection; it's far from the stupidest thing about this idea.
Forboding Angel wrote:The main reason I did this is so I can do clever shit with error reporting. For example, when I tell someone to go poking around for their evo install, I can just so open up windows explorer and where it says "My Documents, erase that shit and put %EVOLUTIONRTS% and press enter.

VIOLA!!! Evo install folder. Now gimmie the infolog.

Or later, I can write a program that automatically uploads an infolog to my server when a user does something or another. The uses of the env var are to make it very easy on game devs. I do not need it for myself, but for the rest of the gamedevs, it could help make their lives much easier.
I'll just quote this part and wait until you figure out why this is entirely irrelevant to a standard (and sensible) spring install.

The real question is what was I expecting from a forb "Development" thread? I apologize for being such an idiot.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Add spring environment variables

Post by Forboding Angel »

How many times do you tell newbies to go to their spring install?

Omg, relevant.

In no way does the addition of an environment variable make multiple spring installs useless. It's an environment variable... It's a pointer to a location. Just because it exists doesn't mean you have to use it.

As I have spent the last half hour explaining to smoth... portable installs would not be affected at all. What would be the purpose of setting an env var pointing to a location that may or may not exists at any given point? That would be fucking retarded.

I'm talking about normal spring installs (I made this quite clear in the original post). At the end of the install, the installer would set env vars to common locations, such as (but not necessarily limited to)

Spring install folder (possibly %SPRING_INSTALLDIR%)
Spring common maps folder (perhaps %SPRING_MAPS%)
Spring common games folder (maybe %SPRING_GAMES%)

Useful for a lot of things, but mainly for gamedevs who use the spring installer as their main platform.

BA
BAR (even though BAR will have it's own install, 80% of it's players probably won't use it)
ZK (because zk caters to regular spring installs as well -- Of course, this isn't really applicable for zk because they would just go to the registry to get the location, but whatever, listing it here for posterity)
the rest of *A
Spring Tanks
other random spring games
etc.

Why am I bothering to respond to a troll?
Last edited by Forboding Angel on 21 Jun 2012, 23:52, edited 1 time in total.
User avatar
Peet
Malcontent
Posts: 4383
Joined: 27 Feb 2006, 22:04

Re: Add spring environment variables

Post by Peet »

It conflicts with multiple spring installs in that any tool that relies on the env variable will be completely useless for interacting with any but one. Environment variables are generally only used for global frameworks and toolchains that have to interact with the shell, and even many of their uses under that umbrella are questionable. A game (ok, a a game engine) adding an environment variable for each of its installation and data directories borders on heinous.

And I'd rather be a troll and spew needlessly vitriolic nonsense than not be a troll and still continuously spew needlessly vitriolic nonsense.

And here's the good part:
A normal Spring install does not put the infolog in its Program Files installation directory.

I think you should carry out a basic level of research on the topic at hand before posting in a forum dedicated to the discussion of Spring's internals - let alone insulting everyone within arm's reach.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Add spring environment variables

Post by Forboding Angel »

That last part is a good point.

Enter, %SPRING_COMMON_DATADIR%. See what I did there?

Of course it would only point to one. This is for player spring installs. Gamedevs do any number of weird shit spring installs ( I know I do, but I use isolated in all of them except one ).

However, maps, games, and datadir would all be the common locations. install would be the only one that might be a moving target (however doubtful) on a player's machine.

I am well aware of what env vars are, what they do, and how they are commonly used. That part of your post was completely irrelevant to the topic at hand.

Peet, you have a way of making everything unpleasant for everyone involved.

It's worth noting that of course, these locations could all be stored within the registry, but I think we all know that pulling out registry locations is more often than not a pain in the ass. And then you get into the fact that locations are then stored differently on windows than linux and a bunch of other crap that would just make it more trouble than it's worth.

Regardless, this would not benefit me in any way shape or form. I just thought that it might help out Beherith and BAR mainly, and everyone else to a lesser extent.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Re: Add spring environment variables

Post by zwzsg »

Well, just have your Desura Evo installer create whatever env variable you fancy, I don't see why the Spring devs need to be involved.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Add spring environment variables

Post by smoth »

he does that, he was asking if they'll do it for spring
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Add spring environment variables

Post by Forboding Angel »

^^ This. I do not need this feature. I am asking for it purely for the convenience of others.

Independent spring is already very difficult to work with an maintain. Anything that makes doing that easier to do, should be considered a good thing.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Add spring environment variables

Post by AF »

One install to rule them all...... *sigh*
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Add spring environment variables

Post by Forboding Angel »

The reasoning being that gamedevs generally use portable installs, whereas players use the normal installer and generally don't have more than one.

It's not a must have feature, just something that might help make life easier on some gamedevs.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Add spring environment variables

Post by smoth »

but to be fair, it isn't what envvars are for.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Add spring environment variables

Post by Forboding Angel »

True, but so what? A tool is a tool.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Add spring environment variables

Post by smoth »

I *can* hammer in a screw.. but should I?
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Add spring environment variables

Post by gajop »

I've read this a couple of times without knowing how to respond exactly.
You're saying that environment variables could be useful, well, ok, I agree, but one would need to be precise in exactly which variables you would use and what would their semantics be.

Having a %SPRING_DIR% variable is wrong f.e, it wouldn't work with multiple spring engines (a common case in zero K f.e). Having %SPRING_MAPS% may make sense, although I'm not sure how that'd work out with multiple games, or what would be the benefit of that, if any.

Using environment variables for debugging tutorials is probably not very useful either, creating better error reporting tools would probably be time better spent (and those tools should really know where they're installed without any environment variables).

Could you come with concrete variables and their semantics so we can discuss that?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Add spring environment variables

Post by Forboding Angel »

Well, my thought process was that env vars are pretty standard across windows and linux. I mean they basically function more or less the same way.

But if you use the registry to store locations, then you have 2 perpendicular systems, where on one you have to muck about in the windows registry and in the other you have to use a completely different method in linux.

Maybe someone has an idea on better methods?

@smoth, granted, but in this case, what would be the nail? Certainly not the windows registry. Everyone knows what a travesty that is.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Add spring environment variables

Post by AF »

This thread:
I have a cart wheel and it only turns at 0.5m/s

Obvious solution: Buy a car, why are you messing with cart wheels? Its the 21st century
Request made in Thread: Allow us to modify the aerodynamics of the wheel so that we can improve the speed by 0.2m/s
The shared Spring setup is useful for developers and whatnot, but it's not how we should be distributing our games once we're happy to market them as anywhere near complete.

So rather than try to bandage a bandage on a bandage on a bandage, on a gaping hole in your Torso, just do it the proper way and watch half the threads you've started over the last 2 years suddenly become utterly irrelevant and pointless non-issues
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Add spring environment variables

Post by hoijui »

to share the lobby makes sense for pretty much every spring game except maybe BA and ZK, though.. i would say even for them it still does, and it allows for an easier transition from BA/ZK to other, less often played games.
as in.. you can install ZK, and just double-click on a KP autohost, and you are ready.
muhc more likely to happen then someone finding KP on the ofrum or on its homepage, downloading, installing, opening it, and then finding noone else to play for sure (while in hte above example, chances are at least existing, that he would find someone to play).

if stuff would be as black and white as you draw them, the situation would not be as it is anymore.
Post Reply

Return to “Engine”