These are chat archives for cmdPP/core

24th
Mar 2016
Russell Hueske
@ninja4826
Mar 24 2016 00:01
Finished a working model of the terminal application if you want to take a look. Its also published to Node's package manager registry, so anyone with Node.JS installed can install it and run it from their terminal.
Zerosan
@Zerosan
Mar 24 2016 19:38
A nice side effect of modularization is also that it makes it easier for people to submit new commands.
I think your current code due to it's simplicity is an excellent example for demonstrating the benefits of modular structures.
Russell Hueske
@ninja4826
Mar 24 2016 19:40
Thanks!
Zerosan
@Zerosan
Mar 24 2016 19:42
I'm still quite a beginner with developing modular code of this kind, at least in javascript, I had a php based webapp a while ago that featured a virtual cmd using javascript and a little REST api
each command being a PHP file that registered it's functions in a cmd array
I was wondering about how to manage features like the autoMiner properly, given that it's currently very linear in it's implementation.
Maybe a concept where you can buy threads/workers that you can assign tasks to would be an idea
Russell Hueske
@ninja4826
Mar 24 2016 20:01
I was thinking about the "buy threads/workers" idea as well. The only problem with the autoMiner system is that JavaScript isn't very multithreaded. setInterval would be our best bet, but if not that, then I guess a promise? Idk. Right now I'm working on moving the github pages demo to an angular system with a terminal directive that I found.
Zerosan
@Zerosan
Mar 24 2016 20:03
Instead of actual threads/workers a queue could be used
Russell Hueske
@ninja4826
Mar 24 2016 20:03
what do you mean?
Zerosan
@Zerosan
Mar 24 2016 20:05
Say there is a limit of 6 workers, you can assign 1 command per worker, this essentially just adds the command to an array which gets looped through in a single thread
For the end users it essentially ends up the same, doesn't it?
Russell Hueske
@ninja4826
Mar 24 2016 20:07
So, for example, if you had 2 workers, and somehow your increment is set to 100, you could set the first worker to mineData, and the second to sellData 100?
Zerosan
@Zerosan
Mar 24 2016 20:07
Yeah
Russell Hueske
@ninja4826
Mar 24 2016 20:09
That could be useful. What if, for each command (excluding commands such as help) there was a worker "type". Max quantity of workers could be expanded through upgrades, and each worker type has a different price?
Zerosan
@Zerosan
Mar 24 2016 20:09
Yeah
Russell Hueske
@ninja4826
Mar 24 2016 20:09
It wouldn't have much use at the game's current stage, but if more upgrades are implemented that the user might need to do repeatedly, it could definitely be useful.
Zerosan
@Zerosan
Mar 24 2016 20:10
It would probably be game breaking if any kind of command was possible in the worker thread, example, mineData after a few upgrades would be very powerful
But something along those lines would be interesting
Russell Hueske
@ninja4826
Mar 24 2016 20:11
should autoMine have a separate thread so that the user can still use different commands? Or should user input be disabled while the miner is running?
Zerosan
@Zerosan
Mar 24 2016 20:12
How about giving workers a storage capacity? If we were to imagine a mineData worker, that one would only be able to "carry" a limited amount of data at once
Russell Hueske
@ninja4826
Mar 24 2016 20:12
then the user would have to manually collect it?
Zerosan
@Zerosan
Mar 24 2016 20:13
I think that would be a hassle and damage the idle play a bit
I just mean to throttle the speed of workers in a way
Russell Hueske
@ninja4826
Mar 24 2016 20:13
Ah.
Zerosan
@Zerosan
Mar 24 2016 20:13
Something like a buffer, basically
I think input should always be possible
Russell Hueske
@ninja4826
Mar 24 2016 20:40
PHP was my first main language. I was building a system to track parts, equipment, and workorders in an engineering company. Nearly failed a couple of classes in highschool because I was always working on the system on my school laptop lol
Russell Hueske
@ninja4826
Mar 24 2016 22:39
Well, if anyone is interested, I've almost finished an implementation using the terminal directive.
Zerosan
@Zerosan
Mar 24 2016 22:40
I might check it out later
Did you use angular 1 or 2?
I've really liked the more component focused approach of angular 2
Russell Hueske
@ninja4826
Mar 24 2016 23:07
I used angular 1, but I'm completely impartial to either of them. I'm not very experienced in either, I just used it to use the terminal directive. If you want to take a look, I've merged all the changes on the GitHub page
Zerosan
@Zerosan
Mar 24 2016 23:08
Seems quite neat :)
Russell Hueske
@ninja4826
Mar 24 2016 23:09
Are you very familiar with ES6?
Zerosan
@Zerosan
Mar 24 2016 23:09
I have a scrollbar on there btw, the page is a bit taller than my browser window
Not yet
Russell Hueske
@ninja4826
Mar 24 2016 23:09
That's weird. I'll work on the CSS in a bit.
Zerosan
@Zerosan
Mar 24 2016 23:09
Been using Typescript a decent bit when I played around with angular2
Russell Hueske
@ninja4826
Mar 24 2016 23:10
Ah. Well, some of the conventions are pretty similar between TS and ES6. Have you taken a look at the core project?
Zerosan
@Zerosan
Mar 24 2016 23:11
Not yet, currently not much in a programming mindset
Russell Hueske
@ninja4826
Mar 24 2016 23:11
lol I understand