• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Starting back

Status
Not open for further replies.

Screamernail

S

Screamernail

I want to make my own engine again. But this time it's gonna be a simpler one as the first attempt to make my own from scratch where a maximal failure. So I'm gonna make a raycaster engine instead.


I have been inspired by the downloadable Raycaster Game Maker engine from the beginning. A first-person engine in 265 lines this is a tutorial and explanation about raycasters. But instead of Java I'm gonna use C++. (And for once I'm positive that I'm able to do it) But I'm wondering how to do it. Maybe I need a Library to make a window, and I'm scared if Xcode couldn't work for this.


Maybe I should start with a Java raycaster on the browser?
I'm awaiting replies for willing helpers.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
You can use a library like SFML (C++ API), SDL (C API), or many other similar ones, to create a window, listen to OS events, load standard image/sound files, etc. etc.
They also offer some basic graphics capabilities, if you don't want to write your own.

Note that the reason that JavaScript code could be so short is largely because all the rendering code uses the built-in 2D canvas context.
That is, your raycasting code will be (at the very least in the beginning) a magnitude simpler than the rendering code.
Therefore, consider using a library for the rendering capability, e.g. like one of the aforementioned.
 

Screamernail

S

Screamernail

I've downloaded SFML. Now what? Can it work with this tutorial?
Raycasting

I think that SFML is the only thing I need? I am going small so it's no problem with time.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
From a quick glance, that tutorial seems to be for SDL 1, which is very old and should not be used.
But this doesn't mean much - you read a tutorial to understand the concept.
Once you understand the concept, you can figure out in what way you want to implement it.

You might be interested in a math library, perhaps something like glm, because there isn't much of a point in reinventing the wheel with vector operations.
 

Screamernail

S

Screamernail

From a quick glance, that tutorial seems to be for SDL 1, which is very old and should not be used.
But this doesn't mean much - you read a tutorial to understand the concept.
Once you understand the concept, you can figure out in what way you want to implement it.

You might be interested in a math library, perhaps something like glm, because there isn't much of a point in reinventing the wheel with vector operations.
Dude, I think it's pointless continuing with this. It's that time for me to quit again.

I will just be saying the same old thing because I always forgot that I CAN'T make game engines on my own. I'm just too lazy and have too much to do. Remind me not to bother with C++ or engine making. It's just too hard for me.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
All things considered, game engines are indeed not a one-man job.

The main question is what your motivation is.
Do you want to make a game engine because you want to learn all of the design issues, and solutions, of making a game engine? rendering, physics, collision detection and response, animation, models, music, and so on and so forth.
Or do you want some fun side project, in which case you should clearly shrink the scope of the project.
Or do you want to make a game, in which case I'd suggest you to use a game engine that exists.
 

Screamernail

S

Screamernail

(I want to make a game. So I guess I'll stick with Unity for now.)

No! I will not give up. I will make a raycaster.


Can you tell me where to begin? How do I make a ray in C++?
 
Last edited by a moderator:

Screamernail

S

Screamernail

Okay. But how do I implement SFML into Xcode?

I tried doing the SFML tutorial on it's website but I got stuck immediately. Can I just use #include for this then?

EDIT: I did the "Lode's Computer Graphics" tutorial with the untextured part done but now I can't get it to work. Any idea?
 
Last edited by a moderator:

Screamernail

S

Screamernail

I implemented it so don't worry. It feels like I might be able to script it too. This might work!

But still, any more advice?
 

Screamernail

S

Screamernail

I get an error when I'm trying to get sfml to work. Can you or someone else help me?
 

Attachments

  • Skärmavbild 2017-12-07 kl. 12.09.27.png
    Skärmavbild 2017-12-07 kl. 12.09.27.png
    982.9 KB · Views: 426
Status
Not open for further replies.
Top