ENIGMA Forums

General fluff => General ENIGMA => Topic started by: Goombert on August 09, 2013, 03:02:00 pm

Title: Proper working directory and output messages
Post by: Goombert on August 09, 2013, 03:02:00 pm
You decide.
Title: Re: Proper working directory and output messages
Post by: TheExDeus on August 10, 2013, 04:52:14 am
The first part, yes, while I don't really understand what "method" you are referring too.
The second part, no, I don't care and in most cases you cannot really output sensible feedback. The places where vulgarity is used it shouldn't ever fail unless something is very wrong (like cheese case where he had two instances with the same id). So I don't care if it is removed or not, but if anyone is willing to do that then I won't stop them.
Title: Re: Proper working directory and output messages
Post by: Goombert on August 10, 2013, 05:06:00 am
By Game Makers method Harri? I meant that when you hit run, working_directory is set to the source locatin of your gmk file, this is why it is very hard to test games using external resources when it outputs the executable to the AppData/tmp and /temp directories on platforms. Josh doesn't want this behaviour as he is afraid of letting it loose on the source directory. However I disagree we are going to be inundated with people wondering why it doesn't work the way that it should, or work as expected. This was a huge mistake by Game Maker Studio sandboxing the working directories. But in Game Maker once you compile the exe and run that seperately outside the IDE working_directory will become the exe location or the place you ran the file from, it makes it perfectly easy to find the external resources for games. I don't agree with Josh's worryment over where working_directory is set as almost all games that use external resources place the external resources into folders next to the source, they don't usually place the files right next to the source.

Now as for the cursing, I think it would be much more helpful if in cheese's case it would have just printed something like "Instance system has become delinked, this is a rare case that should never, ever happen!" at least gives people an understanding of what happened, and then they at least know where to look in the source code, we are dealing with a large engine here that is likely to become quite popular. When people see those kind of errors messages he does output especially with the current state of the project, they just think its a joke, and then our project ends up looking like a joke. Which is something I do agree with DatZach quite a bit about. And everybody thinks oh no, Roberts gonna be the "word police", but seriously we are dealing with children here, that is primarily who is most going to use our software, we could set a little bit better of an example. Now however I do agree with Josh in that he doesn't want merge conflicts with JDI, but I am talking about after that happens having it replaced.
Title: Re: Proper working directory and output messages
Post by: TheExDeus on August 10, 2013, 08:45:43 am
Quote
By Game Makers method Harri? I meant that when you hit run, working_directory is set to the source locatin of your gmk file, this is why it is very hard to test games using external resources when it outputs the executable to the AppData/tmp and /temp directories on platforms. Josh doesn't want this behaviour as he is afraid of letting it loose on the source directory. However I disagree we are going to be inundated with people wondering why it doesn't work the way that it should, or work as expected. This was a huge mistake by Game Maker Studio sandboxing the working directories. But in Game Maker once you compile the exe and run that seperately outside the IDE working_directory will become the exe location or the place you ran the file from, it makes it perfectly easy to find the external resources for games. I don't agree with Josh's worryment over where working_directory is set as almost all games that use external resources place the external resources into folders next to the source, they don't usually place the files right next to the source.
Ou that. I agree with that and I have reported that here for many many times. If a 10 year old GM user can safely do that and not fuck up the source, then I don't see why we should do it any differently. At least an option in ENIGMA settings should be provided for this, so that default one can be exe location, but you can switch for GM compatibility (and ease of use). Because this does cause a lot of problems for me daily. I load configs and other files and this slows down development A LOT because I have to copy the exe from temp directory to the source directory every time I want to test (I could do that in reverse, but the problem would be just as big, as my resources could be deleted (it's temp dir after all) or that I modify them in tmp and then forget to copy back to source). This also makes using external dll's a pain. So yes, we need to do this and I still don't get why we haven't. I have posted several resolutions to this problem before.

Quote
then they at least know where to look in the source code, we are dealing with a large engine here that is likely to become quite popular
How does that line tell you where to look in the source code? Actually the previous error was a lot easier to find, as having 13 consecutive fucks are quite rare. And if you want errors to be easier to find, then we should maybe employ __FILE__ and __LINE__ directives (I use them extensively in another project).

We also swear a lot in these forums and EDC comments, so we should stop that in general (though never gonna happen).
Title: Re: Proper working directory and output messages
Post by: Goombert on August 10, 2013, 09:54:16 am
Harri, yep, 100% agree.

Quote
How does that line tell you where to look in the source code?
Proper Message...
Instance system, hmmm, thats related to instance code somewhere.
Retarded Message...
Fuck, wtf? wtf does that have to do with anything?
Title: Re: Proper working directory and output messages
Post by: TheExDeus on August 10, 2013, 10:15:11 am
Quote
Proper Message...
Instance system, hmmm, thats related to instance code somewhere.
Retarded Message...
Fuck, wtf? wtf does that have to do with anything?
That doesn't help in any way.
Title: Re: Proper working directory and output messages
Post by: Goombert on August 13, 2013, 09:42:22 am
Also, to add to this
Code: [Select]
workDir = new File(LGM.class.getProtectionDomain().getCodeSource().getLocation().toURI());LateralGM, whoever wrote that code, assuming IsmAvatar, uses source directory as working directory as well, in fact all of LGM does. The argument about it being unsafe is asinine, if you can manage to fuck something up with that working directory as a source directory, you are a retard, and you shouldn't be programming, you should be fucking shot.
Title: Re: Proper working directory and output messages
Post by: Josh @ Dreamland on August 14, 2013, 07:42:09 am
Well, congrats. This is the stupidest thread I've seen in a long time.

1) Don't lump issues. I don't want to hear about any result of this poll if you're pulling a politician and trying to force your agenda on an all-or-nothing basis. That's not how things are run, here. Creating a poll wherein the votes for an option effect a positive outcome for a group of people and a neutral outcome for nigh everyone else is simply a loaded question.

2) I know multiple people who have fucked up their game directory with file_find_ and file_bin_open. I'll just reply to anyone who stages a complaint or posts a blog about doing so with that little remark from you.

Quote
Yes, hi, sorry to hear about your loss. I saw it coming six months ago, but according to our developers, if you can manage to fuck something up with that working directory as a source directory, you are a retard, and you shouldn't be programming, you should be fucking shot. Oop, I guess I'm not sorry about your loss; you should be shot because you're a retard and that's what you get.

3) If you want to remove profanity from the error messages for the sake of "professionalism," that's fine. I personally tend to agree with Torvalds on "professionalism," (http://linux.slashdot.org/story/13/07/15/2316219/kernel-dev-tells-linus-torvalds-to-stop-using-abusive-language) but I'll grant you a G-rated output log considering our userbase is likely to comprise young children. My code, however, is rated PG-13. Most code is rated PG-13, especially collaborative code wherein the decisions of others negatively impacts code quality, and workarounds need written (http://stackoverflow.com/questions/184618/what-is-the-best-comment-in-source-code-you-have-ever-encountered#answer-184673).Fortunately, ENIGMA's engine is granular enough to just rewrite or dump stupid components, except the instance system, which the new compiler should help with. By this virtue, we don't have flamewars in code comments. We do, however, have snide comments regarding stupid problems in our own code and in API code. I don't see any problem with that. If you are under the age of thirteen and are reading my code, and you are offended by the occasional language, go ahead and send me a note. But then, any 12-year-old who can read C is probably mature enough not to get his panties in a bunch because my code says something distasteful about WinAPI.
Title: Re: Proper working directory and output messages
Post by: Goombert on August 14, 2013, 09:56:53 am
1) Still don't think I am lumping issues here, but ok I'll just remove the profanity part of it, since you agree to keep it out of the error messages, the votes still stand though because everyone voted based on working_directory.

2) You can literally point the finger straight at me, I promise you, not one single person will manage to fuck it up Josh. I find it surprising you are worried about that, when the IDE itself with the Java threads was causing a race condition which could have led to hard drive failure on someones PC. If slojanko who is 12 can load a game with models and make an FPS Josh, I am pretty sure the kids can manage the fucking working_directory :P Even worse than that though, you'd rather set them loose on their on User acccount subdirectory, temp is AppData under user accounts on Windows, your argument about file_find_ and file_bin_open applies there too, they could very easily have too many escape sequences and fuckin delete their whole user account. Besides, anyone who doesn't make regular backups of their game, is also a motherfuckin retard.

3) I agree with that, just keep it out of the fuckin error messages, I don't give shit bout the code really.
Title: Re: Proper working directory and output messages
Post by: TheExDeus on August 14, 2013, 02:41:24 pm
Quote
2) I know multiple people who have fucked up their game directory with file_find_ and file_bin_open. I'll just reply to anyone who stages a complaint or posts a blog about doing so with that little remark from you.
And your solutions is what exactly? Because this creates MASSIVE (WITH CAPITALS) headache all the time. I cannot use my dll's, I cannot use external resources (be it images or just my own created saves files or ini's) and to make it work I either have to copy all my resources to temp directory (which is much more stupider as that basically guarantees loss of data sooner or later) or copy the exe out of the temp directory into the source directory (which makes Run and Debug buttons basically useless, and I might as well just have a working Build button). And as I usually make stuff that either import or exports something, then this is a problem I face for almost every project. And of course there is GM compatibility, which means that many projects break with the current system. So I vote for the way GM does it and if anyone fucks up for some reason, then you can point at me as well. The best thing of course would be just a freaking setting in LGM. It doesn't even have to be on per project basis or an ENIGMA setting. It just needs to be "set once, and forget about it" kind of setting like themes or disable D&D.

Quote
1) Still don't think I am lumping issues here, but ok I'll just remove the profanity part of it, since you agree to keep it out of the error messages, the votes still stand though because everyone voted based on working_directory.
You did lump it together. That is why I didn't vote as I don't vote on loaded questions.
Title: Re: Proper working directory and output messages
Post by: Josh @ Dreamland on August 15, 2013, 10:48:59 am
Quote
I promise you, not one single person will manage to fuck it up Josh
I realize I am talking to a wall, but let me again emphasize that I know multiple people who have done it, one of whom I held in very high esteem.

Quote
when the IDE itself with the Java threads was causing a race condition which could have led to hard drive failure on someones PC.
Java's issues aren't my fault. Nothing the JVM does should ever lead to hard drive failure; that's the entire point of a fucking JVM. If there's such a problem, contact Oracle.

Quote
If slojanko who is 12 can load a game with models and make an FPS Josh, I am pretty sure the kids can manage the fucking working_directory
Slojanko is 16. He'll be 17 in a few months. I realize I am talking to a wall, but let me again emphasize that I know multiple people who have ruined their games directory, one of whom I held in very high esteem.

Quote from: Harri
And your solutions is what exactly?
My solution is to default to a subdirectory of the project as the default working directory, or, at the user's option, to ~/LateralGM. Any files you want access to, copy them there.

Quote
to make it work I either have to copy all my resources to temp directory
The temp directory thing should not be the case. I don't recall changing the working directory. Right now, as far as I know, the working directory is your ENIGMA folder. I have no idea where you people keep getting that you have to copy it there; my guess is that I don't change the working dir, and no one has ever tried copying anything to temp. But anyway, that behavior was never my intention.

Quote
The best thing of course would be just a freaking setting in LGM.
This is what I've asked Ism and told Robert to do sixteen times. I prefer that the default location *not* be the folder of the EGM/GMK/GM6. That way, people have to take responsibility for their own actions.

Most of the weapons fire exchange revolving around this topic has been due to polyfuck not realizing that the operating system maintains an environment for each application containing a working directory. The bastard had, at one point, hard-coded the entire engine to prefix a string working dir to all unqualified filenames. I'm not unreasonable, I just start to get irritated when people do something that stupid.
Title: Re: Proper working directory and output messages
Post by: TheExDeus on August 15, 2013, 01:52:15 pm
Quote
The temp directory thing should not be the case. I don't recall changing the working directory. Right now, as far as I know, the working directory is your ENIGMA folder. I have no idea where you people keep getting that you have to copy it there; my guess is that I don't change the working dir, and no one has ever tried copying anything to temp. But anyway, that behavior was never my intention.
The working directory when you load a game is the temp directory (the place where the .exe is). At least it was for me. Now to get around that I use absolute paths everywhere (and have a directory selection to set those paths).

But I think that just needs to be an option. Make it be LGM or something by default, then have GM compatibility (GMK dir) or a custom directory. Custom directory would require a per project setting though... unless we limit custom directories to only be subdirectories of source. Anyway, i'll wait until that option is implemented (I don't know Java for jack, so I don't plan to do it).
Title: Re: Proper working directory and output messages
Post by: Josh @ Dreamland on August 15, 2013, 04:16:14 pm
The working directory shouldn't be where the EXE is, unless CreateProcess is broken. It should be where ENIGMA.exe is run from. But I don't really care; I can pass any working directory to CreateProcess/execvp. I just need that directory from the IDE.
Title: Re: Proper working directory and output messages
Post by: Goombert on August 15, 2013, 05:53:22 pm
Harri, I think Josh's solution is fine. By default each game will automatically set working directory to your GMK location += "/Resources" the only reason I haven't done it though is I don't know how, or if I have to implement a plugin callback >:
Title: Re: Proper working directory and output messages
Post by: Goombert on August 16, 2013, 12:57:25 am
Hey Josh, just an update to this so I don't forget to tell you tomorrow, someone already snuck in working_directory for Windows, however what you said I still like so I will postfix it "/WorkingDirectory/" I decided on calling it that instead of "/Resources/" since it just automatically explains itself to noobs. I just need canthelp to implement it on Linux then I'll add the Win32 fix as you do have a semi good point about people fucking up their shit and I like the idea of the working directory being ensured and dedicated to circumvent GameMaker: Stupido's nonsense horseshit.

Edit: Btw, to all the people talking about how powerful Studio is and how great and wonderful it is compared to shitty old ENIGMA, which can only draw 1 million cubes, here is me trying to draw just a little more than the 15 in their default demo...
(http://oi40.tinypic.com/mh7tbs.jpg)

You as shocked as I am? I bet you are, because its SOOOOO FUCKING OPTIMAL isnt it? Right? ENIGMA haters, eat my dick.
Title: Re: Proper working directory and output messages
Post by: TheExDeus on August 16, 2013, 01:41:11 am
15 cubes?

And ENGIMA plugin is the one launching the compiled game (has like an exec at the end of compiler source) and that is probably where you add the directory change. I want it be modifiable though as I don't want "/WorkingDirectory". But that is a small problem for now.
Title: Re: Proper working directory and output messages
Post by: Goombert on August 16, 2013, 01:43:53 am
Harri, the first time I ran this demo before upgrading Studio to the shader version, it could at least draw 32k at 100fps, it is such garbage, and I get tired of like DatZach and DaSpirit who think our project is a waste of time, when it clearly is not :(
Title: Re: Proper working directory and output messages
Post by: TheExDeus on August 16, 2013, 04:53:48 am
They are trolling. I personally work on ENIGMA just because I use it. I don't really care or even want other people to use it. It's for my projects and I love it.
Title: Re: Proper working directory and output messages
Post by: polygone on August 16, 2013, 06:51:12 am
Just add a string argument to the set_working_directory() function to allow it to set to a directory folder, but leave the option of using an empty "" string to set to where the gmk is. LGM can then pass whatever string it likes to this as an option.
Title: Re: Proper working directory and output messages
Post by: TheExDeus on August 16, 2013, 07:19:00 am
Quote
but leave the option of using an empty "" string to set to where the gmk is
The "" wouldn't set it to where gmk is. It would set where the exe is (the temp folder). So LGM needs to pass the gmk folder. I think it would be easier just to change the working directory when launching the exe, not adding a code line in some IDE_EDIT file just when launching using LGM. Because this would break exe's that are copied OUT of the tmp folder (like all executables, because we don't have a normal Build button). So it would be better to just set it in CompilerSource\compiler\compile.cpp.

edit: Actually the line is in CompilerSource\general\bettersystem.cpp, line 201. The CreateProcess has NULL parameter where working directory should be (that means it uses parents process directory just like Josh said) and that is where we need to pass the path from LGM.
Title: Re: Proper working directory and output messages
Post by: polygone on August 16, 2013, 07:45:59 am
The "" wouldn't set it to where gmk is.
The set_working_directory() function I added in already sets it to the gmk position but it needs to be altered to the .exe position for when it's not run from LGM. But all I was saying is the add an argument to that function to allow setting it to a new directory in the gmk/exe directory.