LANing X3TC: work in progress. help me out with Project LANX

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Acer777
Posts: 15
Joined: Mon, 8. Aug 11, 16:46

LANing X3TC: work in progress. help me out with Project LANX

Post by Acer777 » Wed, 28. Sep 11, 17:02

K guys i know this seem impossible and farfetched but its true I’m working on a LAN function for X3TC called Project LANX. I’m using VB.NET to send data and variables to other computers. this is made possible by the scripted editor been able to write to TXT files.

This is what is gana be possible:
:arrow: To give another player money from your account
:arrow: To give ships to another player
:arrow: To give stations to another player
:arrow: To give Items to another player

Sure these are not too bad to be able to do but i want to sink to games so that you can see the other player flying around and the two games are the exact same... But the problem is that my knowledge of the script editor is very basic
so i need some help and ideas on how to get 2 games to be the same.

the way i do it with VB.NET is get the script editor to send\write info to a TXT then VB.NET reads this TXT and sends what’s needed to the other computer so VB.NET acts as a sever almost

If you want to contact me my email is jowacer -AT THE DOMAIN- gmail.com

:!: if you want to LAN X3TC with your friend as much as i do then help me out.
Strangers have the best candy :)

User avatar
Ikaruga
Posts: 372
Joined: Fri, 30. Jan 04, 15:26
x3tc

Post by Ikaruga » Wed, 28. Sep 11, 21:17

:o Wow ! Multiplayer for X3 ?! That's a totally new idea on the forums and has absolutely never been discussed before ! Just try and use the search function and you'll see that no one has talked about it yet ... :roll:



(I was sarcastic, by the way...)
If brute force doesn't solve your problems, then you aren't using enough

Treelor
Posts: 312
Joined: Mon, 5. May 08, 01:25
xr

Post by Treelor » Wed, 28. Sep 11, 22:12

That being said, gratuitous use of force pos and externally handled networking functions might make some kind of rudimentary (albeit horridly slow and inefficient) LAN multiplayer possible. Lets not shoot this kind of thing down right off the bat.

My knowledge of the engine is rudimentary myself, however take a look at the scripts from other projects (namely, that one ingame IRC window doodle) and see what they do to interface the script engine with the game. After that, its just looking at the different commands and seeing how they work together.

User avatar
Jack08
Posts: 2971
Joined: Sun, 25. Dec 05, 11:42
x3tc

Post by Jack08 » Wed, 28. Sep 11, 22:38

Treelor wrote:That being said, gratuitous use of force pos and externally handled networking functions might make some kind of rudimentary (albeit horridly slow and inefficient) LAN multiplayer possible. Lets not shoot this kind of thing down right off the bat.

My knowledge of the engine is rudimentary myself, however take a look at the scripts from other projects (namely, that one ingame IRC window doodle) and see what they do to interface the script engine with the game. After that, its just looking at the different commands and seeing how they work together.
Ive seen this topic many, many times... and each time it all comes to the same conclusion:

The X3 Script Engine is not powerful enough nor has enough direct access to the game to syncronise two games to the point at witch they both look the same

Nor does it have the direct access nessasary to make another players ship appear fluidly in the game universe, as Treelor Commented, it will look sloppy and slow at best

There is also another problem, even if you manage to come up with a way to sync the two games, the ammount of data you need to pass in and out of the game constantly will overload the script engine to the point where it causes other scripts to start stalling and ships to stop moving compleatly (0m/s bug), this isnt even a network issue its a engine limitation because the only way to get data in and out is via log/t files, and disk io is expensive.

All that being said... We, The X-Timelines Team do plan on adding some multiplayer features to our mod(and have since we started the mod), but i dont have the information at the moment to be able to release as to exactly what it will be, as we havent yet decided how it will work, however it will most likely all be trade related if we can deal with the savegame paradox's.
Image
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

User avatar
s9ilent
Posts: 2011
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Wed, 28. Sep 11, 23:19

*jedi wave*
You want to do this in c# and not vb. vb can go about it's business, move along, move along

Striker304
Posts: 890
Joined: Fri, 26. Mar 10, 22:15
x3tc

Post by Striker304 » Wed, 28. Sep 11, 23:34

There was a project in the german forums, also about a TC-multiplayer. According to what they said, they had even made it possible for two players being in the same sector with their ships... but unfortunately they stopped working on it.

The principle itself is quite simple:
Get the position of ship A, get it's rotation, shields, weapons and so on, put all that data into a textfile, send it to player B, and then in player B's game you create a ship, move it to the position defined in the textfile, with the right rotation, shields, etc... and then you have the very basics...

Fighting with lasers should be impossible, though. That's because you cannot find out the position of a laser bullet using SE or MD.

mfg
Striker

shilhi
Posts: 640
Joined: Sun, 15. Apr 07, 23:28
x3tc

Post by shilhi » Thu, 29. Sep 11, 03:04

Ikaruga wrote::o Wow ! Multiplayer for X3 ?! That's a totally new idea on the forums and has absolutely never been discussed before ! Just try and use the search function and you'll see that no one has talked about it yet ... :roll:



(I was sarcastic, by the way...)
He said he's working on lan. The threads I've seen have been asking for multiplayer in other X games.

User avatar
em3e3
Posts: 2102
Joined: Tue, 15. Aug 06, 00:04
x3tc

Post by em3e3 » Thu, 29. Sep 11, 08:04

Something like this has been suggested before. Probably the most likely form of multiplayer based on the current X game engines. Show a demo/working example, and you'll get more support.
8^)

Online Complex Calculators - X3:TC • X3:R • X2
Online Ship Compurator - X3:TC

bolgimo
Posts: 20
Joined: Thu, 3. Jun 10, 08:21

Post by bolgimo » Thu, 29. Sep 11, 14:28

you could use the JSON library scripts to read and write objects as JSON to text files on the local machine, then run a helper client or daemon push and pull these JSON objects to a webserver. it wouldn't be a true multiplayer but it would enable dynamic content between players.

example flow
player bolgimo loads his saved game up and undocks from argon equipment dock in argon prime in buster sentinel with 6 pacs and fight command 1
1. script captures this and exports me as a json to my local output file:

Code: Select all

object {
        created: timestamp in UTC
        guid: whatever
        ship {
                pilot: bolgimo
                id: ss_sh_a_m4_3
                equip [
                        ss_ware_sw_fight_1,
                        ss_laser_pac,
                        ss_laser_pac,
                        ss_laser_pac,
                        ss_laser_pac,
                        ss_laser_pac,
                        ss_laser_pac,
                ]
         }
}
2. helper daemon sees the object file has changed, reads it in, checks the guid as new, POSTs it to http://whatever.xserver:80/
3. another player's daemon GETs the server file and sees the new JSON on the page, saves it to the local input file
4. this player's x3tc then reads the JSON in and creates a buster with fight software mk 1 and six pacs and a pilot named bolgimo, undocks it from argon equipment dock in argon prime


this could be expanded on to include some sort of job, details about the player, what he/she gets up to in a game, etc. could even group up objects with particular pilots, put in their stations and other things. would allow players to chat in reasonably close real time, could even establish online bulletin boards and auction centres in game. while you wouldn't have direct control over someone else's universe, you could certainly see some interesting situations appear in your own, trade rare items, swap well-trained marines or Lucike Traders, have other players fit out ships for you, maybe even sell off completely built complexes to other players.


text should be fairly trivial to output from the game through log files. getting external text back into the game might be iffy; if an external process modifies a text file in the /t/ folder, will a script load this from the file again or does it cache it in memory

Acer777
Posts: 15
Joined: Mon, 8. Aug 11, 16:46

Post by Acer777 » Thu, 29. Sep 11, 16:24

k it seems im not getting alot of support on this... but i can understand why.

you guys say that the script will over flow thats y i want to use vb to send and collect all the data.

i was not aware that alot of people tryed this and faild.

Im a very advanced user of VB.NET but when it comes to the script edditor Im clueless so if I use VB to help then im sure it will work.

at the very least i want to come with a function to give player money, ships, wares and so on like a trad function. would you guys be happy with that
Strangers have the best candy :)

User avatar
Jack08
Posts: 2971
Joined: Sun, 25. Dec 05, 11:42
x3tc

Post by Jack08 » Thu, 29. Sep 11, 16:34

Acer777 wrote:k it seems im not getting alot of support on this... but i can understand why.

you guys say that the script will over flow thats y i want to use vb to send and collect all the data.

i was not aware that alot of people tryed this and faild.

Im a very advanced user of VB.NET but when it comes to the script edditor Im clueless so if I use VB to help then im sure it will work.

at the very least i want to come with a function to give player money, ships, wares and so on like a trad function. would you guys be happy with that
You need to use the script engine to export the data to VB, thats what i said will cause problems, Passing to much data out of the game via log files is extreamly performence hungry - a few mesages every now and then is fine, but the amount you would need to sync a game compleatly would overflow the script engine.


Passing Money, Ships and Wares shouldnt be a problem :) but syncing a whole game is rather difficult/impossable
Image
"One sure mark of a fool is to dismiss anything that falls outside his experience as being impossible."
―Farengar Secret-Fire

Acer777
Posts: 15
Joined: Mon, 8. Aug 11, 16:46

Post by Acer777 » Thu, 29. Sep 11, 16:52

i was thinking of just making the script edditor write varribles to a .TXT
then VB.net just reads it or will this be a problem
Strangers have the best candy :)

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Thu, 29. Sep 11, 17:11

Acer777 wrote:you guys say that the script will over flow thats y i want to use vb to send and collect all the data.
"Cargo" objects like money and wares are no problem whatsoever but if you want to do a convincing job of it, you have to include ships and stations.

Ships are the problem.
If they participate in combat then you can not reliably detect how often exactly they shoot, at what, and how much of that will hit.
You can get part of that info if you reach all the way into the bottom level combat scripts but then you really should know what you're doing there.

Scripts can only detect / set positions at 1m accuracy.
All mobile objects exist and move with an internal accuracy of 1/500 m.

"Simulated" movement often looks jerky as a result and you'll have a hell of a time getting the target lead prediction to properly lead your "simulated" moving object.

You also have to update damage on all objects because different clients would have different amounts of random bullets hitting a target.
By necessity, some players may end up "lag killed" by having the "true" damage updated from the outside when they got hit for far less on their screen.

To do anything combat related you must have such "simulating" scripts running at very high frequencies and update a lot of objects.
It is likely that you'll end up having FPS issues...

Acer777 wrote:i was not aware that alot of people tryed this and faild.
You might even find something related in the X3 Multiplayer FAQ.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Acer777
Posts: 15
Joined: Mon, 8. Aug 11, 16:46

Post by Acer777 » Thu, 29. Sep 11, 18:17

k it looks like it would be VERY VERY hard if not impossible to create a LAN with X3TC but im not gana give up just yet.

i would like to know if a simple function to trade ships,items,money and stations with other players, what do you guys of a function like this.
this is what im planing to do but with no vissuals , so you wont see the other player and what his doing.

another thing another thing like if you could see the stations other players build since they dont move.

please let me know what you guys think
Strangers have the best candy :)

User avatar
Gazz
Posts: 12430
Joined: Fri, 13. Jan 06, 17:39
x3tc

Post by Gazz » Thu, 29. Sep 11, 19:46

To repeat, simple trades that are not "real time" like combat are no problem whatsoever.

Every thing in X3 is defined by 2 numbers. Maintype and subtype.
You never need to mess around with ship names or string comparisons of any sort.

Even ship "mods" like engine tunings are merely wares in the cargo hold, defined the same way. MT, ST, amount.

You need an interface to do the transfer, write it to a log file, and import it to X3 via textfile.

I just have my doubts about how attractive that is going to be.
And when players use different mods, you make a bloody mess of things because the wares and ships mean completely different things.
My complete script download page. . . . . . I AM THE LAW!
There is no sense crying over every mistake. You just keep on trying till you run out of cake.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”