*Update 4/20 New Release SHK Stocks v1.7 Beta 2* Market Tool

If you’re new to Stronghold Kingdoms or have a question about the game, check here for useful advice.
User avatar
Nublet
Posts: 95
Joined: Thu Sep 13, 2012 6:36 am

*Update 4/20 New Release SHK Stocks v1.7 Beta 2* Market Tool

Post by Nublet » Mon Apr 15, 2013 2:38 am

Development began - 4/11/2013
-Update 4/20/2013 - Posted a New video explaining new version and stuff.

Here is Beta 2 v 1.7 - Download link at bottom of post. ( This program is created to use Microsoft Net 4.5 architecture, Windows 7+, Sorry XP guys :( )
The file download is a self extractable file, just run it and extract it where you can find it will be in a folder called SHK_Stocks

Please test it and provide feedback so I can continue developing it and making improvements.
and of course report any bugs you find or annoyances.

Tutorial Video for v1.6 How to setup OCR for auto importing Prices.
Watch Tutorial on YouTube
Tutorial Video for 1.7 / 1.7a Feature update overview, problems, future content
Watch on YouTube

Current Known Bugs (Beyond my control)
Sometimes the OCR cannot decipher a 9, 5, 8 or 0 and sometimes will not recognize the selected box. This is due to the hard to see text on the potato sack linen background
User will just need to change that value after reloading the parish from the list.
The OCR code is complex, The image is captured and inverted in color and converted to gray-scale so OCR can work nicer. I nearly beat myself to death trying to get it perfect.
- If for some reason you get values that are way off in multiple tabs, select a different parish in the game and then re select the one you were having problems with, this will fix the importing problem almost perfectly. Why? I have no idea, but it does.


-In the works Updated 4/19/2013-
- World selection so you will have separate price databases for different worlds - Done
- Help File
-Update all from game (current parish only) - Done
-Failed character recognized replacement
-Village trading from selection
-Travel time from selected village calculation for best profit (might steal this code from my timed attack program since it converts time to total seconds for comparing ;)
-Overall best profit item regardless of village selected option

-Things I have added today 4/19/2013-
-World selection
If you have a list of parishes already from 1.5 1.6,
Start SHK Stocks and select your current play world, Then goto C:\SHKParishData\Parish and copy all the parish files and paste into C:\SHKParishData\Yourworld_Parish where Yourworld is the name of the world you are playing on.

-Enabled the "Update All From Game" Button
- Added a "Turn off Confirmations" check box so you can get rid of the annoying "blah blah has been recorded"
- You will only have to setup locations one time, and set OCR box up into its main location once. All locations are saved on exit so all you
will have to do next time you open the program is open your parish trade window, select your parish from list and hit update ;)
-SHK Stocks now stays above all windows on screen so you don't have to switch between windows constantly.
-Tweaked the interface so recording of prices is smoother and quicker
-Boxes that are not recorded correctly now change to the color red so they are easy to see and fix.

If for some reason a record don't come out great, just update all from game again or update each column individually with the update button.

Current Version
Image

Grab it here v1.7 Updated 4-19-2013


Thanks all
Nub
Last edited by Nublet on Sun Apr 21, 2013 2:31 pm, edited 16 times in total.

User avatar
DavidSpy
Posts: 7163
Joined: Wed Oct 26, 2011 1:08 am
Location: WI, USA
Contact:

Re: *New Release SHK Stocks v1.5 Beta 1* Market Tool

Post by DavidSpy » Mon Apr 15, 2013 3:49 am

Glad to see the project has been resurrected, downloading now. :)
Questions? You should join my Discord group
Helpful SHK Sites: SHK Advanced Guide | SHK Strategy
Check out my Stronghold Kingdoms tutorials on YouTube | RazingHell

ImageImage

User avatar
Nublet
Posts: 95
Joined: Thu Sep 13, 2012 6:36 am

Re: *New Release SHK Stocks v1.5 Beta 1* Market Tool

Post by Nublet » Mon Apr 15, 2013 4:03 am

A few things:

-You can double click an item in the parish list to load its prices, or click on it and click load
- Clicking the resource button next to the price will give you the best buy / sell for that specific resource reflecting a profit loss or gain and by how much.
- Best price list gives you the entire list of everything and it's best prices buy/sell regardless if you are losing profit or not

-Nub

User avatar
Nublet
Posts: 95
Joined: Thu Sep 13, 2012 6:36 am

Re: *New Release SHK Stocks v1.5 Beta 1* Market Tool

Post by Nublet » Mon Apr 15, 2013 4:06 am

DavidSpy wrote:Glad to see the project has been resurrected, downloading now. :)
Hey David, Can I get a sticky for both programs?

-Nub

User avatar
DavidSpy
Posts: 7163
Joined: Wed Oct 26, 2011 1:08 am
Location: WI, USA
Contact:

Re: *New Release SHK Stocks v1.5 Beta 1* Market Tool

Post by DavidSpy » Mon Apr 15, 2013 5:36 am

I don't see why not, yours seem to be quality utilities.
Questions? You should join my Discord group
Helpful SHK Sites: SHK Advanced Guide | SHK Strategy
Check out my Stronghold Kingdoms tutorials on YouTube | RazingHell

ImageImage

User avatar
Nublet
Posts: 95
Joined: Thu Sep 13, 2012 6:36 am

Re: *New Release SHK Stocks v1.5 Beta 1* Market Tool

Post by Nublet » Mon Apr 15, 2013 6:16 pm

Development Progress update 4/15/2013
- OCR
---I have successfully achieved reading from the screen and performing an OCR on parish prices, However one problem I am running into is the background image used behind the price values
mess with 9's 6's and 0's I am working on trying to clear that up or writing an algorithm to replace the characters with the correct ones.

I am hoping to achieve this:

When you click the trade button on the parish, my program will click each tab and read the prices of all resources and update them into the SHK Stock program
giving a semi automatic price update of all your parishes you are trading with in the area.

User avatar
thekpd
Posts: 791
Joined: Sat Jan 08, 2011 1:56 am
Location: Rochester NY

Re: *New Release SHK Stocks v1.5 Beta 1* Market Tool

Post by thekpd » Mon Apr 15, 2013 9:54 pm

I look foreward to seeing a final result.
I'll download it and mess about with it for sure :)

User avatar
Nublet
Posts: 95
Joined: Thu Sep 13, 2012 6:36 am

Re: *New Release SHK Stocks v1.5 Beta 1* Market Tool

Post by Nublet » Wed Apr 17, 2013 4:20 am

Ok, I am about to release v1.6 sometime today.

This version will include-

Auto import of parish prices per tab (Resources,Food,Weapons,Honor Goods)

User will need to setup location through training the program, basically you need to "Set Resources" then right click and hold your mouse over the Resources tab
and then you will get a confirmed location recorded.
You will do the same for the rest.

Then the user will need to put the "OCR" reader box over the parish price list.

You will only need to do this one time for each time you use the program.

Then you can just open a parish of your choice in trade, type the name of the parish in the Parish name box and select "Update" for each resource tab And prices will automatically imported

Current Known Bugs (Beyond my control)
Sometimes the OCR cannot decipher a 9, 5, 8 or 0 and sometimes will not recognize the selected box. This is due to the hard to see text on the potato sack linen background
User will just need to change that value after reloading the parish from the list.
The OCR code is complex, The image is captured and inverted in color and converted to gray-scale so OCR can work nicer. I nearly beat myself to death trying to get it perfect.

Other bugs are just features I will like to add or fix up better.


Image

kaesekuchen
Posts: 6
Joined: Fri Mar 29, 2013 11:24 am

Re: *Update 4/17 New Release SHK Stocks v1.6 Beta 2* Market

Post by kaesekuchen » Thu Apr 18, 2013 12:06 pm

Hello,
first off: Good work! I was meaning to write a tool like this myself, but i just hadn't had the time to do that.
But i know how annoying OCR related programs are to write, i coded one myself for a poker bot some time ago, but instead of using a generic OCR library i wrote specific pattern matching algorithm that catered to the need of the OCR related tasks for that bot.
(That being, detection of suites, oncard values, and of course digits and letters for bet value/player names etc.)

I hope constructive criticism is welcome, because i have a few things to point out:

- World Selection
I've seen in your todo list that you are already working on a world selection list, which is a very good feature to implement down the road.
I'm guessing you are going to achieve that with the help of a filter or tag to the Parish names.

My thought on this: It would be helpful, if one could distinguish different counties/provinces/countries within one world as well.
This is aimed at those, that can't trade world wide yet, but have villages in multiple "trade zones" (Or for that matter want to limit the radius of parishes eligble for the "best price trade" algorithm, to optimize trade routes time efficiency wise)

- OCR
As you as well pointed out, the OCR sometime fails to recognize certain digits. For this, it would be helpful, if you could check the input boxes, after a scan, if they contain numerical values.
If they don't exclusivly contain numeric values, but for instead 's' or 'a' characters, you could highlight that field somehow, so that one sees right away, that you have to manually put in the correct value.
You are probably already/still working on that matter, but for now this would help in terms of usability.

- Trade time
This is probably something not too urgent at the moment, more of a "nice to have" feature :)
You could scan the travel time as well, and factor these into the "best price" algorithm as well. But i'm guessing that occured to you already as well :)

-Additional Thoughts/ question to the ocr
I don't know how exactly your ocr is implemented (obviously), but i was wondering if you get any additional information to the detection results as well.
For example: If the ocr results a certain string for an input image, does it have some sort of probability/level of correctness value attached to that?

Just for those 10 digits 0 to 9 it might be more feasible to try to match those directly with a pre recorded pattern of the digits 0 to 9.
But once again, don't want to step on your toes here, these are just some thoughts that were going through my mind testing your program and recollecting the thought process i've undertaken when developing my poker bot :)

Again, thanks for putting in the effort to bringing this program to us. I appreciate it, because i know, that this sort of software can drive you mad from time to time during development :)

And thanks for reading my thoughts :)

keep up the good work!

regards
kaesekuchen

User avatar
DavidSpy
Posts: 7163
Joined: Wed Oct 26, 2011 1:08 am
Location: WI, USA
Contact:

Re: *Update 4/17 New Release SHK Stocks v1.6 Beta 2* Market

Post by DavidSpy » Thu Apr 18, 2013 3:54 pm

Just remember guys, the use of bots is against the game rules. I know the implemented OCR isn't being used for gameplay automation but still, it's a thin line. I think it's safer not to mention bots at all.
10. Bots

Players may not use any form of bot, 3rd party tool or script tool for Stronghold Kingdoms. We ask players to inform Firefly Support of any tools they discover that may allow players to cheat.
http://www.strongholdkingdoms.com/GameRules.html
Questions? You should join my Discord group
Helpful SHK Sites: SHK Advanced Guide | SHK Strategy
Check out my Stronghold Kingdoms tutorials on YouTube | RazingHell

ImageImage

Post Reply

Return to “Game Help”