Prophesy of Pendor Dev Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Forum for the Development Team associated with the Mount&Blade Module Prophesy of Pendor Development
 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

 

 Testing Menus

Go down 
5 posters
AuthorMessage
Manka
Contributor
Contributor



Posts : 24
Join date : 2011-09-23

Testing Menus Empty
PostSubject: Testing Menus   Testing Menus EmptySun Oct 09, 2011 1:25 am

I've been working on restructuring module_game_menus with regards to testing menus, and I think I've got something that'll halfway work and isn't that invasive. I modified process_game_menus to accommodate the following changes:

1) For menus, change the mesh-name from "none" to "test".
2) For menu items, change the door-name (optional 5th tuple slot) from whatever to "test".

To have test menus compile into the game, have ENABLE_TESTING = True at the top of module_game_menus. To pull them out, set it equal to False.


I'm not the best at this python business, but the process script should change the mesh-name back to "none" and delete the unnecessary door name when testing is on and just plain remove the menus otherwise.

Downside is that it might require some work for future versions of M&B. Upside is that they haven't changed those parts of the format in at least 3 years.


Yours in cleaner code,
M
Back to top Go down
mp84
Nemisis
Nemisis



Posts : 690
Join date : 2010-12-21
Age : 42
Location : New Jersey

Testing Menus Empty
PostSubject: Re: Testing Menus   Testing Menus EmptySun Oct 09, 2011 3:19 am

Now why would we want to change the way the testing menus appear?

The only reason we have those is simply for our testers to able to test things easily .. (create the necessary battle quick, spawn the companions, check the artwork on all troops, etc..) So I'm not quite sure why we want to change anything with how the test menu works since the release version of PoP 4 whenever that may be will not have a test menu, so I may be missing the point of this here.

Back to top Go down
abhuva
Mind Reader
Mind Reader



Posts : 191
Join date : 2011-06-27
Age : 44
Location : Germany

Testing Menus Empty
PostSubject: Re: Testing Menus   Testing Menus EmptySun Oct 09, 2011 8:04 am

As far as i understand its more to clean the code, not changing the menus.
So during testing phase all is the same like before, and when we compile the ready game, this will not be included in the compiled txt.files.
(And its not needed to delete the code, but just set a constant from true to false).

If it doesnt break things, i am all in for a cleaner code.
Back to top Go down
http://abhuva.wordpress.com
Mordred
Insidious Diety
Insidious Diety
Mordred


Posts : 2523
Join date : 2009-07-17

Testing Menus Empty
PostSubject: Re: Testing Menus   Testing Menus EmptySun Oct 09, 2011 8:42 am

Aye agreed.
Back to top Go down
Akuthia
Thought Warden
Thought Warden



Posts : 118
Join date : 2011-09-13

Testing Menus Empty
PostSubject: Re: Testing Menus   Testing Menus EmptySun Oct 09, 2011 10:10 am

My only concern on this would be for continued testing post release. It sounds like this requires a separate compiled folder, is that right?
Back to top Go down
Manka
Contributor
Contributor



Posts : 24
Join date : 2011-09-23

Testing Menus Empty
PostSubject: Re: Testing Menus   Testing Menus EmptySun Oct 09, 2011 10:30 am

Yeah, all this does is make the test menus go away with a single change to the source. And it does require a test/non-test set of text files, but I imagine that's not asking too much. The way it was done in 3.42 is for someone to scan an 18,000 line file for test menus and to comment each out manually. If you know what you're looking for, that's great, but the code seems to change hands regularly enough that that becomes time consuming and error prone.

Originally, all I wanted to do was to put all the test menus in a separate file which could be included or not based on testing status. Unfortunately, there are still the testing menu items to worry about, which sometimes appear in non-testing menus.


An alternative approach that y'all might like more would be to add a global variable to the game similar to what gets set when you use the console to get the cheat menu. This would let me leave all the menus in the text files and I could limit access to them to a couple of points that would be easily identified so that new coders wouldn't have to go hunting to turn them off. I can't tell if there was a reason this wasn't done before, as manually commenting out all the test menus is a lot of work.
Back to top Go down
mp84
Nemisis
Nemisis



Posts : 690
Join date : 2010-12-21
Age : 42
Location : New Jersey

Testing Menus Empty
PostSubject: Re: Testing Menus   Testing Menus EmptySun Oct 09, 2011 11:13 am

Ahh I get you.. I'm for a cleaner code too..

To be honest as long you give instructions on what exact "line" to put in the specific .txt file to activate the test menus while the testers are playing the I don't think anyone will have a problem understanding that..

So you should be good on that front.. plus I prefer that to the alternative method as I don't know what is, but I simply can never get the console cheats to work correctly.. (even though I know I have them activated).. So, I know for a fact I can edit a text file easily, as with everyone else if given the proper instructions.

Back to top Go down
Manka
Contributor
Contributor



Posts : 24
Join date : 2011-09-23

Testing Menus Empty
PostSubject: Re: Testing Menus   Testing Menus EmptySun Oct 09, 2011 11:36 am

Er, no editing of the text files will be necessary. In the source, there's a single line that needs to be changed from True to False or back again, and depending on that you'll get test menus added to the text files or not. The idea is that we simply switch them off when we package a release. If anyone wants a testing version of a release version, we'd can make a build with them turned on (or even just the menus.txt file).

I think at least as much is required presently, as in order to get, say, Mad Vader's test menus in 3.42 someone would have to go and find them all and uncomment them in the source.
Back to top Go down
mp84
Nemisis
Nemisis



Posts : 690
Join date : 2010-12-21
Age : 42
Location : New Jersey

Testing Menus Empty
PostSubject: Re: Testing Menus   Testing Menus EmptySun Oct 09, 2011 12:17 pm

Manka wrote:
Er, no editing of the text files will be necessary. In the source, there's a single line that needs to be changed from True to False or back again, and depending on that you'll get test menus added to the text files or not. The idea is that we simply switch them off when we package a release. If anyone wants a testing version of a release version, we'd can make a build with them turned on (or even just the menus.txt file).

I think at least as much is required presently, as in order to get, say, Mad Vader's test menus in 3.42 someone would have to go and find them all and uncomment them in the source.

Ahh ok now I get it.. Hey like the others have said why not, if it makes the code cleaner and less work in the end for you guys.

MP
Back to top Go down
Sponsored content





Testing Menus Empty
PostSubject: Re: Testing Menus   Testing Menus Empty

Back to top Go down
 
Testing Menus
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Prophesy of Pendor Dev Forum :: Siege Workshop-
Jump to: