OnceBot - Elvenar Bot

ok , and the work its get the samples to identify the pixel pattern ? right ?

I dont know if the background its important , but if not i think the icons they use in their forum are the same , the dimensions and the colors look alike , and probably it will be easier to identify the pixels , they are in png.

This ones are 24x24 , and i think they are the same size that they use in the game .

And they have this 32x32 , but they seem to big compared with the game use.

 

ok , and the work its get the samples to identify the pixel pattern ? right ?

If you know a way how to continue from there, maybe. Otherwise I think the “get the samples” part is just a small part of the work.

With the current version, the approach is to find icons of finished productions in the games window and then click below them as the factories are expected to be below the icons.

In order to test and compare different versions of the icon-finding model, we can use a set of sample screenshots from the game. For each sample screenshot we define what icons should be found were. This set of sample screenshots along with the expected outcome of the icon search is the training set.

With the training set, we can compute a score for a model for finding the icons.

Using these scores, we can decide which icon-finding-model we choose out of a set of possible models.

Unfortunately i dont know the way.

Hello,

I am going to release all the source codes which are needed to adjust and build new versions of Oncebot. This also means that everybody will have access to the same tooling I used to make it locate the different icons ingame. At the moment I do not think I will have time to spend on testing myself. Nevertheless, I will continue to assist by answering your questions on the BotEngine Forum. The release will happen when I get home around christmas.

Hi arcitectus i would be interested in taking a look at the source and seeing what i can add / improve it,

regards

spud

Hi Spud,

I will post a link to the source on the BotEngine forum. (The topics URL will change because we move to another forum software in the meantime). I will also add the source to the repositories on https://github.com/botengine-de

See you then

Michael

EDIT:
The project files have been published at GitHub - botengine-de/OnceBot: Bot for the game Elvenar.

1 Like

Hi Michael ill see you over there

cheers :slight_smile:

Hi Arcitectus

Do you get access to the project files ?

Hello Dreamsoul, I will upload the files next week.

Hello @Dreamsoul, @spudwood, the project files have been published at GitHub - botengine-de/OnceBot: Bot for the game Elvenar.

has anyone been able to get the bot working

The bot gathers coins for me but I can’t seem to figure out how to get it to interact with workshops. Is there something I need to do?

thank you for any help!

Looking at the previous discussion about the Elvenar bot, it seems like the bot does not find the workshops anymore because the icon floating above has changed. First thing I would try is to adapt the pattern matching to the current icons in the game.

I guess I need to learn how to do that. I can get a screenshot but not real sure how to edit anything since it’s just an .exe file for me.

For editing, you can edit the source code from GitHub - botengine-de/OnceBot: Bot for the game Elvenar., and then use the Build function in Visual Studio 2017 to build an .exe file from the source code.

For anybody working on adapting for changed icons and not yet familiar with the project structure, I recommend looking at the test results in test explorer of Visual Studio 2017. I guess there are tests already for the different icons the bot searches in the screenshots.

I’m trying to make sense of it but having a hard time so far. I’ll keep researching and see if I can figure it out.
Thanks.

has anyone been able to get the bot working again, i have no clue myself to how and to what to do to help upgrade the bot. im not tech savvy at all

Hi Michael
First thing. Thank you for the work you’ve done for the game community with this bot.
Some players may have knowledge to adjust the source code of the Bot, some people don’t know how.
I have some knowledge and I am willing to update the images and adapt the Pattern Matching but I am not sure what must be done.
I already did some updated to the bot. Buildings have different height. I did adjust the distance,
Vektor2DInt FromProductIconToBuildingOffset = new Vektor2DInt(0, 55);
and now is ok, for my current level.

I did the test ( One_match_for_image_containing_single_instance()) and i get error:

`Message: Failed for test case { patternId = workshop.product.ready, directoryPath = workshop.product.ready }`

I changed the icons in OnceBot\sample\single\workshop.product.ready and got it run, only after commenting out some ‘PatternElement’ in OnceBot.Service Config.cs But i get like 200+ icons found by the bot. I guess i am on the right track just don’t know how to adjust the PatternElement.
Please tell me what and how to change this:

new PatternElement {
	locationOption    = new[] { new   Vektor2DInt(13 ,12),new   Vektor2DInt(12 ,12) },
	ColorR  = 8,
	ColorG = 8,
	ColorB = 32,
},
  1. What is the locationOption and why some PatternElement have 2 Vektor2DInt and some have just 1 Vektor2DInt as locationOption?
  2. What are the RGB colors?
    Tel me if I’m wrong assuming that the colors are the pixel color of the locationOption.
    Please let me know how and what I must do to adjust the PatternElement.
    Is there a easy way to get those colors?

Thank you.

Welcome Liveland!

For context, I did not work on this for a long time, so I am not surprised if you remember some parts of the code bettern than me.

My guess from what I see here:
locationOption is a set of locations relative to the origin to the instance to be found. The pattern is only found there when there is a matching color at at least one of the locations.

Yes, those three color properties are referring to the pixel color in the screenshot of the game.

Is this PatternElement used together with other PatternElements to build a pattern?

Yes, you can use the color picker tool in paint.net:

https://i.imgur.com/t63b1uN.png

You can use this on a screenshot from the game and then copy the values displayed for R, G and B.

1 Like

I compiled the bot but get errors …

The reference assemblies for framework “.NETFramework,Version=v4.6.1” were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. OnceBot