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.

Newcomers DBPro Corner / Match Cards game: Main Menu bg image won't stay on screen at replay...

Author
Message
Gyrich
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Here, obviously.
Posted: 31st Jan 2006 07:37 Edited at: 31st Jan 2006 07:44
*edit* thought i could attach multiple files to post and ended up screwing up attachment and couldn't get the right file to attach. please read the post below

DBPro User
PC: WinXP, AthlonXP 2100+ 1.7ghz, 80gb HD, Nvidia GeForce FX 5200 (128mb onboard RAM), 512mb DDR400 system RAM. Thank you for your help.

Attachments

Login to view attachments
Gyrich
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Here, obviously.
Posted: 31st Jan 2006 07:43
Hello again all.

Match Cards has been coming along nicely and im done except for the slowdown problem that i've mentioned in other posts(which I still haven't solved) and this problem. When the player finishes a game, they're given the option to "press 'p' to play again, press 'm' to go to the main menu, or press 'q' to quit...". If the player presses 'm', the main menu background image and the text that is printed onto the screen show correctly for an instant(a small fraction of a second) then they disappear behind an all blue screen. I can't figure out what's making that happen, but if i click on one of the menu items on the main menu("new game" or "quit") then the text will show up through the blue background and the game will start as normal. but for some reason i can't get the main menu to perform correctly after the first time.

Although this would normally be a bad idea to do, i'm posting my entire game code, and attaching the main menu bg image so that someone can see firsthand what i'm talking about. This game will never be commercially released, so i'm willing to risk posting the code in its entirety, in the hopes that no one will screw me over. This is my first game, and I only made it to learn about the language and the game development process. Here's my code:



background image is attached. Please help, as this is the last really necessary thing that I have to do before the game can be considered complete. It runs at a constant 20fps which is slow, but the game being what it is, doesn't really hinder the gameplay much. I've inquired on these forums before as to help with increasing my frame rate with no success, so im content to release it as is in the Showcase when i have this main menu glitch fixed.

Even still, if anyone would care to take a look at the frame rate problem, please note that the problem doesn't manifest itself unless my skybox is loaded. without the skybox the game runs at 30fps. I've tried scaling the skybox smaller, opening it up in a 3d modeler and scaling it to the size i need to get rid of the scale command, opening up the skybox textures in photoshop and decreasing the image size, doesn't matter. The skybox i'm using is attached, in case anyone wanted to take a look.

Lastly, the Clock(), MusicPlayer() functions, and the fps code that is in the main loop disappears when I click a card and doesn't reappear until the operations on the card are done being performed. I understand that this happens because the card operations, including deck construction, shuffling, and dealing at the beginning of the game all happen outside of the main loop, but I have not been able to find a solution to fix this. I'm ok with it happening, but if anyone knows of a way I could have that text onscreen all the time i'd appreciate it. As I said I made this game to learn and later on I would like to know how to set up my code so that operations that should happen all the time perform correctly. Thank you all for your help, and sorry for the long post; i'm almost done

DBPro User
PC: WinXP, AthlonXP 2100+ 1.7ghz, 80gb HD, Nvidia GeForce FX 5200 (128mb onboard RAM), 512mb DDR400 system RAM. Thank you for your help.

Attachments

Login to view attachments
Pincho Paxton
21
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 31st Jan 2006 09:35
I think you are just pasting an image for the main menu, and DB does not like bitmap images with 3D games. You need to texture your menu onto a plain. Then use that as your background.

Make object plain OBJECTNUMBER,1024,768

smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 31st Jan 2006 12:00
have u tried setting ur own refresh (sync) rate?
i mean try turning manual sync on... this may help with the background problem...

as for the functions that don't appear all the time, these need to be called all the time to be displayed all the time, therefore before every sync where u want them to be displayed u must call them.

life's one big game
Gyrich
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Here, obviously.
Posted: 31st Jan 2006 21:51 Edited at: 31st Jan 2006 21:57
@Pincho: thanx, i'll try that

@smallg: In other words, I must call the Clock(), MusicPlayer(), and skybox rotation functions within the other functions and then put in a sync?

I tried turning sync on at a rate of 60, but because my other functions, like the functions that flip the cards, use a lot of short wait commands to make the animation of the card flipping look fluid and visible to the human eye, even when I implemented sync, the text wouldn't stay on screen smoothly. It was disappearing and reappearing several times a second so it was visible, but not easily legible. I was about to ask you guys if there was a workaround that would take out the wait commands, but it just occured to me that i should take them out and put sync in right? lol sorry, im still a noob and this is my first game, don't fully understand things sometimes. In any case im gonna go re-implement sync, and see if I can get it to do what I need. Please feel free to make any suggestions or comments you think would be helpful.

DBPro User
PC: WinXP, AthlonXP 2100+ 1.7ghz, 80gb HD, Nvidia GeForce FX 5200 (128mb onboard RAM), 512mb DDR400 system RAM. Thank you for your help.
Gyrich
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Here, obviously.
Posted: 1st Feb 2006 17:41
@Pincho: thanx for the plain suggestion, it worx fine. However, does this mean that I can't use a bitmap for a menu in any 3d game? is the problem with using bitmaps, or just 2d images in general in a 3d game? The reason im asking is because, if i make a game wherein I would like to use a menu with animated elements or something else more complicated, do I have no other choice than to use a plain, or is there a way to successfully use an image as menu screen?

@smallg: maybe i just don't have a good grasp of sync smallg, but I plugged it in throughout my program, with sync rates of 40, then 60, and when i ran my game it chugged along at 8fps lol. I don't know what I'm doing wrong. . However, I was able to solve my disappearing text problem. The onscreen text for my Clock() and MusicPlayer() functions stays onscreen all the time now . Now if I could just up the speed some...

But at this rate, expect to see my game, Match Cards, being released fairly soon. Thanks alot to you 2, and to everyone else who gave me advice.

DBPro User
PC: WinXP, AthlonXP 2100+ 1.7ghz, 80gb HD, Nvidia GeForce FX 5200 (128mb onboard RAM), 512mb DDR400 system RAM. Thank you for your help.
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 5th Feb 2006 13:28
that's some neat coding.
ok anyway onto the problems, is this wait still in place?
Quote: "`********************************************************MAIN LOOP***********************************************************
while escapekey() <> 1 `hit Escape to exit game

center text (screen width() / 2), (screen height() - ((Screen height()/10) * 9)), str$(screen fps()) `publish game fps

`rotate skybox
angle# = wrapvalue(angle#) + 0.5
rotate object 54, 0, angle#, 0

****wait 2000***** <-here
MatchedCards = 52

MusicPlayer()
Clock()
MouseControl()
GameOver()

endwhile
`*****************************************************END OF MAIN LOOP********************************************************
`------------------------------------------------------END OF PROGRAM--------------------------------------------------------
`---------------------------------------------------------FUNCTIONS----------------------------------------------------------"


u really want to use timer() to remove it...


also have u tried taking out the skybox thing and looking at the fps then?

life's one big game
spec= 1.6ghz, 512mb ram, 128mb gpu, directx 9.0c, dbpro and classic
Gyrich
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: Here, obviously.
Posted: 5th Feb 2006 23:57 Edited at: 5th Feb 2006 23:58
@smallg:

the "wait 2000" and "MatchedCards = 52" commands are tester coding that i put in so i could skip playing the game and go straight to game over, to see if the game over code was working correctly. I forgot to delete those lines before i posted for help . As for taking out the skybox, I had tried that already and w/out the skybox it moves at a nice 30fps, but the skybox is part of the atmosphere so i didn't want to lose it. In any case, i've already released the game in the Showcase forum if you'd like to check it out, here's the link:


http://forum.thegamecreators.com/?m=forum_view&t=70871&b=5

and thx for the compliment on my code

DBPro User
PC: WinXP, AthlonXP 2100+ 1.7ghz, 80gb HD, Nvidia GeForce FX 5200 (128mb onboard RAM), 512mb DDR400 system RAM. Thank you for your help.

Login to post a reply

Server time is: 2024-09-24 15:33:26
Your offset time is: 2024-09-24 15:33:26