Это видео недоступно.
Сожалеем об этом.
Creating Minecraft in Python [with the Ursina Engine]
HTML-код
- Опубликовано: 12 авг 2024
- A basic tutorial on how to create Minecraft in Python by using the Ursina Game Engine. This also includes a general introduction to the engine itself.
Timestamps:
0:00 - Intro
1:24 - The basics of Ursina
15:49 - Creating Minecraft style blocks
35:25 - Creating a sky, a hand and adding sounds
Project files are available here:
github.com/clear-code-project...
Artwork from Kenney:
opengameart.org/content/simpl...
my snake game project had 250+lines, and he created a "minecraft" in 90 lines, well life aint easy.
🤣🤣 Lamao
Using an engine tho
quality of a project can't be measured in number of lines. If you have a different coding style you can easily create more lines without reducing or even improving readability.
Also, (still at the start of the video, so not sure what's in the Pynecraft game), snake needs quite a bit of logic that a minecraft clone doesn't need, whereas snake also needs a world to move in...
@@sauliustb Agree with you on the first part, not sure if i do on the last though.
in python 250 or 90 lines can be the exact same speed because interpreter (and by exact same speed i mean very slow)
WOW, I wasn't expecting this at all! With a few more key features you can make this game pretty gameable. Keep it up, C!
It's not C, it's Python
@@LtdJorge He wasn’t referring to the programming language C, the youtubers name begins with C
@@_alfie_phillips_2058 understand the code
@@_alfie_phillips_2058 yes. That's the joke.
@@LtdJorge C is the first letter of this channel name..
"Mom can I buy minecraft?"
"No"
"Fine. I'll do it myself."
Lmao 🤣 🤣
Right I have might mine carft without money I was a hacker front before only
@@parthacodes5893 ur grammar is so good im proud of you
why would you ask someone if you can buy something with YOUR money
@@parthacodes5893 you don’t know how hacking is really. i know cyber security
Dear RUclips Algorithm,
You have FINALLY given me a good suggestion, one that has actually had a high value to it, one that I actually really enjoyed.
No but actually this is a great tutorial, and I really like it! Thanks!
69 likes 😎
@@_lun4r_ lol yea
69: 💩📉
Stack and 5: 😀📈
agreed here
Yeah RUclips has some great, high quality content, it just takes some time to find it
Making Minecraft...
Him: 'So lets first begin with a circle'
Me: *visible confusion*
**confused screaming**
So let's make a square.. Let's type uhm.. Circle! Then a circle is drawn on the screen!
first i started with a circle, then i erased some of the details, and tada, minecraft
*_-yeah-_*
Bro you are one of the people on youtube who makes comments that are not copied from other videos. This is the type of comment that makes me have a little laugh. If I could pin this comment then I would!
This channel is criminally underrated
For real god
agree i think he is going well in 3 days he got 140 subs which is great for small channels and i am sure one day this channel will be great and have more subs :-)
Its because he doesnt post often, if he posts often then he would get hundreds of thousands of subs
Lol the video has 1.4 m visits, do you want us to make him a party or something?
@@Pirater666l gee, I wonder if those views happened after I commented that more than a year ago.
Minecraft java edition: ❌
Minecraft python edition: ✅
*LAG INTENSIFIES*
🤣🤣
Well... there is Minecraft Pi.
how 2 get 3 FPS on good GPU's simulator
Minecraft pi edition is that
*starts coding Minecraft from a circle*
Mojang:
"Understandable, have a good day."
I‘ve learned flappy bird, snake game, GTA2 car in this channel, and now I'm learning create 3d objects in python !
Sir this is the only video to make Minecraft with python, this video will get million views, I can bet.
You bet wrong at least for now
@@sanderdrack yes but only for now
there are other videos of how to make cubes with pyopenGl and pyglet but this is the best one.
yes i had to search for this, it didnt pop up in my recs
@@zyugyzarc yeah
There were other minecraft clones made in phyton, but i can't remember who did it, but I remembered to watch it a couple of years ago
This is by far the coolest thing ive seen in coding so far. Especially with how simple it is
I've*
This channel has advanced and skyrocketed with unexpected great tutorials from you, I've never expected minecraft to be replicated with python until now thanks to you!
I was searching for graphic libraries while ago for python (as pygame feels a bit too basic) and was unlucky for some time, but month later your video popped up almost accidently and showed this awesome library that i had no idea about, so thank you kind sir for showing this to us!
yeah me too a bit basic
You can never know everything, I was just getting bored of pygame and this pops out of nowhere, and btw your channel is extremely underrated, and by that I mean *EXTREMELY* underrated...
I really apprecaite your tutorials. Often creators make a tutorial and don't explain what the key functions do. This was so helpful.
My 9 year old child wants to learn programming because of this movie! He believed it's possible to do it and wants to create a game like Minecraft. Yo are amazing! Thanks a lot.
Luv how this video is both a tutorial and a demonstration for ursina
A very nice tutorial! I never thought you can make a 3D game so simple in Python using Ursina
This is quite fascinating. I like how this engine simplifies the process of making a game in an easy-to-learn language like Python with very little code. It removes the complicated parts of 3D Math, collusion, player camera, etc while just leaving the programmer just attaching the objects (Entity) and setting up their properties. I hadn't seen anything this light. I think this engine has great future potential.
When using the color = color.color(h, s, v)
h = hue
s = saturation
v = value
You can look up HSV Color Model to learn more
rgb better
It is top grade, top class content you are delivering...with the most humble way possible..
You are gonna make it like the Fat dino channel..I'm one of his early subscribers..
But he is more of an entertainment oriented(I didn't make games with unreal)..your's is truly amazing, with explanations to every single step..
I can't imagine the amount of effort you're taking...
What to say, if I'm starting a channel in youtube, this will be the benchmark..
Millions of love..
Ursina comes with it's own sky function. Sky() does everything you have here without having to create a custom class for it.
I’d love to show my support for these videos. Thank you for this amazing, engaging, and informative content!!
I am so glad I found this channel I learned a lot of stuff from it. I hope you make another ursina tutorial
NO WAY i didnt knew we can create anything 3d in Python
yah!
Ever heard of Opengl binding? There is opengl binding for almost every language.
@@safi3968
People judge a programming language on how it looks and how popular is it sadly :(
You can basically create anything in Python, albeit it's a bad idea to.
@@grimm5751
Nah there are big names who uses python a lot and the low speed of python doesn't matter that much in most cases.
I created the same structure in FTEQW and it took over a month and.. with Ursina you did it in less than an hour! This engine, if the developer will keep adding vital features(skeletal animations, particle emitters, pool system, etc.) from Panda3d, it will become my engine of choice. Thanks A LOT for sharing this tutorial, keep it up the great work!
That Block Placing and Destroying Sound is really satisfying for some reason
please do more video on the Ursina Game Engine pleaaaase
yeah ursina is better than pygame...
@@balaji.n7819 Yes really it is very difficult in pygame
@@sarthakarora2897 it's very tough to open a window, and add entity
@@balaji.n7819 Are you talking about pygame??
@@sarthakarora2897 yep
Ursina looks more like an advanced version of turtle
what did he sayyyyyyy
accept turtle isnt a game engine
😂😂
It is a child version of panda3d
@@apurvakumardani172 Child version ? That makes no sense, it is just programming in 2D, I bet it would take u 7 weeks to complete a full snake game u sloww
Small update on the new version of Ursina and this video : if you want to specify a color and change the shading do as follows:
color = color.Color(color.hsv(hue,saturation,random.uniform(.9,1.0))) # the third parameter is value , check the HSV color system for more info .... if you also question as this is only a tuple with 3 elements : check the Color class and you can see that there is a forth default argument a = 1 ! No need to meedle with that only if you know what you're doing.
The cause of this if you did like in the vid there would be an error thrown just before the game renders anything and yall get confused : the constructor of the Color class expects a Vec4 (as Color enhreits from Vec4 basically) and you can notice this in the init function of Color.
Hope it helps !
Hey, Do you know how to get the 'assets/block' file?
I dont see it on the github
Hello, can anyone help me? I am trying to download the block thing from github and there are 2 files for the block and they are both code and not images or textures. How would I go about downloading them?
Hi @@aerotics8775. Have you figured it out yet? I am having this same problem. I If you have figured it out can you please help me?
@@supansup actually the block file is Grass_block.blend
This is incredible the game engine is so easy (as you said much more than pygame even the sound is easy) also the voice timing and the method of teaching is great
man u're awesome i'm broke asf and i want to learn this things to see u showing this info free u're great keep going all love and respect to u sir
Me: Mom, can we get Minecraft?
Mom: We have Minecraft at home.
Minecraft at Home:
Hahahhaha funny omg comedy 100
@@shelby255 :)
Me: Mom, can we get Minecraft?
Mom: Yeah, sure.
Minecraft at the store:
Is it me or this man's voice makes you wanna stay and learn?
Great vid man!
Love this tutorial it helped me alot in learning python and about ursina I was so so bored on making basic games so I decided to make a little advanced game so here it is such an excellent tutorial on creating minecraft in python Love it! :)
HOLY I DIDN'T REALIZE THAT URSINA WAS THIS POWERFUL :O
same here!! I realized it rn!!hahaa
ITS OVER 9000!!!!!!!!!!!!!!!!
To supply a possible answer to what confused you at around 27:18...
It's most common to define colors in the RGB color space. But there are quite a lot of other popular color spaces also.
This one looks like it might be using one called HSV. (Hue, Saturation, Value)
Hue is a range of 0 - 256 (possibly 255), While Saturation and Value are both 0.0 - 1.0
Thank you for this fantastic tutorial ! I realised all steps following your explanations and everything is clear
I don't have errors and the game is working. Thank you :)
I just started learning python and this seems so easy because you are a wonderful teacher! I'm going to finish the course so I can do this.
I think the colour values are HSV:
Hue changed the colour but with no saturation it didn't change,
The Hue was 0 which is usually red when you changed saturation,
And the grey change was the Value (or Lightness)
i love that you do random coloring to blocks. this need to the real minecraft too. :)
Amazing! I finished the entire program! God bless you and god bless your channel :D
Wow! So simple! Ursina is beautifully clean!
Names it test_Square, makes the shape a circle
*im about to do whats called a pro gamer move*
This was beautiful.
When I saw the title, I expected 1FPS, since PETHON SLOW.
But now I found an awesome coding channel. Good luck!
😁
The engine probably runs off c extensions, otherwise it would be too slow
@@byojuwon 🤣🤣
yeah, obviously it breaks down when you're loading too many blocks, but even java minecraft has to load by chunks, I wonder if you can compile this and make it even faster
@@byojuwon the core of the engine was written in c++
I was looking for a fun code to do with Python. This seems dope, THANKS!!
So regarding the thing at around 9:50, I don't know Ursina, so I don't know if it caches loaded textures in some way, but loading a texture from file at each call could otherwise create a new texture instance every time at runtime. For textures that are reused very often, this might have a performance impact, so unless Ursina handles this already, I would advise people to do as the video does and use one variable for the texture unless you need to make instance specific modifications.
A bit late, but that color.color() probably expects HSV values, first is Hue, second is Saturation, third is Brightness
100% recommend following this tutorial, the explanation is great :)
You don't know how grateful I am for this video. Thank you.
22:17 what I was not believing that it was so easy!!!
The only thing I know in Python: print("Hello World")
@@NoobieYT You assumed that print is only in lua??
but here is writed(modifered):
from ursina import *
from f11func import *
xlay=int(input('X plate size? '))
zlay=int(input('Z plate size? '))
tl=(xlay+zlay)*4
print('Total blocks:',tl)
ylay=int(input('Y layers? '))
tl=tl*ylay
print('Total blocks:',tl)
v=input('Not flat? [1/0] ')
input('Any enter...')
BP = 0
k = color
from ursina.prefabs.first_person_controller import FirstPersonController
class Hand(Entity):
def __init__(self):
super().__init__(
parent=camera.ui,
model='square'
)
class BVoxel(Button):
def __init__(self, position=(0, 0, 0), texture='grass.png', colr=255, colg=255, colb=255, alpha=255, sc=(1,1,1), model='cube'):
super().__init__(
parent=scene,
position=position,
model=model,
origin_y=0.5,
texture=texture,
color=rgb(colr,colg,colb,alpha),
scale=sc)
def input(self, key):
if self.hovered:
if key == 'left mouse down':
voxel = BVoxel(position=self.position + mouse.normal, texture='download.png', colr=255,colg=255,colb=255,alpha=255)
if key == 'right mouse down':
destroy(self)
if held_keys['z']:
BVoxel(position=self.position + mouse.normal, texture='cg.png', colr=100,colg=100,colb=100,alpha=120)
if held_keys['f']:
BVoxel(position=self.position + mouse.normal, texture='fb.png', colr=255,colg=255,colb=255,alpha=255)
if held_keys['x']:
BVoxel(position=self.position + mouse.normal, texture='glowium.png', colr=random.randint(0,255),colg=random.randint(0,255),colb=random.randint(0,255),alpha=255)
if held_keys['c']:
BVoxel(position=self.position + mouse.normal, texture='grass.png', colr=random.randint(0, 200),
colg=255, colb=random.randint(0, 200), alpha=255)
if held_keys['v']:
BVoxel(position=self.position + mouse.normal, texture='brick.png', colr=255,colg=255,colb=255,alpha=255)
if held_keys['q']:
app.saveCubeMap('ss32_#.png', 0)
app.save_cube_map()
app.saveSphereMap('ss32_#.jpg', 0)
app.save_sphere_map()
if held_keys['e']:
app.loader()
app = Ursina(
)
for z in range(-zlay, zlay):
for x in range(-xlay, xlay):
for y in range(0,ylay):
if v=='1':
if y==0:
grs = BVoxel(position=(x, y+random.uniform(0.6, 0.9), z), texture='grass.png')
if y >= 0:
stn = BVoxel(position=(x, y-(ylay-0.8), z), texture='download.png')
if v!='1':
if y == 0 or y == 1:
grs = BVoxel(position=(x, y, z), texture='grass.png')
if y >= 1:
stn = BVoxel(position=(x, y-(ylay-1), z), texture='download.png')
player = FirstPersonController()
app.run()
I know a lot of Python.
DUDE you are amazing
This is awesome!
I love it when it works!
Nice game pragz
Python is an easy language, I almost learned it
You almost learnt it? What does it mean ?
This is probably the best tutorial you will get online
Thank you so much for this tutorial!
Ursina and Panda3d has so much potential!
Please do more ursina tutorials
test square = *C I R C L E*
Ah yes, this is my jam.
I'm definitely using ursina for all of my python game projects from now on.
I like your voice, the way you make the tutorial going step by step, liked and subscribed, really looking forward to your channel :)
This is a good video. Only one thing I am still confused about-Where can the assets/block be downloaded?
in the description of the video he has the project files, click there
Yes that’s the problem! How to download??!!
Did anyone got the solution of this problem
Are you going to do a part 2? I'd really like to see how can we do inventory, main menu, and most importantly the chunk system work.
The way he did the blocks is really weird ,its not like minecraft where its made via the code instead its a .obj which can lag if you make it infinite and via chunks.
@@morewinxdoesplaygames2074 i didnt understand how he made block textures on each side. if it's not a problem for you, can you explain it?
@@bigsyxthy9603 ikr, but still, it would be nice if it works in some way.
The chunk system is pretty simple, just load/unload voxels depending on the player's position, and save the world chunks in a variable or file
@@archlinus5066 nice idea!
Finally someone shedding more light to ursina
This is something interesting I have watched. good job man love it ✨.
Can you pls do a tutorial series on this and how to make 3d games with it and also a series on how to expand this game and make a inventory and all that kinda stuff
how would you make the mouse visible for the inventory?
There is a tutorial on making an inventory on the official ursina engine site : www.ursinaengine.org/inventory_tutorial.html
@@origin-panda5439 I guess you would have to make your own first-person controller, or use the pause function in Ursina to pause the game
@@ohtych1004 I tried, but I couldn't get it to resume. I think it wouldn't detect my keypress after paused but maybe I'm just stupid
@@origin-panda5439 you could put the update function and everything in an if or while statement, so:
if resume == True:
# game code, update, and everything in here
else:
# Inventory code
I tried that but something weird happens, where the color.red or color.blue thing stops working somehow, but if you color it inside of blender then it should work fine.
LOL. I did this in one line of code:
from minecraft import game
It is python at the end of the day, you know :P
I was like Wait- hold up when I read your comment xd
@@JupiterVortex hahaha 😄😄
I remember seeing that, "Minecraft in 5 seconds" lol.
and minecraft turns out to be a C library :P
@@grimm5751 Exactly
*MISSION FAILED SUCCESSFULLY*
yo bro u explain this so nicely tbh u r very underrated
i swear this is the best tutorial i have ever seen
Can someone please explain why RUclips keeps recommending me new Game Dev Engines? First Unity, then Godot, then Unreal, now Ursina. What's next, Samsung Smart Fridge?!
Great video, though!
Man i hope the Samsung Smart Fridge is gonna be a good game engine.
@@fwoompdotexe5225 lmao
But does it have ray tracing.
Just use RayTracingMode = on
¿
Just kidding but who knows, you have to know advanced maths to make raytracing
Really love the engine and your videos
Incredible!! this was so didacted, so cool man
tnx from Mexico, it was funny to practice in this way
Alternate title : how to impress an gamer girl
Code goes brrrrr
...I just searched up how to make Minecraft in python as a joke...
And I searched for how to make mortal combat 11 in Idea
Wooow. As game developer i didn't know about python engine like this.. wow man thank you very much for this powerful engine 😊 you made my day
A really great tutorial and very nice explained!!!
Now Lets Create A square Named ..... *SANS*
me: *CONFUSED SCREAMING*
Fun fact: Minecraft python edition actually exist.
No.
Congrats on 10K man! I had subbed when you had like 300 subs lol :)
Tips if you want to expand this:
-implement chunks
-after chunk implementation, add infinite world
-give blocks tags, for example, what sound is played when you punch them
-show what item is selected
-implement transparent blocks
-the basic ui stuff. Pause and settings menu, Inventory slots f.e.
Then..
-add naturally spawning structures
-add mobs
-add the nether
-add the end
-add more bloks
You are the Brackeys of python, love it !
28:00 it is hue, saturation, brightness. Hue is an angle on the color wheel, saturation is percent of that color instead of white, and brightness is a final multiplier. Black is (h,s,0), grey and white are (x,0,brightness), and for any kind of pink or red you use (0,x,1)
Wow this makes 3d so easy! Will definitely have to check it out.
Thanks you, man. Its amazing tutorial! You make big work.
didnt expect a ursina tutorial, but wow thanks i learned unrisa now and i think its better than pygame, you got a new subscriber
its one of my favorite explicative video in youtube
Appreciate your hardwork man
Great Tutorial. Thank you for sharing. It works for me on Linux and Windows.
This texture pack looks cool!
27:21 it's probably HSV or HSL so changing the first value doesn't do anything unless it's saturated; which also explains the last value controlling it's greyness
Thank you! This has been an amazing video!
Nice work! So easy to follow!
This is so cool i'm impressed
Really clear code + tutorial 💪
This is a great gamedev tutorial
It's crazy how this engine is so simple and intuitive
pls help I am not able to get the grass block
Nice, congrats for finish result
Awesome! Works perfectly! Thank you :)