Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: 1 ... 3 4 [5] 6 7 ... 23  All

Author Topic: MAKiNG MORE FUN: Mod for Dominion Online 2.0  (Read 171824 times)

0 Members and 1 Guest are viewing this topic.

SCSN

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2227
  • Respect: +7140
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #100 on: October 13, 2015, 02:07:40 pm »
+10

There's this ridiculous function that calculates a factor that affects how long cards stay up in the air:

Code: [Select]
public static float getFlightTimeMultiplier(string source, string destination)
{
    float num = 1f;
    if ((source != null) && (destination != null))
    {
        if (source == destination)
        {
            if (source == "play")
            {
                return 0.6f;
            }
            return (!source.Contains(".0") ? 0.1f : 0.4f);
        }
        if (source.StartsWith("deck"))
        {
            if (destination.StartsWith("hand"))
            {
                num = !(destination == "hand.0") ? 0.3f : 0.9f;
            }
            return num;
        }
        if (((destination == "globalReveal") || (destination == "globalRevealTwo")) || ((destination == "globalRevealBlackMarket") || destination.StartsWith("reveal")))
        {
            return 0.45f;
        }
        if (source.StartsWith("discard"))
        {
            if (destination.StartsWith("deck"))
            {
                num = !(destination == "deck.0") ? 0.3f : 0.5f;
            }
            return num;
        }
        if (source.StartsWith("hand"))
        {
            if (destination.StartsWith("discard"))
            {
                num = !(destination == "discard.0") ? 0.4f : 0.8f;
            }
            return num;
        }
        if (destination == "play")
        {
            return (!(source == "hand.0") ? 1f : 0.5f);
        }
        if ((source == "play") && destination.StartsWith("discard"))
        {
            num = !(destination == "discard.0") ? 0.5f : 0.7f;
        }
    }
    return num;
}

Being a fan of both speed and concision, I'm making this slight simplification:

Code: [Select]
public static float getFlightTimeMultiplier(string source, string destination)
{
    return 0f;
}
Logged

jsh357

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2577
  • Shuffle iT Username: jsh357
  • Respect: +4340
    • View Profile
    • JSH Gaming: Original games
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #101 on: October 13, 2015, 02:13:01 pm »
+1

That is a welcome change in my book. I can see the delays being nice for newer players, but I prefer the extra speed myself.
Logged
Join the Dominion community Discord channel! Chat in text and voice; enter dumb tournaments; spy on top players!

https://discord.gg/2rDpJ4N

popsofctown

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 5477
  • Respect: +2860
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #102 on: October 13, 2015, 02:50:54 pm »
0

There's this ridiculous function that calculates a factor that affects how long cards stay up in the air:

Code: [Select]
public static float getFlightTimeMultiplier(string source, string destination)
{
    float num = 1f;
    if ((source != null) && (destination != null))
    {
        if (source == destination)
        {
            if (source == "play")
            {
                return 0.6f;
            }
            return (!source.Contains(".0") ? 0.1f : 0.4f);
        }
        if (source.StartsWith("deck"))
        {
            if (destination.StartsWith("hand"))
            {
                num = !(destination == "hand.0") ? 0.3f : 0.9f;
            }
            return num;
        }
        if (((destination == "globalReveal") || (destination == "globalRevealTwo")) || ((destination == "globalRevealBlackMarket") || destination.StartsWith("reveal")))
        {
            return 0.45f;
        }
        if (source.StartsWith("discard"))
        {
            if (destination.StartsWith("deck"))
            {
                num = !(destination == "deck.0") ? 0.3f : 0.5f;
            }
            return num;
        }
        if (source.StartsWith("hand"))
        {
            if (destination.StartsWith("discard"))
            {
                num = !(destination == "discard.0") ? 0.4f : 0.8f;
            }
            return num;
        }
        if (destination == "play")
        {
            return (!(source == "hand.0") ? 1f : 0.5f);
        }
        if ((source == "play") && destination.StartsWith("discard"))
        {
            num = !(destination == "discard.0") ? 0.5f : 0.7f;
        }
    }
    return num;
}

Being a fan of both speed and concision, I'm making this slight simplification:

Code: [Select]
public static float getFlightTimeMultiplier(string source, string destination)
{
    return 0f;
}

Your solution is inferior, SCSN.  It doesn't create a variable in order to initialize it and then use it only 0 - 1 times. 

What's next, you're going to try to tell me I'm a bad dominion player for buying Feast with 5$ to spend so that I can trash it for a Duchy?

You're clearly trying to destroy everything I love about Dominion.
« Last Edit: October 13, 2015, 02:53:39 pm by popsofctown »
Logged

werothegreat

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8172
  • Shuffle iT Username: werothegreat
  • Let me tell you a secret...
  • Respect: +9630
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #103 on: October 13, 2015, 03:11:19 pm »
+1

That is a welcome change in my book. I can see the delays being nice for newer players, but I prefer the extra speed myself.

Bear in mind that it's not just your cards that are delayed, but opponent's cards.  I get that you all want this to be as close an experience to ASCII Dominion as possible, but I like getting a visual reference of what my opponent is doing, other than just the log.  This was a problem at the beginning of the 2.0 beta when cards were moving too fast and I had no idea what my opponent was even doing.
Logged
Contrary to popular belief, I do not run the wiki all on my own.  There are plenty of other people who are actively editing.  Go bother them!

Check out this fantasy epic adventure novel I wrote, the Broken Globe!  http://www.amazon.com/Broken-Globe-Tyr-Chronicles-Book-ebook/dp/B00LR1SZAS/

jsh357

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2577
  • Shuffle iT Username: jsh357
  • Respect: +4340
    • View Profile
    • JSH Gaming: Original games
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #104 on: October 13, 2015, 03:28:32 pm »
0

That is a welcome change in my book. I can see the delays being nice for newer players, but I prefer the extra speed myself.

Bear in mind that it's not just your cards that are delayed, but opponent's cards.  I get that you all want this to be as close an experience to ASCII Dominion as possible, but I like getting a visual reference of what my opponent is doing, other than just the log.  This was a problem at the beginning of the 2.0 beta when cards were moving too fast and I had no idea what my opponent was even doing.

Well, nobody is forcing you to use the modifications if you don't care for them. I don't see the issue here.
Logged
Join the Dominion community Discord channel! Chat in text and voice; enter dumb tournaments; spy on top players!

https://discord.gg/2rDpJ4N

werothegreat

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8172
  • Shuffle iT Username: werothegreat
  • Let me tell you a secret...
  • Respect: +9630
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #105 on: October 13, 2015, 03:30:41 pm »
0

Okay, the Bane animation needs to die.  That's distracting.  Embargo and Grand Market/Contraband are fine, though.

EDIT: What did they do to the seeking crystal ball?  It was fine, and now it's an utter eyesore.  Jeebus.
« Last Edit: October 13, 2015, 03:34:59 pm by werothegreat »
Logged
Contrary to popular belief, I do not run the wiki all on my own.  There are plenty of other people who are actively editing.  Go bother them!

Check out this fantasy epic adventure novel I wrote, the Broken Globe!  http://www.amazon.com/Broken-Globe-Tyr-Chronicles-Book-ebook/dp/B00LR1SZAS/

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9709
  • Respect: +10765
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #106 on: October 13, 2015, 03:47:31 pm »
0

That is a welcome change in my book. I can see the delays being nice for newer players, but I prefer the extra speed myself.

Bear in mind that it's not just your cards that are delayed, but opponent's cards.  I get that you all want this to be as close an experience to ASCII Dominion as possible, but I like getting a visual reference of what my opponent is doing, other than just the log.  This was a problem at the beginning of the 2.0 beta when cards were moving too fast and I had no idea what my opponent was even doing.

Well, nobody is forcing you to use the modifications if you don't care for them. I don't see the issue here.

It sounds like issue is that he wants the modifications for his plays, but not so much for his opponents' plays.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

SCSN

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2227
  • Respect: +7140
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #107 on: October 13, 2015, 03:48:22 pm »
+1

I have a speedfreak patch ready that eliminates every source of artificial delay I've so far been able to find.

Because I imagine this isn't for everyone, I'll be maintaining it alongside the regular patch.

I'm interested in hearing how it's working, especially from those having a keen interest in fast play.
Logged

jsh357

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2577
  • Shuffle iT Username: jsh357
  • Respect: +4340
    • View Profile
    • JSH Gaming: Original games
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #108 on: October 13, 2015, 04:17:53 pm »
+1

I just played a game with the hyper speed patch. I liked it fine, but I was OK without it too. The opponent's play speed was the most noticeable delay.
Logged
Join the Dominion community Discord channel! Chat in text and voice; enter dumb tournaments; spy on top players!

https://discord.gg/2rDpJ4N

Donald X.

  • Dominion Designer
  • *****
  • Offline Offline
  • Posts: 6367
  • Respect: +25712
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #109 on: October 13, 2015, 07:09:32 pm »
+6

There's this ridiculous function that calculates a factor that affects how long cards stay up in the air:
I am really curious if this kind of thing is the norm in the twisted world we live in, or as bad as it looks to me.

It is checking card destinations (etc.) against possibilities. And to do this it compares strings. Not, I dunno, numbers. In a good language it would be an enumerated type, perfect. You would actually be comparing 16 or 32 bits, when 8 would do, since computers prefer bigger numbers these days. But still, a comparison of two numbers. Rather than seeing, is the first letter g, is the second letter l, etc., as if your meaningful information is a bunch of characters when in fact it is no such thing.
Logged

Donald X.

  • Dominion Designer
  • *****
  • Offline Offline
  • Posts: 6367
  • Respect: +25712
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #110 on: October 13, 2015, 07:17:40 pm »
+6

Jeff says there will be an option to disable animations in the next version.
Logged

Schneau

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1174
  • Shuffle iT Username: Schneau
  • Respect: +1461
    • View Profile
    • Rainwave
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #111 on: October 13, 2015, 07:39:42 pm »
+2

There's this ridiculous function that calculates a factor that affects how long cards stay up in the air:
I am really curious if this kind of thing is the norm in the twisted world we live in, or as bad as it looks to me.

It is checking card destinations (etc.) against possibilities. And to do this it compares strings. Not, I dunno, numbers. In a good language it would be an enumerated type, perfect. You would actually be comparing 16 or 32 bits, when 8 would do, since computers prefer bigger numbers these days. But still, a comparison of two numbers. Rather than seeing, is the first letter g, is the second letter l, etc., as if your meaningful information is a bunch of characters when in fact it is no such thing.

While I totally agree that there's got to be a better way (my preference would be something like symbols in Ruby or keywords in Clojure), comparing strings vs. comparing integers/enumerated types will not have significant performance differences unless this code is run literally billions of times. It's still really ugly though, and should probably be in a case statement.
Logged

Donald X.

  • Dominion Designer
  • *****
  • Offline Offline
  • Posts: 6367
  • Respect: +25712
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #112 on: October 13, 2015, 07:50:04 pm »
+7

While I totally agree that there's got to be a better way (my preference would be something like symbols in Ruby or keywords in Clojure), comparing strings vs. comparing integers/enumerated types will not have significant performance differences unless this code is run literally billions of times. It's still really ugly though, and should probably be in a case statement.
It's not just ugly and slow. Man. Let's say I have a typo in one of the strings. With the enumerated types, it doesn't compile. Oh, typo, fixed, compile. With these strings, it compiles, it runs, you've got a bug. In this case the bug is that the time it takes a card to go from one place to another isn't the intended time in certain situations, so, it does not loom large, unless it's awful enough to notice. But you know. If they're doing this here they're doing it in other places.

Say what you mean! Is my first rule of computer programming. When you don't mean a string, don't use a string.
Logged

SCSN

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2227
  • Respect: +7140
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #113 on: October 13, 2015, 08:30:30 pm »
+14

Jeff says there will be an option to disable animations in the next version.

I'll have to sue them for plagiarism.
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9709
  • Respect: +10765
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #114 on: October 13, 2015, 08:37:18 pm »
+13

I don't want to sidetrack this thread too much; but to respond to Donald's code-related stuff; while perhaps not the "norm" in our twisted world, it's also far from the worst thing I've see in code that I've inherited from other companies to maintain. My favorite example of silliness is this bit from some old VB6 code that I had to work wtih (though written here as c# for my own sanity):

Code: [Select]
for (int x = 1; x <=5; x++)
{
    switch (x)
    {
        case 1:
            [Do some stuff];
            break;
        case 2:
            [Do some stuff];
            break;
        case 3:
            [Do some stuff];
            break;
        case 4:
            [Do some stuff];
            break;
        case 5:
            [Do some stuff];
            break;
    }
}
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

Cave-o-sapien

  • Jester
  • *****
  • Offline Offline
  • Posts: 887
  • Respect: +1676
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #115 on: October 13, 2015, 08:56:07 pm »
0

I don't want to sidetrack this thread too much; but to respond to Donald's code-related stuff; while perhaps not the "norm" in our twisted world, it's also far from the worst thing I've see in code that I've inherited from other companies to maintain. My favorite example of silliness is this bit from some old VB6 code that I had to work wtih (though written here as c# for my own sanity):

Code: [Select]
for (int x = 1; x <=5; x++)
{
    switch (x)
    {
        case 1:
            [Do some stuff];
            break;
        case 2:
            [Do some stuff];
            break;
        case 3:
            [Do some stuff];
            break;
        case 4:
            [Do some stuff];
            break;
        case 5:
            [Do some stuff];
            break;
    }
}

This is amazing.
Logged

Witherweaver

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 6476
  • Shuffle iT Username: Witherweaver
  • Respect: +7866
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #116 on: October 13, 2015, 08:57:19 pm »
0

Looks solid.
Logged

Witherweaver

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 6476
  • Shuffle iT Username: Witherweaver
  • Respect: +7866
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #117 on: October 13, 2015, 08:58:08 pm »
+3

Wait I think I can optimize it:

Code: [Select]
for (int x = 1; x <=5; x++)
{
    switch (x)
    {
        case 5:
            [Do some stuff];
            break;
        case 4:
            [Do some stuff];
            break;
        case 3:
            [Do some stuff];
            break;
        case 2:
            [Do some stuff];
            break;
        case 1:
            [Do some stuff];
            break;
    }
}
Logged

Voltaire

  • Jester
  • *****
  • Offline Offline
  • Posts: 957
  • flavor text
  • Respect: +1097
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #118 on: October 13, 2015, 11:57:55 pm »
0

Someone translate that bad code into a language I can understand so I can be a part of this.
Logged

GendoIkari

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 9709
  • Respect: +10765
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #119 on: October 14, 2015, 12:22:19 am »
+4

Someone translate that bad code into a language I can understand so I can be a part of this.

The result of running that code is identical to just writing the [Do some stuff] parts without anything else. It loops through the whole thing 5 times, and in each iteration of the loop, it does 1 of those things, in order.
Logged
Check out my F.DS extension for Chrome! Card links; Dominion icons, and maybe more! http://forum.dominionstrategy.com/index.php?topic=13363.0

Thread for Firefox version:
http://forum.dominionstrategy.com/index.php?topic=16305.0

popsofctown

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 5477
  • Respect: +2860
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #120 on: October 14, 2015, 12:29:05 am »
+3

Now the joke is funnier, because GendoIkari has explained it.
Logged

pacovf

  • Cartographer
  • *****
  • Offline Offline
  • Posts: 3500
  • Multiediting poster
  • Respect: +3838
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #121 on: October 14, 2015, 12:55:56 am »
+4

Code: [Select]
if (joke.explained == 1)
    joke.fun++;
Logged
pacovf has a neopets account.  It has 999 hours logged.  All his neopets are named "Jessica".  I guess that must be his ex.

popsofctown

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 5477
  • Respect: +2860
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #122 on: October 14, 2015, 01:42:12 am »
+5

Code: [Select]
if (joke.explained == 1)
    joke.fun++;

This code means that if the joke has been explained - that is, if the joke's "explaindness" component has been set to 1, which is a way of storing "true" or "false" using 1 or 0 instead of a boolean variable, usually considered tacky, which adds to the humor - then you should increment the joke's "fun" component - that is, some supposed variable that measures how funny the joke is and needs to be increased to reflect that knowledge of the joke having been explained and the inevitable positive impact that will have.

Posting this code snippet is funny because it is topical, the previous joke was about code snippets.  And it is also topical because I recently mentioned the "explaining the joke makes it funnier" tradition.
Logged

assemble_me

  • Saboteur
  • *****
  • Offline Offline
  • Posts: 1407
  • Shuffle iT Username: assemble me
  • Dominion stream/yt junkie
  • Respect: +808
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #123 on: October 14, 2015, 01:56:12 am »
0

Congrats, you've started this project just in time, it appears...
Logged
Join the f.ds Dominion league | My Twitch channel

... and none of his posts shall remain unedited

SCSN

  • Mountebank
  • *****
  • Offline Offline
  • Posts: 2227
  • Respect: +7140
    • View Profile
Re: MAKiNG MORE FUN: Patch for Dominion Online 2.0 (Windows)
« Reply #124 on: October 14, 2015, 04:21:58 am »
+6

Gotta make sure you never multiply by zero:

Code: [Select]
private int getVPFromSpecialCards()
{
    int num = 0;
    if (this.numFairgrounds > 0)
    {
        num += (this.numFairgrounds * 2) * (this.numOfDifferentCards / 5);
    }
    if (this.numSilkroads > 0)
    {
        num += this.numSilkroads * (this.numVictoryCards / 4);
    }
    if (this.numVineyards > 0)
    {
        num += this.numVineyards * (this.numActionCards / 3);
    }
    if (this.numDukes > 0)
    {
        num += this.numDukes * this.numDuchiesCards;
    }
    if (this.numGardens > 0)
    {
        num += this.numGardens * (this.numCards / 10);
    }
    if (this.numFeodums > 0)
    {
        num += this.numFeodums * (this.numSilvers / 3);
    }
    return num;
}

At least they tried...
Logged
Pages: 1 ... 3 4 [5] 6 7 ... 23  All
 

Page created in 0.056 seconds with 20 queries.