SRL Archive - S.M.A.R.T.

Simba does not recognise SMART client


HT BaaFly

2014-09-05 11:44:44

Hello guys,
There is this problem that has been bugging (no pun intended) me for a while. Sometimes my smart client loads up fine but simba does not seem to recognise it. It doesn't seem to me to be triggered by anything specific. I do think it could be because my scripts run for long (16+ hours) and that simba doesn't clear up previous clients to it fails to load data on any new clients. This is all a hunch and I have no evidence to back it up. I do, however, have this screen shot of simba's console when this problem happens. Hopefully it helps in some way

Edit: I'm willing to pay anyone if they give me solid, long term solution. :)
[ATTACH=CONFIG]23962[/ATTACH]

Edit: 2nd pic:
[ATTACH=CONFIG]23968[/ATTACH]

Incurable

2014-09-05 12:01:18

Are you making sure that you're using the correct display mode in RS for the SMART plugin that you're using? The reason I ask is because I was having the same issue (though I never checked the SMART console) when I started using the DirectX plugin instead of OpenGL and it was just my RS settings not matching SMART.

I'm going to go ahead and assume that this isn't your problem, but it's worth asking just in case you've forgotten or something. :p

Olly

2014-09-05 12:21:38

Got java7 (32bit)? That's where i have the most success with SMART.

HT BaaFly

2014-09-05 12:45:01

I'm 100% sure I'm using the correct settings because this problem doesn't always happen. My scripts usually run for a good 16 hours before this bugs stops them.

@Olly I don't really know for sure. My computer is 64 bit can it run 32 bit java?

Olly

2014-09-05 15:56:42

From: HT BaaFly
I'm 100% sure I'm using the correct settings because this problem doesn't always happen. My scripts usually run for a good 16 hours before this bugs stops them.

@Olly I don't really know for sure. My computer is 64 bit can it run 32 bit java?


Of course it can! I recommend you grab 32-bit java and try. :)

HT BaaFly

2014-09-06 02:23:48

From: Olly
Of course it can! I recommend you grab 32-bit java and try. :)


I'll try 32 bit later but so far I understand that code written in 32 bit can run just as good in 64 because Java is made to run on a variety of machines. I'll try it later just for the sake of it :P

Still open for solution. I can pay up to 100$ for a decent fix

Edit: In addition, if anyone here has solid Java knowledge and knows SMART fairly well, I have a few proposals for development. Willing to pay dearly. Add htbaafly (skype) for further info!

The Mayor

2014-09-06 03:01:37

It could be because SMART spawns in safemode for some weird reason (happened to me a few times). It might spawn in directX mode fine for 3 or 4 sixHourFixs but then it randomly loads safemode. I'm sure this is a Jagex server-side issue.

HT BaaFly

2014-09-06 03:55:18

It just happened again. The game settings is normal (not in safemode).

Here's its picture:

[ATTACH=CONFIG]23967[/ATTACH]

The Mayor

2014-09-06 04:14:12

From: HT BaaFly
It just happened again. The game settings is normal (not in safemode).

Here's its picture:

[ATTACH=CONFIG]23967[/ATTACH]


Post a pic of your graphics settings (from the login screen) when this occurs.

HT BaaFly

2014-09-06 12:10:31

[ATTACH=CONFIG]23971[/ATTACH]

Nothing unusual here

Brandon

2014-09-06 14:14:04

Pairing problem with SMART. It could be that SMART is taking extra long to pair for some reason and it times-out.. Not sure but it definitely is failing to pair or "spawn" a new client.

The only way to fix it is to re-write the pairing logic OR get rid of EIOS.

Getting rid of EIOS means that SMART will be ran inside the simba process and simba tabs would be useless (like in the old days).. It means that you'd be using 1 Simba per SMART and not 1 tab per SMART..


Changing the pairing logic would be difficult IF you did not understand how SMART itself works. You'd have to understand specifically this file: https://github.com/BenLand100/SMART/blob/master/src/SmartRemote.cpp and its accompanying header file. Possibly SmartJNI.cpp as well..

It's not hard but it is messy.


You could get SMART to use WinAPI-Events instead of sockets for pairing on Windows. There are many other options and many ways to make SMART's pairing fail less or not fail at all.. but all of them require you to understand the above file(s) or at least how SMART works so you can make changes.

It says you have 9 clients spawned btw.. Guessing that somehow none of the files were un-mapped or cleaned-up properly. Unless you actually have 6-9 SMART's spawned.

HT BaaFly

2014-09-06 15:12:43

From: Brandon
Pairing problem with SMART. It could be that SMART is taking extra long to pair for some reason and it times-out.. Not sure but it definitely is failing to pair or "spawn" a new client.

The only way to fix it is to re-write the pairing logic OR get rid of EIOS.

Getting rid of EIOS means that SMART will be ran inside the simba process and simba tabs would be useless (like in the old days).. It means that you'd be using 1 Simba per SMART and not 1 tab per SMART..


Changing the pairing logic would be difficult IF you did not understand how SMART itself works. You'd have to understand specifically this file: https://github.com/BenLand100/SMART/blob/master/src/SmartRemote.cpp and its accompanying header file. Possibly SmartJNI.cpp as well..

It's not hard but it is messy.


You could get SMART to use WinAPI-Events instead of sockets for pairing on Windows. There are many other options and many ways to make SMART's pairing fail less or not fail at all.. but all of them require you to understand the above file(s) or at least how SMART works so you can make changes.

It says you have 9 clients spawned btw.. Guessing that somehow none of the files were un-mapped or cleaned-up properly. Unless you actually have 6-9 SMART's spawned.


Oh man, that's a bunch of things that I don't understand :S. I guess I'll have to learn basic Java and delve into SMART a bit, unless anyone is willing to help out of course.
BTW, I do actually have 11 clients running so freeing clients is not the issue. But what do I know?

Edit: Running more than one simba is not a problem since I already use one simba for each account

Brandon

2014-09-06 18:07:16

I'll see what I can do.. I don't want the reward. It'll be done on my own time however, I'll monitor this thread and post if I get anything done. I've been working on other projects for other games.

SMART's not hard to modify. I thought you already knew Java. Maybe I'm mixing you up with someone else.

In the mean while, check your firewall, check to see if there are any left over SMART.pid files. Check the CPU & Memory usage since you are running 11 clients. It could possibly be that the usage is 100% and that it times-out when trying to map too many clients. Could also be not enough memory.

But again, these are all just guess work. How exactly did you manage 11 clients in any mode other than Safemode btw?

It doesn't seem to be a mode problem seeing as you are in other modes and that it prints that it isn't pairing.

HT BaaFly

2014-09-07 02:23:06

From: Brandon
I'll see what I can do.. I don't want the reward. It'll be done on my own time however, I'll monitor this thread and post if I get anything done. I've been working on other projects for other games.

SMART's not hard to modify. I thought you already knew Java. Maybe I'm mixing you up with someone else.

In the mean while, check your firewall, check to see if there are any left over SMART.pid files. Check the CPU & Memory usage since you are running 11 clients. It could possibly be that the usage is 100% and that it times-out when trying to map too many clients. Could also be not enough memory.

But again, these are all just guess work. How exactly did you manage 11 clients in any mode other than Safemode btw?

It doesn't seem to be a mode problem seeing as you are in other modes and that it prints that it isn't pairing.


Thank you thank you thank you :) Glad to have someone working alongside me on this!
You just mentioned memory so I quickly glanced at my task manager and found it to be 95% used of 8 gb :O. This could be the problem so I'm going out today to buy another 8. PID files are all stacked up here so I'll delete them but it's really annoying that I have to close all simba else I would get access errors.
Now with the 11 clients, I found selecting the lowest cpu option in runescape settings really lowers game fps and thus cpu usuage. The game used to take anywhere from 7-13% of my cpu, now it takes around 5-10%. Also my cpu is i7 4790k oc'd to 4.6 ghz so this plays a huge part. But in any case, this is still too low considering other bot clients - mainly injection- are capable of running 20+ with no problem. That's why I'm looking for a developer to tell me if SMART can be made more efficient in any way

Brandon

2014-09-07 02:57:21

From: HT BaaFly
You just mentioned memory so I quickly glanced at my task manager and found it to be 95% used of 8 gb :O.

mainly injection- are capable of running 20+ with no problem. That's why I'm looking for a developer to tell me if SMART can be made more efficient in any way



SMART could only be written more efficiently IFF you get rid of its memory map (basically get rid of Simba and turn SMART into a java-bot). For every SMART client you spawn, it has to map a block of memory for Simba to read & write to + memory to hold the pairing information: https://villavu.com/forum/showthread.php?t=109870&p=1304286#post1304286

Assuming SRL-6 and 800 x 600 size clients, it'd roughly map:


(800 x 600 x 4 x 2) + 28 + 4096 bytes. That's only the memory BOTH Simba & Smart SHARE.. On the SMART only side, it has to allocate 2 BufferedImages which would take up (800 x 600 x 3 x 2) additional bytes to hold the client's image and debug image. That is shown here (client):

https://github.com/BenLand100/SMART/blob/master/src/Client.java#L134

and here (debug):

https://github.com/BenLand100/SMART/blob/master/src/Client.java#L344



It's actually not that much memory "considering how it all works". If there are zombie clients or problems freeing clients, then this can be a problem.


SMART wouldn't work WITH Simba if it weren't for these files/allocations. It copies the Client image to the Simba shared memory and copies Simba's debug image to SMART's internal memory.


Knowing that it does that much work and allocates 2x ([debug + client for Simba/SharedMemory] + [debug + client for SMART/Internal buffers]) the amount of images/buffers as the injection bots, and still runs as well as it does, I'd say it's as efficient as it will ever get.. It is impressive to say the least.


Still.. Not exactly sure how you got SMART into Direct-X mode with 11 clients. IIRC, the limit was 4 :S Either way, it's still pretty impressive. Are you able to Spawn MORE in Safemode?


You can't thank me until I actually do something.

Ian

2014-09-07 03:29:29

From: Brandon

Still.. Not exactly sure how you got SMART into Direct-X mode with 11 clients. IIRC, the limit was 4 :S Either way, it's still pretty impressive. Are you able to Spawn MORE in Safemode?


iirc the 4 Dx/OpenGL client limit is because of the way Jagex handles the caches. If you can get the caches to be created in different locations than each other you can have as many as you want. One way someone found was by having the files stored on separate user accounts using batch files (so 4 SMARTs per user account). A way that @The Mayor; found was by using a sandboxing program that presumably separated the caches in a similar manner.

TylerT

2014-09-07 03:45:15

From: BMWxi
One way someone found was by having the files stored on separate user accounts using batch files


Tutorial by @Gunner here.

HT BaaFly

2014-09-07 04:23:42

From: Brandon
SMART could only be written more efficiently IFF you get rid of its memory map (basically get rid of Simba and turn SMART into a java-bot). For every SMART client you spawn, it has to map a block of memory for Simba to read & write to + memory to hold the pairing information: https://villavu.com/forum/showthread.php?t=109870&p=1304286#post1304286

Assuming SRL-6 and 800 x 600 size clients, it'd roughly map:


(800 x 600 x 4 x 2) + 28 + 4096 bytes. That's only the memory BOTH Simba & Smart SHARE.. On the SMART only side, it has to allocate 2 BufferedImages which would take up (800 x 600 x 3 x 2) additional bytes to hold the client's image and debug image. That is shown here (client):

https://github.com/BenLand100/SMART/blob/master/src/Client.java#L134

and here (debug):

https://github.com/BenLand100/SMART/blob/master/src/Client.java#L344



It's actually not that much memory "considering how it all works". If there are zombie clients or problems freeing clients, then this can be a problem.


SMART wouldn't work WITH Simba if it weren't for these files/allocations. It copies the Client image to the Simba shared memory and copies Simba's debug image to SMART's internal memory.


Knowing that it does that much work and allocates 2x ([debug + client for Simba/SharedMemory] + [debug + client for SMART/Internal buffers]) the amount of images/buffers as the injection bots, and still runs as well as it does, I'd say it's as efficient as it will ever get.. It is impressive to say the least.


Still.. Not exactly sure how you got SMART into Direct-X mode with 11 clients. IIRC, the limit was 4 :S Either way, it's still pretty impressive. Are you able to Spawn MORE in Safemode?


You can't thank me until I actually do something.



You'd be surprised even more if I tell you that this rig is handling 11 clients on only 60-70% cpu. So it has the potential to run 15 at a time. Regarding software mode, I'd assume it would require more processing time so cpu percentage usage per bot would be higher. My understanding is that OpenGL and DirectX modes share the workload across CPU and GPU, instead of just letting the CPU do all the work. i.e. having a software mode client would probably use more cpu.
You're talking here about memory efficiency right? What I meant was CPU efficiency. Memory is not that big of a problem to most people since you can almost always add more sticks if you run out of space. What I meant is that would it be possible to cut back on various parts of smart - cpu intesnive calculations, if there's any - and still have smart run the same way as it does?

Now I wish I had continued past scripting for rsbot and actually learned java, would have saved me from a lot of trouble lol

edit: something I've noticed that maybe of significance is that some of my clients spawn with a lower FPS rate than the others. I've hypothesized that it maybe due to my GPU's memory running out leading to "extra" clients being giving less memory to work with

Olly

2014-09-07 10:05:55

From: HT BaaFly

edit: something I've noticed that maybe of significance is that some of my clients spawn with a lower FPS rate than the others. I've hypothesized that it maybe due to my GPU's memory running out leading to "extra" clients being giving less memory to work with


I sometimes get that when i just launch one SMART, it gets stuck in like 10 fps when 90% of other smarts launch in 50 fps.. :s

HT BaaFly

2014-09-07 10:24:51

From: Olly
I sometimes get that when i just launch one SMART, it gets stuck in like 10 fps when 90% of other smarts launch in 50 fps.. :s


Grhh it's so frustrating! I've been thinking about creating a function that reads fps each time the client spawns or respawns. Pretty crazy now that I think about it… have you found a way to recreate this bug? I've heard talk that it's runescape sided :S

lanadekat

2014-09-13 07:06:33

From: The Mayor
It could be because SMART spawns in safemode for some weird reason (happened to me a few times). It might spawn in directX mode fine for 3 or 4 sixHourFixs but then it randomly loads safemode. I'm sure this is a Jagex server-side issue.

Yup I got the same problem