Haxball Hack Script

0 views
Skip to first unread message

Margit Szermer

unread,
Aug 4, 2024, 9:16:08 PM8/4/24
to diobrowdija
Mygame consists of two sphere (a player controlled sphere and an object sphere). Much like the game haxball, I am trying to write a script that applies a force or impulse to the other sphere when the player controlled sphere is both in contact with it, and the user pushes the space bar. I have attempted the following, but get no effect when I try it in the game.

Hi. I am making a game like haxball. I need to drag and shoot the ball but I have a problem, the ball doesn't act normal for the remote players. On the master client, the ball acts normal, while it acts weird on the remote players' screen. When the master client drags the ball, or shoots, the ball action is exactly how it has to be, but when I try to drag/shoot the ball the ball is weird. When I drag it, it is literally resisting against my player, the ball doesn't want to move, but it moves a bit, then resists again and moves again. I have seen some topics where we need to use something like PRC or something like this but I didn't get how to use it. Also I don't even know what the solution is right now. After days of work, I wanted to ask here finally. What should I do to sync the ball normally? I know lag and undeterministic physics matter but I know in this case I am doing something wrong, and I suppose these thing are not the main problem here. There must be something I haven't applied. So what should I do? Thanks in advance.


One player has control of the ball and sends the position updates. Everyone else is just using those updates when they come in and place the ball accordingly.

If you don't transfer ownership, the ball will act up, when used by anyone but the controller.


Actually yes, kind of. Since it is a 2d football game (like haxball) they will fight for the ball. I am stuck at this point for days. I don't know if you know haxball, but you can check it for a minute and then eventually you will get perfectly what I want/ask.


First I instantiated the ball rather than using it as a scene object, but it had some problems. First, the ball was appearing for the local player only and there was a ball for each client. After that I created a singleton script for 1 ball instance but it did not solve the problem that only the master client had a ball in its screen. The ball has photon view, transform view and rigidbody2d view components. Then I simply converted the ball to a scene object instead of a prefab. Now there is 1 ball but the movement is not perfect for each client. I was reading some topics and the documentation but I really didn't understand what I should do. Can you explain/show me what I have to do?


Explaining this here is sadly a bit out of scope as PUN 2 doesn't have the foundation to implement this interaction well. PUN does neither have a tick based engine (so input / reactions are imprecisely timed by definition), nor does it use the send rates I'd recommend for this kind of action.


You may want to look into Fusion. It has one authoritative client and this controls the physics. Everyone else is sending input and gets the results from the authority. This is a much better architecture for this case.


Disclaimer: Fusion is in beta currently. The APIs may still change and the docs are known to be lacking in detail and ease of use. Still, Fusion is a much better choice for this type of game, than PUN 2 is (where problems will show up much later in the development, when you polish synchronization).


It's not that simple. Physics need to run at high framerates and any delay and correction is very annoying and visible. So lag and network variance are hard to hide and the results get pretty unpredictable in many cases. Fusion syncs input to a host and the state back to all players. This is at least a consistent result.


I was making an python program that executes a java script after loading a webpage it is a web based api where we can execute javascript commands through console of your browser (f12) ( api documentation)

This executing gives back an array, I just want to get this output of execution (the array) to be print. the code i used is given below. the time delay of 15 seconds is used for solving an captcha which have to do manually. executing getPlayerList(); command will give back you a list of players that is currently playing.


But if you have absolutely the requirement to execute the javascript function which is present in the loaded page, you may achieve this by use of PyQt and QwebView class, with something like this:


I have a script that installs tomcat on an offline PC, including all dependencies of tomcat in the script. I need to make the script work on double clicking like windows since most who use the script will not be familiar with Ubuntu.


For GNOME users: the option to run a script by double-clicking it has been removed from Nautilus as of late 2020, following this bug report, enforcing the alternative #2 described in the bug report (right-click the script / click on "Run as a Program" from the context menu) as the only mean to run a script directly from Nautilus (the script must still be executable in order for this to work).


As a workaround, you can create a minimal .desktop file that will run the script, so that by double-clicking the desktop file the script will be run (again, the script must be executable in order for this to work):


To avoid that, maybe the most elegant solution is to get a pop-up window with a question like "What do you want to with that file: Run or edit?" (similar to what you have in other file managers like PCManFM and Nemo) when clicking that file - by using Zenity: here.


Optionally, and maybe preferably, in order to hide such options for all text files except the executable ones, a way is to restrict appearance use to .sh files (or .py files if the case, etc), under "Appearance conditions":


I struggled for ages with this, trying to find out how you can click (or double-click) an executable item and get it to run, without further questions. I looked at all the stuff under Nemo Edit --> Preferences. The answer is actually very simple, and set up for you... I don't know whether this applies solely to Mint.


On the desktop, right-click and choose "+ Create a new launcher here". One of the simplest imaginable dialogs then follows, where you have to choose your executable file, and whether you also want to create a new item in the Start menu, i.e. to run using exclusively keyboard.

3a8082e126
Reply all
Reply to author
Forward
0 new messages