Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - hd

#1
AI Development / Re: Understanding the AI
April 10, 2010, 04:56:28 AM
Quote from: AlsoKnownAs link=topic=1612.msg15655#msg15655   date=1270888141hd,

So here comes the "pros" eh? I believe you do   assume that everyone has the same amount of knowledge or perhaps who   has dedicated that amount of time as you do, judging on the statement   that you've made.

  The only one assuming things is you. This has nothing to do with "pros"   or not. No one is a "pro" at AI scripting in Galaxy yet. Do you always   throw a fit like this?

Quote from: AlsoKnownAs   link=topic=1612.msg15655#msg15655   date=1270888141If I've not recalled wrongly, I think I've only started   posting on this forum a couple of days ago, read through the entire   Base.SC2Data just to know that "pros" here are quite holistic.

  For someone who read through the entirety of the Base.SC2Data MPQ, you   sure seem to know very little. Furthermore, how does that make anyone   holistic? No one stated anything about anything being "more" than the   sum of it's parts. Quite the contrary, actually.
 
 
Quote from: AlsoKnownAs link=topic=1612.msg15655#msg15655   date=1270888141My purpose in asking is not to leech on your "valuable"   knowledge, but instead to create awareness among those others who may be   developing as well, who knows they need the exact thing that I do but   don't know where to find within your prototype codes (Worst case, where   they don't understand at all).

  Asking "is it possible to do [insert whatever here]" or "can the galaxy   scripting engine handle [insert whatever here]" is one thing. Asking   "how do I do [whatever]" is something else entirely. You are asking   people to solve your problem. If everyone spent their time solving the   problems of everyone else, they would never get anything done. Get the   fuck over yourself. Just because you're "developing an AI" doesn't make   you special. No one is going to bend over backwards to help you. If you   can't figure out how to do something within the limitations of your   knowledge, then get more knowledge. Don't ask someone else to do it for   you, jackass.
 
 
Quote from: AlsoKnownAs link=topic=1612.msg15655#msg15655   date=1270888141I've made another thread in the section AI Scripts   saying that I would post my AI once its done, what's the purpose of   posting an AI which does nothing much but to build and attack?

  No one really cares if you're going to post your AI or not. If you don't   post it, no one will ever play it, thus it would make no difference, if   you do post it so people can play it, all of your code becomes   available to everyone anyways. This isn't some popularity contest. No   one is hitting F5 over and over waiting for your AI to be released.   Hell, you're probably just ripping off the AI someone else developed   anyways.

Quote from: AlsoKnownAs   link=topic=1612.msg15655#msg15655   date=1270888141I guess you guys are pretty much aware that there are   more viewers then those who actually make concrete replies, I don't wish   to argue with any of you, but if you don't feel like helping, then   that's fine, it's only a matter of time that I'll figure it out   myself,

  Don't feel like helping? Helping isn't doing your work or solving your   problems for you. Helping is pointing you in the right direction, which   we've already done. Who in the fuck do you think you are? You're just   another one of the many people who are "working" on an AI. You'll   probably give up in a few weeks and even if you don't, your "AI" will   most likely have no affect on the SC2 modding community.
 
 
Quote from: AlsoKnownAs link=topic=1612.msg15655#msg15655   date=1270888141I just wish that you people would help speed up my   development so that I could share it with fans of SC2.

  We should speed up YOUR development? What about OUR development? Again,   what makes you so special that you should get any sort of priority over   anyone else? In fact, thus far you've contributed nothing to the "fans"   of SC2. Everyone else here has. Arrogant prick.
 
 
Quote from: AlsoKnownAs link=topic=1612.msg15463#msg15463   date=1270724287how do i make a unit wanders   around an opponent's base instead of running around the whole   map?
Quote from: AlsoKnownAs link=topic=1612.msg15563#msg15563   date=1270810085How do I check the status of a building (e.g. whether   its being build, and when it's creating a unit)
Quote from: AlsoKnownAs link=topic=1612.msg15585#msg15585   date=1270823238how do I get the composition of units in a wave?
Quote from: AlsoKnownAs link=topic=1612.msg15599#msg15599   date=1270830700how do I make a count of units that I'm currently   engaged in battle for a specific wave?
#2
AI Development / Re: Understanding the AI
April 09, 2010, 06:47:22 PM
While this is a forum for helping people develop AI's, what's the point in making one if someone else is actually doing the work for you? I can understand if you can't find a const or are trying to figure out how a blizzard function properly operates but to consistently ask people to essentially write code for you is pretty counter productive for everyone else.
#3
AI Development / Re: Understanding the AI
April 07, 2010, 10:58:10 PM
Quote from: AlsoKnownAs on April 07, 2010, 03:11:47 PM
Hi everyone,

I've worked with different forms of AI and bot scripting, but I'm unfamiliar with the SC2 AI script as I'm still new to it, I've read through most of the topic and I have some questions that I hope you guys would help me in answering them.

1.) Where in the first place does the execution of the script takes place? Which function is called first when the AI is first loaded?

2.) Does the script runs in a linear fashion which checks from top to bottom? If it does, is it limited to the boundary of one main function or one or more .galaxy files?

Thanks.

To answer your questions:

1.) We don't have access to the functions that are called first but an alternative is AIMeleeStart in MeleeAI.galaxy. As far as the scripts go, it's about as close to the start as you're going to get.

2.) All code runs in a linear fashion. Lines of code are executed from top to bottom, always.

void Example(int player)
{
    AIClearStock(player);    // * this line is run first
    AISetStock(player, 1, c_ZU_Hatchery_Alias);    // * this line is run second
   
    TestSomething(player, someVar);    // * all code in this function is run before any code after this line

    // * you can control when something is handled through logic checking
    if (intReturn > 0)
    {
        // * do not run this code unless the IF evaluates to true, if it does not, this code will be skipped until it does return true
        AnotherTest(player, anotherVar);
    }

    AISetStock(player, 10, c_ZU_Zergling);    // * this won't run until after AnotherTest if the IF evaluates to true
}


You can use as many galaxy files as you want with as many lines of code as you want. You just need to include them via

include "path/file"

Notice it's a forward slash (/) and not a backward slash (\). Also note you do not include the file extension (.galaxy).

include "TriggerLibs/mycustomstuff"
#4
Or was originally going to name it Milkway and realized he could make a pun out of it replacing the 'y' in 'way' with an 'i' thus making a pun on it being an AI editor.

Get over it already.

Quote from: Bifuu on March 30, 2010, 04:24:37 PM
Quote from: hd on March 30, 2010, 11:48:09 AM
Quote from: Sixen on March 30, 2010, 12:46:37 AM
The name of your editor sounds oddly familiar... Sorta like the Editor SC2Mapster released weeks ago. I wonder what inspired you.

Or when people hear Galaxy they think "Milky Way"... since we live in the Milky Way galaxy.


You know what you are right, people thing of MilkyWay when people think of Galaxy, and well the Author knew that and her knew there was a MilkyWayEditor too from Mapster... Want proof?





Kinda Funny his original name was MilkyWayEditor, and knew about Mapster's So he had to change it, not very cleverly tho


http://en.wikipedia.org/wiki/List_of_galaxies Here you go OP, Andromeda is still available i think
#5
Quote from: Sixen on March 30, 2010, 12:46:37 AM
The name of your editor sounds oddly familiar... Sorta like the Editor SC2Mapster released weeks ago. I wonder what inspired you.

Or when people hear Galaxy they think "Milky Way"... since we live in the Milky Way galaxy.
#6
Anyone have all of the upgrade strings for the missing upgrades?

For example, the Roach upgrade to move while burrowed, etc. is missing from the requirementsai file.
#7
So I've discovered a few things...

TechTreeUnitCount(player, unit or building, const) will return the correct number of tech labs or reactors, so if used in conjunction with AISetStock, you can have it build the correct amount automatically as demonstrated below.

AISetStock(player, 1 + TechTreeUnitCount(player, c_TB_BarracksReactor, c_techCountInProgressOrBetter), c_TB_FactoryReactor);

This will build 1 Factory Reactor regardless of how many Barracks Reactors you have.
#8
I was just about to post that apparently c_TB_FactoryTechLab in AITechCount counts ALL tech labs, regardless of what they're attached to. Which is very, very annoying. Even removing the second condition won't build one if there's already a tech lab using AISetStock(player, 1, c_TB_FactoryTechLab);
#9
For some reason, the following if statement is always evaluating to false, even when a factory has been completed.

    if (AITechCount(player, c_TB_Factory, c_techCountCompleteOnly) > 0 && AITechCount(player, c_TB_FactoryTechLab, c_techCountInProgressOrBetter) < 1)
    {
        TriggerDebugOutput(1, StringToText("Blah"), true);
        AISetStock(player, 1, c_TB_FactoryTechLab);
    }


Even though it's a direct copy from the Barracks techlab code (obviously with barracks replaced with factory) which works just fine.
#10
I cannot, for the life of me, seem to get these built by the AI.

I'm using:
AISetStock(player, 1, c_TB_FactoryTechLab);
AISetStock(player, 1, c_TB_FactoryReactor);

They never build, ever.
#11
You wouldn't happen to have the voidray speed one would you?
#12
Why wouldn't you just spawn 1 queen per hatchery / lair / hive and place one queen at each hatchery / lair / hive and then have it check on the unit's think if it can cast spawn larva and then have it target the closest hatchery / liar / hive?
#13
I think the both of you are over complicating the AI and this process. I'm not trying to be a nay-sayer but this is getting some what out of hand. :\
#14
Quote from: Astazha on March 13, 2010, 09:07:51 PM
I think initially HD's approach is going to provide fast improvement for the next version of the AI.  I think ultimately a truly good AI will take Kernel64's approach, and I'm very interested in thinking about that framework.  Having the AI continue with a build when it's being countered hard isn't the kind of thing player would do - a player will turtle and change tech, or try to get an economic advantage, expand to an island, something.  Anything other than throwing more of the same units to their deaths.


A really simple reactive change is the anti-air one that's in the current version.  Another would be to escort troops with detection when the AI is getting mauled by Dark Templars.  A further more complex iteration of that is that if your detection is overlords then you need to be able to protect them from anti-air.  Is it complicated?  Sure.  And I think reactive AI is going to be really bad at first, but writing true artificial intelligence is what excites me about this project, and it will get better over time.



Kernel64 please post stuff as you work on it if you are willing because that stimulates ideas.
I disagree. I don't think his method will have much effect at all on the game. We're talking about early game here. In early game there's not much you can react to. There just isn't enough information that can be gathered by scouting to figure out their plan... yeah, they may go hellion rush, zealot rush or whatever but by the time you get to a point where you can react, it's already mid game.

Having a build order with that many checks and rechecks to try to counter an opponent is silly. I think you guys are confusing build orders with strategies. A build order is only important early in the game to set yourself up. Once mid game kicks in, you're countering units, executing strategies or maneuvers. Early game has nothing to do with the sorts.

No player starts a build to say... rush 'lings and then goes "oh, the opponent might rush banshee's, lets scrap this entire thing and rush hydralisks."

For all they know, they're not rushing banshee's, they're rushing siege, or hellions or reapers. By the time you're even in a position to counter, it's already mid game. And if you are rushing, you HAVE to commit to it. You can't go, "I'm going to sacrifice x, y and z so I can get early 'lings effectively screwing myself for another build and then cancel the entire idea just because the terran walled himself in." A build order is just that, the order in which you build. It is not in and of itself a strategy.
#15
Quote from: Kernel64 on March 13, 2010, 02:06:47 AM
Hd, it gets really complicated once you've tried a lot. But you're right, there should be a way to reduce the lines and have the variations isolated somewhere and all other similar ones kept.

But then again, different cases proved that certain sets of ordered lines are necessary. You're example is where it all starts. Once variations are discovered, I began to notice that blocks of the such as your example shows are called for.

For example,

after the exact order: 2nd ovie, +3drones, pool... you can go:

a) +4 drones (16/18 food)
   i.) fast expo followed by:
      1. Queen (17/18), Ovie3,... then choose:
           I. +2 lings
           II. +1 drone (16 drones total)
      2. (...more lings)
b) +2 drones, extractor1, +2 drones
   i.) Ovie3 (16/18 food), queen 1 (18/18)
      1. R.Warren1 (17/18)
            I. +2lings and drone (20/26)
            II. +drones
            III. +4 lings
      2. Ovie 4, +spam Roaches to 8
   
etc.

Now, this may seem trivial, but imagine in the mid-game? If the AI is not coached to maintain a certain block, or discard, or put it on hold for an emergency, it will go All-in. And that's a bad strat.

I'm looking to make the AI respond to apparent changes in the opponent's strat, unit compo, base, and respond properly that it can even make the enemy say, "I was rolled over because I had no robo for immortals. Those roaches burn."

And for example, the AI will discard that and go tech to Hydra instead, if it discovers, while it was morphing lair, that the Protoss had not started 2nd assimilator and instead had 3 gates and etc etc.

But, yes, I'd love it if someone can implement these concepts properly and much more efficiently. I'm taking the route that I know now. I will post them up when it's playable.

As of the moment, I'm working on a function that turns on and off processing of a block, suspending it to activate another block for execution, or discarding the current block altogether for a new one.

but that is irrelevant that early in the game. You'd be better off having completely separate build orders because every time multiple choices appear where the build can diverge, once a choice is made the number of options decrease at the next divergence until eventually the AI is committed to a build. There's only a few isolated cases where you can figure out what the opponent is going for that early in the game.

The choices are further limited by the race of the opponent. I think if you were to put a timer in that alerts you when mid-game usually starts (6-7 minutes), you'd find that very little is actually done by then.

Thus, having a singular build that can diverge so many times will actually limit and complicate the AI. As stated previously, having each option as a separate build and then having it randomly choose which build to utilize would net much better results.