www.ClassicTW.com
http://www.classictw.com/

File lock bug used in tag and planetary invasion.
http://www.classictw.com/viewtopic.php?f=45&t=35675
Page 1 of 1

Author:  Micro [ Sat Mar 07, 2020 9:24 pm ]
Post subject:  File lock bug used in tag and planetary invasion.

This is a known bug in TWGS v2.x and v1.x, although I know of no known cases where is has altered the outcome of a tournament in v1.x

It caused a huge issue in a tournament in 2016, and we have seen it in other tournaments on TWGS v2.x, but I do no think it i a specific v2 ONLY bug. The basic premise for "Tag" is:

1. Player One is griding and laying a fig in each sector.
2. Player Two gets into a sector ahead of player One.
3. Player Two lays a fig in the sector at the exact same time.

TW2002 locks the sector record for one of the players, and kicks both players out or the game when the second player tries to lock the sector. Player Two relogs and kills player One before he figures out what happened. I have seen really old "Tag" scripts, so I know it predates v2, but I can't get these scripts to work for me.

Something similar is happening during planetary invasions. With photon scripts being run by both teams and re-loaders and everything happening at the same time, the database gets locked and all players are kicked out of the game. There is no way to know if the invading team is intentionally triggering the bug, but it gives them an obvious advantage since their players are most likely at the keys. Re-login scripts will not fire because you are NOT disconnected. You are kicked to the game menu which will not time out and you will never re-login till you are at the keys.

I have never been able to reproduce this bug running TAG or Invasion scripts personally, so any information regarding this bug should be sent to jpritch@eisonline.com for documentation. I spoke with JP on Discord about the bug, and he told me he would give it top priority when he gets to a point he is able to work on Classic TWGS/TW2002. At this time he is not able to compile the source code, but that may change at some point in the future.

Author:  Hammer_2 [ Sat Mar 07, 2020 11:47 pm ]
Post subject:  Re: File lock bug used in tag and planetary invasion.

I've always felt it was also a weight of numbers issue.

Meaning the defenders have 4-5 people in sector, and we have many next door. I've played dozens of games with few people in the game, where I'd send in 1-2 people at same time, and have 1-2 defenders firing, and nothing every happened. WHile in tournaments with a lot of people, we've had issues.

The one that occurred in ICE 2020 had very little happening in reality. I had sent in a number of people to die on your figs.

The last time I sent in, it was just me, no photons etc. I literally just sent a long macro to go in, attack alot and die.

Author:  Micro [ Sat Mar 07, 2020 11:53 pm ]
Post subject:  Re: File lock bug used in tag and planetary invasion.

Hammer_2 wrote:
I've always felt it was also a weight of numbers issue.

Supposedly "Tag" works with just two players, but I scripted two players in a sector. picking up and dropping figs, and never hit it. I think there must be a very specific timing to it.

Author:  Star Killer [ Sun Mar 08, 2020 12:27 am ]
Post subject:  Re: File lock bug used in tag and planetary invasion.

Micro wrote:
This is a known bug in TWGS v2.x and v1.x, although I know of no known cases where is has altered the outcome of a tournament in v1.x

It caused a huge issue in a tournament in 2016, and we have seen it in other tournaments on TWGS v2.x, but I do no think it i a specific v2 ONLY bug. The basic premise for "Tag" is:

1. Player One is griding and laying a fig in each sector.
2. Player Two gets into a sector ahead of player One.
3. Player Two lays a fig in the sector at the exact same time.

TW2002 locks the sector record for one of the players, and kicks both players out or the game when the second player tries to lock the sector. Player Two relogs and kills player One before he figures out what happened. I have seen really old "Tag" scripts, so I know it predates v2, but I can't get these scripts to work for me.

Something similar is happening during planetary invasions. With photon scripts being run by both teams and re-loaders and everything happening at the same time, the database gets locked and all players are kicked out of the game. There is no way to know if the invading team is intentionally triggering the bug, but it gives them an obvious advantage since their players are most likely at the keys. Re-login scripts will not fire because you are NOT disconnected. You are kicked to the game menu which will not time out and you will never re-login till you are at the keys.

I have never been able to reproduce this bug running TAG or Invasion scripts personally, so any information regarding this bug should be sent to jpritch@eisonline.com for documentation. I spoke with JP on Discord about the bug, and he told me he would give it top priority when he gets to a point he is able to work on Classic TWGS/TW2002. At this time he is not able to compile the source code, but that may change at some point in the future.


Is JP giving any kind of time table for his return to this...When I last talked to him he said he was going to start on it soon. that was 2 years ago..

sk

Author:  Micro [ Sun Mar 08, 2020 2:14 am ]
Post subject:  Re: File lock bug used in tag and planetary invasion.

Star Killer wrote:
Is JP giving any kind of time table for his return to this...When I last talked to him he said he was going to start on it soon. that was 2 years ago..
No, he is working on taking his flight model from Star Citizen and implementing a space combat game in the Trade Wars universe using ships made out of Voxels, but you didn't hear that from me.

Voxel graphics give it kind of an ANSI feel in three dimensions. This is not JP's work, just something I found with google as an example of voxel artwork:

Image

Of coarse, Mindcraft is the game that made voxels popular!

Author:  Vid Kid [ Mon Mar 23, 2020 6:02 am ]
Post subject:  Re: File lock bug used in tag and planetary invasion.

The 'TAG' scenario you mention was producible in v1
and was reported to J.P. when the 15 bugs were revealed.

And when this was done , it ended Team Kraaken.
I became the bad guy for saying anything that could give a team an advantage , although we ALL claimed we would never do such things.

I did let the cat out of the bag , now I'm the bad guy .. go figure.
I wanted a FIXED v2 w/o any bugs.

Just sorry ALL bugs were not fixed at that time.

Author:  Micro [ Mon Mar 23, 2020 3:46 pm ]
Post subject:  Re: File lock bug used in tag and planetary invasion.

Vid Kid wrote:
I wanted a FIXED v2 w/o any bugs.
That would be really nice. Maybe if JP's new project does well he will be able to invest some time in Classic TradeWars.

The main question i have is weather or not the "Tag" bug is being used intentionally by the invading team, or if it is a sequence of defensive moves that is actually causing the file lock. I tend to think it is the latter, since Hammer says he just did a solo PE the last time the bug was triggered.

Author:  Hammer_2 [ Mon Mar 23, 2020 5:15 pm ]
Post subject:  Re: File lock bug used in tag and planetary invasion.

Micro wrote:
Vid Kid wrote:
I wanted a FIXED v2 w/o any bugs.
That would be really nice. Maybe if JP's new project does well he will be able to invest some time in Classic TradeWars.

The main question i have is weather or not the "Tag" bug is being used intentionally by the invading team, or if it is a sequence of defensive moves that is actually causing the file lock. I tend to think it is the latter, since Hammer says he just did a solo PE the last time the bug was triggered.


We should try and replicate this. I've seen this happen surprisingly irregularly to be honest. I don't play many games mind you, but when I Was playing in casual games almost never saw this. Only in tournaments or larger games.

The previous time it happened to me was some time ago and that one I definitely did do Mass Enter Xport - however this time, I was sending people through solo.

Just having 20+ accounts on the TWGS might assist in causing the lock. Who know's how the main game loop works?

Author:  Shadow [ Mon Mar 23, 2020 10:51 pm ]
Post subject:  Re: File lock bug used in tag and planetary invasion.

Hammer_2 wrote:
Micro wrote:
Vid Kid wrote:
I wanted a FIXED v2 w/o any bugs.
That would be really nice. Maybe if JP's new project does well he will be able to invest some time in Classic TradeWars.

The main question i have is weather or not the "Tag" bug is being used intentionally by the invading team, or if it is a sequence of defensive moves that is actually causing the file lock. I tend to think it is the latter, since Hammer says he just did a solo PE the last time the bug was triggered.


We should try and replicate this. I've seen this happen surprisingly irregularly to be honest. I don't play many games mind you, but when I Was playing in casual games almost never saw this. Only in tournaments or larger games.

The previous time it happened to me was some time ago and that one I definitely did do Mass Enter Xport - however this time, I was sending people through solo.

Just having 20+ accounts on the TWGS might assist in causing the lock. Who know's how the main game loop works?


It was absolutely reproduced, intentionally, multiple times by one of the teams in ICE a few years back, I think maybe 2016 or 2015?

At this point I don't remember who the guilty parties even were, but they used it intentionally on several occasions in that tourney.

Author:  Micro [ Tue Mar 24, 2020 5:38 am ]
Post subject:  Re: File lock bug used in tag and planetary invasion.

Hammer_2 wrote:
Just having 20+ accounts on the TWGS might assist in causing the lock. Who know's how the main game loop works?

It is more a matter of having more than one player in the same sector at the same time. I don't know the details of the main game loop, but TWGS launches an independent process for each player. Each instance is a separate copy of TW2002 and they communicate by a shared memory file. Only one player can modify a database record at the exact same time. The fix would be for the next player to wait for the record to unlock, in a queue of sorts. Instead of kicking the players out of the game there should just be a delay of a few milliseconds for the second player until the record unlocks.

Author:  Shadow [ Tue Mar 24, 2020 7:03 am ]
Post subject:  Re: File lock bug used in tag and planetary invasion.

Micro wrote:
Hammer_2 wrote:
Just having 20+ accounts on the TWGS might assist in causing the lock. Who know's how the main game loop works?

It is more a matter of having more than one player in the same sector at the same time. I don't know the details of the main game loop, but TWGS launches an independent process for each player. Each instance is a separate copy of TW2002 and they communicate by a shared memory file. Only one player can modify a database record at the exact same time. The fix would be for the next player to wait for the record to unlock, in a queue of sorts. Instead of kicking the players out of the game there should just be a delay of a few milliseconds for the second player until the record unlocks.


Well, that's not really the answer - using thread safe code is the answer - which under the covers involves some degree of locking, yes, but it can be done in near real time. A single, truly multithreaded application would be the way to go.

A few milliseconds means the different between life and death with modern network ping times. That is an eternity in twx. My scripts that use timing techniques for things like foton and gridding operate at the microsecond level.

Author:  Micro [ Tue Mar 24, 2020 8:12 am ]
Post subject:  Re: File lock bug used in tag and planetary invasion.

Shadow wrote:
Well, that's not really the answer - using thread safe code is the answer - which under the covers involves some degree of locking, yes, but it can be done in near real time. A single, truly multithreaded application would be the way to go.
We are not dealing with threads here. Each player is in an independent process. Unlike threads, each process has no idea what is happening in another process. Shared memory files are no longer used in modern programming, but that is how TW2002 was written. The HVS MBBS version is very different and might be thread based. MBBS games are written as .dll files that are loaded into the BBS. I will have to fire up my MBBS and see how many processes it is using per player.

Shadow wrote:
A few milliseconds means the different between life and death with modern network ping times. That is an eternity in twx. My scripts that use timing techniques for things like foton and gridding operate at the microsecond level.
IMO that is not really how the game is supposed to be played. Photon hits should not be based on whoever has the best ping. I like the delay features that JP added to version 2, but everyone screams bloody murder if you turn them on. I also agree with Cruncher that planets should not be able to move faster than ships. Silly Me!

Author:  Shadow [ Tue Mar 24, 2020 8:22 am ]
Post subject:  Re: File lock bug used in tag and planetary invasion.

Shadow wrote:
A few milliseconds means the different between life and death with modern network ping times. That is an eternity in twx. My scripts that use timing techniques for things like foton and gridding operate at the microsecond level.
Micro wrote:
IMO that is not really how the game is supposed to be played. Photon hits should not be based on whoever has the best ping. I like the delay features that JP added to version 2, but everyone screams bloody murder if you turn them on. I also agree with Cruncher that planets should not be able to move faster than ships. Silly Me!


Well, now there are two of you that agree on that point. Keep waiting long enough and maybe that will be a majority :) Or start turning on delays and banning mobile planets and we'll get to that level of players *really* fast.

With the exception of people like Hammer (who just buys a local VPS and has the best ping times from his client anyway), there should not be significant difference in ping times with modern broadband. The issue isn't ping times, it's coding ability - the good scripts that use timing and prediction generally aren't public. Which some will consider unfair, but being a better coder, or a better player, or having more time at keys, are all "unfair" -- it really comes down to the players who are most committed end up winning the most.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/