Nepeo's Recent Forum Activity

  • Kraudi there's a technique called Signed Distance Fields ( SDF ) which you could use here to help you. The basic idea is that you have a function that returns the distance from any position to the closest point on the surface of an object. If the position is inside the object then the distance is negative ( hence "Signed" distance fields ). Circles are probably the easiest SDF, and by the looks of it you only need circles. So that's convenient! Here's the function for a circle written in JS, it's mostly simple maths so should be easy enough to read.

    function circleSDF (point_x, point_y, center_x, center_y, radius) {
    	let dx = point_x - center_x;
    	let dy = point_y - center_y;
    	return Math.sqrt(dx * dx + dy * dy) - radius;
    }
    
    function distance_to_closest_ball (cueball) {
    	let smallest_distance = Infinity;
    
    	for (const ball of balls) {
    		let distance = circleSDF(cueball.x, cueball.y, ball.x, ball.y, cueball.radius + ball.radius);
    
    		if (distance < smallest_distance) {
     			smallest_distance = distance;
     		}
     	}
    
     	return smallest_distance;
    }
    

    The trick here is that you can use your "move along the line" technique with that function. Before moving you can check what the shortest distance to any ball is. You now know that it's safe to move that distance along the line, as there are no objects within that radius of the cue ball. Repeat the check distance, and move along line until the check distance tells you the distance is effectively 0. You will now be at exactly the position the cue ball collides with another ball.

    There's a few minor gotchas. First is that you need to keep count of how far you have moved along the line, as if you don't hit anything the loop will continue forever. Second if you do get a collision the distance is likely to be a very small number ( like 0.0000000007 ) instead of zero because of floating point error, so you should check if the distance is under 0.0001 or something. Lastly the circleSDF function assumes the point is particle ( no size ) so it doesn't take into account the radius of the cue ball. The way I resolved this above is to pass the radius of the cueball and the other ball added together instead.

    There's a fair amount of information about SDF techniques online, but it's mostly about using them for 3D rendering... which is quite complicated. Just so your aware.

  • No worries LukeW :) The site sometimes has difficulty recognising user names for boring reason, you can use [ @Nepeo ] instead and it generally works.

  • DiegoM probably needs to have a look at this.

  • LukeW I think the issue your struggling with here is that the orbit behaviour updates later in the tick than most behaviours. The platform behaviour is seeing the platform before orbit has updated it, hence it appears to be lagging by 1 tick.

    The reason why it behaves like this is due to "orbit pin" ability. By ticking later it guarantees that the object it is pinned to updates before it in the tick, so that when it updates it's not out by a tick. But of course causes other behaviours to be out of sync. The "pin" behaviour uses the same technique, and has similar gotchas. As dop2000 mentions you can probably work around this by using the pin behaviour to stick the character to the platform temporarily.

    If you file a bug about this on the tracker ( should be easy enough to create an example project ) then we can discuss it with Ash. It's a difficult issue though.

  • While this sounds like quite a simple thing, there's actually quite a lot going on there. It would be good if you could file a bug for us to look at.

  • It isn't forced, "loopindex" is a variadic expression ( meaning it can take any number of parameters ). Any expression that takes 0 parameters can omit the calling brackets. While it's classed as variadic it only really makes sense to use it with 0 or 1 parameters.

    I tried just typing loopindex into an expression and had no issues with autocomplete or similar?

  • Well there's 2 options you can go for here, provided you are the one creating the tilemap data.

    The first is that you could use an array instead, with only 2 columns. One for the key and another for the value. Although this obviously makes it harder for you read a value for a specific key.

    The other option is that you can use a JSON file like so:

    {
    	"key": [ tileindex, tileid ] 
    }
    
  • An index doesn't have much meaning in a dictionary. The order of the entries is not guaranteed so you can't get/set values at an index.

    What are you using the index for? Might help come up with an alternative for you if we could know how you are using the dictionary.

  • I'm not sure if the loopindex expression works with the Dictionary.ForEachKey condition.

    Within a dictionary loop you can use Dictionary.CurrentKey and Dictionary.CurrentValue expression to access the current key/value pair for the the loop. If you want to nest loops then perhaps use local variables to hold the values of the parent loop.

  • Looks like a really cool game, congratulations on the award 🎉

    It's always good to hear about what people have made, so yes we do care!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Your apple team ID is part of your iOS developer membership, I can't imagine it would be any use without the associated account. Buying one from a re-seller sounds VERY dodgy, and I think you should stay clear of this.

    You might want to look at this article thisinterestsme.com/instant-game-apple-developer-team-id

  • jobel

    you can't say it doesn't make any noticeable difference with subpar headphones

    It was purely anecdotal, at no point did I claim I was performing a definitive test. Your right that me spending 30 minutes listening to short sections of 1 track isn't a completely representative test of an audio format. But I think perhaps any higher level of testing is probably overkill for what we were trying to decide. As a recreational guitarist I like to think my ear is fairly passable and I used a fairly nice pair of sennheiser on ear headphones. So I was probably able to discern more of a difference than the average person would. If you would like to look into it more xiph publish very detailed reports on their work with opus.

    All this is by the by though, as I was arguing for adding the option to the dialog. I think 96Kbps is likely fine as a default value, but we can allow users to choose higher or lower as they like.

Nepeo's avatar

Nepeo

Member since 8 Mar, 2016

Twitter
Nepeo has 583,792 followers

Trophy Case

  • 8-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • x3
    Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

13/44
How to earn trophies

Blogs