This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Forcing the Remote Server to Host Bots
Hello Friends, Romans, and Countrymen, 

I'm currently hosting megaMek 0.44.0 on a Dell r610 (That's a Dual Xeon Server from 2014). the server is running ubuntu 18.04.2 LTS right now, and is exclusively controlled through SSH. The game itself runs Fine, mostly. 

Does anyone here know how to force the server to host the AI? It appears that whenever I add a bot, my local computer (not as capable of Ridiculous Multithreading) completely takes the burden on. 

My sincere apologies if this is the wrong place, but this seems like a feature we surely already have. 


Right now, I'm using a SSH client to -x into the server and have a gui locally (though i Do Not appreciate the additional load on the server's tiny, ancient GPU.)

If anyone has a better solution, Please let me know
I'm not sure if the server can run AI, but I think it can. But you can always test it. Big Grin

I'd test it by making a game with two clients connected to the server, one client leaves and you use the /replacePlayer command (/help replacePlayer if you don't know how to use it). Then you can see if the server takes the load or the other client. You could also connect a third client as an observer and then replace the last player and see if the two replaced players fight it out (TO THE DEATH!). I think you might even be able to specify a config file for the AI to use to change her personality. So either do my test and let me know the results or do your own and please let us know the results, for posterity of course.  Rolleyes

Second Question, GO:
Ya! Drop the gui. I use ssh into a machine running Lubuntu, so very similar to your set up. This is the script I use to start a dedicated server; modify it as you need (like port and memory). And remember to "chmod u+x" so you can execute it. Wink I can't remember if I use "screen" so I can detach the terminal so I can exit the ssh session or not; I'm thinking I don't since "nohup" might do that. I use to run it all the time, but had to take a long break to graduate. But that is done. This script doesn't need a GUI.


#Run this from the terminal using ./

nohup java -Xmx1024m -jar MegaMek.jar -dedicated -port 2346 &

# From the terminal: ps -aux | grep java
# This will tell you the ids and which java commands have been run.
# With the ids you can kill the process: kill ####
#   where #### is just the id from the ps command: the id is in
#   the second column after the user name (name is root, I think).
Through a bit more research (notably company-scale games to be Certain who has the brunt of AI calculations) I have found that the only way to give the Remote-server the responsibility of running an AI is through using -x Forwarding so that the "add AI" or replace user prompt is through itself.

Running /ReplacePlayer as a keyboard command causes a UI element to be drawn to the server, and kicking the client who dared to want an enemy.

Running /replaceplayer as a GUI shortcut makes the AI run locally.

Short answer: you cannot, as a client, Force your server to host it's own AI. You have to, through -x forwarding or direct server access, add the AI's to that machine, From that machine.

This exercise was also meaningless, ultimately. As the upsides of the server (see: 24 threads of parallelism) is wasted on the single thread task which is Princess's pathing AI.
Thanks for running the experiment and letting us know the results.

I hope you had more success on running the dedicated server without a GUI (question 2) than with the AI on the server.
(04-20-2019, 06:33 PM)Xenon54z Wrote: Thanks for running the experiment and letting us know the results.

I hope you had more success on running the dedicated server without a GUI (question 2) than with the AI on the server.

Running -dedicated was not an issue, but made little use of server resources and feels like a waste as things stand. I have a linuxbox with 48 GB of ram, I might as well use it to brute force some calculations.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unit Lists & Bots JPZX 2 2,744 04-13-2011, 01:33 PM
Last Post: Xenon54z

Forum Jump:

Users browsing this thread: 1 Guest(s)