EHM Editor: Playable leagues validator

Discuss all aspects of editing the data and databases in EHM here. Have a question about the EHM Editor, EHM Assistant, editing the .cfg files, hex editing the .dat or .db files? Want to tweak the EHM exe file to change league rules/structure, start date etc? This is the place!
Forum rules
This is the forum to discuss all aspects of editing the EHM data and tweaking the game.

Have a bug or feature request for the EHM Editor? Post them in the EHM Editor thread. Please start a new thread or post in another thread if you have a question about how to use the EHM Editor.

Given the large number of questions on similar topics, we ask that you start a new thread for a new question unless you can locate a similar question in an existing thread. This will hopefully ensure that similar questions do not get buried in large threads.

Useful links: EHM 1 Assistant (Download) | EHM 1 Editor (Download) | EHM 1 Editor Tutorials | Editing Rules & Structures Guide | Converting EHM 2004 / 2005 DBs to EHM 1 | Converting an EHM 2007 DB to EHM 1 | Extra_config.cfg | Import_config.cfg | Player Roles
Post Reply
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

EHM Editor: Playable leagues validator

Post by archibalduk »

Given the painfully slow progress of Editor v2 in recent months, I've been spending time working on a Rules & Structure validation/status screen in Editor v1 which will display a warning if certain items are invalidly set. If anybody has an suggestions as to any things to validate then let me know in this thread and I'll see if I can add something to the Editor.

The validation rules which are presently applied as at version 1.0.1 of the Editor are listed below (items in red are new for version 1.0.1). Any item labelled "[CORRUPTION WARNING]" indicates that this issue is critical and should be fixed before saving the database in order to avoid the risk of corruption.

Basic Data
  • Concurrent Initial Stages exceeds the number of stages present
  • Number of Stages does not match the number of stages present
  • Stage of History Record exceeds the number of stages present
Flags
  • No schedule template can be found where the schedule template setting is enabled and Has Alternative Dates is enabled (or a schedule template exists but isn't being used)
  • No schedule template can be found where the schedule template setting is enabled (or a schedule template exists but isn't being used)
Match Rules
None added to date

Comp Rules
  • Max League Games is not equal to the lowest of the Stage Max League Game settings for the initial stages (where (i) a league does not use a schedule template and (ii) any of the initial stages have a Stage Max League Game setting greater than zero)
  • Use League Rules is disabled for a competition other than an all-star competition
  • Use League Rules is enabled for an all-star competition
Structure
None added to date

Stages
  • Number of Dates does not match Number of Rounds (cup stages only)
  • Number of Rounds does not match the number of alternative schedule dates (cup stages only)
  • Number of Rounds does not match the number of schedule dates (cup stages only)
  • Number of Dates does not match the number of alternative schedule dates (league stages only)
  • Number of Dates does not match the number of schedule dates (league stages only)
  • Number of schedule dates does not match the number of alternative schedule dates where the Has Alternative Schedule Dates setting is enabled [CORRUPTION WARNING]
  • Schedule dates for initial stages incorrectly set where a schedule template and/or alternative schedule template is used (alternative schedule dates validation has been improved for v0.5.3)

Image

P.s. I have since clarified the warning message for the first item in the screenshot above as it was a bit vague.
User avatar
TBIF
Top Prospect
Posts: 106
Joined: Sun Jan 01, 2017 8:38 pm
Custom Rank: 2000/01 Rosters Author
Favourite Team: Canucks

EHM Editor: Playable leagues validator

Post by TBIF »

I often forget to set league dates for 2nd conference play offs, not sure if that could be included.
User avatar
ideawithoutamind
TBL Rosters Researcher
Posts: 123
Joined: Sat Apr 11, 2015 5:54 am
Custom Rank: Global United Hockey
Favourite Team: Boston Bruins

EHM Editor: Playable leagues validator

Post by ideawithoutamind »

A few things to check, I know some may not be possible, just spitballing from common issues I've ran into that I have missed

Max league games and scheduled games (making sure those match up)
Verify schedules for each stage, and if possible dates end before the next stage date starts
If use real template schedule is set, verify it exists, matches games per team/max league game settings
Verify which teams are pulled in via team picking rules on initial stages
Stage trigger verification (making sure teams being pulled is set from a valid place, and team numbers match)

*I can send you some examples at some point, but I've found certain UIDs behave differently in game (navigation doesn't work or is wonky), which can be resolved by creating a new club competition OR re-assigning existing as league. Not sure if this is an editor thing or an issue with 1.4.1 I've experienced same issue on Pivot/TBL.
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

EHM Editor: Playable leagues validator

Post by archibalduk »

Thanks - very helpful! I'll try and get as many in as I can for this weekend's release. There were a few I wasn't totally sure about:
ideawithoutamind wrote: Tue Mar 30, 2021 5:07 amVerify schedules for each stage
What aspects did you think need validating?
ideawithoutamind wrote: Tue Mar 30, 2021 5:07 amVerify which teams are pulled in via team picking rules on initial stages
In what way were you thinking we validate this? Each thing we verify needs to be broken down into a rule/logic of some sort which I can then code into the Editor.
ideawithoutamind wrote: Tue Mar 30, 2021 5:07 amStage trigger verification (making sure teams being pulled is set from a valid place, and team numbers match)
How can we check what a valid place is? I can see how you can check numbers (e.g. check that the number of clubs drawn from prior stages matches the number of clubs in that stage) but I wasn't sure what you mean by checking valid places.
User avatar
ideawithoutamind
TBL Rosters Researcher
Posts: 123
Joined: Sat Apr 11, 2015 5:54 am
Custom Rank: Global United Hockey
Favourite Team: Boston Bruins

EHM Editor: Playable leagues validator

Post by ideawithoutamind »

Thanks again for your work with this! I apologize for the lengthy response. These are by no means demands, mostly just thinking outloud, and wishlists, I'll try to be as thorough as I can just to help convey what i am thinking of. My responses in BOLD
archibalduk wrote: Wed Mar 31, 2021 9:29 pm Thanks - very helpful! I'll try and get as many in as I can for this weekend's release. There were a few I wasn't totally sure about:

ideawithoutamind wrote: ↑Tue Mar 30, 2021 12:07 am
Verify schedules for each stage

What aspects did you think need validating?
A few things off hand, broken down into real schedule and non-real schedule.
Check schedule type (Uses Real Schedule Template or not),
Real Schedule:
Does Schedule exist? in Schedule Template
Do teams/division ID's match real template? (ex. if there are 4 divisions, with 3 teams each, are the numbers 0, 1, 2, 100, 101, 102, 200, 201, 202, 300, 301, 302), are there any extra numbers or missing numbers?
Count of games by team, ex. ID 0 has 42 home games and 42 away games. Does that number match Max League Games under comp rules
Does the date in the real schedule match the 1st and last date under the schedule dates of the first stage?

Non Real Schedule
Number of dates, matches number of rows in the schedule dates
Max League Games matches result of games per round. ex. 15 teams, 3 rounds (14 games each=42 games, does that match Max League Games

Cup stage types
Warning if Number of teams matches does not match Number of teams for round code 0. *this only applies to stages that have From Prev Stages Top Bye = false, may need to make another logic set for if From Prev Stages Top Bye=true
Apologize for bad syntax and mixing of coding languages, just putting logic into english
var stageteamcount int;
var scheduleteamcount int;
stageteamcount = (team count from stage)
if roundcode = 0 (
scheduleteamcount = (no_of_teams)
}
If (From Prev Stage Top Bye = true && roundcode = 1) {
scheduleteamcount = scheduleteamcount + extrateams
}

if stageteamcount != scheduleteamcount { warning}


ideawithoutamind wrote: ↑Tue Mar 30, 2021 12:07 am
Verify which teams are pulled in via team picking rules on initial stages

In what way were you thinking we validate this? Each thing we verify needs to be broken down into a rule/logic of some sort which I can then code into the Editor.
This is more for the base or initial stages, so excluding any post initial stages
For From Basic Rules List (check if teams exist in the structure, preview what teams show up)
From Basic Rules List by Conference (same as above, verifying conference)
From Basic Rules List by Division (same as above, verifying division)
From Database by Base Comp (is that just verifying teams from the comptition under structure, have teams assigned to that, preview which teams show up
From Nation by Reputation (preview top nations, number of nations verified from structure, may need to verify upper/lower competitions)
From National Teams by Finish (same as above, but not sure where finish is in the database for the initial start, is it iihf ranking?)
From National Teams by ranking (same as other nations)

ideawithoutamind wrote: ↑Tue Mar 30, 2021 12:07 am
Stage trigger verification (making sure teams being pulled is set from a valid place, and team numbers match)

How can we check what a valid place is? I can see how you can check numbers (e.g. check that the number of clubs drawn from prior stages matches the number of clubs in that stage) but I wasn't sure what you mean by checking valid places.

sorry for the confusion, but yes, check the number of clubs drawn from previous stages matches number of clubs in that stage.
ex. Stage 1
6 teams, 4 player(top) triggers stage 2, 2 playoff(bottom) triggers stage 3.
Stage 2:
Verify Stage to draw teams from. Default is 0, fate to draw teams from default is none. ex. Warning that there is no teams from that linked stage. If you change that value to 1, fate to draw from playoff(bottom), it will warn you that playoff bottom = 2; so a quick way to verify you linked the right spots. compare that number to stage to number of teams; making sure that matches up I hope I explained that correctly!)
One more addition. A quick little warning or marker denoting if a stage is an initial stage or not (3 initial stages, stages 1-3 have a little marker at top saying it's an initial stage. additionally, if you have 3 concurrent initial stages (or have a total number of more), but you've only made 1 stage, just a little warning marker that not enough stages have been made.
If you need any more random help or brainstorming for logic, I'm always down to help or test!
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

EHM Editor: Playable leagues validator

Post by archibalduk »

Thanks! :thup: I've made a start adding some of your suggestions and have updated the first post of this thread with a list of the validation rules added so far. The ones relating to stages correctly triggering the next upper/lower stage will require some further prep work which I'll do for v0.5.3 as I want to get v0.5.2 out this weekend.

Ideally I'd like some sort of flow chart in the Editor showing how the stages link together. It's a bit ambitious but I'll see what I can do for v0.5.3.
User avatar
xECK29x
TBL Rosters Researcher
Posts: 1010
Joined: Sun May 03, 2015 2:52 pm
Custom Rank: Premier Pivot Rosters Man
Favourite Team: New York Islanders

EHM Editor: Playable leagues validator

Post by xECK29x »

Oh boy this will be super helpful! I'm still not really too great with league structures so this will be really useful to help find common issues!

Edit: I just fired this up and I'm going through my DB now, I see it flags when 'Use Real Schedule Template' is disabled despite there being a schedule template in the DB, this is likely because I'm using schedule dates for this season, is this really an issue where I should clear out the schedule template or something that should be more of an informational item instead of a hard warning/error?
User avatar
xECK29x
TBL Rosters Researcher
Posts: 1010
Joined: Sun May 03, 2015 2:52 pm
Custom Rank: Premier Pivot Rosters Man
Favourite Team: New York Islanders

EHM Editor: Playable leagues validator

Post by xECK29x »

Just a warning, I made some of the suggested changes but it crashed while saving them. I'll email you the .tmp database it was writing, and the log (thought here isn't much there).
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

EHM Editor: Playable leagues validator

Post by archibalduk »

xECK29x wrote: Sat Apr 03, 2021 10:56 pm Oh boy this will be super helpful! I'm still not really too great with league structures so this will be really useful to help find common issues!

Edit: I just fired this up and I'm going through my DB now, I see it flags when 'Use Real Schedule Template' is disabled despite there being a schedule template in the DB, this is likely because I'm using schedule dates for this season, is this really an issue where I should clear out the schedule template or something that should be more of an informational item instead of a hard warning/error?
I've tried to describe the Status screen as warnings rather than errors, so if you feel there's something which suggests any item is a hard error then let me know and I'll tweak it. Forgetting to enable the schedule template setting is something I've seen before, so I think it's a useful warning. There's no issue with you keeping the schedule templates in the DB and not using them though - you can just ignore that warning.
xECK29x wrote: Sat Apr 03, 2021 11:23 pm Just a warning, I made some of the suggested changes but it crashed while saving them. I'll email you the .tmp database it was writing, and the log (thought here isn't much there).
Thanks. I'm able to repeat the error which means it should be straightforward to debug. It must be something to do with setting an alt schedule. :thup:
User avatar
xECK29x
TBL Rosters Researcher
Posts: 1010
Joined: Sun May 03, 2015 2:52 pm
Custom Rank: Premier Pivot Rosters Man
Favourite Team: New York Islanders

EHM Editor: Playable leagues validator

Post by xECK29x »

archibalduk wrote: Sun Apr 04, 2021 7:22 am I've tried to describe the Status screen as warnings rather than errors, so if you feel there's something which suggests any item is a hard error then let me know and I'll tweak it. Forgetting to enable the schedule template setting is something I've seen before, so I think it's a useful warning. There's no issue with you keeping the schedule templates in the DB and not using them though - you can just ignore that warning.
Perfect, thanks!
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

EHM Editor: Playable leagues validator

Post by archibalduk »

xECK29x wrote: Sat Apr 03, 2021 11:23 pm Just a warning, I made some of the suggested changes but it crashed while saving them. I'll email you the .tmp database it was writing, and the log (thought here isn't much there).
I think I've fixed this but it's been a bit of an odd one to debug. One thing to keep in mind is that where you enable the "Has Alternative Dates" setting, the number of entries in the Alt. Dates table must be equal to the number of dates in the Schedule Dates table otherwise the database will be corrupted. I've added a warning about this to v0.5.3 of the Editor and have updated the list of validation rules in the first post of this thread.
User avatar
ideawithoutamind
TBL Rosters Researcher
Posts: 123
Joined: Sat Apr 11, 2015 5:54 am
Custom Rank: Global United Hockey
Favourite Team: Boston Bruins

EHM Editor: Playable leagues validator

Post by ideawithoutamind »

A few more for the list as they've come up the past week, mostly leaving here for documentation, no rush!

Basic Data tab: Stage reputation = or != League Reputation; more of a warning than error, just something to help cross T's and dot I's.

Basic Data/Stages tab: Number of teams (on basic data tab) = Initial Stage check; number of teams on the stages > structure tabs (would need to count each value depending on initial stages)

Comp Rules tab: max league games = (if real template, matches value of dates present for ID 0 as an example), if not real template (max games = (number of teams - 1) * rounds. many times you can set this number incorrectly without an error, but seeding/playoff clinching gets really wonky if the numbers aren't correct, ie. if it says 8 games, but they play 10, it seeds them at whatever point they played 8)

Stages: Process fate action is selected or not. I always usually have this on, is there a situation it shouldn't be checked?

Comp Rules/Stages/Schedule Dates: For linked competitions or competitions that rely on prior competitions (ie. olympics, frozen four), make sure the draw date of the later competition is AFTER last date of prior competition.


Stages > Schedule Dates/Comp Rules: Date + offset is greater than Comp Rules Draw Date
Stages > Schedule Dates > Type=Cup: Draw Date/Year is before Date/Year Offset and after previous linked stage date (or comp start date)
Stages > Schedule Dates > Type=Cup: Unique and sequential Round Codes
Stages > Schedule Dates > Type=Cup: Match / Replay rules (warning if they would not have a defined winner, replay/match rule 9 or 12 is not true)
Stages > Schedule Dates > Type=Cup: Number of legs corresponds with Round Rules (16: best of 3, must have 2 legs, 17: best of 5 must have 3 legs, 18: best of 7 must have 4 legs)

* in terms of game play i don't know what the TV dates fully signify, but I typically leave them defaulted.
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

EHM Editor: Playable leagues validator

Post by archibalduk »

Thanks! This is all really helpful. I'll see what I can do for the next release. I added some additional rules over the weekend and I'm keeping the first post of this thread up to date as I add them.
ideawithoutamind wrote: Mon Apr 12, 2021 8:37 amComp Rules tab: max league games = (if real template, matches value of dates present for ID 0 as an example), if not real template (max games = (number of teams - 1) * rounds. many times you can set this number incorrectly without an error, but seeding/playoff clinching gets really wonky if the numbers aren't correct, ie. if it says 8 games, but they play 10, it seeds them at whatever point they played 8)
This is an interesting one and I've never truly gotten my head around what the correct figure is. It is either the lowest Stage Max League Games setting of the initial stages or the highest figure - i.e. where some initial stages have more GP than others. I *think* it is supposed to be the lowest GP of the initial stages but the default database seems to be a bit inconsistent in this regard.
ideawithoutamind wrote: Mon Apr 12, 2021 8:37 amStages: Process fate action is selected or not. I always usually have this on, is there a situation it shouldn't be checked?
I think there might be some stages where no fate rule is processed. IIRC where you have simultaneous subsequent stages running (e.g. the Eastern and Western Conference playoffs in the NHL) you would just process the fate action of the final of those simultaneous stages - I might be mistaken though. I can add a validation rule and run it against the default DB to see what comes up.
User avatar
ideawithoutamind
TBL Rosters Researcher
Posts: 123
Joined: Sat Apr 11, 2015 5:54 am
Custom Rank: Global United Hockey
Favourite Team: Boston Bruins

EHM Editor: Playable leagues validator

Post by ideawithoutamind »

archibalduk wrote: Mon Apr 12, 2021 8:59 pm Thanks! This is all really helpful. I'll see what I can do for the next release. I added some additional rules over the weekend and I'm keeping the first post of this thread up to date as I add them.
Thanks again! Awesome work overall! Here's a few more for the future as I come across them (been doing some weird league combinations, so finding out stuff that I miss or overlook)

Stages > Rules, per bit position, a few of the initial stage ones, will built out logic for others as I get to them

1 Basic Rules list > make sure teams exist in Structure
2 Basic Rules List by conference > make sure teams exist by conference (and team numbers match)
3 Basic Rules list by division > make sure teams exist by Division (and team numbers match)
4 From Database by Base Comp > Multiple initial stages not allowed (ex. grouped initial stages see World Championships)
5 From Nation by Reputation > Not compatible with 1.4.1 (is this compatible in 1.5?)
User avatar
ideawithoutamind
TBL Rosters Researcher
Posts: 123
Joined: Sat Apr 11, 2015 5:54 am
Custom Rank: Global United Hockey
Favourite Team: Boston Bruins

EHM Editor: Playable leagues validator

Post by ideawithoutamind »

I'm sure you have your handsful, so definitely no rush, just keeping here for your notes: I've been recreating some leagues in 1.5, no rush again, and just adding some of the common things I've forgotten or messed up, noting for reference and to remember:

Linked Stages: Preceding Stages > Verify Fate to draw teams from. (ex.
Stage 2 example
Stage to draw teams from: 1
Extra stage to draw teams from: 0
Fate to draw Teams from: League: Playoff (top) places

Verify Stage 1 is League (or cup if setting was cup)
Verify top places in Stage 1 = Stage 2 Number of Teams
*not sure how Extra stage draw teams works, but may be different.

Non initial stages, verify that a Prev Stage option is picked from Team Picking rules (this may be more involved, but a generic check, making sure that non Basic rules are not set for non-initial stages.

Side question:
Is there a rule of thumb or recommended number of dates related to number of teams for non-Schedule template schedules? (if so, maybe display a warning if the number of dates may questionably shift dates more)
For smaller leagues or divisions, generally even number teams, Number of Games = (Number of Teams - 1) * number of rounds; odd number of teams, I typically do Number of Dates = Number of Teams * number of rounds.

I am working with larger number of teams or dates, (in 1.5, I'm testing a 50 team NHL which does seem to be the limit here, tried 93, 90, 54, and now 50), using the non-schedule template method, 49 games * 2 rounds = 98 games. I started with 98 games, just for testing and that typically had games scheduled past the listed dates. I've found the sweet spot right now is 105 dates for the 98 games and the season ends on the last scheduled date. Just wondering if there is an actual equation for figuring that out or just trial/error adding dates until it works?
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

EHM Editor: Playable leagues validator

Post by archibalduk »

Thanks - this is all really helpful. :thup: I don't always have time to respond as I often have my head down on the Editor, but I do really appreciate all of your suggestions.
ideawithoutamind wrote: Fri Apr 23, 2021 6:55 pmSide question:
Is there a rule of thumb or recommended number of dates related to number of teams for non-Schedule template schedules? (if so, maybe display a warning if the number of dates may questionably shift dates more)
For smaller leagues or divisions, generally even number teams, Number of Games = (Number of Teams - 1) * number of rounds; odd number of teams, I typically do Number of Dates = Number of Teams * number of rounds.

I am working with larger number of teams or dates, (in 1.5, I'm testing a 50 team NHL which does seem to be the limit here, tried 93, 90, 54, and now 50), using the non-schedule template method, 49 games * 2 rounds = 98 games. I started with 98 games, just for testing and that typically had games scheduled past the listed dates. I've found the sweet spot right now is 105 dates for the 98 games and the season ends on the last scheduled date. Just wondering if there is an actual equation for figuring that out or just trial/error adding dates until it works?
The rule of thumb is number of teams * number of rounds. E.g. a 20 team stage with 2 rounds (so each team plays 38 GP each) = 40 dates. This is the approach typically used in the default database which ships with the game and so I use it as my rule of thumb. I think dropping it down to the price number of GP played by each team is risky because the game doesn't have any spare schedule dates in the event of a schedule clash. I imagine if you start taking the team count to particularly high numbers, such as the 50+ team NHL you mention, then you might need a higher number of spare dates as there must be a higher chance that the game's schedule generator is going to encounter schedule conflicts.
User avatar
ideawithoutamind
TBL Rosters Researcher
Posts: 123
Joined: Sat Apr 11, 2015 5:54 am
Custom Rank: Global United Hockey
Favourite Team: Boston Bruins

EHM Editor: Playable leagues validator

Post by ideawithoutamind »

Thanks for your work and feedback as always!

One more wishlist:
Schedule Template: Check Divisions vs Rules and Structure and check if ID's exist in template.
User avatar
xECK29x
TBL Rosters Researcher
Posts: 1010
Joined: Sun May 03, 2015 2:52 pm
Custom Rank: Premier Pivot Rosters Man
Favourite Team: New York Islanders

EHM Editor: Playable leagues validator

Post by xECK29x »

Found one:

Flag "Declares Regular Season Champion" enabled when no stages have "Regular Season Champions" rule set to True.
User avatar
xECK29x
TBL Rosters Researcher
Posts: 1010
Joined: Sun May 03, 2015 2:52 pm
Custom Rank: Premier Pivot Rosters Man
Favourite Team: New York Islanders

EHM Editor: Playable leagues validator

Post by xECK29x »

Another one to add:

Stage uses "From Lower League X places" but no Lower Competition set under Basic Data.
Post Reply