I have some custom hardware that I am looking to create a demo software for to advertise its potential. SCII would be the ideal platform to showcase the hardware; if a custom map with the proper attributes can be created. I do not own SCII, but I have already identified what is probably going to be the only challenge.
SCII will require modding in order to make the hardware compatible. Here's the list of the conditions for the demo:
SCII needs to read 3 to 5 data inputs that are integers ranging up to 255 from a third party source.
SCII will need to read those inputs at least once every 100ms (.1s).
The demo would be single player, although it may have leader scoreboards.
The hardware is capable of writing several file types including XML.
Over at the Hive Workshop, it was recommended pursuing creating XML files or banking, but reading up on banking here, it appears that banks are intended to only be read once a map. It's unlikely to work, but the hardware would be able to write the data to the PC and create a file (bank or XML) that uses pointers or some other method of updating itself with the written data. I assume that writing the same file that SCII reads will not work, since Windows does not like it when programs attempt to share.
If all else fails because Blizzard has the floodgates to this closed or SCII is not able to handle such operations, I am open to suggestions on another platform that will have a similar UI and units/AI to that of SCII. And if this demo is possible, then I will be hunting volunteers.
You can reload a bank. Therefore, it is possible to receive input from other programs.
This map should be run locally (via editor's "test document") else the bank would need to be uploaded during the map's runtime which can cause delays.
Bank files are written in the XML. They contain "sections" which contain stored elements accessible via a "key". I would suggest that you just use one section and store the 3 integers in it.
1. Reloading banks online can cause lags, that's why it shouldn't be done unless necessary. But your map will run offline on your machine, so there are no latency/lag issues. Blizzard added proper support for bank reloading just a few patches ago.
2. AfaIk, it should be fine. I believe Enexy created something like that for his RPG Rise of Nigma. If you encounter problems, you might want to contact him.
3. I assume it would load local bank files instantly. So, you would be able to update it every game frame. One game second consists out of 16 game frames. On "Faster" speed, it processes 1.4 game seconds in one real time second. This means that you can update 0.04464 real time seconds without any problems.
Sounds like it'll be worth the investment to find out. I know where to find help or volunteers. So unless anyone has more discovery to contribute, this topic is solved except for one last question:
In order to fully use the modding tools, do I need to purchase HotS, WoL, or can you mod with the free trial?
Sounds like it'll be worth the investment to find out. I know where to find help or volunteers. So unless anyone has more discovery to contribute, this topic is solved except for one last question:
In order to fully use the modding tools, do I need to purchase HotS, WoL, or can you mod with the free trial?
You require WoL, I believe. AfaIk, the starter edition has no access to the editor. But it's worth a try anyway as you would need to download the game in any case.
SCII will need to read those inputs at least once every 100ms (.1s).
I do not believe the bank's can be load within 100ms. You have to use "Wait until bank finishes loading" action before proceeding with further actions that will use that same bank file. Thus, I do not know how fast the bank's are read, but I assume this will vary person-to-person, depending on their PC.
The hardware is capable of writing several file types including XML.
The only files sc2 will be creating or reading are proprietary .sc2bank files. This is pretty much in XML format. Just make sure to make the extension .sc2bank
You are indeed correct about Windows not being nice with ppl working/reading on the same file at the same time. You have to be careful when programming.. Just use try/catches.
@GuNSl1nG3R: Go
You require WoL, I believe. AfaIk, the starter edition has no access to the editor. But it's worth a try anyway as you would need to download the game in any case.
The editor does work with the free trial, but you need WoL to play test anything you make with it.
I took a random tower defense mod to start as a base to test using banks with my novice modding skills. The test only tested SC2's ability to read banks, not the ability to write banks while SC2 reads them (due to three problems listed below). I also was not able to confirm if what I coded is actually writing/reading a bank (its not in the SC2 documents directory).
Here's what I found/confirmed (assuming the bank was working):
SC2 cannot read faster than once per frame (16 per game second).
SC2 can read banks of few variables (3 integers) at a rate of 16 times per game second (I am presuming the mod runs at 1.0x speed), which is once every 62.5ms.
And here's the list of problems with my modding and/or SC2:
SC2 does not save the bank in the normal SC2 /my documents directory when testing mods, or my mod is not producing the bank (action: open bank).
My hardware can export its information as a XML, but only through a third party software's request (just about any popular language; ie Java, C+). Is there any third party software for SC2 that writes XML using information extracted from a server or other source? If so, I could simply rewrite the server portion to address my hardware instead.
Reloading banks causes a memory leak -like issue within SC2. SC2's memory usage, with the tower defense game doing absolutely nothing, rises at a rate of about 600kb per second indefinitely. Eventually it leads to the common problems of a memory leak such as 2 frames per second and taking 5 minutes to exit the map. Even after exiting the map, the memory leak still affects SC2, as its memory usage does not return to anywhere close to where it was when it started the map. Based on the fact that SC2 isn't anywhere near its 2gb artificial memory cap, chances are the reload bank action is writing new variables to the ram instead of writing over the old. Or, it is writing some kind of value to something like a temporary or hidden text file, and that file is reaching 100mb plus in size, which results in the severe lag and memory leak-like issues when the game is attempting to open it.
SCII needs to read 3 to 5 data inputs that are integers ranging up to 255 from a third party source.
SCII will need to read those inputs at least once every 100ms (.1s).
To clarify some of the more confusing replies here, this is entirely possible.
Once a bank is set up, it can be read on the fly. SC2 works in "ticks", and one tick happens every 1/16th of a second (62.5ms).
However, SC2 runs at 1.7x real-time speed in the default mode, making this 36.765ms.
Reloading banks causes a memory leak -like issue within SC2. SC2's memory usage, with the tower defense game doing absolutely nothing, rises at a rate of about 600kb per second indefinitely. Eventually it leads to the common problems of a memory leak such as 2 frames per second and taking 5 minutes to exit the map. Even after exiting the map, the memory leak still affects SC2, as its memory usage does not return to anywhere close to where it was when it started the map. Based on the fact that SC2 isn't anywhere near its 2gb artificial memory cap, chances are the reload bank action is writing new variables to the ram instead of writing over the old. Or, it is writing some kind of value to something like a temporary or hidden text file, and that file is reaching 100mb plus in size, which results in the severe lag and memory leak-like issues when the game is attempting to open it.
I can not say without testing, but I have ran sc2 for literally weeks at a time, without exiting the program, and not encountered fps drops.
1. SC2 will indeed save it to the my documents directory. Make sure you "save" the bank via triggers/code. Also, the directory that it's saved in varies if you're testing in single/multiplayer.
2. No, there isn't any... Kind've. I have my own server that handles the middleman, and I have SQL server running on it with a static IP set to it. You'll have to write your own or look for free database servers. You can even use web services to do this.
3. I have not been able to reproduce the memory leak. Might be something with the coding perhaps?
Currently, in my example (Somewhere in the general discussion board) I have an external program that reads and writes to the local bank file at a rate of 10ms. It works perfectly fine, and I can even send other information like coordinates of units, actions, etc to simulate network programming.
1 & 3) I was looking in the wrong directory or something. What I created was an infinite number of dialog elements which was creating the "memory leak". Not sure what I was doing wrong regarding reloading the bank, but I eventually got something that works.
2) I'll look for that general discussion board example for the external program. Assuming all goes well with that, I'll be posting the project as a new thread and asking for some help with it.
I have some custom hardware that I am looking to create a demo software for to advertise its potential. SCII would be the ideal platform to showcase the hardware; if a custom map with the proper attributes can be created. I do not own SCII, but I have already identified what is probably going to be the only challenge.
SCII will require modding in order to make the hardware compatible. Here's the list of the conditions for the demo:
Over at the Hive Workshop, it was recommended pursuing creating XML files or banking, but reading up on banking here, it appears that banks are intended to only be read once a map. It's unlikely to work, but the hardware would be able to write the data to the PC and create a file (bank or XML) that uses pointers or some other method of updating itself with the written data. I assume that writing the same file that SCII reads will not work, since Windows does not like it when programs attempt to share.
If all else fails because Blizzard has the floodgates to this closed or SCII is not able to handle such operations, I am open to suggestions on another platform that will have a similar UI and units/AI to that of SCII. And if this demo is possible, then I will be hunting volunteers.
You can reload a bank. Therefore, it is possible to receive input from other programs.
This map should be run locally (via editor's "test document") else the bank would need to be uploaded during the map's runtime which can cause delays.
Bank files are written in the XML. They contain "sections" which contain stored elements accessible via a "key". I would suggest that you just use one section and store the 3 integers in it.
Thanks for the reaffirmation that banks could be used, but I still have three concerns regarding banks:
1, The only people who can be upset is the moders and not blizzard :)
2, Yes
3, Probably not.
1. Reloading banks online can cause lags, that's why it shouldn't be done unless necessary. But your map will run offline on your machine, so there are no latency/lag issues. Blizzard added proper support for bank reloading just a few patches ago.
2. AfaIk, it should be fine. I believe Enexy created something like that for his RPG Rise of Nigma. If you encounter problems, you might want to contact him.
3. I assume it would load local bank files instantly. So, you would be able to update it every game frame. One game second consists out of 16 game frames. On "Faster" speed, it processes 1.4 game seconds in one real time second. This means that you can update 0.04464 real time seconds without any problems.
Sounds like it'll be worth the investment to find out. I know where to find help or volunteers. So unless anyone has more discovery to contribute, this topic is solved except for one last question:
In order to fully use the modding tools, do I need to purchase HotS, WoL, or can you mod with the free trial?
You require WoL, I believe. AfaIk, the starter edition has no access to the editor. But it's worth a try anyway as you would need to download the game in any case.
Few things about what you're asking.
I do not believe the bank's can be load within 100ms. You have to use "Wait until bank finishes loading" action before proceeding with further actions that will use that same bank file. Thus, I do not know how fast the bank's are read, but I assume this will vary person-to-person, depending on their PC.
The only files sc2 will be creating or reading are proprietary .sc2bank files. This is pretty much in XML format. Just make sure to make the extension .sc2bank
You are indeed correct about Windows not being nice with ppl working/reading on the same file at the same time. You have to be careful when programming.. Just use try/catches.
All other info I agree to.
The editor does work with the free trial, but you need WoL to play test anything you make with it.
I took a random tower defense mod to start as a base to test using banks with my novice modding skills. The test only tested SC2's ability to read banks, not the ability to write banks while SC2 reads them (due to three problems listed below). I also was not able to confirm if what I coded is actually writing/reading a bank (its not in the SC2 documents directory).
Here's what I found/confirmed (assuming the bank was working):
And here's the list of problems with my modding and/or SC2:
To clarify some of the more confusing replies here, this is entirely possible.
Once a bank is set up, it can be read on the fly. SC2 works in "ticks", and one tick happens every 1/16th of a second (62.5ms).
However, SC2 runs at 1.7x real-time speed in the default mode, making this 36.765ms.
I can not say without testing, but I have ran sc2 for literally weeks at a time, without exiting the program, and not encountered fps drops.
@GuNSl1nG3R: Go
1. SC2 will indeed save it to the my documents directory. Make sure you "save" the bank via triggers/code. Also, the directory that it's saved in varies if you're testing in single/multiplayer.
2. No, there isn't any... Kind've. I have my own server that handles the middleman, and I have SQL server running on it with a static IP set to it. You'll have to write your own or look for free database servers. You can even use web services to do this.
3. I have not been able to reproduce the memory leak. Might be something with the coding perhaps?
Currently, in my example (Somewhere in the general discussion board) I have an external program that reads and writes to the local bank file at a rate of 10ms. It works perfectly fine, and I can even send other information like coordinates of units, actions, etc to simulate network programming.
1 & 3) I was looking in the wrong directory or something. What I created was an infinite number of dialog elements which was creating the "memory leak". Not sure what I was doing wrong regarding reloading the bank, but I eventually got something that works.
2) I'll look for that general discussion board example for the external program. Assuming all goes well with that, I'll be posting the project as a new thread and asking for some help with it.
Thanks for the help and answers.
@GuNSl1nG3R: Go
http://www.sc2mapster.com/forums/general/general-chat/49567-dynamic-content-possible/#posts
here you go