Dominion Strategy Forum

Please login or register.

Login with username, password and session length
Pages: [1] 2 3  All

Author Topic: I made a randomizer  (Read 18046 times)

0 Members and 1 Guest are viewing this topic.

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
I made a randomizer
« on: May 26, 2016, 11:01:50 pm »
+18

I'm sure this is the millionth randomizer or so, but I wanted something that could bias like Dominion Online does, and didn't find anything.

It's just on the web. http://makingmorefun.com/dominion/randomizer/

It includes all the cards. (Including Empires)

Use the new UI.  Hooray, it is easier to use now!

ToDo:
Alternate Colony/Shelter bias options
Way to show cards in split piles
Permanent links for Kingdoms
Add input option for requiring specific cards
Add input option for custom cards.



You can still do the manual stuff.  Here it is for posterity:
Code: [Select]
It can bias sets. This makes cards from those sets 3x more likely to be chosen
[url=http://makingmorefun.com/dominion/randomizer/?bias=adventures,empires]http://makingmorefun.com/dominion/randomizer/?bias=adventures,empires[/url]

It can excludes sets, because maybe you don't have something...
[url=http://makingmorefun.com/dominion/randomizer/?bias=adventures,empires&exclude=base,alchemy]http://makingmorefun.com/dominion/randomizer/?bias=adventures,empires&exclude=base,alchemy[/url]

You can adjust the bias multiplier
[url=http://makingmorefun.com/dominion/randomizer/?bias=empires.10]http://makingmorefun.com/dominion/randomizer/?bias=empires.10[/url]

You can exclude or bias individual cards
[url=http://makingmorefun.com/dominion/randomizer/?bias=alchemy.100&exclude=possession]http://makingmorefun.com/dominion/randomizer/?bias=alchemy.100&exclude=possession[/url]
[url=http://makingmorefun.com/dominion/randomizer/?bias=enchantress.100]http://makingmorefun.com/dominion/randomizer/?bias=enchantress.100[/url]

You can bias or exclude based on card types
[url=http://makingmorefun.com/dominion/randomizer/?exclude=attack]http://makingmorefun.com/dominion/randomizer/?exclude=attack[/url]
[url=http://makingmorefun.com/dominion/randomizer/?bias=duration.100]http://makingmorefun.com/dominion/randomizer/?bias=duration.100[/url]

You can bias or exclude based on cost (not sure this is very useful, but why not)
[url=http://makingmorefun.com/dominion/randomizer/?exclude=cost5&bias=cost7,cost8d,cost3p]http://makingmorefun.com/dominion/randomizer/?exclude=cost5&bias=cost7,cost8d,cost3p[/url]

You can change the limit for events/landmarks.
If you provide a one number, it sets the limit for total events/landmarks:
http://makingmorefun.com/dominion/randomizer/?bias=empires,adventures&el-limit=3
If you provide 2 numbers, the first is the max for each type individually, and the second is the total limit:
http://makingmorefun.com/dominion/randomizer/?bias=event,landmark&el-limit=2,3
If you provide 3 numbers, the first is the max number of events, the second is the max number of landmarks, and the third is the total limit:
http://makingmorefun.com/dominion/randomizer/?bias=event.5,landmark.5&el-limit=4,3,6
Use 0 for no limit (if you actually want 0, use exclude=event,landmark):
http://makingmorefun.com/dominion/randomizer/?bias=event.10,landmark.10&el-limit=0
« Last Edit: August 05, 2016, 12:04:08 am by Deadlock39 »
Logged

Aleimon Thimble

  • Minion
  • *****
  • Offline Offline
  • Posts: 698
  • Shuffle iT Username: Aleimon Thimble
  • Respect: +711
    • View Profile
Re: I made a randomizer
« Reply #1 on: May 27, 2016, 03:51:59 am »
+1

The one I always use is this one: http://www.hiwiller.com/dominion/

But it doesn't have Events and also the card Prince is missing for some reason. I would use any randomizer that is actually complete, and yours seems to be, so thanks! :)

Edit: Oh, except that the bias and exclude functions don't seem to work, I just get no cards when I try that out...
« Last Edit: May 27, 2016, 03:53:08 am by Aleimon Thimble »
Logged
[...] The God of heaven has given you Dominion [...] (Daniel 2:37)

Beyond Awesome

  • Global Moderator
  • *****
  • Offline Offline
  • Posts: 2941
  • Shuffle iT Username: Beyond Awesome
  • Respect: +2466
    • View Profile
Re: I made a randomizer
« Reply #2 on: May 27, 2016, 04:24:02 am »
+1

One thing I've noticed from this is that the larger Empires text looks so so nice.
Logged

Davio

  • 2012 Dutch Champion
  • *
  • Offline Offline
  • Posts: 4787
  • Respect: +3412
    • View Profile
Re: I made a randomizer
« Reply #3 on: May 27, 2016, 08:58:52 am »
+1

Here's a little trick:

The images are stored in cryptic locations, but there's a way to find out where.

First, we need the base URL which is http://wiki.dominionstrategy.com/images/thumb/
Then we need the filename, including .jpg, for instance Village.jpg
This filename is hashed with MD5 and displayed as hex, in this case we get 5ab681de1aca02763ed2d6a4d1ce8839
The first 2 characters are the only ones that matter, we need to append them to te URL like so: http://wiki.dominionstrategy.com/images/thumb/firstChar/first2Chars -> http://wiki.dominionstrategy.com/images/thumb/5/5a
Then we use the filename as a subfolder: http://wiki.dominionstrategy.com/images/thumb/5/5a/Village.jpg
Finally, we can pick the right sized one: http://wiki.dominionstrategy.com/images/thumb/5/5a/Village.jpg/76px-Village.jpg

Beware: Not all cards have all resolutions, for instance Worker's Village only has 120 and 180px!
« Last Edit: May 27, 2016, 09:00:30 am by Davio »
Logged

BSG: Cagprezimal Adama
Mage Knight: Arythea

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
Re: I made a randomizer
« Reply #4 on: May 27, 2016, 10:09:13 am »
0

The one I always use is this one: http://www.hiwiller.com/dominion/

But it doesn't have Events and also the card Prince is missing for some reason. I would use any randomizer that is actually complete, and yours seems to be, so thanks! :)

Edit: Oh, except that the bias and exclude functions don't seem to work, I just get no cards when I try that out...

Oh wow, you've made me realize I stupidly forgot to add the promos. I'll probably get them added in this evening, and might add logic for Young Witch.

Do the links I posted with bias/exclude work for you?  Can you post a link that isn't giving you any cards?  (I'm not sure my error handling is very good right now.)

Here's a little trick:

The images are stored in cryptic locations, but there's a way to find out where.

First, we need the base URL which is http://wiki.dominionstrategy.com/images/thumb/
Then we need the filename, including .jpg, for instance Village.jpg
This filename is hashed with MD5 and displayed as hex, in this case we get 5ab681de1aca02763ed2d6a4d1ce8839
The first 2 characters are the only ones that matter, we need to append them to te URL like so: http://wiki.dominionstrategy.com/images/thumb/firstChar/first2Chars -> http://wiki.dominionstrategy.com/images/thumb/5/5a
Then we use the filename as a subfolder: http://wiki.dominionstrategy.com/images/thumb/5/5a/Village.jpg
Finally, we can pick the right sized one: http://wiki.dominionstrategy.com/images/thumb/5/5a/Village.jpg/76px-Village.jpg

Beware: Not all cards have all resolutions, for instance Worker's Village only has 120 and 180px!

That sounds useful.  Do you know why the file finding link can't find those thumb files?  If they all have 180px versions, I'd be set, but if some of them are missing, it might be more trouble than it is worth.

werothegreat

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8172
  • Shuffle iT Username: werothegreat
  • Let me tell you a secret...
  • Respect: +9625
    • View Profile
Re: I made a randomizer
« Reply #5 on: May 27, 2016, 10:42:48 am »
0

Beware: Not all cards have all resolutions, for instance Worker's Village only has 120 and 180px!

Wait, what?  Why the fuck is that?  It's a 1200x2000 pixel file!  That's so arbitrary and weird...
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/

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
Re: I made a randomizer
« Reply #6 on: May 27, 2016, 11:26:00 am »
0

Beware: Not all cards have all resolutions, for instance Worker's Village only has 120 and 180px!

Wait, what?  Why the fuck is that?  It's a 1200x2000 pixel file!  That's so arbitrary and weird...

Well, this probably depends on how and why the thumb versions of the file are generated. 

The 1200x2000 file can be resized to whatever size a webpage wants it in, but the problem is, that resolution comes with a giant file size, so it takes longer for the images to load. I am displaying the files at a maximum size of 180x235, so it is much more efficient if I can download images that are already resized rather than pulling in the huge one and letting the browser resize it.

Not sure if I answered your question at all, or said anything you didn't already know.

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
Re: I made a randomizer
« Reply #7 on: May 27, 2016, 11:52:42 am »
0

Well, actually I think this is just a confusion.

There are only 120px and 180px versions in this directory:
http://wiki.dominionstrategy.com/images/thumb/e/e4/Workers_VillageArt.jpg/

but Workers_VillageArt is not the correct name for the card on the Wiki, it is Worker's_Village, and that directory:
http://wiki.dominionstrategy.com/images/thumb/1/12/Worker's_Village.jpg/

has all the usual sizes.

I'll see if I can do the MD5 thing when I get a chance, it will really improve loading times if it works.

I noticed that you can specify cards on the wiki like:
[[File:Tactician.jpg|200px]]
which makes me thing there might be another parameter that could be passed to the filepath link, but "resolution" doesn't work, and I don't have any other guesses.

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
Re: I made a randomizer
« Reply #8 on: May 27, 2016, 07:47:26 pm »
0

I updated with Promos, Young Witch, and bias/exclude options for individual cards.

Young Witch!
http://makingmorefun.com/dominion/randomizer/?bias=youngwitch.100

Promos!
http://makingmorefun.com/dominion/randomizer/?bias=promo.100

Infthitbox

  • Explorer
  • *****
  • Offline Offline
  • Posts: 317
  • Respect: +440
    • View Profile
Re: I made a randomizer
« Reply #9 on: May 27, 2016, 09:58:55 pm »
+1

Are there any plans for an interface to choose this stuff rather than directly inputting the parameters into the url?
Logged

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
Re: I made a randomizer
« Reply #10 on: May 27, 2016, 10:12:21 pm »
0

Are there any plans for an interface to choose this stuff rather than directly inputting the parameters into the url?

Yeah, I will probably do that eventually.  It's not really part of my primary skill set, so it takes longer and is less fun, but I used the parameters this way so it is easy to submit from a form.  Actually, anyone could create a tool that submits to it I suppose.

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
Re: I made a randomizer
« Reply #11 on: June 06, 2016, 10:13:51 pm »
+2

Empires cards are all added!

The Wiki where it pulls the cards from is really slow due to the extra traffic. If that continues to be a problem, I may copy the images over to my site instead of pulling them live from the wiki. (Edit: It is suddenly much faster, so that is good)
« Last Edit: June 06, 2016, 10:29:04 pm by Deadlock39 »
Logged

Aleimon Thimble

  • Minion
  • *****
  • Offline Offline
  • Posts: 698
  • Shuffle iT Username: Aleimon Thimble
  • Respect: +711
    • View Profile
Re: I made a randomizer
« Reply #12 on: June 07, 2016, 04:24:25 am »
+1

This is awesome! I'm already generating kingdoms and thinking about what I would do if I were to play that kingdom. Thanks!

One suggestion: is it possible to do something with Black Market? Currently, it just shows that Black Market is in the kingdom, but there is no way of finding out which cards are in the Black Market deck. Maybe a small list to the bottom or the side that lists which cards should be in the BM deck, whenever it is included?
Logged
[...] The God of heaven has given you Dominion [...] (Daniel 2:37)

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
Re: I made a randomizer
« Reply #13 on: June 07, 2016, 09:51:29 am »
0

This is awesome! I'm already generating kingdoms and thinking about what I would do if I were to play that kingdom. Thanks!

One suggestion: is it possible to do something with Black Market? Currently, it just shows that Black Market is in the kingdom, but there is no way of finding out which cards are in the Black Market deck. Maybe a small list to the bottom or the side that lists which cards should be in the BM deck, whenever it is included?

Yep, I will add it to my TODO list. I hadn't thought about doing that.

J Reggie

  • Jester
  • *****
  • Offline Offline
  • Posts: 842
  • Shuffle iT Username: J Reggie
  • Respect: +1487
    • View Profile
    • Jeff Rosenthal Music
Re: I made a randomizer
« Reply #14 on: June 07, 2016, 12:15:27 pm »
+1

Not super important, but do you have plans for what to do about Obelisk?

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
Re: I made a randomizer
« Reply #15 on: June 07, 2016, 01:22:02 pm »
0

Not super important, but do you have plans for what to do about Obelisk?

I put a blue border around the Young Witch Bane. I plan to do the same thing for Obelisk, but with a green border.  It would be nice to do something graphically fancier, but I'm no html wizard, so at least for now I'll keep it simple.

Until I get that done, if you get Obelisk, you'll have to choose the random action yourself I suppose.

Edit: Obelisk is done. (If it picks Ruins, there won't be any indicator.)

Also I apparently left Farmland out, so that is fixed now.
« Last Edit: June 07, 2016, 11:58:18 pm by Deadlock39 »
Logged

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
Re: I made a randomizer
« Reply #16 on: June 07, 2016, 11:57:55 pm »
0

New updates are added to allow bias/exclude cards based on types and cost.



...and now it actually picks Colony/Shelters as it should, and shows all the extra setup cards below the kingdom.
« Last Edit: June 08, 2016, 11:12:30 pm by Deadlock39 »
Logged

RevanFan

  • Spy
  • ****
  • Offline Offline
  • Posts: 81
  • Respect: +41
    • View Profile
Re: I made a randomizer
« Reply #17 on: June 15, 2016, 05:32:16 am »
+1

Any chance for an update that allows for more than 2 events/landmarks? I like to play with a max of 3 rather than 2.
Logged

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
Re: I made a randomizer
« Reply #18 on: June 15, 2016, 09:15:14 am »
0

Any chance for an update that allows for more than 2 events/landmarks? I like to play with a max of 3 rather than 2.

Yes!  I did this 2 days ago, but haven't gotten it pushed up the the site yet because I ran out of time, and didn't have time to work on it last night. I will be pushing those updates tonight. 

You will be able to change the limit, for events/landmarks combined, and individually.  Setting a limit of 3 will allow up to 3 of any type, but setting the limit to "2,3" will allow 3 total, but only 2 of any one type.  It will also be possible to do something crazy like "4,2,5" to set a limit of 4 events, 2 landmarks, and 5 total.

I plan to use a max of 3 with the "2,3" setting. I think one of the playtesters said they tested that way.  I will post sample links when I push it live. (and I promise a user interface is getting closer to the top of my TODO list...)

Edit: This update is live. Examples in the first post.
« Last Edit: June 15, 2016, 08:50:46 pm by Deadlock39 »
Logged

Chris is me

  • Margrave
  • *****
  • Offline Offline
  • Posts: 2745
  • Shuffle iT Username: Chris is me
  • What do you want me to say?
  • Respect: +3457
    • View Profile
Re: I made a randomizer
« Reply #19 on: June 15, 2016, 10:34:48 am »
0

This is a neat randomizer.

How hard would it be to make a little page with a basic HTML form that lets you type in prameters, which then generates a URL to use to trigger the randomizer? Without this thread I have no idea what my options are, and it doesn't seem like it would be very hard to have a few text boxes and some basic php logic or somethin'.
Logged
Twitch channel: http://www.twitch.tv/chrisisme2791

bug me on discord

pm me if you wanna do stuff for the blog

they/them

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
Re: I made a randomizer
« Reply #20 on: June 15, 2016, 10:42:48 am »
0

This is a neat randomizer.

How hard would it be to make a little page with a basic HTML form that lets you type in prameters, which then generates a URL to use to trigger the randomizer? Without this thread I have no idea what my options are, and it doesn't seem like it would be very hard to have a few text boxes and some basic php logic or somethin'.

Probably not very hard, and that is my plan.  I just don't like that type of development, so I am procrastinating it.  (Actually, with the way it works, anyone could create a form that throws to this.)  I was also scrambling to get the features I wanted done to use this for our KC meetup, so UI was low on my priority list. I've gotten the key features done now, so I'll be trying to get at least a basic input form done next.

RevanFan

  • Spy
  • ****
  • Offline Offline
  • Posts: 81
  • Respect: +41
    • View Profile
Re: I made a randomizer
« Reply #21 on: June 16, 2016, 02:44:42 pm »
+1

Thanks for the event/landmark settings. Works great!
Logged

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
Re: I made a randomizer
« Reply #22 on: June 23, 2016, 12:33:27 am »
0

Now it has a UI!

Going to the base link will bring up the interface. Refreshing a generated kingdom will reroll with the same settings. You can save the link to your favorites still.

The UI doesn't let you change the bias from the default 3x yet, so you still need to do that manually if you want it.
« Last Edit: June 23, 2016, 12:34:34 am by Deadlock39 »
Logged

werothegreat

  • Adventurer
  • ******
  • Offline Offline
  • Posts: 8172
  • Shuffle iT Username: werothegreat
  • Let me tell you a secret...
  • Respect: +9625
    • View Profile
Re: I made a randomizer
« Reply #23 on: June 23, 2016, 12:35:47 am »
0

Hmm.  This always takes a fair few seconds to load for me, and I'm not sure if it's a computational thing sorting through the randomizing, or if the site is inefficiently loading pictures from the wiki, or what.
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/

Deadlock39

  • Torturer
  • *****
  • Offline Offline
  • Posts: 1722
  • Respect: +1757
    • View Profile
Re: I made a randomizer
« Reply #24 on: June 23, 2016, 12:44:44 am »
0

The pictures on the wiki are enormous, so it takes a while to load.  It actually only takes about a second on my Google Fiber, but takes quite a while if I am on mobile or something.

I intend to eventually connect to the smaller images on the wiki, or (more likely) copy them locally so it doesn't stop working when the wiki goes down.
Pages: [1] 2 3  All
 

Page created in 0.05 seconds with 20 queries.