Menu

#1 Ignore extra Cards

open
nobody
None
5
2013-06-23
2010-06-16
Joschi
No

Problem when loading a xx.card file with more cards than countries (Exception...)

Why not discarding the extra cards...

So this patch tries to.
(currently it also prints a line to the stdout...)

Discussion

  • Joschi

    Joschi - 2010-06-16

    Sri, got my mind screwed a bit. So I changed from ignoring all extra cards to ignore cards with reference to countries that are not there. And inserting wildcards.

     
  • Joschi

    Joschi - 2010-06-16
     
  • B. S.

    B. S. - 2010-07-27

    Making a guess here ... I'm guessing that this issue is what causes me to acquire dozens of wildcards, particularly noticeable when playing Italian Rules on some maps. Currently, noticeably, ameroki - prior to last update, and after the one before that, also experienced on lotr and eurasien.

    May I suggest:
    - there are, what, normally only 2 or 3 wildcards 'per deck'?
    - don't allow more than this number of wildcards.
    - know the number of countries at the beginning of your routine.
    - for the case where there are missing countries, allow sufficient number of mis-matched cards to make up the difference - perhaps with an even distribution of non-wildcard card type?

    I'm throwing spaghetti here, hoping something sticks as making sense.

     
  • Joschi

    Joschi - 2010-07-29

    This is not yet implemented (as far as I know) .

    But, the main problem here was a card that was referencing a city that doesn't exist will generate an error.

    So better than that is either ignore the card or use a wildcard.
    (In my point of view - wildcard - but thats a subject to discuss...)

     
  • B. S.

    B. S. - 2010-07-29

    Sorry, you're right - I overlooked the error being generated, and just leapt to the unwarranted assumption that what I was seeing was caused by this. What I was thinking at the time was, in one sense, a card from an unmatched city is just like any other card to a city I don't occupy - useful only for whether it's infantry, cavalry, or cannon.

    Arguably, a card for a city that doesn't exist is a bum (map) file that should go back to the originator for repair. Equally arguably, fixing the map file (if only temporarily, locally) is also valid. (Or play another map.)

    What if, instead of futzing around with this this way - pick a valid city at random and slap that in? Is it actually wrong (if only from the sense of something else throwing off an exception) to have two cards for the same city?

    I agree, none of this is perfection, but if we had perfection, the map file wouldn't be bum in the first place.

     
  • Joschi

    Joschi - 2010-07-29

    You can't pick another city by random. Because assume you have 10 cities and 12 cards. And all cards are referencing cities (1-12) so 2 cards will fail (and thus generate the stacktrace...)

    I think either discard those 2 cards, or add them as wildcars. (as wildcards are allowed as many you want..)

    That's why I choosed that. Because that happens to me also sometimes during creating some maps. That I reference something wrong ;)

    Two cards for the same city are not (should not) possible, haven't tried what the error is ;) , butI assume that the old card is overwritten.

    And tnx for the discussion.

     
  • Joschi

    Joschi - 2010-09-07

    Anyone listening here?

    So I mean, is any domination developer reading the tracker items?!

     
  • Yura

    Yura - 2013-06-23

    you can not load cards that do not match a map as it will result in strange and unexpected behavior with the missions, as continents may be referenced that do not exist.

    this patch as not been added to the game, and i recommend the solution to the problem, to make a cards file that actually works for a map if you wish to use the non-standard file, and not use files that are not meant for a map.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.