Page 2 of 15

PostPosted: Thu Sep 13, 2007 8:56 am
by lackattack
Let me throw in some incentive - free premium membership* to the contributors of an AJAX-compatible GM script that can replace Tr0y's & BOB**, so I can move everyone onto AJAX :mrgreen:


* Main contributor(s) will get 12 months, secondary contributors according to their contribution :)

** Colourblind feature is now core, no need to replace that

PostPosted: Thu Sep 13, 2007 8:59 am
by Wild_Tiger
if I cheer for the programmers, will that get me a couple days, lack?

PostPosted: Thu Sep 13, 2007 9:00 am
by yeti_c
lackattack wrote:Let me throw in some incentive - free premium membership* to the contributors of an AJAX-compatible GM script that can replace Tr0y's & BOB**, so I can move everyone onto AJAX :mrgreen:


* Main contributor(s) will get 12 months, secondary contributors according to their contribution :)

** Colourblind feature is now core, no need to replace that


Interesting...

C.

PostPosted: Thu Sep 13, 2007 9:04 am
by Night Strike
lackattack wrote:Let me throw in some incentive - free premium membership* to the contributors of an AJAX-compatible GM script that can replace Tr0y's & BOB**, so I can move everyone onto AJAX :mrgreen:


* Main contributor(s) will get 12 months, secondary contributors according to their contribution :)

** Colourblind feature is now core, no need to replace that


I think it's because he doesn't want to do it all and make it part of the actual site. But hey, whatever works.

PostPosted: Thu Sep 13, 2007 9:16 am
by yeti_c
lackattack wrote:Let me throw in some incentive - free premium membership* to the contributors of an AJAX-compatible GM script that can replace Tr0y's & BOB**, so I can move everyone onto AJAX :mrgreen:


* Main contributor(s) will get 12 months, secondary contributors according to their contribution :)

** Colourblind feature is now core, no need to replace that


Actually - I'll make a deal with you...

If I get it up and running - will you look at creating a test area in the Foundry for new maps?

C.

PostPosted: Thu Sep 13, 2007 10:23 am
by MR. Nate
Do it! It's totally worth it to all of us who sit here and admire everyone's work!

PostPosted: Thu Sep 13, 2007 11:26 am
by Ishiro
I'm going through the code now making sure it does not over update too much. Colors still may be dropped from map inspect... have to wait and see. Being able to lose color blind options helps a bit.

PostPosted: Thu Sep 13, 2007 1:56 pm
by Ishiro
Blah... starting over. Some of the paths I went down were wrong and resulted in a map that never updated during your turn. (Like, you attack 10v1 and win, but the map still shows 10 and 1 even while the action section has moved on to Advancement.)

Its probably going to be next week before I get something that works since I have to return to work tomorrow.

PostPosted: Fri Sep 14, 2007 2:16 am
by Tyrion81
Hmmm this has got me interested now.... I already started modifications to BOB to get things working with AJAX... I found testing a real pain in the ass though... Having to wait every time my turn came around sucks. (especially cuz i'm limited to my 4 games)

PostPosted: Fri Sep 14, 2007 5:15 am
by Ishiro
While some things need to wait for turns to test... here is a hint, posting a chat message to yourself in a non-team game goes through the ajax routines to update the chat log.

Starting over reworking the script from the ground up, I've got the clock and player stats working. Text map and map inspect are halfway there.

PostPosted: Fri Sep 14, 2007 5:36 am
by yeti_c
Ishiro wrote:While some things need to wait for turns to test... here is a hint, posting a chat message to yourself in a non-team game goes through the ajax routines to update the chat log.

Starting over reworking the script from the ground up, I've got the clock and player stats working. Text map and map inspect are halfway there.


Nice work buddy - I'll leave it to you then...

C.

PostPosted: Fri Sep 14, 2007 6:08 am
by mfontolan
Ishiro wrote:While some things need to wait for turns to test... here is a hint, posting a chat message to yourself in a non-team game goes through the ajax routines to update the chat log.
Starting over reworking the script from the ground up, I've got the clock and player stats working. Text map and map inspect are halfway there.

Well, I think you understand what I say before.
Is other way of thinking. You have to put all your necessary stuff at the start and then change using "handleResponse".
Ishiro, we are doing a double job. I will stop my development and help you if you want.

PostPosted: Fri Sep 28, 2007 11:53 am
by RobinJ
Just would like to say that even a scaled down version of BOB would be much appreciated if it makes things easier, like TR0Y's first script

PostPosted: Fri Sep 28, 2007 12:15 pm
by PerkinsRooster
I concur. The only thing I really miss is the territory counter. And yes, I do know how to count myself.

PostPosted: Fri Sep 28, 2007 4:59 pm
by RobinJ
PerkinsRooster wrote:I concur. The only thing I really miss is the territory counter. And yes, I do know how to count myself.


But, like me, you can't be bothered :wink:

PostPosted: Fri Sep 28, 2007 5:35 pm
by Aerial Attack
If there were no BOB, you would count on your own - you would almost be forced to. The biggest problem is on non-standard maps, trying to figure out what bonuses people are actually earning. Sometimes you don't realize they have a 1 defending a 4+ bonus. At that point, it's almost always worth taking out. Of course, there are those of us who can't actually count properly (or try counting on Pearl Harbor or World 2.1).

PostPosted: Sat Sep 29, 2007 1:13 pm
by Herakilla
i might get chewed out for saying this but the few times i have done some programming or what not and i got stuck i just started all over again, with nothing. starting from scratch

PostPosted: Thu Oct 04, 2007 3:17 am
by chewyman
First of all I just wanted to say thanks for working on this, I'm really looking forward to being able to use AJAX.

But I was wondering, why is this being made as a separate patch? Wouldn't it be easier to make it part of the website itself?

PostPosted: Thu Oct 04, 2007 6:49 am
by jiminski
I used to count all the troops up .. count cards, going back through all the game text.... without Bob i can;t see a way i could possibly play more than 20 games at a time.

GM is genius and if i had the knowledge i would be helping out with patches and scripts and cups of Tea.... but i am not that smart!

Thanks! email me if you want a cup of Tea.

PostPosted: Thu Oct 04, 2007 10:14 am
by Ishiro
The biggest problem has been that if I do a traditional function override for GM, the BOB functions execute 5 times per click. It slows down and breaks the functions that otherwise work. So I've been working on how to limit the execution of BOB functions. It ain't easy. Right now, the script works 100% if it is not your turn. Once it is your turn, the overexecution causes the map to stop updating, forcing you to exit and return to the game after every action. Unacceptable.

Still working on it...

PostPosted: Mon Oct 08, 2007 9:42 am
by Aerial Attack
Not that you don't already have enough on your hands getting BOB to work with AJAX ...

But, You'll also need to update the way it reads XML. Right now - for maps that use partial bonuses, BOB does not handle "non-explicit" partial pairings.

I'll use Italy as my example map.

New XML
Code: Select all
(you need to talk to whoever wrote the XML for the Italy Map OR Pearl Harbor Map for the new XML)


Old (Explicit Partial Pairings) XML
Code: Select all
(this is only an approximation - not the exact code)
<bonuses>
  <bonus:+1>
    <territory:Napoli>
    <territory:Palermo>
  </bonus>
  <bonus:+1>
    <territory:Napoli>
    <territory:Roma>
  </bonus>
  <bonus:+1>
    <territory:Napoli>
    <territory:Torino>
  </bonus>
  <bonus:+1>
    <territory:Napoli>
    <territory:Venezia>
  </bonus>
  <bonus:+1>
    <territory:Palermo>
    <territory:Roma>
  </bonus>
  <bonus:+1>
    <territory:Palermo>
    <territory:Torino>
  </bonus>
  <bonus:+1>
    <territory:Palermo>
    <territory:Venezia>
  </bonus>
  <bonus:+1>
    <territory:Roma>
    <territory:Torino>
  </bonus>
  <bonus:+1>
    <territory:Roma>
    <territory:Venezia>
  </bonus>
  <bonus:+1>
    <territory:Torino>
    <territory:Venezia>
  </bonus>
// negative because of overlap with 3 terrs
  <bonus:-1>
    <territory:Napoli>
    <territory:Palermo>
    <territory:Roma>
  </bonus>
  <bonus:-1>
    <territory:Napoli>
    <territory:Palermo>
    <territory:Torino>
  </bonus>
  <bonus:-1>
    <territory:Napoli>
    <territory:Palermo>
    <territory:Venezia>
  </bonus>
  <bonus:-1>
    <territory:Napoli>
    <territory:Roma>
    <territory:Torino>
  </bonus>
  <bonus:-1>
    <territory:Napoli>
    <territory:Roma>
    <territory:Venezia>
  </bonus>
  <bonus:-1>
    <territory:Napoli>
    <territory:Torino>
    <territory:Venezia>
  </bonus>
  <bonus:-1>
    <territory:Palermo>
    <territory:Roma>
    <territory:Torino>
  </bonus>
  <bonus:-1>
    <territory:Palermo>
    <territory:Roma>
    <territory:Venezia>
  </bonus>
  <bonus:-1>
    <territory:Palermo>
    <territory:Torino>
    <territory:Venezia>
  </bonus>
  <bonus:-1>
    <territory:Roma>
    <territory:Torino>
    <territory:Venezia>
  </bonus>
// back to positive because of dual overlap with 4 or 5 terrs
  <bonus:+1>
    <territory:Napoli>
    <territory:Palermo>
    <territory:Roma>
    <territory:Torino>
  </bonus>
  <bonus:+1>
    <territory:Napoli>
    <territory:Palermo>
    <territory:Roma>
    <territory:Venezia>
  </bonus>
  <bonus:+1>
    <territory:Napoli>
    <territory:Palermo>
    <territory:Torino>
    <territory:Venezia>
  </bonus>
  <bonus:+1>
    <territory:Palermo>
    <territory:Roma>
    <territory:Torino>
    <territory:Venezia>
  </bonus>


For the Italy map the number of bonus lines are the same, but for Age of Merchants - I know that the new XML would require fewer lines and therefore less processing time.

PostPosted: Tue Oct 09, 2007 4:32 am
by yeti_c
I was looking into this...

I can get the handleResponse() back but I can't manage to override it with a new version - without copy and pasting the contents of the function from the source file...

Code: Select all
//function dave()
//{
//   alert("dave");
//}
//
//var newHandleResponse = unsafeWindow.handleResponse;
//var contents = ""+newHandleResponse;
//alert(newHandleResponse);
//start = contents.substring(0,28);
//middle = "dave();";
//end = contents.substring(28, contents.length);
//alert(start);
//alert(middle);
//alert(end);


This creates a new String that holds the entirety of the function - with my new function in it... (dave();) but I can't override the existing function easily... any ideas?

C.

PostPosted: Tue Oct 09, 2007 6:08 am
by yeti_c
In actual fact - what would be better LACK... is if you coded a dummy function...

i.e. refreshGMScript()

which was called from handleResponse() by you...

and then we could override refreshGMScript easily without having to merge your code into it...

Is this something that you could do?

C.

PostPosted: Tue Oct 09, 2007 7:41 am
by Ishiro
A dummy function would be great, especially if lack coded it to always be called last as a clean up once he's done all his stuff.

If you want to override lack's handleResponse, you can either:
a) copy his entire function and make the changes you need to it (this is what I'm currently working on).
pros: lets you place new code exactly where it is needed.
cons: it replaces lack's function and so if he makes changes to that function you will be ignoring it until you update your script.

b) make a copy of his function and throw in your own code like this:
Code: Select all
var newhandleResponse = unsafeWindow.handleResponse;
unsafeWindow.handleResponse = function() {
   //put all your new code here
   return newhandleResponse();
}

pros: doesn't replace lack's code, so when he makes changes you won't be ignoring his new code.
cons: as I've mentioned before, the handleResponse function is called 4 or 5 times per action, so BOB executes 4 or 5 times making it slow and actually breaking the map (it "freezes", stops updating with the AJAX).

PostPosted: Tue Oct 09, 2007 8:07 am
by yeti_c
Ishiro wrote:A dummy function would be great, especially if lack coded it to always be called last as a clean up once he's done all his stuff.

If you want to override lack's handleResponse, you can either:
a) copy his entire function and make the changes you need to it (this is what I'm currently working on).
pros: lets you place new code exactly where it is needed.
cons: it replaces lack's function and so if he makes changes to that function you will be ignoring it until you update your script.

b) make a copy of his function and throw in your own code like this:
Code: Select all
var newhandleResponse = unsafeWindow.handleResponse;
unsafeWindow.handleResponse = function() {
   //put all your new code here
   return newhandleResponse();
}

pros: doesn't replace lack's code, so when he makes changes you won't be ignoring his new code.
cons: as I've mentioned before, the handleResponse function is called 4 or 5 times per action, so BOB executes 4 or 5 times making it slow and actually breaking the map (it "freezes", stops updating with the AJAX).


Ah yes - that's a nice way of doing it - nice work Ishiro...

With regards to the 5 times calling...

I think you need to examine the parameters that are being called upon it... that way you could pick and choose which ones update your data...

--------------

I was thinking the best way for BOB to run is to hold all the data in arrays - and then only modify the data based on this turns action (Frist time init will be slow (as per) but each auto-refresh will be quicker... (You can hold the index of this)... this way you'll not have to do so much work... what do you reckon? (If a proper F5 is done though then a slow re-init will be run but that could be mentioned in the docs?)

n.b. for freestyle - will have to be this round... for sequential can be limited to the players turn.

The time consuming stuff of BOB is the Log parsing.

C.