Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / For the Impatient

Author
Message
Silence
13
Years of Service
User Offline
Joined: 14th Oct 2012
Location:
Posted: 8th Jan 2013 18:59
Hello everyone,

I have successfully made a complete game but I do not have a loading bar. So it stays on a splash screen for a bit before going into the actual game. Some people think that if they press the start key more than once it will start the game quicker.

I would like something to pop up after the button is hit for the third time, something like

"Stop hitting the key! It's loading!"

how does one do that?
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 8th Jan 2013 19:29 Edited at: 8th Jan 2013 19:50
Hello, err...

Quote: "I would like something to pop up after the button is hit for the third time, something like

"Stop hitting the key! It's loading!"

how does one do that?"


Quote: "I have successfully made a complete game"


There seems to be a contradiction here...

All joking aside, simply track key presses until it hits a certain value '3' then display the message.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 8th Jan 2013 20:16 Edited at: 8th Jan 2013 20:17
That won't work, because it's loading. You'd need another thread to track keypresses.

There is a work-around for it. You can "cheat" by using the entry buffer and periodically check it. The following function will search the entry buffer for the character you're looking for:



Then in your program, spread that function out a few times in your loading routine, something like this (considering your start key is "a"):



Of course, it would be cleaner to wrap that entire thing into a function as well, and use a #constant to define your start button so it's as dynamic as possible.

[EDIT] This feature seems kind of pointless to me though. Whoever thinks that pressing the start button makes it load faster is a moron.

TheComet

http://blankflankstudios.tumblr.com/
Quote: ""
- Randomness 128
Sasuke
20
Years of Service
User Offline
Joined: 2nd Dec 2005
Location: Milton Keynes UK
Posted: 8th Jan 2013 21:07
So... pretty much what I said then

My question is why didn't you just ask for help on loading bar?
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 9th Jan 2013 04:04
Didn't someone make a plugin that will load resources using a separate thread?

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 9th Jan 2013 05:45 Edited at: 9th Jan 2013 05:47
1. Lets be realistic here... you could with great difficulty dig up some plugin method to background load the game. It's a good suggestion, but very difficult and a lot of work.

2. Realistically, while things are loading the game can't check key presses. So if you are loading big files that take lets say several seconds each a player might be able to slap some keys fast enough for the game not to catch the key press.

3. Of course you can check for key presses between each file being loaded. It is important that you don't SYNC between each file load. This will limit loading speed greatly to the frame rate. Games with many files will suddenly take huge amounts of time to load. That's because 1 file per frame, caps out at about 60 frames a second usually. A time check is needed to make sure you are syncing once every second or so at most.

4. The best recommendation I can give, if you aren't adding a loading bar, is to ditch the key press idea altogether. It's never going to work properly without threading. Instead rotate or move an on screen graphic like a gear, or change on screen text every couple of seconds using a Timer() based function. Be careful not to cap your loading speed to maximum frame rate.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 9th Jan 2013 06:06
Quote: " It's never going to work properly without threading. "


The entry buffer is a separate thread (my solution above).

TheComet

http://blankflankstudios.tumblr.com/
Quote: ""
- Randomness 128
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 9th Jan 2013 06:15
Quote: "The entry buffer is a separate thread (my solution above)."


No you are right, just I'm perhaps setting the bar a bit high by saying it'll never work properly.

I had envisioned you hitting the button and perhaps several seconds later the text appearing. This will happen with big files. This lead me to dismiss the entry buffer a bit quickly. Also on my mind was unbuffered input that clearly could be missed.

I still think a simple timer based animation, something rotating, or merely text that changes is the best looking and performing minimal option here.

Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 9th Jan 2013 06:22 Edited at: 9th Jan 2013 06:23
I'll also add, taking a step back at the bigger picture...
The fact that this game is loading with zero on screen feedback is terrible. Having a key press update the screen with feedback "if the player gets impatient" is terrible. This is a bad approach to the problem, even if you aren't adding a loading bar.

Constant on-screen feedback of some minimal kind is expected in a modern game. Even a little blip of some kind.

Now I like the OP and I think he's great, but he should approach the problem differently than he is doing here.

Silence
13
Years of Service
User Offline
Joined: 14th Oct 2012
Location:
Posted: 11th Jan 2013 19:27
"He" is actually a "she" c:

and i have just concluded to put my frustrations aside and add a loading bar. Thank you all!
Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 11th Jan 2013 23:53
I just display a loading video onscreen. Since it's played by a separate program, not your DBP program it gets updated as expected. In fact, that's what most commercial games do.

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Mage
Valued Member
19
Years of Service
User Offline
Joined: 3rd Feb 2007
Location:
Posted: 12th Jan 2013 10:04
Brilliant.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 12th Jan 2013 19:24
Great tip.

Login to post a reply

Server time is: 2026-07-07 18:44:42
Your offset time is: 2026-07-07 18:44:42