Mobile builders do not use their full build distance

Mobile builders do not use their full build distance

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Mobile builders do not use their full build distance

Post by Forboding Angel »

Imagine my surprise...

I have no idea what the calculation is, but it's some weird funky math. From what I can tell it almost seems like a curve? O_O!

Please put builddistance in elmos. Everything else is in elmos, and having builddistance in some weird other unit of measurement is not awesome.

From what I can tell, 850 builddistance is roughly equivalent to 500 elmos.
Last edited by Forboding Angel on 06 Apr 2012, 14:09, edited 1 time in total.
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Builddistance is not in elmos

Post by Jazcash »

Image

I have no idea where you got 500 from.
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: Builddistance is not in elmos

Post by Jazcash »

what the fuck am i doing with my life
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Builddistance is not in elmos

Post by Forboding Angel »

Despite myself, I laughed xD
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Builddistance is not in elmos

Post by knorke »

the big thing is a builder with builddistance=850, left to it is a unit whose weaponrange is 850.
holding down shift while mouse over the unit, both range are displayed:

Image
green = buildrange, red = weaponrange

sameenough.jpg
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Builddistance is not in elmos

Post by knorke »

what the fuck am i doing with my life
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Builddistance is not in elmos

Post by Forboding Angel »

And what did you do to get the build distance in a ring?

Did you actually check the distance?

Knorke... think it through. You're drawing the rings in elmos, grabbing the builddistance value from the unitdef, but that number is displayed in elmos! Of course it's going to match up!

If I tell it draw me a weapon range of 850, and then turn around and say, draw me a ring of x distance (x being the number in the unitdef), OF course they will match! Because you're just giving it the same number, twice. You aren't actually showing the real value!
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Builddistance is not in elmos

Post by knorke »

And what did you do to get the build distance in a ring?
spring displays it for immobile builders, just select something to build but do not place it.
Did you actually check the distance?
by comparing it to weaponrange and by looking at coordinates.

just post something where it does not work..?
Of course it's going to match up!
indeed it does \o/
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Builddistance is not in elmos

Post by Forboding Angel »

Image

Image

Image

Image

Image

Image

Image

Image

Image
^^ A split second later the nanoframe appears.

If I set the ring size to 1000 elmos, and builddistance to 1700, the corner of the new construction will touch the edge of my range ring.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Builddistance is not in elmos

Post by Forboding Angel »

knorke wrote:
And what did you do to get the build distance in a ring?
spring displays it for immobile builders, just select something to build but do not place it.
.. No it doesn't.

That would be a widget that you have.

Probably this one: http://springrts.com/phpbb/viewtopic.php?f=23&t=17520
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Builddistance is not in elmos

Post by knorke »

What are all those rings in funny colors? Maybe the wupget to draw them is wrong.
Anyway, watching some con waddle around building things is a bad way to test buildrange because it is not accurate.
Cons get too closer to construction site than needed, terrain height differences when buildRange3D=true, etc.
Why would one ever screenshot some text instead of linking to the whole unitdef.
That would be a widget that you have.
Probably this one: viewtopic.php?f=23&t=17520
That widget shows buildradius when placing startposition, something different. I can tell by actually having looked at the link.
Start BA, build a nanotower, type /luaui disable, hold shift and put mouse over the nanotower = green buildrange circle.
Or see the NOTA commander tower things.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Builddistance is not in elmos

Post by Forboding Angel »

Because it isn't committed, and much of the text is custom params for a widget.

Code: Select all

-- ring 1
                if customParams.ring1radius then
                    gl.Color(explode(',', customParams.ring1color))
                    gl.LineWidth(customParams.ring1thickness)
                   gl.DrawGroundCircle(x,y,z, customParams.ring1radius, 32)
                end
The widget isn't done yet (the boolean for whether the rings should show up all the time or just when the unit is selected isn't done yet). I also haven't commented it yet.

Since this stuff isn't committed, it's not in a state where you can easily test it, and for that matter, I doubt you have evo checked out anyway.

Since you won't stop coming up with total bullcrap until I show it to you, here it is: http://pastebin.com/Ldz3fFzf

The custom params are :

Code: Select all

ring1radius = "1000", --Using this one for buildrange
	ring1color = "1,0.5,0,0.8", --Orangeish
	ring1thickness = "1", --Normalish thickness
	ring1ShowOnlySelected = "true", --boolean If true, ring only shows when the unit is selected, if false, show all the time.
Showonlyselected switch doesn't work yet.

The unit def is here: http://pastebin.com/kg1r8DBG

But you're still missing the point about ranges being drawn. If you take the builddistance value from the unitdef, lets say 1000, and make a weapon on the same unit with a range of 1000, then you tell a widget to render the value of builddistance in elmos, of course they will match.

But that doesn't mean that the builddistance is actually a range of 1000 elmos.

Think it through.


Edit: I committed this stuff to evo svn. Take it for a spin, and be amazed.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Builddistance is not in elmos

Post by Forboding Angel »

knorke wrote:Start BA, build a nanotower, type /luaui disable, hold shift and put mouse over the nanotower = green buildrange circle.
Or see the NOTA commander tower things.
Yes because testing with either of those is a great idea because they don't have ANY TAisms.

Edit: I have committed everything to evo's svn, all current and the most up to date.

http://www.source.evolutionrts.info
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Builddistance is not in elmos

Post by knorke »

But you're still missing the point about ranges being drawn. If you take the builddistance value from the unitdef, lets say 1000, and make a weapon on the same unit with a range of 1000, then you tell a widget to render the value of builddistance in elmos, of course they will match.

But that doesn't mean that the builddistance is actually a range of 1000 elmos.
I did not use a widget to render the builddistance.
As said, range drawing stuff is in the engine. Since you do not believe it:
https://github.com/spring/spring/blob/8 ... andler.cpp
line 3639 or ctrl+f "draw build distance for immobile builders"

Also in first post you said "Everything else is in elmos" but now weapon ranges are wrong too? Obviously that can not be right.
Or put the unit at topleft map corner (0,0) and use the coordinates from tooltip. Well, maybe those are wrong too.
Trust nobody, question everything
The only thing certain is death eventually!

Image
Forboding Angel wrote:The unit def is here: http://pastebin.com/kg1r8DBG
buildDistance = 1700,
ring1radius = "1000", --Using this one for buildrange
shouldnt those be the same?
in svn they are different too.
Yes because testing with either of those is a great idea because they don't have ANY TAisms.
Damm TAisms make elmo sad
Image


just kidding, dsd is alright
Image
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Builddistance is not in elmos

Post by Forboding Angel »

Knorke, in order for builddistance to actually be 1000 elmos, I have to set it to 1700.

Have you not been listening?????

I even posted screenshots for you. Seriously... you can't possibly be this clueless.

How many times do I have to state the same thing over again a different way for you to get it?
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Builddistance is not in elmos

Post by knorke »

in order for builddistance to actually be 1000 elmos, I have to set it to 1700.
To you mean actual builddistance, because in your screenshots you only tested at what distance "the nanoframe appears", which is not nessecarely the maximum builddistance.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Builddistance is not in elmos

Post by Forboding Angel »

knorke wrote:
in order for builddistance to actually be 1000 elmos, I have to set it to 1700.
To you mean actual builddistance, because in your screenshots you only tested at what distance "the nanoframe appears", which is not nessecarely the maximum builddistance.
Yeah, I think builddistance is actually done from the center of the model that gets spawned, but a multiplier of 1.7 was the closest I could get and be accurate at short distances, and still accurate at long distances.

I made a video for you: http://www.evolutionrts.info/random/builddistance.avi

That should explain things nicely (8mb, xvid, 1080p)
Last edited by Forboding Angel on 06 Apr 2012, 13:35, edited 1 time in total.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Builddistance is not in elmos

Post by Forboding Angel »

OMG KNORKE, WE WERE BOTH RIGHT!

So on a whim, I decided to make my comm immobile and see what happened.

All of a sudden builddistance is in elmos and he has the full giant distance of 1700. Set him mobile, and it's my calculations I've been doing all along in this thread.

So turns out, we were both right and both wrong.

Wow, how the hell???
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Builddistance is not in elmos

Post by knorke »

Forboding Angel wrote:I made a video for you: http://www.evolutionrts.info/random/builddistance.avi

That should explain things nicely (8mb, xvid, 1080p)
It again only shows that mobile builders do not use their full builddistance but move closer than they need to.
It has nothing to do with "some weird other unit of measurement " being used for builddistance.

builddistance = 1000 on this unit.
Two units stand at left edge of map.
Tell unit to to reclaim a feature 1000 elmo away :arrow: it does so without moving.
Tell unit to build something 1000 elmo away :arrow: it moves forward much further than needed.
Image
So the unit has the full range, but prefers not to use it in this situation.
I think builddistance is actually done from the center of the model that gets spawned
The difference is much larger than just unit radius.
Guess it has to do with pathing, maybe roam/hold position makes a difference (did not test)
Or it was done so cons do not have to move all the time when building lines of stuff. (fold-unfold-fold-unfold-fold-unfold-fold-unfold etc)
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Builddistance is not in elmos

Post by Forboding Angel »

Yep, you're right.

Regardless, it needs to get fixed. Any of this behavior would have been a holdover from *A.

Additionally tag could be added to control how much closer the builder gets. You can't tell me that some funky lolmath is not being used to calculate that.

But regardless, this is a bug, plain and simple. Maybe not in the traditional sense, but a bug nonetheless.
Post Reply

Return to “Engine”