Poll

Would this prevent virtually all lag regarding non-registered shots? Or am I talking about something way out of my league?

You know what you're talking about, and you've got something here, I like it.
4 (30.8%)
You know what you're talking about, but this would be useless.
2 (15.4%)
Out of your league, go play with your Gamemaker.
7 (53.8%)

Total Members Voted: 13

Author Topic: Possible lag prevention regarding bullets and grenades  (Read 1658 times)

0 Members and 1 Guest are viewing this topic.

Offline Mistercharles

  • Veteran
  • *****
  • Posts: 1371
  • +
Possible lag prevention regarding bullets and grenades
« on: June 15, 2006, 09:22:04 pm »
When a bullet in soldat "moves," in reality, its X and Y coordinates change. If a line is made that connects the point where the bullet is at, and where the bullet was one "tick" ago, a line is formed, in the direction of the bullet's "movement." What if, instead of the soldier colliding with the bullet or the grenade, he collides with that line mentioned earlier?
shoutout to m'boyz eagles_arrows, echo_trail, wraithlike, sadistatheart, chakapoko maker, jrgp, aznblood, chakra, keron cyst, et al, miss you, let's '#gather some day

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Possible lag prevention regarding bullets and grenades
« Reply #1 on: June 15, 2006, 09:36:56 pm »
I couldnt help but vote for option 3... lol.

Yeah that would kinda work, but I dont think its really needed...

Offline John The Engineer

  • Major(1)
  • Posts: 18
Re: Possible lag prevention regarding bullets and grenades
« Reply #2 on: June 15, 2006, 09:42:40 pm »
Um... no.  The "line" you are talking about can be thought of as the motion in which the bullet is travelling at a particular instance, (a tangent to its motion).  Your logic of registering a hit when the player collides with the "line" is flawed.  The "line" is not actually where the bullet is.

Offline Mistercharles

  • Veteran
  • *****
  • Posts: 1371
  • +
Re: Possible lag prevention regarding bullets and grenades
« Reply #3 on: June 16, 2006, 12:01:49 pm »
Never mind then. I was just thinking of when bullets go through people without hurting them, the ones in weapon mods that have bullets go 9000 speed. That would be the only instance where this would help.

*opens gamemaker*
shoutout to m'boyz eagles_arrows, echo_trail, wraithlike, sadistatheart, chakapoko maker, jrgp, aznblood, chakra, keron cyst, et al, miss you, let's '#gather some day

Offline zyxstand

  • Veteran
  • *****
  • Posts: 1106
  • Mother of all Bombs
Re: Possible lag prevention regarding bullets and grenades
« Reply #4 on: June 16, 2006, 12:53:58 pm »
The fact that the source-code isn't out (yet) means that you have no idea how Michal's game renders collision detection.  I'm sure Michal has given thought to everything and anything YOU can think of.  There are so many problems a programmer faces when trying to add a simple idea that hasn't been thought about very thoroughly (like yours) to the game.  No offense, but let's leave the coding part to MM...
Can't think of anything original to put here...

Offline Fraggy

  • Soldier
  • **
  • Posts: 164
  • Mecha 0_o
Re: Possible lag prevention regarding bullets and grenades
« Reply #5 on: June 16, 2006, 01:16:36 pm »
no thanks, its good the way it is..


Offline ramirez

  • Retired Soldat Developer
  • Camper
  • ******
  • Posts: 394
    • Soldat Central
Re: Possible lag prevention regarding bullets and grenades
« Reply #6 on: June 16, 2006, 01:35:31 pm »
The "line" is not actually where the bullet is.
True, but also not true.

In terms of computing, the bullet simply can not be in the every point of its motion if it travers at high speed. That would require way more game logic processing than necessary (you especially couldn't render all those frames in an acceptable timeframe!). Whereas if you "draw" a line from bullet's previous coordinates to the new ones, you get the motion of the bullet between its previous and current update. So basically this line IS where the bullet HAS been during its position change (although still not 100% accurate, but can be improved with interpolation). It's not flawed logic at all, and is a very common collision detection technique. In online game there can be some problems with lag, or packets not registering, however, especially with UDP since there's no way of knowing are packets lost or not because their arrival is not enforced, neither are their order. I don't really see this causing too much trouble though, unless someone is playing on VERY poor network, where a lot of packets won't go through. And even then there are means for the server to "fix" those problems (for example by interpolating the bullet coordinates to find more accurate course, if the bullet packets are sent often enough this isn't really necessary at all though).

Random rant over. Personally I am content with how Soldat does it now (like zyxstand said, we have no real way of knowing how it's done exactly, unless some of you are specialized in reverse-engineering). I have not noticed problems with non-modified weapons, and personally I wouldn't spend the effort needed to make the possible changes in the software to support collision detection for modified weapons and ligthspeed bullets, when that time can be spent for more useful things. In my opinion that is.