saiyadjin's Recent Forum Activity

  • Ashley - thanks for the long answer

    i'll reply shortly (backwards) - i don't agree with you about overcoming limitations. limits can always be overcome, one way or another, that's why not a single software is "ever finished". always something to improve, upgrade, develop and so on.. when i'm using your engine to export my games i use it in it's native form as it came with installer, but i've got a separate installation for testing stuff out where i replace code and see if things improve/change etc.., however all the things i do i keep in my folder, each test i've done in its own file.

    on top of the support thing and including changes and tests that users comment / commit to forums, at least i would love if you'd take at least 5-10 mins to check them out and see if there is a possibility of improving something that someone has tested / tried and so on. whether you include that in the engine in some newer versions is ofcourse up to you, and your team alone. as a developer i have a need to tweak stuff, so if i can help that ends up great, and even if you do use any (even 1 out of 100 tweaks i do) it feels like a great job for me, to contribute to the devs of engine i use / follow /etc.

    and now to the tech part:

    • i've posted now 4 posts about tweaks / changes, and some of them do seem useless like the semicolons problem that is left after assert statements, but i've just mentioned it because i've noticed some random semicolons appearing out of nowhere. now i know that compiler probably ignores them, still uses a bit of time to process them, but ok. not much of a problem.
    • nextPowerofTwo - i didn't find it's use, but still a faster way is faster, at least by a bit, but also i think you're right when you say it doesn't appear anywhere in performance profiling.

    but the last 2 are pretty performance based...

    cr.segments_intersect - i've optimized that and it returns correct results, and have been testing with random values for both algorithms, both receiving random input data, but same data for both functions. it appeared that everytime results were the same and my function was faster. also your comment there is:

    "// Long-hand code since this is a performance hotspot and this type of

    // code minimises the number of conditional tests necessary."

    i would like if you could take a look at that one at least. I've noticed also that you mentioned that code is optimized for one type of game but not optimized for another type of game. i understand your approach to the problem when you say "general-purpose" and i didn't even try to go in some specific direction for it. Still a function that returns a value, should return always the same value, no matter how it's written, but that could impact it's performance. i highly doubt that one function can determine if a game is of one type or other.

    i agree that checks with math calculation can reject before/after, but after testing that function against the regular one, with over 10 000 000 input data, every time mine got the best of it.

    and what happens with the last (contains_pt) is a mystery to me, i might have missed something, but it's performance is double of the performance of default function. as much as i've understood you split the quad into 2 triangles and check if the point is in each. if it is in first you return true, and if not then you check for 2nd one, and return true if there, if not return false. that's exactly the same what mine code should do, and i my tests it did, but when used in engine it produces halfway good working. i'll try to fix that today and see if it gets better.

    i would be also gratefull if you could check the code and the 2 links i've posted and see if there is a possibility to improve that function.

    i also know how deep the rabbit hole goes when you have to be careful with floats and overflow and 4-5-6 decimal places and stuff..

    and also, i can give you my test html files (which include the JS with functions and how i've tested) if it will make it easier for you to see what happens.

    i'm pretty sure there's a lot more in the engine that can be fastened in microbenchmarks and improve overall performance of the engine, without depending on what type of game it is.

    p.s. sorry if my post is long, i'm not here to argue, insult or anything, i love C2, love your work, but i would appreciate if you'd "let" me at least post those improvements and take periodically a look, and even if you find 1 useful it will be my joy!

  • here comes a big one, which i didn't use in ingame engine (i did but reverted change) but Ashley might describe where the problem is and why:

    so there's this function that tests if a point is in quad (Quad.prototype.contains_pt = function (x, y)), so here's it's code:

    Quad.prototype.contains_pt = function (x, y)
    	{
    		var tlx = this.tlx;
    		var tly = this.tly;
    		var v0x = trx - tlx;
    		
    		var v0y = try_ - tly;
    		var v1x = brx - tlx;
    		var v1y = bry - tly;
    		var v2x = x - tlx;
    		var v2y = y - tly;
    
    		var dot00 = v0x * v0x + v0y * v0y;
    		var dot01 = v0x * v1x + v0y * v1y;
    		var dot02 = v0x * v2x + v0y * v2y;
    		var dot11 = v1x * v1x + v1y * v1y;
    		var dot12 = v1x * v2x + v1y * v2y;
    
    		var invDenom = 1.0 / (dot00 * dot11 - dot01 * dot01);
    		var u = (dot11 * dot02 - dot01 * dot12) * invDenom;
    		var v = (dot00 * dot12 - dot01 * dot02) * invDenom;
    				
    		if ((u >= 0.0) && (v > 0.0) && (u + v < 1))
    		{
    			return true;
    		}
    						
    		v0x = blx - tlx;
    		v0y = bly - tly;
    
    		dot00 = v0x * v0x + v0y * v0y;
    		dot01 = v0x * v1x + v0y * v1y;
    		dot02 = v0x * v2x + v0y * v2y;
    
    		invDenom = 1.0 / (dot00 * dot11 - dot01 * dot01);
    		u = (dot11 * dot02 - dot01 * dot12) * invDenom;
    		v = (dot00 * dot12 - dot01 * dot02) * invDenom;
    
    						// Point is in second triangle
    		return (u >= 0.0) && (v > 0.0) && (u + v < 1);
    	};[/code:ysujrfy2]
    
    so i've wanted to upgrade this, and after checking manual and doing some work of my own, i've noticed that every quad is split into 2 triangles and then the point is checked in each, if found in first return true, else check other and return true if there or it's false.  it's being done with some mad math. 
    so i went to see what is the most performant way to do it, and here's what i got:
    
    [code:ysujrfy2]		if((((this.try_ - this.tly) * (x - this.tlx) - (this.trx - this.tlx) * (y - this.tly)) | ((this.bry - this.try_) * (x - this.trx) - (this.brx - this.trx) * (y - this.try_)) | ((this.tly - this.bry) * (x - this.brx) - (this.tlx - this.brx) * (y - this.bry))) >= 0)
    					{
    						return true;
    					}
    				    if(!compareResult)
    					{
    						if((((this.bry - this.tly) * (x-this.tlx) - (this.brx - this.tlx) * (y - this.tly)) | ((this.bly - this.bry) * (x - this.brx) - (this.blx - this.brx) * (y- this.bry)) | ((this.tly - this.bly) * (x - this.blx) - (this.tlx - this.blx) * (y - this.bly))) >= 0)
    						{
    							return true;
    						}
    						else
    						{
    							return false;
    						}
    					}[/code:ysujrfy2]
    this code does the same. takes the first 3 points (tl, tr, br) and 2nd  3 points (tl,br,bl) and checks if in those triangles the point is in. and really this works way faster and in my testing examples gives the same results. here's a link to "performance difference" which is almost double. 
    [url=http://imgur.com/GPFfzbe]http://imgur.com/GPFfzbe[/url]
    
    so where's the problem, i've put this function instead of the original and what happened is that in my game that i was testing it with happend this - the bombs sometimes fly through the objects and sometimes explode on the objects (they should explode every time they hit the object). now there is probably something different which i can't get through what and i was wondering if @Ashley you could take a look into it. you could gain some performance in collisions if this is optimized and people would be gratefull. it's not much but it will help. funny thing is that when i go from right side to left side bombs hit well, but form the left side to right side they "miss". like something is wrongly / badly calculated. do variables change in realtime in quads? that might be possibly a problem. 
    
    p.s. - here are articles i've been using to "improve" solution
    [url=http://jsfiddle.net/z7x0udf7/3/]http://jsfiddle.net/z7x0udf7/3/[/url]
    [url=http://stackoverflow.com/questions/2049582/how-to-determine-a-point-in-a-2d-triangle]http://stackoverflow.com/questions/2049 ... d-triangle[/url]  (last answer is JS) 
    
    i'm off to optimize some more and some other things.. i'll be back <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">
    
    p.p.s.  pls check 4 posts behind @Ashley about those assert statements that leave junk in code.
  • it can't. if it's a server side turn based game, server works only as much as players (1 per current turn) pushes data up on server.

    unless you have a huuuuuge amount of players at the same time, then you're pretty much ok. if you do have ~1000 or more players pushing data onto server at the same time (ending their turn) this could slow things down. still you would have to do this - make asycn calls to database so they are queued up for processing, and since servers can easily process ~1000 connections at once, they will be processed in a matter of minute / two /etc.. other players wait until they have the turn. it can take that minute two or more since they don't know when really the other player is done, and through pings on database you should check turns.

    also if someone DC-s, make it a permanent DC and make sure when it's that players turn, to automatically skip it.

  • winkr7 - like i said, there is no real reusability. ever. anywhere. but if your projects are similar - for example - car race, bird race, planes race, etc.. you can create a group of controls that use wasd (for example for pc), which are put on a family named "player", where objects inside are just player objects that can use the movement, and then in another game, you create family "player", and copy paste the events. voila.

    but there will always be tweaking, pimping, fixing, and more.. so

    once again. there is no REAL reusability!

  • 1. - lol

    2. - lol - sure, go create sheets for each object, gl hf with order later. also - i agree with family part - you can't select an object from family by it's name or id or sth, but still you can create instance of an object by dropping it in with spawn/create, so whatever.

    3. - lol - you sure are not a pro "developer" like you've said in the post above. "pro" developers know that there is no real reusability. you can create parts of code which can be reused, but create a single (if we're talking about C# for example) DLL which will do everything, it's impossible. same goes for this.

    also it depends on type of game. if you have cars racing game where you have controls wasd, and they are binded and programmed perfectly, you can reuse them in another project that uses the movement. but if you copy / paste the movement of wasd to a tower defense game - wtf is it going to be used for there? nothing exactly and therefore the reusability concept already drops in water.

    4. really? like really? did you even read manual? check forum? tutorials? anything? wtf, and you're a "pro" developer. do you even think bro? use dictionary? array? save locally and access from anywhere? global vars? global somethings? dictionary in dictionary... i can go on..

    5. didn't use it so i can't say... but i guess you're a "pro" developer so you're gonna tell me what is good and what is bad

  • i've just flew across the blog and found this out:

    https://crosswalk-project.org/blog/deprecate-40.html

    is it just 4.0 version or all 4-4.4 versions?

    also.. you can enable downloading crosswalk libs and stuff in background:

    https://crosswalk-project.org/blog/cros ... -mode.html

    100mb apks anyone?

  • not sure what you're asking?

    i've done some cm, push out solids and such in my game, didn't use tilemaps though.

    check here:

    https://dl.dropboxusercontent.com/u/136 ... index.html

    p.s. if you don't see menu - > there's a new game button floating on the left upper side, so just randomly click around until you get it, it seems some font is causing sometimes problems and people do not see it, also there's options under it / but defaults are wasd + 4 on numpad for shooting.

    everything is done with custom movement / pathfinding / pushing out solids and more...

  • rexrainbow - i've noticed you got your repository, why not just get a small database (up to 1GB) and create a software that uses the base and does all that for your / everyones plugins ?

    p.s. i could help you, but i'm not that good with python which i see you used

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you mean offline plugin manager inside the editor? yeah that would be nice.

    i've started building my program for the same purpose but i stopped halfway. wanted to create a nice admin interface for users to upload through and manage their plugins, and another where you could easily browse them, download and install.

    i've stopped halfway through because i had some other business to attend to, but i will continue it's development shortly..

  • what's the point if they have no internet connection?

  • i'm not sure if he developed so that it automatically takes the 2% or you have to manually do it, but i'd say it's the first thing.

  • hey guys,

    currently it's 100mb for APK, which leaves us at around ~70MB for stuff. if you make a game that has > 70MB you can't put it on googleplay. is there a way to use expansion files for adding more content? i'm guessing packing images and sounds should be just fine, and leaving runtimes and data in the first 70mb.

    any ways how to do it?

    i've found a few blog posts but they are for apps, not for game engines.

    https://iphonedevlog.wordpress.com/2014 ... a-project/

    https://groups.google.com/forum/embed/# ... NTRDZHN5Cw

    could it be made through plugin?

saiyadjin's avatar

saiyadjin

Member since 19 Jul, 2014

Twitter
saiyadjin has 2 followers

Trophy Case

  • 10-Year Club
  • Jupiter Mission Supports Gordon's mission to Jupiter
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies