Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: MineCraft.. Where to start?  (Read 1605 times)

0 Members and 1 Guest are viewing this topic.

LandoKane

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
MineCraft.. Where to start?
« on: February 16, 2024, 04:29:33 am »
Hello new here so pardon me if this is unorthodox...
can it be done!!?? cis it possible to recreate minecraft using SFML?? and if so where abouts do i start??

and any resources.. links would be nice if you cant muster any...

thanks in advance

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: MineCraft.. Where to start?
« Reply #1 on: February 16, 2024, 07:53:27 am »
If you have to ask, you're not ready, i.e. lack the knowledge and experience, for the amount of work required to build something like a Minecraft clone.
You're probably better of using some engine that already has some templates that are Minecraft-like.

Otherwise you'll have to learn about 3D rendering with OpenGL, as SFML doesn't provide support for that. Then you need to learn about all the details of how Minecraft works. Find out how to optimize chunk loading and rendering. Apply lighting to everything. And yet, you'll still just be at the very beginning. Mining, crafting, red stone, NPC, fight system, etc. etc.

There are a few people who implemented some basic Minecraft version using SFML, you can find them by just using a web search engine with the terms: "SFML minecraft"
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

hdsiria

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: MineCraft.. Where to start?
« Reply #2 on: February 16, 2024, 12:16:22 pm »

You have to be proficient in opengl, data structures, and algorithms

8Observer8

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • My website
    • Email
Re: MineCraft.. Where to start?
« Reply #3 on: February 16, 2024, 01:27:44 pm »
Physics engine is the most important thing for games for moving a character, avoiding obstacles, collecting items, raycasting for detecting a ground for jumping and so on. You can start with this book: "Learning Game Physics with Bullet Physics and OpenGL". This book is an introduction tutorial to Bullet Physics engine. You can build this physics engine from source: https://github.com/bulletphysics/bullet3 The book uses the fixed pipe line of OpenGL v1. So it uses glBegin/glEnd for drawing instead of shaders. I like to use OpenGL ES 2.0 with shaders. It is simpler than ES 3.0 and it is enough for me. When SFML supports WebAssembly in the future you will be able to build your apps to Web. OpenGL ES will be transfer to WebGL automatically with Emscripten. OpenGL ES works on Desktop, Android, and Web with one code base. But I think it is simpler to start with Box2D to familiar with basics of OpenGL rendering and simple 2D physics. It will be simpler to move from Box2D to Bullet Physics. Just practice a lot with OpenGL ES and Box2D at first by making simple examples and game demos and move to 3D later. Built the latest release of Box2D from source using MinGW or MSVC: https://github.com/erincatto/box2d/releases
« Last Edit: February 16, 2024, 02:14:38 pm by 8Observer8 »

8Observer8

  • Newbie
  • *
  • Posts: 25
    • View Profile
    • My website
    • Email
Re: MineCraft.. Where to start?
« Reply #4 on: February 20, 2024, 09:03:54 pm »
You should start with recreating the demo below. Use the Bullet Physics engine to move a character. It is a third person camera in this example. It doesn't matter because you can place a camera to the top of player collider. At first you should draw edges of colliders using the btIDebugDraw class. This class has the drawLine method. Use this method to draw a line by OpenGL.

Inherit from "btIDebugDraw" and override "drawLine":

Code: [Select]
#include <btBulletDynamicsCommon.h>

class DebugDrawer : public btIDebugDraw
{
    virtual void drawLine(const btVector3 &from, const btVector3 &to,
        const btVector3 &color) override;
};

I use Qt instead of SFML because it allows me to build for Android, Desktop, and WebAssembly from one code base.

Use WASD keys to move:




« Last Edit: February 20, 2024, 09:08:20 pm by 8Observer8 »

 

anything