QuaziGNRLnose's Recent Forum Activity

  • norman

    There should be an option to convert all faces to triangles in the obj exporter, Q3D and most game engines don't support faces with more than 3 vertices / edges for optimization reasons. It looks like those circles are a single N-sided polygon instead of a triangle fan if they're the only things missing

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I don't know how to read whatever you wrote.

    Q3D might not be displaying your object if you are only exporting one of them, if your normals are flipped, or you didn't include them in the .obj file, or if you're trying to export multiple separated objects as unique parts of the model. Play with your exporter settings and try to understand what each setting does and how it affects the exported file. As a general practice if your model is made of multiple parts its a good idea to fuse the pieces before you export with select+ctrl-J, and export different pieces as separate blocks.

  • rexrainbow

    from what i understand looking at the source, onDestroy is only called in cleanup on cleardeathrow, so it'd be smarter to do it the way i did and call destroyinstance in destroyinstance for specially flagged plugins. Construct doesn't do any hierarchical destruction, but all destruction is handled by destroyinstance anytime any destroying is needed. This supports recursive stuff too. I'm not sure where it can break. I do agree some official solution or word on this would be nice though

  • yup it seems to do the trick, though im not 100% sure if it introduces bugs in certain cases, but it shouldn't, since its calling destroy instance at the same time for all hierarchical objects.

    	var runproto = Object.getPrototypeOf(runtime)
    	var oldfunc = runproto.DestroyInstance
    	
    	runproto.DestroyInstance = function(inst){
    	
    		if(inst.Q3Dobject){
    		
    			for ( var i = inst.obj.children.length-1; i > 0; i -- ) { //iterate backwards or messes up!
    			
    				if(inst.obj.children[ i ].userData.inst){ 
    					this.DestroyInstance(inst.obj.children[ i ].userData.inst); //recursively destroy all Q3D type objects
    				}
    
    			};
    		
    		};
    	
    		oldfunc.call(this,inst)
    	
    	}[/code:oi9u5h7j]
  • rexrainbow

    I think i'm going to try moving destroyinstance into itself and modify the function to recursively call itself before it does it's normal task.

    I think this will work.

  • at this point from what i understand:

    -OnDestroy is only called at the end of an event block or in special cases to get rid of an object for good.

    -DestroyInstance() is not working the same as before the optimization, and is going to break a lot of 3rd party plugins... Calling it in OnDestroy() results in nothing actually happening

  • I'm trying to wrap my head around how to create a container style destructor.

    onDestroy for the top level object should cause children objects to get destroyed by their onDestroy.

    Calling DestroyInstance(inst) seems to do nothing, and not remove the objects i called it on, but inst.OnDestroy() gets rid of the objects as i wish. My fear is that using OnDestroy() this way is going to break things somehow, but i'm not sure how? It'd be nice if someone who knew what would happen could help out.

    How should I go about this ? Another option i tried was calling DestroyInstance, then ClearDeathRowForSingleInstance(inst,inst.type), but i'm not completely sure this is a good idea either, what are the side effects if any?

    I understand the issue is that destroyinstance doesn't work inside an ondestroy for whatever reason, but what is that reason?

    Also i remember DestroyInstance(inst) previously working in this context

  • Toetoe

    thanks! It's really not all that complicated either, I threw it together in 2.5 hours

  • smebor

    not really sure what you mean by "copied"

    as long as you have an animation called "DiffuseMap" it'll have the diffuse map, and as long as you have an animation called "BumpMap", it'll have a bump map. I have no idea what you're trying to show me.

  • smebor

    if you want to use a bumpmap just name one of the animations in a Q3DModel "BumpMap", and use a gray-scale image to control the bump.

  • irina

    i went a little overboard:

    Q3D RTS Example

    I'll upload the capx when i include physics in the next update.

  • Ruskul

    lookup tables don't innately speed things up, and would only really be used on weaker hardware, or places where you need the same sin/cos value over and over, which is rarely true when they're being fed continuously changing floats like they are in construct.

    C2 afaik uses the JS Math.sin() / Math.cos() functions, which likely work using the fastest possible implementation of trig functions using your hardware. You're not going to get a performance improvement by using a lookup table, and you'll likely get way worse performance if you try. If you have to recalculate the same sin/cos multiple times, do it once in a variable. this is the "fast" way to do things. Even if you do this you might not get any performance gains since most new js engines will dynamically find these little things and optimize them with their JIT compiler, unless its a really significant overuse in your code.

QuaziGNRLnose's avatar

QuaziGNRLnose

Member since 2 Aug, 2008

Twitter
QuaziGNRLnose has 5 followers

Trophy Case

  • 16-Year Club
  • Email Verified

Progress

17/44
How to earn trophies