vicplay's Forum Posts

  • +1 would also like to know if it is possible

  • I figured out that the game is failing to download resources when the url is https.

    Back in Oct 22 it was crashing, now it is triggering the Browser plugin "is Downloading Update" forever

  • On the other hand, calling functions to modify instances is like nightmare fuel.

    Not being able to modify instances with reusable code is pretty much being left with limited useless functions, sadly.

    Any other professional engine let you instantiate and modify instances in the same tick at any point of the code as long as you call them after instantiating. That`s why it is a bad design of C2. For me it is a bug because that`s not how functions should work but it seems that it is just a terrible limitation of the engine

  • Are your C2 projects on a HTTPS url?

    Here I have this problem only when the game is HTTPS

    If it is HTTP it works just fine!

  • Actually they don't exist - fully. You can not pick, except by UID, until the next top level event after an object is created. There are countless threads on this - it is just part of the design.

    With functions not even if you run the function in a separated "top level event" it will not work, you will have to wait until next frame. Without functions it works. Again... either a bug or a bad design

  • Nevermind you're doing something weird.

    Objects don't really exist till the end of their event.

    I disagree (Run my Test3). Without functions you can freely modify a created object right after "Create Object" and everything will work just fine.

    If you have the SAME events inside a function it has the strange behavior of changing instance variables just inside the function context for that tick.

    Functions are useless if you have to wait 1 tick to access values modified by them.

    The problem extends not only for objects created in the same tick. If you have a simple function that changes an instance variable value of an existing object, log the new value inside the function and then log the value AFTER running the function you will see that the value is logged correctly ONLY inside the function. The log AFTER the function was called will log the old value until the next frame.

    This is either a bug or a terrible design

  • You can do everything in the same tick without functions and can't with functions. Objects DO exist at the time they are created.

  • Problem Description

    You can`t compare instance variables of objects that has been set inside functions with the oficial Function plugin. Let`s say you create a function called SET that sets an instance variable value of a sprite to 1 (And logs it`s value)

    Then you create a function called GET that only logs the value of the instance variable. If you run SET and then GET after (Inside an On Start of Layout event) the SET will set the value and correctly log the value. The GET function that runs after will fail to log the value (Will log the old value stored in that variable)

    That being said... you can`t pick objects based on their instance variables unless you wait for the next frame. Waiting for the next frame is a terrible workaround. I`m uploading a capx with 3 tests. Only the test without any functions works as expected.

    Attach a Capx

    https://www.dropbox.com/s/9n1cruqrutv1g ... .capx?dl=0

    Description of Capx

    The capx has 3 tests where a "Card" object and a "CardImage" object are created on start of layout. CardImage stores inside itself the UID of the Card created. After that, the scale of both Card and CardImage are changed to 0.1. Test1 has two functions (SpawnCard and SetScale), Test2 has one function (SetScale) and the card is spawned "hard-coded" inside an On Start of Layout event. The Test3 is made without any function (So it does not support parameters without ugly go horse workarounds) but it works by successfully picking the right CardImage and resizing it. I`m not using containers for this because what I need is more complex and containers are too limited to this (Because they can only allow one instance of each object per Container Group)

    Steps to Reproduce Bug

    • Run the tests inside the capx

    Observed Result

    What happens?

    When using functions, events do not recognize the value of instance variables and fail to pick objects to change their scale. The SetScale functions just works correctly one frame after the objects Card and CardImage were created

    Expected Result

    What do you expect to happen?

    To work just like the Test3 without functions

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (NOT TESTED)

    Operating System and Service Pack

    Windows 10

    Construct 2 Version ID

    Construct 2 r244 64bits

  • Awesome plugin, very powerful.

    Just an observation: The expressions "RGBA At" (When called multiple times in the same frame update) causes a considerable impact on performance when playing the game with Firefox.

    Google Chrome seems to handle the same events pretty well.

    Thanks for sharing this, I love it!

  • Hello there!

    Your isometric behavior is awesome but when the game have big layouts with lots of objects the game gets really slow.

    I've tested with a layout that had about 1000 objects with your iso and the preview was running at ~5 fps

    (With the behavior disabled it was running at 60fps)

    Then I've made some changes on the runtime.js of the behavior to ignore all objects outside of the canvas completely and creates an array of references to the remaining objects index numbers before looping over and over again.

    Now running at 60fps with the same amount of objects without messing the sorting.

    	behinstProto.tick = function ()
    	{
    		//alert(window.rojoList.length);
    		var refList=[];
    		var isoList = this.type.isoList;
    		if(this === isoList[0])
    		{	
    			for (a=0; a < isoList.length;a++)
    			{
    				var isoA = isoList[a];
    				if(this.IsInstOnScreen(isoA.inst))
    				{
    					refList.push(a);
    				}
    				else
    				{
    					isoList[a].behind.length=0;
    				}
    			}
    		}
    
    		if (this === isoList[0] && (this.type.state.enabled || this.type.state.sortOnce))  // only run once
    		{
    			this.type.state.sortOnce = false;
    			var isoA, isoB, a, b, c=0;
    			
    			// updade positions from isometric positions
    			for (a=0; a<refList.length; a++)
    			{
    				isoA = isoList[refList[a]];
    				//isoA.updatePosFromIso();
    				isoA.inst.update_bbox();
    				isoA.visited=false;
    			}
    
    			// build dependency graph
    			for (a=0; a<refList.length; a++)
    			{
    				isoA = isoList[refList[a]];
    				
    				// culling
    				if (!isoA.visited && !isoA.inst.visible && !this.IsInstOnScreen(isoA.inst))
    				{
    					isoA.visited=true;
    					continue;
    				}
    				
    			    for (b=0; b<refList.length; b++)
    				{
    					isoB = isoList[refList[b]];
    					
    					// culling
    					/*if (!isoB.visited && !isoB.inst.visible && !this.IsInstOnScreen(isoB.inst))
    					{
    						isoB.visited=true;
    						continue;
    					}*/
    						
    					if ( isoA != isoB 
    						&& isoA.inst.bbox.intersects_rect(isoB.inst.bbox)  //bounding box check
    						&& isoA.ix-isoA.sx/2 < isoB.ix+isoB.sx/2 -0.001
    						&& isoA.iy-isoA.sy/2 < isoB.iy+isoB.sy/2 -0.001
    						&& isoA.iz-isoA.sz/2 < isoB.iz+isoB.sz/2 -0.001)
    						{
    							isoA.behind.push(isoB);
    							c++;
    						}
    				}
    
    			}
    			
    			// topo sort
    			for (a=0; a<refList.length; a++)
    				isoList[refList[a]].visitNode();
    		}
    	};
    [/code:1s0bhs7i]
    
    \o/
  • I'm having a similar issue. I'm developing a project with a PC with Windows 10. Every text have the correct size both inside C2 and in any browser while running with Windows 10 but if I open this same project with a PC with Windows 7 all the texts get bigger, ruining the alignment of (for example) the ranking table.

  • Sadly this turns listroompeercount, listroommaxpeercount and listroompeerstate useless since we would have to create rooms with no peer limit so anyone can join merely to test ping. We would have to analyze all these information manually (and also implement the room locking system through the event sheet).

    This listroomlatency to get average latency before joining rooms would save us from a lot of rework and I think it can be added to the mp plugin. It would be simply a join room which ignores peer limits, locked state, synced objects and does not fires any peer related trigger on the host side. It would be simply a "stealth join room" :'D

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • True true, but you could ofc just have it invisible by default, and that after some ping pong like events, the players gets activated and is brought into play ?

    Construct 2 games often have a base object, on which another sprite is pinned with player animations.

    If the base gets synced, you could simply not create the extra objects.

    Well this is a good solution (At least for simple games). But I hope that in the future we get an update to make this more practical and safe.

    Always good to discuss with people that also understand MP btw

    Thanks for taking time to reply to this, lennaert!

  • "Host sees the 0 ... and does not create the needed objects."

    This can't be done. Sync Object is automatic, it doesn't have an option to create or don't create objects.

    The only thing you can do is don't create the object that represents the peer on the host side but all the existent synced objects on the host side will be created on the peer side automatically.

    Example:

    Synced objects:

    • player
    • bullet

    On peer connected, send message, check playing

    Peer receives messages, and replies: 0

    Host sees the 0 ... and does not create this peer player object

    Every other synced object that already exists on host side (player object associated with the host and bullets) will be automatically created on the peer side regardless of if check playing was 0 or 1. (and this can't be disabled during runtime).

    *Bullets spawning on the lobby!*

  • I meant the connection between the host and the peer wanting to know the latency.

    To get the latency, you would actually have to transmit some data back and forth resembling the game data in order to get a decent estimate about latency between the peer wanting to know the latency and the host hosting the game.

    To overcome the obstacle of on which layout is what ... simply add some checks for on which layout it resides. There is an expression LayoutName, which returns the current layout name.

    LayoutName <> "lobby" should prevent it from checking while it is in the lobby

    I see... but the problem is: Sync Object is a setting that (as far as I know) can't be disabled during runtime. Once it is set it will automatically start to create objects everytime the player joins any room (Sync Object is usualy set before connecting to the signaling server and persists forever while the game runs) . If we had an action like Desync object to disable it when needed it would be possible to use your method.

    We could think of executing the Sync Object action only when the layoutName == "game" but (as I said) it will persist during runtime even if the player leaves the room, so if the player tries to check latency after (in layout "lobby") the Sync Object would be previously enabled, causing the unwanted behavior of creating objects.

    Do you know any way to disable the Sync Object after it was executed?