Question on Traceline Systems

Mindless

New Member
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
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.
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
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
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.
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
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.
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:
    Friday Yay!
  • mgarcia mgarcia:
    did you guys catch Carl's interview? https://www.youtube.com/watch?v=kuHiMXABkGs
  • mgarcia mgarcia:
    he's the one that informed me about the DVD's working!
  • mgarcia mgarcia:
    he also mentioned the progress on the controllers!
  • The Helper The Helper:
    I did actually it was cool to see the NUON mention
  • The Helper The Helper:
    https://discord.com/channels/985377399338332202/985377399950696481 you can still use this chat too we are two fisted now :)
  • thewrongvine thewrongvine:
    costs me $80 to fill gas tank sad face
  • Ghan Ghan:
    Oof
  • The Helper The Helper:
    Yeah that gas is some expensive stuff :)
  • The Helper The Helper:
    ghan does not have to worry about it he has a tesla and I have a small tank so it does not cost me usually more than 50
  • The Helper The Helper:
    fyi Ghan we are getting an error trying to access stats or world editor tutorials Error 526 Ray ID: 72128c6bf99f6707 • 2022-06-26 02:35:15 UTCInvalid SSL certificate
  • Ghan Ghan:
    An artifact of switching to Cloudflare... the Let's Encrypt certs can't autorenew through Cloudflare.
  • Ghan Ghan:
    I got the forum updated before things expired but there were some other casualties.
  • Ghan Ghan:
    Everything should be fixed now....
  • The Helper The Helper:
    Thank you Ghan!
  • The Helper The Helper:
    Happy Monday!
  • The Helper The Helper:
    new NUON forum mod cubanral!
    +1
  • The Helper The Helper:
  • tom_mai78101 tom_mai78101:
    Started learning how to make tools-assisted speedruns, so I'm lately busy.
  • tom_mai78101 tom_mai78101:
    Here's my current project.
    +3
  • O Old Mountain Shadow:
    that was pretty good!
  • jonas jonas:
    really cool! I saw the game before but always thought it's just a half as good double dragon. Now I realize it actually has a lot of depth!
  • The Helper The Helper:
    I just saw a bunch of running and jumping past all the enemies look like it was scripted as he said I guess I should have watched the whole thing. I only got a couple of minutes in. You should post that video in the forum Tom
  • Darthfett Darthfett:
    "Hi in the chat!"
    +2
  • tom_mai78101 tom_mai78101:
    Currently busy with making the run even better, so I'll post that new one once I'm done. Right now, I had to modify the emulator itself, the tools that makes this video, and some RAM address disassembling / reverse-engineering to get the right values, and such.
    +1

    Members online

    No members online now.

    Affiliates

    Hive Workshop NUON Dome World Editor Tutorials

    Network Sponsors

    Apex Steel Pipe - Buys and sells Steel Pipe.
    Top