Ruskul's Recent Forum Activity

  • For example: Here is an entry from defining aces. When I compare the documentation here on c3, compared to game maker or unity, it really is... simple.

    -isStatic

    Normally, the condition runtime method is executed once per picked instance. If the condition is marked static, the runtime method is executed once only, on the object type class. This means the runtime method must also implement the instance picking entirely itself, including respecting negation and OR blocks

    That, compared to this:

    docs.unity3d.com/ScriptReference/Physics2D.Raycast.html

    I had several years in construct before learning unity. I picked up unity way faster and I still have trouble with the sdk here.

    Part of that is inconsistency between the sdk addon api, scripting api, and the way events sheets get used. The other part is that many default behaviors that would work as examples use undocumented api calls so they aren't the best learning tools. Many of those undocumented calls SHOULD be a part of the api but aren't for reasons. Lastly, unlike most other engines, auto complete only is half useful, so you can't crutch around using it as a tool to explore what you can and cant reference.

  • Lol thanks. Man, what the heck!. I did both a google search and searched the manual via the search tool on the website, it returned like 12 hits, but the first few didn't have it when I did a page search. Thanks for the link, I'll try harder next time before asking :/

  • It's because Fake Triggers which is used by the "On Timer" in the Timer Behavior actually check if they're true everytick as opposed to True Triggers So if you have a bunch of objects checking a bunch of On Timers it can be heavy.

    True Trigger on the other hand don't do anything every tick, they're just triggered when they're called (with a little overhead)

    Both approach have their own trade-offs as often in programming. Even if I admit I did tricks to avoid many "On Timer" Fake Triggers in my project

    (Ruskul, I think the comment of tunderrunz was about official behaviors not the Advanced Signals pack I made)

    Oh no, I understand why one runs slower, I think I meant why did Scirra choose to use a fake trigger at all on the timer, but then not on the tween.

    Imo, if there really is a need for a fake trigger (or perhaps they wont change it in order to not break projects) then why not add an option for a real one. Its a wash as far as I am concerned because I already copied the behavior, stripped out the fluff, and added a single "untagged" timer and reduced it to a simple true trigger alarm and a second timer for polling. If you need multiple simple timers you just add the behavior again and name it what you need.

    Simple Alarm. A behavior that solves 1 problem, and solves it in as performant a way as I can manage. Let me know if anyone wants to try it out.

  • Oh cool, right on!

  • Hello all,

    I was curious if there was any attempt at this yet?

    Honestly not sure how best to do it in c3.

    It honestly seems like the sort of thing that could eventually exist as a part of the editor and haves its own set of dedicated eventsheet style calls.

    I was thinking about just writing the behaviorTree as a JSON using particular keywords and then creating a plugin/behavior that reads a json file and executes the behavior, but imo that doesn't seem very elegant. Plus, writing behavior trees as a json file imo isn't fun. lol.

  • Hi all,

    Using the built in pathfinding behavior, is there a simple way to compute a path from an arbitrary position (such as the destination target)?

    Currently, the only way I know is to save the desired new target to an array, and then, on arriving at current target, fetch the next command and compute a path.

    It seems like a waste to not compute the path while en route. I thought to create an object at the current destination target and use it to compute the next path, but I don't see a way to share paths from one object to another. There are several features I need in pathfinding (like being able to edit node connections directly for teleporting, and a few other things related to the graphs construction and editing, that likely means I'll have to remake the behavior anyway...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi everyone,

    I'm a bit confused by this.DispatchScriptEvent as used below. I looked through the manual and couldn't find any reference of it. I feel like I'm overlooking something obvious (is it part of some other JS library). The Timer behavior uses a false trigger as a condition for OnTimer so I'm not sure why an event is being dispatched anyway, unless this if for something else to hook into? I don't recall if the timer interacts with other behaviors.

    Tick() {
    			const dt = this._runtime.GetDt(this._inst);
    			for (const [name, timer] of this._timers)
    				if (!timer.IsPaused()) {
    					timer.Add(dt);
    					if (timer.HasFinished()) this.DispatchScriptEvent("timer", false, {
    						tag: name
    					})
    				}
    		}
  • Looping back to the original point of the post, I'm still confused why "OnTween" finished seemingly causes no reduction in fps, while "onTimer" does. Seems like timers are.... outdated? Tweens are nice and fast for all they do.

  • Overboy

    Sorry If I missed the answer elsewhere, but I wanted to ask about performance of your tools.

    For the custom signals and the like, do they perform better than c3 built in functions?

    I have a project where I need to call alot of functions, those functions call other functions, etc... Its in loops in order to achieve object picking,.

    I have alot of object that have large lists of buffs, effects, etc, that are all being passed around. And alot of those effects do something every tick. How is the comparable performance of your plugin compared to built in custom actions and functions?

  • I'm looking over the behaviors code, I can understand why one might want a fake trigger for order of events stuff. (Right, true triggers can fire at any time? Or is the order in the event sheet still protected?)

    That's my assumption too.

  • Also, to add, I have the other test where I mentioned you can read out the results to an array and verify the loop is running.

    And yes, I used the debugger in this case, and I know it has overhead. Are the results accurate? No. But I think they are good enough, and certainly mirror what I have been seeing in my project:

    Pure JS = fastest

    Pure Event sheet no functions (function inlined) = next best

    Eventsheet with c3 event functions = okay

    JS in JS blocks mixed in eventsheet = Awful

    I mean it all depends on what you are doing, and I am doing 1000 objects, which imo isn't much, but already requires careful attention to this stuff.

  • The obvious thing to do is if you need maximum performance, write the loop itself in JavaScript, and avoid mixing interfaces (in this case event blocks and JS). So why not just do that?

    I did that too, which I mentioned and is in the project, to compare and point out that was blazing fast. The TLDR was don't use JS blocks inside of big eventsheet loops, or eventsheet blocks that will get called alot, which I had been doing in my project and wondering why it was so slow.

    The reason you can't write the loop in JS is because you might be doing other things in that loop that you can't handle with JS, or should by recommendation of the SDK manual.

    But this isn't expressed in the manual, and everybody is like "Performance problems?" write a JS module or script. But it turns out this doesn't solve the issue at all, but makes it worse.

    Thus the only solution is AddonBehavior with sdk (tedious and laborious to write) or built in event sheet functions, but they have the overhead too.

    Which, leads me back to the issue about the insanity of manually in-lining construct functions in order to improve performance. Which is BAD for scalability, maintainability and general mental well being lol.

Ruskul's avatar

Ruskul

Member since 23 Nov, 2013

Twitter
Ruskul has 2 followers

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • x6
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies