Placeholder Image

字幕列表 影片播放

  • what is going on everybody and welcome to tutorial series that I have been looking forward to for quite some time and that is building a eyes in Starcraft two.

  • So if you don't know, Starcraft two is it's just a strategy game, very much like command and conquer.

  • Age of Empires were played those, um, where you've got workers and you still you started with some workers you collect some resource is you build more buildings, research upgrades, you amass an army and you annihilate your enemy.

  • So that's basically the game.

  • So it's a little more complicated than that, but that's basically it.

  • So, uh, around like mid 2017 deepmind, the machine learning slash deep learning company partnered with Blizzard, the creators of Starcraft two, to create an AP I around the game to help people create artificial intelligence is to play the game deep mines.

  • Main interest seems to be more like creating reinforcement learning algorithms, but with the A p I, you could do anything from just creating simple, rule based bots all the way up to yes, like a reinforcement learning algorithm that you would hope could could defeat other players.

  • Unfortunately, the game is unbelievably complicated.

  • And to my knowledge, there exists no reinforcement learning algorithm that's actually decent at playing the game yet just because of the extreme level of complexity to the game.

  • Now, um, what you need, Thio play is pretty simple.

  • The Starcraft two is free to play now, so you just need to just download it and install and all that.

  • And then we're going to be using Python Dash S C two to interact with the actual AP I itself quick shut out, by the way, to my two recent sponsors needs vich and Werther's original ah user named Werther's original not actually Werther's original the company.

  • If you didn't know, you can sponsor the channel.

  • If you're looking at a video, there should be a blue sponsor, but in some countries it's not available.

  • Ah, but if you click on that, you can see the perks that we get.

  • Basically, you get early access to some of the content and you get the opportunity to shape future content via poles that I put up for next topics that people would like to see also you even most importantly, you get certain emojis for live chat and then also ate shat badge, just like in the comments section.

  • So if you want to support Awesome, this is my full time job.

  • And if you want to, um, help me continue making content like this.

  • You sure can.

  • Now what we're gonna do is so Yeah.

  • First of all, you need Thio.

  • Go to battle net, basically making account head to the download section and download Starcraft two.

  • I'm on windows.

  • You get on, Mac.

  • I believe there's a way to get it on Lenox.

  • I I really don't know anything about putting it on Lenox.

  • I may eventually be finding out, but, uh, at least for now, Windows and Mac So Ah, once you have that, you're going to need Python Dash S C to not to be confused with pious See too.

  • So python ESI two is a different wrapper than pious, cto pious.

  • He, too, is from deep mind themselves.

  • It's really more focused around reinforcement learning, and it's a more complicated package.

  • If you ask me.

  • I think this one's a little easier to get started with, and you could definitely do reinforcement learning all that.

  • It's just pious.

  • See two offers.

  • Um, something's Maur oriented towards deep learning and stuff that will probably save you time later on down the roads.

  • We may find ourselves using that package later, but for now, Python Dash s C two.

  • So to get that, it's just pip.

  • Install SC two Super simple.

  • Once you have those packages, you also need the map packs.

  • Now, I've linked to them in the text based version of tutorial, and I'll try to put them in.

  • The description of the tutorial is well, but here they are.

  • S.

  • So what you're gonna want is at least one of these, I would say Just get them all.

  • Might as well have a bunch of maps that you can plan.

  • Um, but you should at least probably grab like season one.

  • We're just going to be playing on that first map in there.

  • Oh, you just have to download it.

  • Sorry.

  • So, anyway, I was gonna show you, perhaps in there and then when you have those, you want to extract those to your actual starcraft two environment.

  • So let me pull up, see if I have one up or not.

  • I don't think I do my waters in the way.

  • Mmm.

  • I don't, But let me just pull it up real quick.

  • Just so you get an I d.

  • X.

  • This is pretty important.

  • Otherwise, it's not gonna find it.

  • So if you go to wherever you like installed lights, pride like your see dry and then program files or something like that let me find mine.

  • Road quick.

  • Starcraft So actually installed mine in J Dr.

  • I didn't want to give up precious, solid state space for the game.

  • Um, inside of here is the actual game itself.

  • You probably don't have a maps directory yet.

  • Go ahead and make one.

  • And then inside a year is where you're gonna extract your actual maps.

  • And then inside there are your map.

  • So don't make make sure you just don't extract maps directly into the maps directory because it's not gonna find them for whatever awesome reason it just won't.

  • So, uh, moving this aside, I'm going to assume most people pride didn't even have this game installed.

  • So probably here, I would recommend you pause and wait till you actually have the game downloaded and installed.

  • Otherwise, what we're gonna go ahead and do now is proceed to the actual part of the tutorials.

  • So let me pull Ah, some code here.

  • So this is actually what's running right now off here, and I'm gonna go ahead just close out of this.

  • We're gonna forfeit the match.

  • Sorry, guys.

  • Yeah, Close this one out, too.

  • On and always get this Always takes me, like, forever to clear this thing out.

  • I thought I could just, like, right click.

  • Maybe it's a left.

  • Like there we go.

  • Hide panel.

  • Okay, so, um, working with this is actually pretty darn simple, but it's just kind of like getting used to the patterns that you have to have to use.

  • So in order to make use of the package, we're just gonna need to import SC to make that a little bigger.

  • Uh, and then we're gonna go from sc two dot import.

  • I'm sorry.

  • From SC to import run game, that's just gonna have us actually be able to launch the game and play the game based based on certain parameters, we're going to import maps were gonna import race, and they were gonna import difficulty.

  • So the only thing I don't really talk too much about is race.

  • So in the game.

  • There's three different races.

  • You've got Tehran pronounced someway tzar ge, and you have pro toss and Tehran appears to me to be more like humans.

  • Zorg's like some sort of bugs and then pro toss is like technology slash robots based.

  • So we're gonna be playing as protests seems the most fitting.

  • Um, but there are other races in each race has their own kind of perks and disadvantages and stuff like that.

  • So again, just more complexity that we need Thio Probably worry about let way later on down the road.

  • And the difficulty is for the bought that we're just gonna play against just to have somebody to play against.

  • You can also play against your own body, but especially like starting off, you probably want to play against the, you know, just built in box.

  • There's, like, easy a medium and a heart, and then once you can, like, consistently, beat the hard.

  • But then, sure, you might want to go ahead and compete against maybe your own body or a variety of different bots.

  • Then what we're gonna do is from SC two dot player.

  • We're gonna import that bought in computer.

  • So but is us.

  • Like if you wanna have something that runs based on a class that you write, you use bought.

  • Otherwise, the computer is just the computer.

  • A I So I'm gonna start with my class center, but And that's gonna inherit from SC two dot Bought a I So what is bought?

  • A I So if you go to your installation directory for SC, too.

  • So just wherever your python as lives packages SC two, you'll see there's bought a I If you go ahead and write click, that'll just open an idol just because, um and in here you can see the body I class and all the methods that it has available to it.

  • You've got things like enemies start location.

  • So you can pretty relatively no like, especially if it's one V one.

  • You guys will be at opposite ends of the map so you'll know where the enemy has started.

  • But if you wanted to send some units to that location like maybe you don't know exactly where they are, but they're probably around there.

  • Uh, you could just tell your units to go that way.

  • Known enemy units.

  • This is just where you know enemy units to have been.

  • You have to have seen them.

  • But once you know about it, once you've seen them, you can go there.

  • Known enemy structure, ST sort of thing.

  • Um, where have we expanded Thio?

  • Uh, you're available.

  • Abilities expand now, which is actually a pretty useful, um, method, Um, trying to think if there's anything else distribute workers.

  • Also one of the more useful methods.

  • Also somewhat complicated.

  • Um, Anyway, there's a bunch of methods here that you can use, but all of these air inherited, so just keep that in mind.

  • So coming back over here.

  • Oh, and while we're here, I'm just gonna pop into paths.

  • So just in case you did like me install it.

  • Two different directory thegame.

  • You'll need to modify pads.

  • So, in my case, I changed windows installed path t where I put it, So just keep that in mind if you changed it.

  • Okay, So, inheriting from the S E two body, I So one of the things that that has is an on step.

  • Um, basically, it is What do you want to do?

  • Every step.

  • So?

  • So when the game actually runs, um, it's gonna check first you're on step method.

  • So we're gonna define, uh, as an asynchronous method a sink, death on step self and it oration.

  • So every step that we get basically, um, what do we want to d'oh?

  • Well, the first thing that we're gonna do is we're just gonna distribute our workers.

  • This is a method that's already been written for us, as I just showed you distribute workers and all this does, basically is so you're going to start the game with 12 little workers, and then you need to tell them what to do.

  • So in the game, there's two different types of resource is there's minerals and then there's like this gas, and at least to start, we're just gonna grab the minerals.

  • And what this is gonna do is basically any more than three workers per little mineral patch is too many you're not.

  • There's no benefit to having any more than that.

  • So the idea of distribute workers is toe toe intelligently.

  • Distribute them.

  • Now that's fairly complex operation.

  • But it's already been written for us.

  • So we're just going to use that one as just to get us started with working with this.

  • This a p I.

  • So there's distribute workers for us.

  • That's all we're gonna actually do with our bought.

  • Now, what we want to do is actually run the game.

  • So to do that, it's run game, and then you're going to specify where you running it, like, what map are we gonna run on?

  • And then you give the player list and then if you want to, you can specify the run speed.

  • Basically, is it real time either true or false?

  • If it's true, it's gonna run at a regular speed.

  • False.

  • It's gonna run ultra fast like it's fast as it can run basically.

  • So So you're not like wasting time like once you get through these earlier stages, there's really no point sitting through them s So it was better t real time falls for now.

  • We'll keep it is true.

  • Anyway, maps dot get and then you're just gonna specify one of the maps.

  • I think I've closed it.

  • I don't know if I left it not yet closed it, But anyways, in your maps you got the map name, and it's like dot s e to map or something like that.

  • Just copy and paste the map name over.

  • So I'm gonna use abyssal reef l e.

  • So that's going to get that map for us.

  • And then what we're gonna do is we're going to specify the list of players.

  • So first we're gonna bought player.

  • The baht will be race dot pro toss, and then the actual bought itself is going to be sent a pot then and actually, we need to do that.

  • Then what we're going to dio is specify the next pot, which is gonna be a computer player, and the computer will be raised on Tehran and then it's going to be a difficulty dot easy for now.

  • So later on, especially if we, um if we find that this is like it really easy, we're defeating that bought will want to upgrade that to medium, and then we'll upgrade it too hard.

  • And then one's heart is easy.

  • You will probably maybe a couple hard or three other hards.

  • And then, um and then maybe incorporating our own bought into the mix.

  • So then we'll do the real time.

  • And that will be for now.

  • We'll equal true if everything's the way we want it.

  • Uh, why're you okay.

  • Weather.

  • Okay, so let's go type.

  • Oh, yeah, I did.

  • Difficulty is not not sorry.

  • I got difficultly called.

  • Okay, anyway, running that.

  • So what's going to is going through all your maps, find the one that you wanted to play, and eventually it will launch the game for us.

  • Anything you want to do before upgrading your bought, like if you're consistently winning is probably changed the map.

  • Try a different map and see how well you do.

  • So, anyways, right away we can see our little workers are quick to start collecting.

  • Resource is, um and then they like you would want only three Pirlo patch.

  • Because these patches three minerals, it's kind of pointless to have more than three workers on each path.

  • Patch brother.

  • Okay, so, um, I hate to break it to you, but you're probably not gonna win any games.

  • Uh, by doing this, So we need to We need to have quite a few other things, like building buildings and upgrading and building our actual army and attacking and expanding our base here.

  • All that stuff.

  • But hopefully, at least up to this point, you're starting to catch on to how this is gonna work if you have any questions, comments, concerns, whatever.

  • Feel free to leave them below.

  • Otherwise, I will see you in the next tutorial where things hopefully get a little more excited.

  • That then just collecting resources.

  • Okay, till next time.

what is going on everybody and welcome to tutorial series that I have been looking forward to for quite some time and that is building a eyes in Starcraft two.

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

A2 初級

介紹和收集礦物--《星際爭霸II》中的Python AI教程第1頁。 (Introduction and Collecting Minerals - Python AI in StarCraft II tutorial p.1)

  • 6 0
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字