Android’s Text Box Problem
If you don’t know how to program you can still help. This can be thought of strictly as a logical problem. There are dozens of ways to solve this problem. I just thought it would be really interesting to see what you all thought. Just leave a comment here or start a thread if you want to get crazy. I'll hand out keys to everyone when we decide on a solution.
Android 42’s dialog text box is a little different than the other Androids. In the game I use overlapping volumes to update Android 42’s text. When he overlaps one of these cubes it sends a message containing what new lines to show (string array). His text box is then closed (destroyed) and rebuilt/resized based on the number of lines he receives and their length. When a text box is updated it is automatically opened. This is to ensure he says things at the right time.
When the texbox is updated it is automatically assigned a delay. This is to ensure the player has time to read the text before it disappears. Currently it is set to 6 seconds (6s) per line. In other words, 6s for each element in the array. The length of each line doesn't matter***. The two ways to update and open the text box are by overlapping one of these boxes or when the player interacts with him (left mouse click).
The problem occurs when you want to send him a new text box but the count down delay has already been activated from a previous box. If he is sent a message with one line (6s delay) and then 5s later he is sent another message with a 6s delay the box will close 1s after the text box for the second message opens. Effectively opening an updated text box for 1s (You might experience this bug in the current game).
This happens most often when the player interacts with Android 42 right before he is triggered by another box.
Being the professional Programmer I am, I created a very simple (but temporary) fix for this. Here's the original delay: When the Android is triggered you are given a delay time and regardless of what happens you will close your text box.
Now here's the (TEMPORARY) fix: Scenario 1 (perfect scenario): A message arrives and is assigned the "delay 1" branch. When that delay is complete it checks to see if another message has arrived before it's done. If not (delay 2 is FALSE), it completes it's task and closes the text box. Scenario 2 (OMG!!!): A message is received and is assigned the "delay 1" branch. Before delay 1 is complete another message is received and is assigned the "delay 2" branch. When the first delay branch finishes It checks to see if a second delay was received. If so, it will also take that branch and activate the second delay before ultimately closing the text box. This effectively adds the delays.
Like I said, It isn't pretty but it works for the most part. One bad thing is that the delays are constantly counting down in the background. Eventually they will close the text box and it might not be the best time. You can also only handle 2 delays. You could put another branch or twenty but I'm curious what else you think of.
You CANNOT reject or delay a message. When Android receives updates he MUST accept them and immediately display them. Similarly, You CANNOT "save" messages to display later. You CANNOT change, add, subtract, pause, or alter a delay in any way once it has been started (you CAN ignore it when its done though). You CAN close a message early. You CAN add as many branches as you want. You CAN break delay times up (e.x. 10 delays of .2 seconds Vs. 1 delay of 2 seconds). You CAN literally do anything and we can rewrite the code but if we keep these rules it will make it a lot easier to insert .wav (voice acting) later.
The delay could be based off the number of total characters and you could even add additional time for each '_' to account for complete words. It's actually pretty interesting. That's not the problem though.
[ 2016-11-30 22:22:33 CET ] [ Original post ]
First off
If you don’t know how to program you can still help. This can be thought of strictly as a logical problem. There are dozens of ways to solve this problem. I just thought it would be really interesting to see what you all thought. Just leave a comment here or start a thread if you want to get crazy. I'll hand out keys to everyone when we decide on a solution.
The Problem
Android 42’s dialog text box is a little different than the other Androids. In the game I use overlapping volumes to update Android 42’s text. When he overlaps one of these cubes it sends a message containing what new lines to show (string array). His text box is then closed (destroyed) and rebuilt/resized based on the number of lines he receives and their length. When a text box is updated it is automatically opened. This is to ensure he says things at the right time.
The Delay
When the texbox is updated it is automatically assigned a delay. This is to ensure the player has time to read the text before it disappears. Currently it is set to 6 seconds (6s) per line. In other words, 6s for each element in the array. The length of each line doesn't matter***. The two ways to update and open the text box are by overlapping one of these boxes or when the player interacts with him (left mouse click).
The problem occurs when you want to send him a new text box but the count down delay has already been activated from a previous box. If he is sent a message with one line (6s delay) and then 5s later he is sent another message with a 6s delay the box will close 1s after the text box for the second message opens. Effectively opening an updated text box for 1s (You might experience this bug in the current game).
This happens most often when the player interacts with Android 42 right before he is triggered by another box.
The Fix
Being the professional Programmer I am, I created a very simple (but temporary) fix for this. Here's the original delay: When the Android is triggered you are given a delay time and regardless of what happens you will close your text box.
Now here's the (TEMPORARY) fix: Scenario 1 (perfect scenario): A message arrives and is assigned the "delay 1" branch. When that delay is complete it checks to see if another message has arrived before it's done. If not (delay 2 is FALSE), it completes it's task and closes the text box. Scenario 2 (OMG!!!): A message is received and is assigned the "delay 1" branch. Before delay 1 is complete another message is received and is assigned the "delay 2" branch. When the first delay branch finishes It checks to see if a second delay was received. If so, it will also take that branch and activate the second delay before ultimately closing the text box. This effectively adds the delays.
Like I said, It isn't pretty but it works for the most part. One bad thing is that the delays are constantly counting down in the background. Eventually they will close the text box and it might not be the best time. You can also only handle 2 delays. You could put another branch or twenty but I'm curious what else you think of.
Rules:
You CANNOT reject or delay a message. When Android receives updates he MUST accept them and immediately display them. Similarly, You CANNOT "save" messages to display later. You CANNOT change, add, subtract, pause, or alter a delay in any way once it has been started (you CAN ignore it when its done though). You CAN close a message early. You CAN add as many branches as you want. You CAN break delay times up (e.x. 10 delays of .2 seconds Vs. 1 delay of 2 seconds). You CAN literally do anything and we can rewrite the code but if we keep these rules it will make it a lot easier to insert .wav (voice acting) later.
Sorry "Signals" isn't done yet.
***
The delay could be based off the number of total characters and you could even add additional time for each '_' to account for complete words. It's actually pretty interesting. That's not the problem though.
CAT Interstellar
Ionized Games
Ionized Games
2017-10-06
Indie Singleplayer
FREEGame News Posts 52
🎹🖱️Keyboard + Mouse
🕹️ Partial Controller Support
Mostly Positive
(681 reviews)
http://www.IonizedGames.com
https://store.steampowered.com/app/384740 
The Game includes VR Support
Linux [77 ]
ProjectFiles
Warning: This is a short story meant to be played in a single sitting.
Play as a DOG V4 drone, a newly activated maintenance bot who is assisting in the terraforming effort on Mars. After a predictable yet unfortunate accident DOG finds himself uncovering the past of a seemingly barren planet.Gameplay
The games current state includes the first environment (~15 minutes of gameplay) and an introduction to the second environment. The main goal of this release to get feed back on the player controls and game mechanics.Story
We're trying to bring the "science" back to science fiction. We also wanted to explore a scenario humanity might really encounter on the first planet we aggressively try to terraform.https://ionizedgames.com/
Visit the webpageHttps://www.facebook.com/ionizedgames
Check Out Our Facebook PageContact@ionizedgames.com
Or Contact Us HereMINIMAL SETUP
- OS: Ubuntu 16.10
- Processor: 2 GHz Quad-CoreMemory: 2 GB RAM
- Memory: 2 GB RAM
- Graphics: Nvidia GTX 750
- Storage: 7 GB available space
- OS: Ubuntu 16.10
- Processor: 2 GHz Quad-CoreMemory: 2 GB RAM
- Memory: 2 GB RAM
- Graphics: Nvidia GTX 970
- Storage: 7 GB available space
GAMEBILLET
[ 5950 ]
GAMERSGATE
[ 1903 ]
FANATICAL BUNDLES
HUMBLE BUNDLES
by buying games/dlcs from affiliate links you are supporting tuxDB