gemforce-team / wGemCombiner

Automatic gem combiner bot for GC:CS
MIT License
30 stars 8 forks source link

Upgrading / Delay Problem #29

Closed Majamulli closed 8 years ago

Majamulli commented 8 years ago

I have a suggestion / problem.

With ~30k mobs on the map, it's quite laggy and that makes it hard for the program to work properly. With the delay you can of course remove some of the potential problems, but sadly not all. I just tried to upgrade something and the first two steps are:

-Duplicate A1 -Upgrade A2

Between those two we have a one second delay. Sadly it's programmed that the mouse movement and the upgrade button are without a delay. What happened was that it duplicated A1 and then upgraded A1, because of lag the game didnt recognize the new mouse position yet before the upgrade happened.

My suggestion would be to make it possible to add a delay between those steps as well. It should remove a lot of the potential problems. As it is right now I almost never get the same result twice using the same upgrade pattern and base gem. It always has another final mana value. And it differs between about half of the value it should theoretically have and about 100x the value it should have. So the result really varies a LOT depending on which step bugs.

Would be awesome if the delay could be added! :)

RobinHood70 commented 8 years ago

I had experimented with that at one point, but it didn't seem to be necessary in further testing. It's entirely possible that I just didn't have enough lag in my game (less monsters, different Flash client, whatever). I can fairly easily re-add a delay there...or perhaps half the normal delay, since these operations tend to be less intensive than combining?

Majamulli commented 8 years ago

I guess half the normal delay would be enough. I tried it quite a few times and it's happening often. Adding it would be awesome :)

12345ieee commented 8 years ago

Please not mandatory, add an option if you have time, @RobinHood70

RobinHood70 commented 8 years ago

Yeah, that makes sense. I'll try to get on it tomorrow.

Majamulli commented 8 years ago

Awesome, thanks a lot! I will throughoutly test it and hope I can get consistant results with the added delay. If not I'll be back ;)

RobinHood70 commented 8 years ago

Okay, code changes have been uploaded.

12345ieee commented 8 years ago

You'll probably want to make a debug version for our friend @Majamulli to test, @RobinHood70, as I cannot do it now.

Majamulli commented 8 years ago

I wont have time to test it until thursday/friday due to an important exam. Once that's over I'll start another endurance and try the new delay and see how it works :) Thanks a lot!

Majamulli commented 8 years ago

I started another run after all and am now at the point where exactly the same thing as described happens. I would like to try out the new version, however, I have no idea how I can use it. Any help there?

RobinHood70 commented 8 years ago

Send me an e-mail at robinhood70@live.ca and I'll reply with a copy of the new program. My ISP is having a lot of Internet issues at the moment, so let me know if anything goes wrong.

12345ieee commented 8 years ago

So, @Majamulli and @RobinHood70 , what came out of this?

Majamulli commented 8 years ago

RobinHood70 sent me a version with the option of adding an extra delay after mouse move. I've been using that version for the past week and it's been perfect in any situation. The random weird combines are completly gone and I get the perfect results constantly.

A small issue is that the timer is not working properly. But as far as I am concerned I don't really mind that. I just add ~50% of the time in my mind and it's about right.

Awesome addition and I'm only using this new version cause it's just that much more awesome :)

12345ieee commented 8 years ago

I imagine @RobinHood70 forgot to account for this option when setting the timer, at least in your debug version.

@RobinHood70 : If you think the changes are significant, feel free to draft a new release (1.1.2). If you have problems with packaging send the the exe and I'll package it.

Majamulli commented 8 years ago

I would definitly add this in the new version. As it is right now it's an additional option that has to be manually enabled. There's no harm in addon it and it certainly helped me a lot and I think other people would also appreciate it :)

I didn't even know that it could be that great. I just assumed because of the lag it will become harder to combine properly and that I have to live with it until I personally saw the upgrade happening before the mouse movement was recognized. I could imagine that there's a few other people out there just assuming that nothing can be done about it and would be amazed to see that it can indeed be fixed :)

Makaifren commented 8 years ago

Is there someway I can get a hold of this new version? I'm having the same problems using Firefox via Armor Games in Windows 7. I'm certain most users having trouble just aren't coming here to create a github account so they can tell you about it.

Issues: 1: The longer the combining ( starting with 32 ), the greater a chance an action won't take place. I've never seen a 512 work, and I had to try the 256 about 6 times to get it to work. I end up with extra gems (sometimes 1, sometimes more) floating around and often a final gem that's a lower grade than it's supposed to be. In practice I'm limited to the 256* combines for the spec gem (time cost of retrying), and because of exponential gem costs I'm limited to 16* combine recipes (mana cost of retrying).

2: The number of actual combines isn't listed, so the 'cost' seems meaningless? (I don't mean to sound harsh) My gems cost 6 each, my combines are 48. When the cost says "2048x", I multiply by 6 that's 12288. Great I have 39k, no problem. I run out of mana before I'm 25% through. I have to restart-and-try to discover I only have enough mana for a 256x starting out.

@RobinHood70 As a fellow software engineer, might I recommend dividing the 'delay' between the number of actions taken each step? This way there is still one delay number field everybody will use, it won't slow down people who don't need it, and the time calculation won't need different logic. It would be an invisible upgrade that benefits everybody, and a user with extra gems can just increase the delay until it's reliable for them, as they already attempt to do. Very copacetic I think.

12345ieee commented 8 years ago

Let's start with saying that the in-browser version lags a ton, nothing we can do about it.

  1. People can run combines in the millions with no problems tweaking the delays, this seems more a tooltip or delay problem. I'm sorry, without further details not much can be done.
  2. I understand your point, your problem is that the cost of a gem is not combine_length*gem_cost, but combine_length*(gem_cost+gem_combination_cost). The combination cost is irrelevant in 99% of the cases, but not for the initial spec. This is a game basics, something the user is supposed to know by WL 2k+, when they start using wGC.
  3. Good point, consider helping the development if you think you can pull it off. I'm very very busy in this period and @RobinHood70 also is, probably.
Makaifren commented 8 years ago

1) The fix RobinHood already made would solve the problem I'm having. Tweaking the delay makes it better, but stops improving after 150. I'm certain that delaying the subactions is where the money shot is.

2) I probably failed to communicate properly. The problem is that the number of combines isn't mentioned, so I can't do the math. Your answer has me reflecting on the math though... Is the number of combines always the same as the number of gems minus 1, regardless of how they are mixed/upgraded?

3) I actually downloaded the source, but it's built with a visual studio 2014 I think. I only have 2008 and 2010. I started to reconstruct a 2010 project, but after a dozen compilation fixes I realized it depends on Dotnet 4.5+ which requires a newer dev studio, so I was facing an overhaul. It's expensive to buy visual studios versions, I use my work laptop so I can't just pirate it. I have up in defeat after realizing it. If it were build with 2005 CSharp, anybody could contribute, with no significant functionality loss.

On Feb 23, 2016 10:49 PM, "Andrea Stacchiotti" notifications@github.com wrote:

Let's start with saying that the in-browser version lags a ton, nothing we can do about it.

1.

People can run combines in the millions with no problems tweaking the delays, this seems more a tooltip or delay problem. I'm sorry, without further details not much can be done. 2.

I understand your point, your problem is that the cost of a gem is not combine_length_gem_cost, but combinelength(gem_cost+gem_combination_cost). The combination cost is irrelevant in 99% of the cases, but not for the initial spec. This is a game basics, something the user is supposed to know by WL 2k+, when they start using wGC. 3.

Good point, consider helping the development if you think you can pull it off. I'm very very busy in this period and @RobinHood70 https://github.com/RobinHood70 also is, probably.

— Reply to this email directly or view it on GitHub https://github.com/gemforce-team/wGemCombiner/issues/29#issuecomment-188107408 .

12345ieee commented 8 years ago
  1. Have a look at it
  2. Yes, that is the whole point, the number of combines is the number of gems minus 1 by construction, so I don't need to write it down explicitly. We should write it in the help, maybe.
  3. Visual Studio Community 2015 is free and it's what we use.
    The project used to use .NET 4.0, but @RobinHood70 wanted some new features of C# 4.5 and we upgraded. As there is a free compiler, I saw no problem in doing this.

Let us know.

Makaifren commented 8 years ago

1) Did you attach it or something? I could only download 1.1.1 release which had the problem from the site. If there are nightly or beta releases I couldn't see them. I looked. I'm wl 6000 BTW, but never reached endurance wave 999, and my diminishing returns on mana cap my killgems at about level ~83. 2) in help, and or a tooltip over the Cost would have helped me out, and I suspect I'm more mathematically inclined than others. But yeah, how to calculate the combination cost wasn't obvious until we talked about and I gave it a deeper think. I agree it's only an issue for the spec gem building early game, but for sure everybody wants the best they can make, and when they have enough to make it. 3) I didn't know that! I'll hop on that when I get into the office tomorrow provided there are no anti-corporate loopholes in the license. On Feb 23, 2016 11:46 PM, "Andrea Stacchiotti" notifications@github.com wrote:

  1. Have a look at it
  2. Yes, that is the whole point, the number of combines is the number of gems minus 1 by construction, so I don't need to write it down explicitly. We should write it in the help, maybe.
  3. Visual Studio Community 2015 https://www.visualstudio.com/it-it/downloads/download-visual-studio-vs.aspx is free and it's what we use. The project used to use .NET 4.0, but @RobinHood70 https://github.com/RobinHood70 wanted some new features of C# 4.5 and we upgraded. As there is a free compiler, I saw no problem in doing this.

Let us know.

— Reply to this email directly or view it on GitHub https://github.com/gemforce-team/wGemCombiner/issues/29#issuecomment-188129079 .

12345ieee commented 8 years ago

@Makaifren, so could you get it working? If you can compile the source you need no "nightly builds", as the tip of master contains the fix you need.

  1. I work on Linux, I don't have regular access to a Windows box (I usually use a VM). wGC compiles with Mono 4.2+, I can compile with Mono and give it to you, but it'd be much better if you compile it yourself from the source.
  2. Pull requests are welcome. Including the mana cost for a spec at fusion 45 could make sense, too (you cannot include the cost of a combine, as you can put a gem of whatever value to be combined)
  3. Again, let us know.
Makaifren commented 8 years ago

I got it to build by downloading the master code in a zip file. I built it around 8:15p last night. Armor games went down for 2 hours of maintenance last night from 8p to 10p.

I couldn't get the github installer to install as it's mid-install download of content dies before it reaches the end to actually install it. I'm a big mercurial/HG guy, I have very little experience with git, anything from the github tutorials I see a I'm also a decent fan of SVN.

I was able to get my first 512 combine working, but I'm in there office and they probably won't take kindly to my gemcraft activities. I can build so if it doesn't work I can tweak it and I'll let you guys know what my results are. Promise. On Feb 25, 2016 12:19 PM, "Andrea Stacchiotti" notifications@github.com wrote:

@Makaifren https://github.com/Makaifren, so could you get it working? If you can compile the source you need no "nightly builds", as the tip of master contains the fix you need.

1.

I work on Linux, I don't have regular access to a Windows box (I usually use a VM). wGC compiles with Mono 4.2+, I can compile with Mono and give it to you, but it'd be much better if you compile it yourself from the source. 2.

Pull requests are welcome. Including the mana cost for a spec at fusion 45 could make sense, too (you cannot include the cost of a combine, as you can put a gem of whatever value to be combined) 3.

Again, let us know.

— Reply to this email directly or view it on GitHub https://github.com/gemforce-team/wGemCombiner/issues/29#issuecomment-188961812 .

12345ieee commented 8 years ago

Great to know, @Makaifren ! To be honest, git is frightening to new users (I started hard with command line only), but Github's front-end is very nice and will make everything pretty easy, once you can install it (I have it installed in my win7 VM, it should work).

Have fun hacking on it.

Makaifren commented 8 years ago

Ok, so... after some careful diagnostics i realized the core problem was that using the 'Combine' button for G wasn't synchronous with the other actions, and additionally it appears that flash needs to recognize the '1' or '0' in the resulting keyboard messages coming down to it, indicating weather the key was already up or down at the moment it was pressed, which often gets confused by windows.

The key delay was easy; i increased the hardcoded Sleep(3) to Sleep(50) and my mixes were instantly 90% better. My 200-step combines were successful more often than failures. This give windows a chance to sort out the '1' and '0' parameter.

However, there was still the sticky issue with the Combine step. The combine is handled specially by GemCraft because it's not a singular operation. Sometimes the combine button wouldn't light up despite there clearly being a delay to allow for it. It only doesn't have to activate once, and the gems will swap places instead of fusing, and then the long chain is broken.

I suspect this might be a race condition bug in GemCraft as I imagine most users don't manually click the button evertime they combine gems, and usually I don't think users combine gems more than 10 times in a game usually. I don't think the bug is specific to the Combine button, I suspect it effects all of the control buttons.

So anyways, being a windows developer of forever years and being old as dirt, I decided to just revamp the whole remote control process to remove all the fun.

Now, GemCombiner behaves as follows: 1) All instructions flow at 5ms delay per step, with 100% mix success (only 1 gem remaining), no matter how many steps are present. I do recommend pausing the game though if you have 5000+ monsters out. 2) The application does not have to be selected, clicked, or even visible on screen, the mixing will continue at full speed until it's done. Which is usually less than 1 second so good look alt-tabbing out fast enough. 3) Removed the Internet Explorer fix as it's no longer relevant 4) Removed the Steam window detection as it's no longer relevant 5) Remove inter-move delay as it's no longer relevant 6) Removed the normal delay as it's no longer relevant. The application auto-synchronizes with each of GemCrafts 'combine' instructions, so the CombinePerformer always goes as fast as GemCraft can handle, without running more than a couple instructions ahead at a time.

It's lightning fast, and there are never ever gems leftover now on my slow Firefox flash plugin, so I can just focus on trying to get to wave 999 now.

I also installed Xmouse so I can power-bomb the waves. It kind of occurred to me that it would take very little effort to press '8' to 'repeat-bomb' the next available wave 100 times, with whatever gem is in the 12C. But that's beyond the scope of gemcombiner.

The changes are kind of extreme, so this code should probably be checked in on another branch in case there's some strange new issue like on Steam or Google Chrome or Browser X that I just haven't noticed yet.

While it works 100% of the time in firefox, and is well tested this far with no downsides, I don't want to be one of those "well it worked for me!" developers. So it's an alpha.

On Thu, Feb 25, 2016 at 4:36 PM, Andrea Stacchiotti < notifications@github.com> wrote:

Great to know, @Makaifren https://github.com/Makaifren ! To be honest, git is frightening to new users (I started hard with command line only), but Github's front-end is very nice and will make everything pretty easy, once you can install it (I have it installed in my win7 VM, it should work).

Have fun hacking on it.

— Reply to this email directly or view it on GitHub https://github.com/gemforce-team/wGemCombiner/issues/29#issuecomment-189053104 .

12345ieee commented 8 years ago

@Makaifren , I am very very impressed but I'm in a huge hurry and have not time to comment on several things.

Please do the following:

Thank you for your help.

If you have issues doing some of the above, let us know.

12345ieee commented 8 years ago

@Makaifren , this weekend I have some free time to look at this, otherwise I'll have to wait for next one (maybe). Can you please upload your code?

Thanks

Makaifren commented 8 years ago

I still don't know how, and I don't like replying to this email because apparently it's going into a post/forum who's topic doesn't match the conversation. Perhaps you can email me directly? On Mar 4, 2016 4:01 PM, "Andrea Stacchiotti" notifications@github.com wrote:

@Makaifren https://github.com/Makaifren , this weekend I have some free time to look at this, otherwise I'll have to wait for next one (maybe). Can you please upload your code?

Thanks

— Reply to this email directly or view it on GitHub https://github.com/gemforce-team/wGemCombiner/issues/29#issuecomment-192530568 .

12345ieee commented 8 years ago

No, I don't know your email address, because github acts as a middleman in the communication.

Please email me at: [REDACTED AFTER SUCCESSFUL EMAIL]

I'll then handle the git(hub) stuff

12345ieee commented 8 years ago

Sorry to bother you again, @Makaifren , but I received nothing till now and I still have no way to get your email. Two ways to solve this:

Sorry for all this, once we get this conversation going I'll clean up this issue.

12345ieee commented 8 years ago

We'll continue the discussion with @Makaifren in PR #30