Question on Traceline Systems

Mindless

New Member
Reaction score
4
Hi everyone,

I'm trying to make a FPS shooter game in SCII Editor. I want to create a system that processes unit's missiles and moves them accordingly. For example, I want to create a Rocket Launcher that is able to launch missiles and make it explode upon the first thing it hits, and shotgun bullets that travel at infinity speed, so it will just instantly hit anything in the direction it is going.

Can anyone help me start this, like giving me some concepts to start thinking about? Or introduce me to a good tutorial on this subject?

Any help would be appreciated.
 

Sensang

TH.net Regular
Reaction score
7
Hi everyone,

I'm trying to make a FPS shooter game in SCII Editor. I want to create a system that processes unit's missiles and moves them accordingly. For example, I want to create a Rocket Launcher that is able to launch missiles and make it explode upon the first thing it hits, and shotgun bullets that travel at infinity speed, so it will just instantly hit anything in the direction it is going.

Can anyone help me start this, like giving me some concepts to start thinking about? Or introduce me to a good tutorial on this subject?

Any help would be appreciated.

if its supposed to be multiplayer, forget it cuz sc2 has 125ms minimum lag and a lot more if you play with more complex triggers. :banghead:
You have to add a behavior to the missiles that searches for nearby units every x (i think the least is something about 0.125) seconds, and when it found one it will destroy itself and damage the unit accordingly. > data editor
I think the proper way to do the targetting is by making the unit use an ability, targetting the point where your left or right mouse button (whichever fires the shot) just clicked. > trigger editor

Also possible to do it with more triggers and less data editor...

all in all thats a pain in the ass to do within sc2... unless theres something we dont know or theyre yet to release, dont put your hopes up. :nuts:

thats probable as far as you can get: http://www.thehelper.net/forums/showthread.php?t=150786&highlight=first+person+shooter
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
Now to get things straight:

The minimum lag you're talking about doesn't really have anything to do with triggers itself. It's input lag. That means it takes a certain time to convey your mouse/keyboard input to other players in the game. Until that has happened things won't start.
This lag is present in any game and heavily depends on the players and server. It's true that Battlenet enforces a minimum lag time though, which is used relieve the servers a bit.

I think what you want to say is the length of a game tick, so the minimum time a Wait command sleeps a trigger (because that's what's needed to make a smooth missile).
This minimum time is 0.0625 (unless you use a small bug) - and Data has the same implications. Minimum wait time on persistent behaviors is 0.0625 too.

I only know of one advanced tutorial for tracelines in custom script, but the concept is pretty easy.

JASS:
Local Variables:
    Missile = no unit <unit>
    MissileIsAlive = true <boolean>
    Angle = 0 <real>

Actions:
    Set Angle = Facing angle of Firing Unit
    Set Missile = Your new missile
    Set MissileIsAlive = true
    While:
        - MissileIsAlive == true
    Do Actions:
        If:
            Or:
                - (Missile) is dead
                - Number of enemy units in range of 0.5 of Missile greater than 0
        Then:
            - Set MissileIsAlive = false
            - Detonate missile!
         Else:
            - Set Position of Missile to Position of Missile shifted by 0.1 facing Angle
            - Wait 0.0 seconds


In words:
As long as the missile is alive we check if there are any enemies in close proximity of the missile. If yes then we detonate it. If not then we move the missile a little bit towards the direction the shooter was looking at and wait a little bit.
(waiting 0.0 seconds actually makes the game wait 0.03125 seconds, which is as low as you can go). To make the bullet go instatly you can just remove the Wait time completely.
 

Sensang

TH.net Regular
Reaction score
7
input lag? Well how come shooter games dont really have it?
Maybe its not the minimum lag. But then something else about the editor is fucked up in a way that makes it impossible to create a multiplayer shooter game.
0.0625 seconds means a maximum lag of 63ms.
maybe its them both added up together. But 125ms minimum lag is still crap...

Set Angle = Facing angle of Firing Unit

doesnt that mean it wont fire up? wouldnt matter if it was some 2D arcade game but wont work for a real shooter-like game.
 

Builder Bob

Live free or don't
Reaction score
249
input lag? Well how come shooter games dont really have it?

Because the games just display things differently.

In shooter games it is common to have the client act on your input right away and adjust what other people see later on. To make it look like other players walk smoothly, you client will assume they continue walking, even if it can't be certain. You might have seen players suddenly jump from position to position with seemingly no coherence. This can only happen because assumptions has been made that did not come true due to high latency.

Starcraft on the other hand makes sure what everyone sees is syncronized at all times. Every computer in a game has to recieve what one player does before the command is carried out. While this doesn't give you as tight control in games where you control one character, it is better for strategy games so you don't have units jump around.
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
input lag? Well how come shooter games dont really have it?
Maybe its not the minimum lag. But then something else about the editor is fucked up in a way that makes it impossible to create a multiplayer shooter game.
0.0625 seconds means a maximum lag of 63ms.
maybe its them both added up together. But 125ms minimum lag is still crap...



doesnt that mean it wont fire up? wouldnt matter if it was some 2D arcade game but wont work for a real shooter-like game.

There IS a minimum lag on battlenet and I think it's 125ms unless they've changed it again.
However, that lag is created because your input has to be sent to every other player (thus input lag). Triggers and Data indirectly suffer from that but ONLY if they're triggered by any player's input (e.g. pressing a button).
Directly Triggers and Data are only limited by the 0.06125s game tick. But for some reason they skip every second tick, making it 0.125s instead.

And yes, using the facing will make the missile not shoot up or down. If you want that you can use a vector (x,y,z position) or you can save th up/down angle seperately.
It's just a bit of math.
 

Sensang

TH.net Regular
Reaction score
7
Because the games just display things differently.

In shooter games it is common to have the client act on your input right away and adjust what other people see later on. To make it look like other players walk smoothly, you client will assume they continue walking, even if it can't be certain. You might have seen players suddenly jump from position to position with seemingly no coherence. This can only happen because assumptions has been made that did not come true due to high latency.

Starcraft on the other hand makes sure what everyone sees is syncronized at all times. Every computer in a game has to recieve what one player does before the command is carried out. While this doesn't give you as tight control in games where you control one character, it is better for strategy games so you don't have units jump around.

Id actually very much prefer the shooter way for strategy games... due to the fact that every unit gets ordered to do stuff there shouldnt be that much of a problem predicting units' path.
the input lag kind of means, you actually cant do things as fast as you can offline.
The other way around, lets call it output lag, seems like a better way to go.
But there are a lot of things blizzard screwed up especially about custom maps... guess we have to live with it :banghead:

Nevertheless. The most important thing is:

Multiplayer FPS/3PS arent viable within sc2
 

s3rius

Linux is only free if your time is worthless.
Reaction score
130
Actually the shooter way for Sc2 would be TERRIBLE. Predicting units' paths obviously isn't hard when you know their destination. But when you issue new orders to a unit you CHANGE the destination and thus the path.

Look at this image:
http://simplest-image-hosting.net/png-0-unbenannt49

This is how the shooter way works:

Image 1)
A unit (the circle) is assigned a location it should move to (the X) and starts moving.

Image 2)
While moving the unit gets a new target location (the red X) issued by the player. The new order is sent to all clients (= players in the game).

Image 3)
The new target order hasn't reached the other players' computers yet. Because of unit prediction the unit continues to walk towards the original target.

Image 4)
Now the order has reached the players' computer and calculates the unit's new position by looking at when the order was issued, where the unit should have been at this point and where it's supposed to go.
The result: The unit suddenly "teleports" from one place to another.

Targeting enemy units would be much harder and would create a lot of strange behavior (missiles suddenly flying in arcs, medivacs healing units which are way too far away in reality, etc etc).

Even worse:
Since the player who actually lags isn't affected by this, but only OTHER players we'd get a lot of cheaters who'd use up all their bandwidth by downloading/uploading something and abuse their "stuttering" to make it almost impossible to place spells/target units.

And the way information is processed and passed around would also allow hackers to develop new hacks.

Also: Input lag isn't a result of the way they did it. Input lag is ALWAYS there. It'd just get lower by using the "shooter method" but it wouldn't disappear.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top