Hero6
It is currently Sun, 10 Nov 2024 11:23

All times are UTC - 8 hours


Post new topic Reply to topic  [ 15 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue, 28 Jan 2014 18:31 
Offline
Glory Hound
User avatar

Joined: Mon, 27 Jan 2014 21:45
Posts: 65
So I have implemented an options menu, but it is marked as work in progress until I'm sure of some details. Options should be accessed from two places in the game the way it is designed now, the title screen and in game. However some of the actions available doesn't make much sense to access from the Title Screen, load and quit game you could already do without the options menu, and why would anyone want to save at the title screen?

The code of Hero6 is already packed full of bools and tons of if-statements, clogging up the code heavily and making it difficult to read, far from impossible, but also far from optimal. To avoid more of this I've decided on making a new GUI interface, gTitleOptions, which is pretty much a duplicate of gOptions - four buttons, and I'm pretty satisfied with how neat the code turned out. However, I did decide on using a simple bool render for accessing the Options in game because as far as I could tell from the code surrounding it, it was the simplest option. The options are right now accessible through the character sheet through a placeholder button(missing graphics).

The question is, should I make up a new GUI? Separating the character creator sheet and the in game character sheet. This is some more work than than the four buttons on the options screen to say the least, BUT, it would not only allow for simple code to implement, this also allows me to remove a bundle of space hogging code that is already there.

Also it would be great if someone knew if the options buttons existed somewhere. I saw it in the MAD-demo so it might still exists somewhere, unless it already is in the AGS-build an I'm blind.


Attachments:
OptionsButton.jpg
OptionsButton.jpg [ 13.55 KiB | Viewed 49339 times ]


Last edited by ChamberOfFear on Mon, 17 Feb 2014 17:06, edited 2 times in total.
Top
 Profile  
 
PostPosted: Thu, 30 Jan 2014 16:34 
Offline
Glory Hound
User avatar

Joined: Mon, 27 Jan 2014 21:45
Posts: 65
I was pretty much able to answer my own question when I got an light bulb idea. Analyzing how the original MAD engine source code and referencing to the documents on the web site, I was able to figure out how to decompress and unpack all the code, music, sound and graphics existing in the MAD demo.

This show me that the in game character screen is fully drawn with buttons and text, so it seems to me that the simplest thing would be to make a new GUI. Answering my dilemma from previous post, I'll get to work on this and post the result when I'm done.

I'll post the resources I retrieved from the MAD demo if anyone is interested. I've included two full screen character dialogue portraits, they look pretty neat.


Attachments:
karadlg.jpg
karadlg.jpg [ 16.42 KiB | Viewed 49333 times ]
glithdlg.jpg
glithdlg.jpg [ 17.21 KiB | Viewed 49333 times ]
charscn.jpg
charscn.jpg [ 32.59 KiB | Viewed 49333 times ]
Top
 Profile  
 
PostPosted: Thu, 30 Jan 2014 23:57 
Offline
Site Admin
User avatar

Joined: Wed, 18 Dec 2013 09:56
Posts: 101
I would definitely appreciate a link to the resources so I can host them.
Thanks Chamber!

_________________
Robert

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"What good is knowledge and wisdom if you can't use it?" - Erasmus


Top
 Profile  
 
PostPosted: Sat, 01 Feb 2014 12:51 
Offline
Casual Adventurer

Joined: Sat, 11 Jan 2014 15:20
Posts: 9
We dropped support for the full screen talking animations as AGS don't support them very well. It basically expects a full 320x240 size animation where only the mouth moves.

The MAD engine supported the full screen stuff better but it was also tedious to write and maintain and we also decided that the smaller talkie boxes just looked better. I would be against any attempt to return to the fullscreen talking for the sake of time and effort.


Top
 Profile  
 
PostPosted: Sat, 01 Feb 2014 16:56 
Offline
Glory Hound
User avatar

Joined: Mon, 27 Jan 2014 21:45
Posts: 65
So I'm done I think, I'll mark the thread as yet to be implemented untill I recieve some feedback if my changes has been successfully implemented. https://dl.dropboxusercontent.com/u/402 ... ources.zip

Import the CharacterScreen sprite attached

Delete gOptions and import the new gOptions.guf attached
Import gTitleOptions.guf and gCharSheetIngam.guf that is attached

Remove gOptions_OnClick in GlobalScript.asc

Replace the following functions in GlobalScript.asc
Code:
   
function sliderVolume_Change(GUIControl *control) {
   System.Volume = sliderVolume.Value;
}


Add the following functions in GlobalScript.asc
Code:
   function sliderVolume2_OnChange(GUIControl *control)
   {
      System.Volume = sliderVolume2.Value;
   }
   
   function btnGameSpeedSlider2_OnChange(GUIControl *control)
   {
      SetGameSpeed(btnGameSpeedSlider2.Value);
   }
   
   function btnOptions_OnClick(GUIControl *control, MouseButton button)
   {
      gOptions.Visible = true;
   }
      
   function btnOptions_OnClick(GUIControl *control, MouseButton button)
   {
      gCharsheetIngam.Visible = false;
      gOptions.Visible = true;
   }

   function btnInventory_OnClick(GUIControl *control, MouseButton button)
   {
      gCharsheetIngam.Visible = false;
      gInventory.Visible = true;
   }

   function btnResumeGame_OnClick(GUIControl *control, MouseButton button)
   {
      gCharsheetIngam.Visible = false;
   }
   
   function btnViewCharSheet_Click(GUIControl *control, MouseButton button) {
     gSubbar.Visible = false;
     gIconbar.Visible = true;
     gCharsheetIngam.Visible = true;
     Update_stats();
   }


Add the following lines in the following functions in room101.asc
Code:
   function hotspot1_a()
   {
      imgClassInGame.NormalGraphic = 1570;
      imgClass.NormalGraphic = 1570;
   }
   
   function hotspot2_a()
   {
       imgClassInGame.NormalGraphic = 1571;
      imgClass.NormalGraphic = 1571;
   }
   
   function hotspot3_a()
   {
       imgClassInGame.NormalGraphic = 1572;
      imgClass.NormalGraphic = 1572;
   }


Replace the following function in room101.asc
Code:
   function room_Leave()
   {
      gTopbar.Visible = true;
   }


Add the following functions IN THE TOP of Statistics.asc
Code:
   function updateCharacterCreateScreen()
   {
     lblStr.Text = String.Format("%d", heroinfo.str);
     lblInt.Text = String.Format("%d", heroinfo.Int);
     lblAgi.Text = String.Format("%d", heroinfo.agi);
     lblVit.Text = String.Format("%d", heroinfo.vit);
     lblLuck.Text = String.Format("%d", heroinfo.luck);
     lblMagic.Text = String.Format("%d", heroinfo.magic);
     lblWeaponUse.Text = String.Format("%d", heroinfo.weaponuse);
     lblParry.Text = String.Format("%d", heroinfo.parry);
     lblDodge.Text = String.Format("%d", heroinfo.dodge);
     lblThrow.Text = String.Format("%d", heroinfo.throw);
     lblClimb.Text = String.Format("%d", heroinfo.climb);
     lblStealth.Text = String.Format("%d", heroinfo.stealth);
     lblLock.Text = String.Format("%d", heroinfo.lockpick);
    
     lblAllocate.Text = String.Format("%d", allocate);
     lblCharHealth.Text = String.Format("Health:%d/%d", heroinfo.hp, heroinfo.mhp);
     lblCharStamina.Text = String.Format("Stamina:%d/%d", heroinfo.sp, heroinfo.msp);
     lblCharMagic.Text = String.Format("Magic:%d/%d", heroinfo.mp, heroinfo.mmp);
   }

   function updateInGameCharacterScreen()
   {
     lblStrength.Text = String.Format("%d", heroinfo.str);
     lblIntelligence.Text = String.Format("%d", heroinfo.Int);
     lblAgility.Text = String.Format("%d", heroinfo.agi);
     lblVitality.Text = String.Format("%d", heroinfo.vit);
     lblLuckInGame.Text = String.Format("%d", heroinfo.luck);
     lblMagicInGame.Text = String.Format("%d", heroinfo.magic);
     lblWeaponUseInGame.Text = String.Format("%d", heroinfo.weaponuse);
     lblParryInGame.Text = String.Format("%d", heroinfo.parry);
     lblDodgeInGame.Text = String.Format("%d", heroinfo.dodge);
     lblThrowing.Text = String.Format("%d", heroinfo.throw);
     lblClimbing.Text = String.Format("%d", heroinfo.climb);
     lblStealthInGame.Text = String.Format("%d", heroinfo.stealth);
     lblLockPicking.Text = String.Format("%d", heroinfo.lockpick);
    
     lblCharInGameHealth.Text = String.Format("Health:%d/%d", heroinfo.hp, heroinfo.mhp);
     lblStamina.Text = String.Format("Stamina:%d/%d", heroinfo.sp, heroinfo.msp);
     lblMagicPool.Text = String.Format("Magic:%d/%d", heroinfo.mp, heroinfo.mmp);
   }


Replace the following functions in Statistics.asc
Code:
   function Update_stats() {
      if(cEgo.Room == 101)
      {
         updateCharacterCreateScreen();
      }
      else
      {
         updateInGameCharacterScreen();
      }
   }


Top
 Profile  
 
PostPosted: Sat, 08 Feb 2014 18:38 
Offline
Site Admin
User avatar

Joined: Wed, 18 Dec 2013 09:56
Posts: 101
I took a look at your code. Good work, but the current AGS version already supports this. It's available here:

http://www.hero6.org/?page_id=32

The character sheet is accessible much like the QfG system, as is the inventory. However, the options menu is only accessible through the use of the Escape Key during game play. During testing I continue to look for a Sierra-like icon along the top menu for options, but the Escape Key option is the only way.

_________________
Robert

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"What good is knowledge and wisdom if you can't use it?" - Erasmus


Top
 Profile  
 
PostPosted: Sat, 08 Feb 2014 20:46 
Offline
Site Admin
User avatar

Joined: Wed, 18 Dec 2013 09:56
Posts: 101
The volume slider change was great too. I implemented that change in the update I've uploaded just now. It was a good excuse to make some much-needed touch-ups to a few GUIs. Thanks again!

_________________
Robert

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"What good is knowledge and wisdom if you can't use it?" - Erasmus


Top
 Profile  
 
PostPosted: Sun, 09 Feb 2014 07:55 
Offline
Glory Hound
User avatar

Joined: Mon, 27 Jan 2014 21:45
Posts: 65
robertkety wrote:
I took a look at your code. Good work, but the current AGS version already supports this. It's available here:

http://www.hero6.org/?page_id=32

The character sheet is accessible much like the QfG system, as is the inventory. However, the options menu is only accessible through the use of the Escape Key during game play. During testing I continue to look for a Sierra-like icon along the top menu for options, but the Escape Key option is the only way.


Allready supports what? Can you be more specific? If you're referring to the extra implement of character sheet that I did, it wasn't because I found it missing, but because I found an old picture in the MAD demo which gave me an convenient Options button.

The changes I did should have made Options availabe on the Title screen, and in-game via the Character Sheet, which they are not in the current AGS version, so your statement confuse me.


Top
 Profile  
 
PostPosted: Sun, 09 Feb 2014 12:17 
Offline
Site Admin
User avatar

Joined: Wed, 18 Dec 2013 09:56
Posts: 101
Sorry for being vague, I was also confused. I've never seen the MAD demo.

The buttons your code implements are a duplication of existing features. The Options menu is available via the Escape Key (it's not the best implementation, but it's there). The Inventory will be available from the icon bar along the top of the screen, much like the Sierra interface.

Your implementation looks great and mirrors the image you posted from the MAD demo, but duplicating features in a user interface can be confusing. I think the natural location for these features should be in the same place as the Sierra interface. We have something close to that now, I'm not sure if straying from that style of interface is the best way to go.

As for the Options button on the Title Screen, the artwork was already there with no functionality. I don't think that the Title Screen version of that button should load the gOptions GUI, as that contains features like Save and Restart which shouldn't be available from that screen. The Sierra interface used the same options menu for the title screen and in-game, but the title screen version made the Save and Restart selections unavailable. Maybe we could do something like that.

What do you think?

_________________
Robert

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
"What good is knowledge and wisdom if you can't use it?" - Erasmus


Top
 Profile  
 
PostPosted: Mon, 10 Feb 2014 00:39 
Offline
Glory Hound
User avatar

Joined: Mon, 27 Jan 2014 21:45
Posts: 65
robertkety wrote:
Sorry for being vague, I was also confused. I've never seen the MAD demo.

The buttons your code implements are a duplication of existing features. The Options menu is available via the Escape Key (it's not the best implementation, but it's there). The Inventory will be available from the icon bar along the top of the screen, much like the Sierra interface.

Your implementation looks great and mirrors the image you posted from the MAD demo, but duplicating features in a user interface can be confusing. I think the natural location for these features should be in the same place as the Sierra interface. We have something close to that now, I'm not sure if straying from that style of interface is the best way to go.

As for the Options button on the Title Screen, the artwork was already there with no functionality. I don't think that the Title Screen version of that button should load the gOptions GUI, as that contains features like Save and Restart which shouldn't be available from that screen. The Sierra interface used the same options menu for the title screen and in-game, but the title screen version made the Save and Restart selections unavailable. Maybe we could do something like that.

What do you think?


You might be right, I only did it this way as a quickfix as there were no graphics or space availabe for an options button in the top bar. Could you perhaps rebuild the top bar to contain a placeholder button? We don't actually need the graphics for now.

The changes I made should have adressed that the options from the Title screen didn't have restart and save, but I think maybe I can make some improved one-liner code to fix this later today, or worst case, during the week, I need to catch up with some school assignments.

If you haven't tried the MAD demo you should give it a go, it's full of cool stuff like areas and persons that are unavailable in the AGS-demo.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours

Who is online

Users browsing this forum: No registered users and 5 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Search for:
Jump to:  

cron
Powered by phpBB® Forum Software © phpBB Group