Jump to content
  • Advertisement
Sign in to follow this  
JonathanCCC

Fallout 3 Terminal in C++

This topic is 1455 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello,

 

I'm making some console apps and games in C++ while I learn the language.

 

I really like the terminals in the game Fallout 3 and would like to make my console apps similar. Is there a way I can achieve a similar effect to the way text is drawn to the screen without any add-ons like ncurses etc?

 

Say for example drawing 5 characters to the screen, then half a second later another 5 etc to simulate that effect?

 

If you skip to 00:58 on the below link you'll understand what I'm after. Thanks!

 

Share this post


Link to post
Share on other sites
Advertisement
std::string message = "Hi I'm a console with really badly optimized text rendering capabilities";

for(size_t i = 0; i < message.length(); ++i) {
  std::cout << message[i];
  
  Sleep(50);
}

On Windows #include Windows.h for Sleep which is in milliseconds, and on Linux you can use usleep in unistd.h, and usleep is in microseconds.

 

 

EDIT:

Actually, if you have a reasonably up-to-date compiler you can use the built-in sleep if you include <chrono> and <thread>:

std::this_thread::sleep_for(std::chrono::milliseconds(50));
Edited by Erik Rufelt

Share this post


Link to post
Share on other sites

The other option is to use a mask that animates per line on the rendering. You can then just set the text of all lines and the mask animation will reveal text as goes a long untill it is finished.

 

Ignore this I missed the console app, my solution will only work if you are doing some fancy rendering

Edited by NightCreature83

Share this post


Link to post
Share on other sites

on that subject, at the moment i've just been doing exclusively console based games for windows.

 

If I did want to branch out in some graphics for more fancy text games like the fallout terminal, what is the easiest thing to use with C++ do you think to achieve something like that and practice graphics for text games?

 

EDIT: just for the record I'm clueless on graphics and have never done anything but console stuff.

Edited by JonathanCCC

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!