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 The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/
  • The Helper The Helper:
    I think we need to add something to the bottom of the front page that shows the Headline News forum that has a link to go to the News Forum Index so people can see there is more news. Do you guys see what I am saying, lets say you read all the articles on the front page and you get to the end and it just ends, no kind of link for MOAR!
  • The Helper The Helper:
    Happy Wednesday!
    +1
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    Sticking with the desserts for now the latest recipe is Fried Apple Pies - https://www.thehelper.net/threads/recipe-fried-apple-pies.194297/
  • The Helper The Helper:
    Finally finding about some of the bots that are flooding the users online - bytespider apparently is a huge offender here - ignores robots.txt and comes in from a ton of different IPs

      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