Redpill me on game engines

Redpill me on game engines.
A good book is highly appreciated.
I want to make a 2D ASCII shoot-em-up on c++, where do I begin? How do I handle collisions?
Want to make this using only iostream and string.h.

Attached: serveimage.png (320x300, 5K)

Other urls found in this thread:

termsys.demon.co.uk/vtansi.htm
youtube.com/watch?v=Gw-K466u8GE
viewsourcecode.org/snaptoken/kilo/index.html
youtube.com/watch?v=6arBu6eIyeo
Jow
github.com/LambdaHack/LambdaHack
roguecentral.org/doryen/libtcod/
youtube.com/watch?v=rVBDywOmX8Y
github.com/DuncDude/Arduino-Serial-Stellar-Loop/blob/master/Main Code
twitter.com/AnonBabble

Do a 2D opengl instead of an ascii game.

I want to keep this as simple as possible. And I have no idea how opengl works at all.

Games are 90% art assets and 10% non-retarded monkey tier programming.

Here's your redpill.

I want to know this also but in C.
Cant I just do it in terminal with basic loops and chars or I have to use something on top of it?

You'd want to look at ncurses.
>How do I handle collisions?
Check of coordinates are the same, for sure.

termsys.demon.co.uk/vtansi.htm
termsys.demon.co.uk/vtansi.htm
termsys.demon.co.uk/vtansi.htm

But how do I check those coordinates, given a rectangular hitbox? That's private data.

why C++?
that kind of thing is easier done in BASIC
and if it was done well it could earn you some money especially if you sell it to some manufacturer of kids arcade game toys

I did a snake game in C that is terminal only. It's possible, yes.

Time to learn how to design an application.

We aren't in 2002

Well could I please get some pointers (no pun intended)?

>Want to make this using only iostream and string.h.
This is going to be hard if you want it to be cross-platform.

ANSI escape codes like posted would cover most UNIX setups but they are not enough.
You also have to at least put your terminal into raw mode to get single key presses without newlines, which is different even across different UNIX derivates.

I'm doing this just for windows for now.

wow Jow Forums really gives the worst advises on all categories! impressive

you dont check that the co-ordinates are the same. THINK HARDER ! it is easier to check whether the pixel currently occupied by an object on the screen is a different colour to the last pixel. If the ships are blue and the background black and next pixel the missile, or whatever object it is, hits a blue pixel next then some shit happens. If the next pixel is black the object moves forward one pixel

>windows
Then it's impossible with just iostream.

You'll need to use the Windows API shit to do fancy terminal shit.

That's actually pretty neat, but I'm just using bare bones ascii rows printed on the screen one by one.

Isn't tcgetattr highly standard?

You still have to reset the cursor position to an upper row when you redraw.
Even that requires the Windows API AFAIK.

seriously you know nothing about programming that is for certain. The guy is asking about making that game in C++ - it's like asking, How do I fly a space shuttle to pick up some groceries? Why would you use a space shuttle when it is easier, simpler, uses less resources to drive a fucking car there?
If you write a game like that in C or C++ youre a fucking idiot

>That's private data.
It's not a problem
youtube.com/watch?v=Gw-K466u8GE

You're gonna be bottlenecked by terminal output speed on Windows unless the game runs at like 10fps.

I don't want to use a rinky dink opel astra when I can use a jetpack. This is an exercise, not an actual product I'm making.

now I know youre trolling
Fuck you !
I'm out

Please tell me this video is ironic.

You can fall into undefined behaviour, but it's possible to get access to private members of class, as you can see.

take a look at first chapters of kilo editor for how to work with terminal modes and escape sequences
viewsourcecode.org/snaptoken/kilo/index.html
I'm not really sure if there is something like actual game engine for terminals or you have to use ncurses/termbox/your own library. The screen redraw time is pretty miserable, very low resolution with non-square pixels sucks a lot. Otherwise the design should not be that different from 2D graphics with something like SDL or SFML.
Maybe just grab some good beginner resource and follow with tools they use and then go back to terminal if you don't know how to design such game.

>Redpill me on game engines.
they're not magic. if you know how to program in general, you should be able to figure out how they work in general. They can just get very complicated as your game grows and programming them gets quite difficult if you want to make them efficient, which is why you should know c++ already if you want to do this.
A high level description:an infinite loop that handles input, updates what has happened in the game world according to some game logic, and then displays the changes (and possibly play sound).

>How do I handle collisions?
Give every object a 2d box, then write some code to check whether two objects intersect. If your game is simple enough you can probably just iterate over all objects to find collisions.
If you have too many objects and want to make collision detection more efficient, look up some 2d spatial data structure (like a quadtree).

>only iostream and string.h.
consider using vector too.
a library to handle your ascii display could be useful too, since that's tedious to program, but your game needs to display something.

Look up X-Master 5000

youtube.com/watch?v=6arBu6eIyeo

Jow Forums-science.wikia.com/wiki/Computer_Science_and_Engineering#Game_Development

Maybe industry game development, but making a decent, functional game engine takes a few weeks.

Write it in assembly like all real men.

Can you help me out a bit and share pseudo code for it?
I kinda want to do it on my own without looking at other code.

there are only 3 different clr commands. just call those depending on OS.

;standard clear screen

xor dx,dx
mov cx, 4f18h
mov bh,7
mov ah,0
int 10h

;move cursor to upper left corner

xor dx,dx
mov bh,0
mov ah,2
int 10h

What is this, 1989?

Reinventing the wheel will probably take a little more than "a few weeks"

Making a game in c over c++ is brutal. Game development is really where oop makes life a million times easier

we are talking bare bones things here it shouldn't e overly difficult.

It's nineteen comfy eight

The Windows API doesn't have any clear screen function for the terminal so you will have to code a routine yourself.

I don't really know anything about actual game design, but I'm making an roguelike as a hobby.

so far i've found a few good things:

github.com/LambdaHack/LambdaHack

roguecentral.org/doryen/libtcod/

and this guy has like a 50-part tutorial on writing one in pygame:

youtube.com/watch?v=rVBDywOmX8Y

>Simple as possible
>Hitboxes

Lel

>winapi
Pfft,
system("cls");

>Want to make this using only iostream and string.h.
Impossible. First, you'll need to draw shit without moving cursor. Second, you'll REQUIRE a thread that will redraw the console, otherwise it'll just hang waiting for you to press a key.

>it'll just hang waiting for you to press a key
Op could just make it a rouge-like

Turn-based shoot-em-up?

SUPERHOT basically.

Oh my bad, just ate and came back to the thread. The only thing I could remember was that he wanted to make a game.

Attached: auuuu.png (680x521, 94K)

he isn't, spamming the terminal on any platform (unless you're modifying characters in place or using some clear routines) is not efficient, there's a hard limit on the amount of shit you can output

>he isn't, spamming the terminal on any platform (unless you're modifying characters in place or using some clear routines) is not efficient, there's a hard limit on the amount of shit you can output

i've always wondered about that with things like dwarf fortress. that games get cripplingly slow when tons of events start building up

DF isn't actually using console output, it literally draws pictures of symbols using opengl. It's slow because it's simulating a lot of shit.

I'm a novice but I recently wrote a scrolling game for Arduino so basically in C, C++ that uses the serial terminal, it's fairly simple but it was fun to make, and fun to play. The code is commented ( and yes could be written better) buy fairly straightforward. If you change the serial.print to work with whatever ide you're using you can definitely run it. I'm thinking of making an python version of it in the next week. Take a look at the collision part or object detection, that may answer your questions somewhat. github.com/DuncDude/Arduino-Serial-Stellar-Loop/blob/master/Main Code

Attached: 1523952364857.png (1440x900, 398K)

it has a console output but yes, the lag is caused by the computations and not the refreshing - any smart application/game will replace characters instead of clearing the screen or printing another screen

t. ncurses user

winapi has a function that replaces an entire line, it's blazing fast too.

Edit: this also only uses ASCII which is what you were looking for

What's it called

you can make your nigger tutorial 2D game (what OP wants to make) in like one hour using unity, godot or gamemaker.

Dear op, please remake the binding of issac in ascii so i can play it in my terminal

Thanks in advance

steer clear from winapi shit, especially if you aim to release something in ascii - unportable afterwards!

don't be vulgar

You need to use the Curses library

You'll have to use the Curses library

It looks like you need to use the Curses library

Try the Curses library

No clue but I've heard good things about the Curses library

Best option would be the Curses library

Use the Curses library

Curses sucks.

It looks like you should use the Curses library