Page 1 of 3

LOVE Terminal Emulator

Posted: Fri Mar 28, 2014 4:39 am
by Draetheus
Hi all! I've always been fascinated with text interfaces, so I decided my next (well first real) game should be an interactive text adventure. In doing this I implemented a complete terminal emulator! As of now its not easily embedable inside another game, however if there is enough interest I might work on that (a la quake terminal perhaps).

Update 3/31/14:
Made some huge improvements to the handling of the terminal and completely changed the tech demo. The terminal is now custom sizable so my demo now showcases how to implement a quake style drop-down terminal. Use the tab key to activate and deactivate the terminal. I have implemented one valid command: set. You can use this to change the values of the bouncing ball object like so:

set ball.xVel 100

The ball has an x, y, r (radius), xVel, yVel values that you can change using the set command. Any other input will just bring up the list of commands.

The one main bug is that the input line is not wrapped to the terminal width like the output is. I will hopefully have this fixed soon.

Update 4/4/14:
This is just about a full featured terminal emulator now! Output scrolling and line breaking is handled better, the input line supports overflow if you type beyond the terminal width, and output text scrolling can be disabled if you don't want it. I also added some basic comments for usability, but it still needs a wiki.

Demo now supports: set outputScrolling [true, false]

Grab it on bitbucket: https://bitbucket.org/draetheus/lovetty

Re: LOVE Terminal Emulator

Posted: Fri Mar 28, 2014 9:54 am
by Germanunkol
Hi,

It's looking nice!
I had to open the scripts to find out what you meant by "try killing". :) Coming from Linux, I am used to "killing" being CTRL+X or CTRL+Q or typing q and then enter (for "quit") and none of those worked.

Two other things I'd implement if I were you: You definitely should print something when "help" is entered. Even if it's just a welcome text... it feels weird when no help is printed. Maybe you should wait until you have more commands running though - then you can actually display the commands.
The easter egg appears before I press enter. That's weird - a console should not respond before I press enter.

The typing effect looks really nice. For using it in a "real" terminal kind of way, that would be somewhat annoying, but for a game this can work out really well.

Looking forward to seeing more about your game!

Re: LOVE Terminal Emulator

Posted: Fri Mar 28, 2014 1:37 pm
by Draetheus
Thanks for the feedback! I may end up implementing some more keyboard commands, especially copy paste now that LOVE supports grabbing the clipboard.

This is just a tech demo, so basically all it does is echo your input. Its up to the person implementing it in their game what commands to listen for and parse. Also that's the point of the easter egg: to do something you don't expect. My game is going to be a very out of the box text adventure with lots of whacky OMG moments. :D

Re: LOVE Terminal Emulator

Posted: Sun Mar 30, 2014 8:17 am
by vynom
I too thought it was a little odd that the easter egg started running before I pressed return, also random text and then entering the command worked too.

I was contemplating something like this as the "ships computer" for my game, so I threw it into the game using my set font, looked good! Was actually pretty simple to integrate, just localized terminal, and the callbacks in main.lua.

I like the simplicity of the design, maybe use a list and commands as keys so you can get the most out of the commands. :nyu:

Re: LOVE Terminal Emulator

Posted: Mon Mar 31, 2014 4:34 am
by Draetheus
Shameless self promotion bump for my update! I'm also calling the project LOVETTY now. :awesome:

Re: LOVE Terminal Emulator

Posted: Tue Apr 01, 2014 2:29 pm
by neptune12100
Gonna have to try this after I get LÖVE 0.9.0 compiled.

Re: LOVE Terminal Emulator

Posted: Wed Apr 02, 2014 11:56 am
by Izzo
This terminal is a great idea and it can be very useful not only for end-users but as a development tool as well. For instance logging/printing (especially with the current version of love for android which doesn't have console output) or debugging your game.

Re: LOVE Terminal Emulator

Posted: Wed Apr 02, 2014 4:51 pm
by Draetheus
Izzo wrote:This terminal is a great idea and it can be very useful not only for end-users but as a development tool as well. For instance logging/printing (especially with the current version of love for android which doesn't have console output) or debugging your game.
There is currently no way to make it function as an output only device like a debugging console, however if there is demand I could make the appropriate changes. I'm thinking about putting it up on bitbucket if enough people want to use it.

Re: LOVE Terminal Emulator

Posted: Fri Apr 04, 2014 9:39 pm
by Draetheus
Bump for update, nearing production ready I think!

Re: LOVE Terminal Emulator

Posted: Sat Aug 14, 2021 8:21 pm
by WAWAWA
The link no longer works.