« first day (2678 days earlier)      last day (2343 days later) » 

9:00 AM
1000 reputatioooon yay! :D
 
 
1 hour later…
10:12 AM
hohohohoho
how do you folks tweak trackpad scrolling?
 
Very easily
I get a mouse
 
@Bálint yeah, but I mean in-engine/game
 
user92578
what do you mean by tweak?
 
I am implementing the scrolling for a crude debugconsole and am currently playing with hard limits that scroll-input must pass to trigger caret repositioning; but I keep wondering if a gradient-function would work better
@Tyyppi_77 playing around with numbers until it feels right
 
user92578
10:27 AM
oh I've never done trackpad scrolling
 
I use GLFW so I get input from the trackpad without any much effort, so I use it. A mousewheel scrolling produces a clean 1 or -1 for scrollinput; while the trackpad gives me fractions. Currently I check if the input is greater than |0.05| which cuts off the weird little fractions and allows me to scroll less by going slower on the pad. But I would still like to try some complex gradient function - yet have no idea how to implement one, or if it's even worth the effort
 
I've used trackpad and mouse, and I've used different devices (Windows, Mac) on a whole range of different apps. From what I've seen myself and from others, the correct way to implement touchpad scrolling is in a way that resembles the native experience as much as possible -- or uses whatever everything else is doing to have that native experience.
For example, the Mac touchpad's scrolling is like panning a sheet around within the screen. A user would expect that across any app.
Some people have acceleration turned on; preferably your app should read for that.
I've used programs that attempt to interpret my scrolling in novel ways (read: inconsistent from my expectations) and it can be unpleasant.
 
very interesting
 
that might be difficult depending on what you're working in though
 
I will turn acceleration on/off to see how it behaves. Right now I just cut very low values based on me perceiving it as annoying that the littlest touch would scroll up/down a line
 
10:40 AM
(the worst experience I've ever had was a program that involved scrolling lots of lines of text, and whilst I have my mouse scrolling wheel -- not a trackpad -- set to scroll something like 3-5 lines of text per notch, the program insisted on only ever scrolling 1 row/line per notch. That program made my middle finger begin to hurt after a while, I'm pretty sure it was giving me RSI.)
 
interesting
 
@dot_Sp0T Ah! What usually gets used to resolve that is to have some tiny deadzone of movement. So, the scrolling motion gets completely ignored until half a line's worth of movement has been carried out. Then you start listening. To the user, the deadzone would hardly be noticeable.
 
I don't think it's possible to get these infos using GLFW
 
Half a line is small enough nobody notices, large enough that tiny movements don't do anything.
@dot_Sp0T yeah, if you can't get native information, that's a bummer but not too bad.
 
@doppelgreener seems I'll make a bugreport/feature-request
 
10:45 AM
IMO the best way to handle touchpad movement is to just pretend the user is shifting about a piece of paper with their fingers. That's the way most systems operate it.
Pieces of paper don't accelerate beneath our fingers, and have a little bit of inertia.
In lieu of being able to access what lets native applications implement touchpad scrolling, you could go for that, and introduce things like the movement deadzone to resolve issues you run into.
(this is similar to having a joystick deadzone, etc)
 
11:03 AM
@doppelgreener yeah i'm just doing that and having a miniscule deadzone near zero; seems to work fine so far. might further tweak it towards zero
While we're at it, can anyone tell me if redistributing a font with my engine counts as "...any document created using the Font Software"? As described in point 5 of this license
Or should I rather go to LAW.se?
 
@dot_Sp0T The intent of that license seems to be that: (a) you gotta distribute your font with this license intact, but (b) this license doesn't affect the thing you've written using this font. It's written assuming something classical like a set of pages, but in your case, the various places in your game where you've written something using the font would count as the "document".
In other words they're trying to say "this isn't a viral license, we're not insisting you also distribute your own stuff for free under the same license, otherwise nobody would use this."
[cough GPL cough]
 
Yeah I assumed so, there's also plenty redditors and other forums that say OFL fonts are fine and safe. I just like clarifying things and thought putting it into my own words and asking the query on here might give me some pointers. Seems using it and adding the author to the credits should do just fine
thanks
might be time to add a function returning a map of tools/software and their authors to my engine
 
@dot_Sp0T use it, add author to credits, repackage font file with your game, include a license document beside the font in your files OR in a legal section somewhere in your game. (but e.g. having a fonts folder with foobar.ttf and foobar-license.pdf would work)
> 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
 
So standard pretty much
thanks for helping me clarify!
 
Yup, nothing special
No worries
Consider asking this on mainsite too! I'll write this up in an answer to it.
We'll get some updoots and it looks like the kind of thing that'd be useful: "Can I use OTF fonts in my game, and how does condition 5 apply?"
 
11:18 AM
good idea, I'll ping you once it's done
 
Please do. I will BRB!
 
it's very interesting that tehre are question asking how to include them into engines like libgdx but noone caring about how to properly attribute
 
nwp
That's because including cool fonts improves your game and proper attribution doesn't.
(for some definition of "improve")
 
In my rendering loop my drawn models use different shaders and its own buffer objects. Could that be the reason, why the depth test isnt working ?
 
@FerencRozsa can but must not; have you turned on the respective flags?
@doppelgreener do you want to link to this in your answer, or should I include it into the q?
 
11:29 AM
@dot_Sp0T I think, link to that or the Adobe PDF.
I won't be linking to that page directly.
 
12:09 PM
That makes my first decent GDSE answer in a long while. :)
 
Yeah, you've done quite some edit work as well already!
One good Q&A closer to the goal
 
Woo!
@dot_Sp0T Thanks. :'D
 
@doppelgreener yw
 
 
1 hour later…
1:39 PM
Dev Blog- Colonial Sea Trader- Setting up the mission design. colonialseatrader.com/blog/index.php/2017/12/04/…
 
1:51 PM
Here is the code : https://hastebin.com/hoxojiluye.cs
I get an error: The variable renderer of DestroyObject has not been assigned.
You probably need to assign the renderer variable of the DestroyObject script in the inspector.
DestroyObject.Update () (at Assets/Scripts/DestroyObject.cs:20)
I don't know what to assign to renderer variable.
Can anyone please help me?
 
user92578
wasn't this covered yesterday
 
user92578
you assign the whatever renderer you have for the object
 
3:42 PM
.
 
nwp
..
 
you should do parabolic next time. 1 2 4 8 16
.
 
nwp
Nah, now it's ruined.
 
user92578
3:59 PM
exponential, right?
 
Maybe I was just doing a fibbonaci-like sequence starting from 1 and 2
 
user92578
I got stuck on the first one and gave up lol
 
I guess I'm becoming lazier this year. I've only done the first half of day 3, and I'm like, why...
The first one? That's easy...
 
user92578
yeah should've been
 
4:03 PM
All it is is comparing the pairs of values... My code for it is like 4 lines, for the first part at least.
Eh, 8, but...
sum=0
p=input[-1]
for c in input:
	if p==c:
		sum+=int(p)
	p=c
print (sum)
I can do the second part of day 3, but I just don't want to... Sigh.
Considering one line is for the input, and one for the output...
 
nwp
Yay python. I'm gonna start by #includeing a couple of megabytes of headers.
 
I pretty much always do python for this kind of stuff.
It's about the only time I use Python...
 
nwp
But python is so efficient at solving these. I want to play with expression templates instead to solve the challenge at compile time or something like that.
Which is probably one of my greatest flaws as a software developer.
 
@Tyyppi_77 the first one really..?
 
user92578
yes I didn't lie
 
4:17 PM
Sorry
I didn't get the energy to start number three so far
@PearsonArtPhoto does this properly wrap?
 
Yep.
I initialize the p to the value of the last index.
That way the first thing it tests is if the last index equals the first one. Then it checks every pair up until the two last ones.
 
clean
I did them so far using java, although I did them a tad overcompllicated I guess
 
I'm looking at day 3 right now, the second part.
I want to do it such that it's a mostly mathematical solution, but my mind is failing me...
 
I read spiral and spaced out on the first part...
 
The first part was fairly easy.
At least, to do it mostly mathematically.
	nSquare=int(sqrt(input-1))
	if nSquare%2==0:
		nSquare-=1
	rem=(input-(nSquare+1)//2-((nSquare)*(nSquare)))
	adj=rem%((nSquare+1))
	if (adj>(nSquare+1)//2):
		#print("  %i %i"%(rem,nSquare))
		adj=nSquare+1-adj
	output=(nSquare+1)//2+adj
I'm trying to do something similar for part 2, but spacing on it...
 
4:24 PM
I'm spacing out trying to read this
 
which day is this problem on?
 
Basically it's math.
What I figured out is that the pattern repeats on odd squares.
So 1, 9, 25, etc.
This is day 3, BTW.
The first thing I do is determine the square.
rem is the difference of the square, basically where on the square it is.
If you do the math, the pattern for each square increments and decrements by one, as would be expected. It repeats 4 times, and then goes on to the outer edge.
Each cycle counts up, and then down.
There's also a bit of an offset in there.
It took a while to figure it out, but that's really something I could punch in a calculator in a few seconds.
 
yuck
 
Yeah, it's a bit messy to figure out, but it works quite well and very quickly.
 
wait, there should be a simple solution based on the binary digits of N
 
4:29 PM
That's what I thought, but I couldn't figure it out.
It's likely based on the binary of the rem, if anything.
 
well every "shell" is 2^N items
 
... wait. that's not right
 
I tried to figure out a binary solution to it, but it wasn't that clear. I'm happy with what I have.
 
it's 8 * N, sorry
 
4:30 PM
Yep, sorry, was just about to correct that.
 
5:08 PM
def advent3(n):
    # shell index
    i = int((n - 1) ** 0.5 / 2 + 0.5)
    # shell odd index
    s = i * 2 + 1
    # shell base value
    b = (s - 2) ** 2
    # residual
    m = n - b
    # triangle wave on range(n) with amplitude (s - 1) / 2
    t = abs((n - 1) % (2 ** i) - i)
    return (n, t + i)
uhh, something like that maybe
wait, that's overcomplicating things still
 
On that note, is anyone else versed in JS and would min explaining to me what the two exclamation marks in the variable name do? thank you so much! gamedev.stackexchange.com/questions/151735/…
 
user4704
I don't think that JS?
 
user4704
The question is tagged libgdx, which is a Java framework
 
@JoshPetrie libgdx does JS iirc
 
user4704
Oh, didn't know that. I don't enough of either to really tell the difference.
 
user92578
5:18 PM
What? LibGDX does javascript?
 
I thought it did
there's plenty of javascript mentions on the homepage
@JoshPetrie Java doesn't have a var keyword, and !! at that position would be invalid in Java - so I assume it to be JS from the looks of the code
 
user4704
Good point. That "apply {}" block is a bit suspect for Java code too.
 
user4704
Although LibGDX "Dialog" doesn't seem to have "apply" as a method? libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/…
 
user92578
I can't find a mention of javascript as a supported language of libgdx
 
user92578
can't be JS either, there are no semi colons
 
user4704
5:21 PM
It's very possible the question is actually using something else, and "libgdx" is the only tag they could find.
 
@Tyyppi_77 JS doesn't need semicolons
 
user92578
what?!?!?!
 
user4704
Although there is "Gdx.app.log" too.
 
user92578
yeah I was just about to say that
 
You only need semicolons in JS for a little number of things, mostly the interpreter can assume what's a statement and what is two (as long as they're on different lines iirc)
 
user92578
5:22 PM
oh yeah just looked it up, cool
 
Also Java got a JS interpreter with Nashorn, so might be using that
@Tyyppi_77 no it's not, it's a terrible language feature. Don't use it :)
 
user4704
Well I closed it as unclear.
 
the double !! also works in javascript, it can be used to shoehorn an object into a boolean value. It's actually two invocations of the ! operator and some blackmagic. But putting it there would not constitute a valid identifier afaik, so I have no idea what it does, can't find anything on the webs and am positively curious to the explanation
 
but that would be a prefix !!, not a suffix !!
 
user4704
My guess would be some kind of conditional nullable check
 
5:26 PM
@Jimmy that's why I'm stunned
 
user4704
Like: "foo!!.bar()" -> "if (foo is not null) foo.bar()"
 
user4704
But that's just a guess.
 
ah, the ?. operator
 
I assumed it might return a boolean for each call or something like that
 
user4704
And afaik neither language currently supports it. So who knows.
 
5:29 PM
aha
I figured it out
26
Q: What is the Kotlin double-bang

Michael BruzenakI'm converting Java to Kotlin with Android Studio. I get double bang after the instance variable. What is the double bang and more importantly where is this documented? mMap!!.addMarker(MarkerOptions().position(london).title("Marker in London"))

 
yuck it's kotlin
and you were faster
dang
you folks got no it seems
Can I create it and get rep?
 
do it
 
edited the question and added the kotlin tag
 
Ahhh, did day 3!
 
nwp
@dot_Sp0T you are close to meme-hood.
 
5:31 PM
I'm relatively happy with my answer too!
 
@nwp ? (I can not follow you comment; I assume that you are talking about me meta-ing the rep game)
 
nwp
Nov 28 at 13:15, by DMGregory
user image
 
user92578
it's kinda weird that you can just edit stuff by yourself but there's still a need for two votes to approve an edit
 
@nwp oh sweet, accumulated chat rep
@Tyyppi_77 it's a natural progression in rep. If your edits are good you get rep for them and thus eventually don't have to have them approved. It's a great system imho
 
user92578
nonono
 
user92578
5:34 PM
I could've unilaterally edited the kotlin tag to the question
 
user92578
However my approval of your edit isn't unilateral
 
Well, I am glad I got to do the kotlin thing first; I always wanted my own tag
It's interesting how in the new top-bar the review link replaces the help-centre link
 
Did anyone here ever worked with mapbox before ?
Or does anyone of you know what reference points are ?
 
Day 4 is much easier:-)
 
user4704
@genaray Yes, why?
 
user4704
5:43 PM
@Jimmy Neat, I was close.
 
@JoshPetrie Because i have a problem regarding them. Im currently trying to implement a chunk system. Because of conversion iusses my chunks are mostly spawned at x = 500k and y = 500k in the unity engine. Thats because i convert the lat/lng position to a unity position. So i thought it would be possible to use reference points to solve this. But how do i calculate them ? And what exactly are those ?
 
user4704
"Reference points" won't solve anything.
 
user4704
Reference points are just agreed-upon points used as the basis for some measurement.
 
user4704
If your points have different latitude/longitude coordinates but are all spawning at 500k, 500k in Unity, that sounds like your conversation from one coordinate space to another is bad.
 
They arent all spawning there at the same position... let me describe it a bit different. My map is at 0;0;0 in the unity engine. The map displays the lat/lng 70;70. My player also stands right at the map (unity pos : 0;0;0 ). When i walk around i want to calculate chunks, so i take the lat/lng pos of the map click and convert it to a unity world coordinate. Then i calculate the chunk and place a gameobject right there.
When im at lat/lng 0;0 everything works fine. When i move far away ( lat/lng 70/70 ) the gameobjects starts to spawn somewhere at over x = 500k and y =500k
while my player is still at x = 0; y = 0
Because i dont move the map in the unity space...
 
5:50 PM
@Tyyppi_77 I even did edit the tag-wiki now it exists :D
 
@JoshPetrie And until now i thought reference points could solve this, atleast DMGregory told me so yesterday...
@JoshPetrie do you know a solution ?
 
user4704
@genaray No, because I don't know what the problem is.
 
user4704
The problem your describing sounds like a basic problem converting between latitude and longitude.
 
user4704
You can use the concept of a reference point in that conversion e.g., deciding where you want (0,0) to convert to in X, Y coordinates. But a "reference point" is not a magic bullet to make your math work.
 
user4704
If all your chunks place at 500k, 500k... or basically at 500k, 500k... that's a math problem.
 
user4704
5:57 PM
Especially if they initially placed at 0,0.
 
user4704
There are too many variables you're leaving out here, you should probably post a question on the site about it. With example code and a clear description of what goes wrong and what you expect the behavior to be.
 
@JoshPetrie Its hard to describe.... The main problem is that the map shows lat/lng 70,70... i tap somewhere on the map and convert the lat/lng position using AsUnityPosition to a unity position. Because im at lat/lng 70,70 the unity position is extremly high (500k,500k) and not anymore supported by unity. And thats where i place my gameobjects then. Im gonna do a question about it later, thats much better i guess
 
user4704
If you get such a high position you probably have whatever that map object is set up to handle extremely large distances. That's probably not what you want.
 
user4704
If it it really is, I can see what DMGregory may have meant by the term "reference point:" some way to reorient your coordinate space so each chunk has a local original that you use for things inside that chunk to avoid running afoul of floating point issues at large numbers.
 
user4704
This is a pretty common technique for large-world games, but it's not just a checkbox you flip somewhere. You're going to have to implement the functionality yourself, probably
 
user4704
6:05 PM
Which probably means not using "AsUnityPosition" and instead writing your own position conversion.
 
user4704
or similar
 
@JoshPetrie And i thought there would be a much easier way... what kind of chunk system would you use for an open world mapbox game ?
 
user4704
Probably exactly that. It depends how large the map needs to be. If you can just adjust the relative scaling on the map so that "AsUnityPosition" doesn't give you an insane position, that could work too.
 
user4704
I also probably wouldn't use mapbox, since it sounds like its more trouble than its worth unless you really want to overlay some stuff on the real world or whatever.
 
@JoshPetrie Even if i change the relative scaling, because my map is always at 0,0 and shows for example lat/lng 70,70 the chunks will be spawned somewhere else due to the asUnityPosition method. I only choosed mapbox because its easy to implement >.<.
 
6:12 PM
@genaray Have you looked at Quill18's bit on that kind of problem?
 
user4704
@genaray I don't really believe that. I think you're just using it wrong or not understanding what the APIs options are.
 
@PearsonArtPhoto What do you mean ?
 
I'm not 100% sure it's the same problem, but it sounds similar.
Basically how to map a planet both as a planet from "Orbit", and the local terrain, all in Unity.
 
user4704
Latitude and longitude conversions are complex, and involve features of the curvature of the planet involved, for example. Make the planet smaller, maybe choose a different projection, and you get different -- and basically saner -- results.
 
user4704
Mapbox does not seem like something that's easy to implement for a fictional world unless you're actually trying to simulate the world as both a sphere and a plane
 
6:14 PM
It was quite complex, I think it took him ~2 hours of video to do the full conversion, if not more, including quite a bit of work outside.
 
user4704
Yeah.
 
That series of videos does exactly that, simulates the world as a sphere and as a plane. It's not easy...
 
user4704
I'd avoid anything involve a latitude and longitude system for this.
 
user4704
Then the conversion between clicked map point and world coordinate is a simple scale + translation, at most.
 
That's pretty much what I do.
 
user4704
6:16 PM
Way more trivial than dealing with all the complexities of reality that mapbox is going to try helping you with
 
You could do something like a map projection, which is easier then a full planar system.
I don't know what mapbox is, so...
 
Hmmmm, im gonna take a look at that, thanks :). Mapbox uses the mercator projection, if you mean that ^^
 
user4704
(or alternatively, if I had to represent the world as a sphere, I'd just do everything in polar-ish coordinates. Maybe just lat/long/elevation directly, and build the chunk system accordingly
 
user4704
like as a system of arcs)
 
Mercator is the most common.
But if you are having problems because you are using the limits of the Unity engine terrain boundaries, you have to re-center the terrain somehow.
 
6:18 PM
Yep... i already tried a fully lat/lng based coordinate system. But the chunks i placed were stretched due the projection type and it looked awefull
 
What is your end goal for this?
 
user4704
You did it backwards then.
 
user4704
You should keep the chunks uniform, stretch the projection.
 
user4704
I still think you're overcomplicating it since it doesn't sound like you need a spherical world here.
 
user4704
shrug
 
6:20 PM
No, just a flat world map :D
Totally forgot to mention this >.<
 
user4704
Then you don't need lat/long at all.
 
user4704
Just drop it. And probably don't use mapbox.
 
I still want some kind of real world map... are there any mapbox alternatives ? Because my game should "play" on the real world.
 
If you only need a flat world map, you could just do a cylindrical map, same as many many games.
 
Yep just a flat world map. But i really would like to use the real world map with zoom levels and all the other stuff that comes along with mapbox... coding one on my own would be hard i guess
 
6:25 PM
What level of detail do you want?
 
Extremly detailed, roads, parks, woods
And road names of course
 
So like Google Maps?
Kerbal Space Program?
Civilization?
 
Yea, right ... like google maps
 
What is the source of input data for this going to be?
 
thats why i started using mapbox, because i didnt found an good google maps plugin for unity.
 
6:27 PM
There is an open map database.
Open street map
 
But no unity plugin for that ...
 
Looks like there is a half-dozen.
Including MapBox, but others too.
 
Ouh, well... but when i use open streetmap im gonna have the same problem... that due to the lat/lng position and the map at unity position : 0,0 the chunks are spawning in a different spot
 
user4704
So you don't need a "simple rectangle map" then.
 
Well, with a world that big, you are kind of on your own...
 
user4704
6:30 PM
Yeah.
 
There is usually a way to re-center the terrain to 0,0 that is the area you are focused on, but that's all I can offer really.
 
Alright than im searching a bit more... thanks :)
 
nice related questions sidebar
 
:D
 
7:08 PM
oh my, the tag has already been used by another question. Is this warm and fuzzy feeling what it means to be a dad?
 
I wouldn't know, sorry man.
 
 
2 hours later…
9:23 PM
@Jimmy roflmao
 
 
2 hours later…

« first day (2678 days earlier)      last day (2343 days later) »