I was glad to get all the basic startup understandings to design, write, and compile a visual studio program. Kicks are using it for sc2 galaxy code. I have quite a library of stuff on the same topic. I posted back in
Space Traders – Entire Universe of variables. (Spreading Invention)
This was written with the same concept. It contains 18,000 lines of galaxy code I cut and pasted into sc2mapeditor. The only values I had to work with were 900 planet names and elements from earth name values). All other values were more developed, and specific random number generated values. Every time the program runs, I have a new universe of values.
NOW I CALL FOR THE RUMBLE. What kind of galaxy triggers would be useful, and need a massive amount of coding? Techniques for coding can be included. I am looking for the smart minds of galaxy to speak on what’s NEEDED?
I like your idea a lot, but I feel looking at this right away is diving past a tutorial. So I have written the first stages of a Program that would do what you asked. The initial step is to read a library. We would need to read, recompile, and write the library.
I understand what you are asking to do. But my confusion is settled by replacing what you call Fuction with Action. If we new thread a fuction call we are still tied waiting for the result. So a new thread is not really created. If we thread an Action, then we are no longer waiting for a result, and so the thread is free to run on its own.
I would like to look at writing a program for optimization. Where it will read a library and recompile it for threading optimal.
Check out my tutorial, and I would like to continue this descusion S2rius
However you want to call it. I'm usually trying to avoid the word "action" unless I'm dealing with GUI scripts. It's basically all functions.
The point is that it can be inconvenient (especially with larger functions) to actually new-thread them, since you have to write a "starter" function and turn all paramters into globals.
So it's not actually optimizing but rewriting what I had in mind. But optimization is a good subject too.
Then maybe my terminoligy was incorrect by using the word optimization.
RE-Writing was what I had in mind. Locate all actions, and thread them as trigger execute, no wait. The question would be when does an action rely on previous actions. Probably would have to index each variable used, making sure to only thread deep if variables are not shared.
I'm not sure I can follow.. where could passed variables make problems?
The global variable used to pass the parameter is instantly turned into a local again,
And Galaxy doesn't have a pass-by-reference.
Of course if you use your main thread to kill a unit, and use your new thread to do something with this unit a few seconds after it's actual death, then this is your fault for writing stupid code :P
if each action was threaded on its own without wait. One action might rely on the one previous to have finished fist. So arbitrarily threading everything would be a problem. The solve would be making sure previous action did not change any variables that future actions use. Again I don’t know galaxy enough to say how much of an advantage threading everything possible would be.
I'm not talking about threading everything. That'd probably be a very bad idea.
However, in some cases it's useful to start several functions originating from one main thread which all run seperate from each other, and don't (have to) wait for each other.
So what I was talking about is a tool, which lets you enter the code of a function and turns it into a threaded one, so you can use it on those functions you actually need threaded.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
No not the fabric but let’s go to war on the entire galaxy. Since my thread The Galaxy Wars are ahead of us!
http://forums.sc2mapster.com/development/galaxy-scripting-and-trigger-lib/14471-the-galaxy-wars-are-ahead-of-us/#p7
With following [Tutorial] Creating a Visual Studio Program to write Galaxy Custom Scripts [Tutorial]
http://forums.sc2mapster.com/resources/tutorials/14517-tutorial-creating-a-visual-studio-program-to-write/
I was glad to get all the basic startup understandings to design, write, and compile a visual studio program. Kicks are using it for sc2 galaxy code. I have quite a library of stuff on the same topic. I posted back in
Space Traders – Entire Universe of variables. (Spreading Invention)
http://www.sc2mapster.com/assets/space-traders-entire-universe-va/
This was written with the same concept. It contains 18,000 lines of galaxy code I cut and pasted into sc2mapeditor. The only values I had to work with were 900 planet names and elements from earth name values). All other values were more developed, and specific random number generated values. Every time the program runs, I have a new universe of values.
NOW I CALL FOR THE RUMBLE. What kind of galaxy triggers would be useful, and need a massive amount of coding? Techniques for coding can be included. I am looking for the smart minds of galaxy to speak on what’s NEEDED?
Sldprt (ItsAboutTime)
Well, I can't think of anything which is useful, needs massive amount of coding and can be nicely streamlined.
Only thing which could get rid of some inconveniences might be a tool to turn a regular function into a "threaded action definition".
So basically turn this:
into that:
To call functions in a new thread.
@s3rius: Go
I like your idea a lot, but I feel looking at this right away is diving past a tutorial. So I have written the first stages of a Program that would do what you asked. The initial step is to read a library. We would need to read, recompile, and write the library.
http://forums.sc2mapster.com/resources/tutorials/14818-tutorial-visual-studio-net-how-to-read-sc2lib-file/
I understand what you are asking to do. But my confusion is settled by replacing what you call Fuction with Action. If we new thread a fuction call we are still tied waiting for the result. So a new thread is not really created. If we thread an Action, then we are no longer waiting for a result, and so the thread is free to run on its own.
I would like to look at writing a program for optimization. Where it will read a library and recompile it for threading optimal.
Check out my tutorial, and I would like to continue this descusion S2rius
Cheers,
Sldprt (ItsAboutTime)
@sldprt: Go
However you want to call it. I'm usually trying to avoid the word "action" unless I'm dealing with GUI scripts. It's basically all functions.
The point is that it can be inconvenient (especially with larger functions) to actually new-thread them, since you have to write a "starter" function and turn all paramters into globals.
So it's not actually optimizing but rewriting what I had in mind. But optimization is a good subject too.
@s3rius: Go
Then maybe my terminoligy was incorrect by using the word optimization.
RE-Writing was what I had in mind. Locate all actions, and thread them as trigger execute, no wait. The question would be when does an action rely on previous actions. Probably would have to index each variable used, making sure to only thread deep if variables are not shared.
@sldprt: Go
I'm not sure I can follow.. where could passed variables make problems?
The global variable used to pass the parameter is instantly turned into a local again,
And Galaxy doesn't have a pass-by-reference.
Of course if you use your main thread to kill a unit, and use your new thread to do something with this unit a few seconds after it's actual death, then this is your fault for writing stupid code :P
@s3rius: Go
if each action was threaded on its own without wait. One action might rely on the one previous to have finished fist. So arbitrarily threading everything would be a problem. The solve would be making sure previous action did not change any variables that future actions use. Again I don’t know galaxy enough to say how much of an advantage threading everything possible would be.
@sldprt: Go
I'm not talking about threading everything. That'd probably be a very bad idea.
However, in some cases it's useful to start several functions originating from one main thread which all run seperate from each other, and don't (have to) wait for each other.
So what I was talking about is a tool, which lets you enter the code of a function and turns it into a threaded one, so you can use it on those functions you actually need threaded.