V4 Project Management

I have added a couple of spreadsheets to Google Drive, links below.
One deals with attempting to minimise the nested conditionals for the trait ‘restrict commands’.
The other deals with attempting to minimise the nested conditionals for the weather zone overlay patterns. The graphic shows the weather chart. We have 6 game turns per annum, 6 weather zones and a die roll of 1 thru 10. Fine weather predominates, so that is the last state of all the nested conditionals.

Have you tested that these are faster than a lookup table? If so, what was the result?

I strongly suspect that indexing into an array will be both faster at runtime and easier to maintain for something like this.

A lookup table, an array! Indeed, I yearn wholeheartedly for this ability, but where does Vassal provide this? The, so named, spreadsheet is useless. Do you now see my plea for a real spreadsheet capability?
As for your post, YES. An array, X x Y with row and column number ‘intercepts’ that are accessible by simple maths, would be far faster than the multiple nested conditional statements I currently use. Thankfully, players of my modules do not discern a great deal of time lapse for the weather tiling. But I am sure it does add to the time it takes to load a game.
There is no capability, that I can discern, within Vassal for arrays. If there was do you not think that I would have used it. Recall my previous missive for calculating the number of hexes a unit moved. For that I used a number of text, quasi, numeral strings and used about 8 different calculations to achieve the outcomes I wanted. An array, results accessible by row and column numbers, or a spreadsheet using vlookup and hlookup, would obviate all that nonsense.
Mayhap using the google spreadsheet capabilities, as it is cross multiple OS platforms, may do this. I have absolutely no idea what you guys are talking about when you mention 'swing this, ‘swing that’. Mayhap you are so focused on what you are using to edit and develop Vassal that this ‘swing stuff’ clouds and/or limits your view. I do not know. At the same time, perhaps you also do not know.
Something to really consider, yes?
Link to the word doc for the weather equations is:

Swing is the GUI toolkit provided by Java, that renders all of the UI elements in Vassal. It’s what would have to be used to render any sort of spreadsheet component in V3.

I have posted more than once in this forum about a simple, high-efficiency way to implement array lookups in Vassal. Typing ‘Lookup table’ into the search facility at the top of this page should get you there.You can implement the equivalent of VLOOKUP in as many dimensions as you like. Your complete weather calculation then becomes a one-liner looking up a value indexed by location, roll and month, at the expense of a one-time setup of the required Global Variables.

The fact that you can program such a calculation in V3 at all is actually remarkable and tells me that Beanshell is doing exactly what it is supposed to be doing, and doing it well. That’s some nice Java you have written there.

Or perhaps you might consider the combined 100+ year computer science and software development experience of the dev team and that when we say your suggestion of plugging google spreadsheets into Vassal V3 is unicorn and fairy talk, you might let it go instead of constantly banging on about it. Unless you have some magic technological solution to simply implement it, the while it’s conceivable we could cobble something together from scratch, it would be an enormous effort, effort we consider better spent on V4.

Is your problem actually with the language itself, or is it because it appeared to lack a function that you are used to in another language and would have made your life easier?

V4 will also have an embedded scripting language and expression evaluations will be handled in the native syntax of that language, quite probably Javascript. Access to V4 will be via an API of function calls and we will no doubt provide utility functions (like a more formal implementation of a table lookup). Non-programmers will, as always, struggle with this aspect.

Thank you. Learnt something new. Not that I would use such, being an end user not a developer.

Aside from any considerations of how you would hook up something like Google Sheets to V3, you also have to take into account how it would work when you’re offline and also how it would work after Google kills Google Sheets. (Google is notorious for ending products people had come to rely on.)

1 Like

A very valid point indeed. Whatever V4 will use will be inherent/inbuilt and thus far more stable. For that I am sure it will be because of you guys. Utmost confidence.
I asked myself - self, why are you (as in me) so damned steadfast in this belief, when the guys who do the actual work have told, time and time again, it is improbable? My answers are:
Most humans are quite comfortable when using tools that they know and are very proficient in that tools use.
Conversely, most humans are uncomfortable when using tools that they do not know and need to learn how to use that tool.
This is exacerbated by the human who compares the tool they know “just does it better” than that other tool, but fails to recognise that the other tool works too. So I’m a die hard (no pun intended to Bruce Willis), who is probably fairly set in his ways. So, I am to get over it and get on. Spreadsheets off the table, forever (although it will still swing (pun intended) around in my mind anyway) in this forum. :slight_smile:
Brent,
I have a look at the various posts as you suggested. Not really that much to go on. But I think I get the nub of what I need to be doing in that arena. My question is, does Vassal have a limit on the number of GPs a module can have?
Thank you for your kind words re the equations. I just realised that I can really simplify the ‘desert’ ones as they have 2 states that depend on the weather is in their major weather zone. Just popped into my brain today.
You are probably not interested, but the stuff I did when I tried to automate the combat odds calculations, for 3 different combat tables, variations for weather, etc were way more complex. Shame no-one used it so I deleted all of it.

No. And they access to them is hashed and fast.

For example, 2 of the GP’s may be:

WEATHER-NORTH AFRICA-MAY/JUN-3=Sun
WEATHER-NORTH AFRICA-MAY/JUN-4=Rain

You would get the weather using (I forget your actual property names):

{GetProperty(“WEATHER-”+Location+“-”+Month+“-”+Roll)}

Thanks Brent. What you posted actually created more clarity with what I am going to do. I will, however make a copy of the latest module version before I go playing with something that does work and replacing it with something that will probably work, but as per usual I’ll stuff something up.

1 Like