Jump to content


Photo

TMC SGS Fast Collision System

engine extension

  • Please log in to reply
46 replies to this topic

#1 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 06 July 2014 - 10:50 PM

TMC_SGS_BANNER_1140x360.png


TMC SGS Fast Collision System
 
New Forum

Outputs: All

Type: Extension (scripts)

Included: Scripts, Demo Sprites, Demo Objects and Demo Room

Demo: https://onedrive.liv...45D1EA9168D!714

Demo 2: http://gmc.yoyogames...howtopic=637430

Marketplace: https://marketplace....ollision-system

How to use: http://gmc.yoyogames...29451&p=4608157

Description:

TMC SGS Fast Collision System

Spacial Grid Segregation System that allow fast collision detection which improves on Studio's Collision System

You can literally have thousands of bullets or thousands of instances colliding with themselves at a cost of about 1% of Studio's Native Collision System

Functions that mirror most useful Studio Collision Functions Included

Functions to emulate Studio's Collision Event Included so little changes is needed in your code

Example Included with API

Note YYC Error: http://gmc.yoyogames...29451&p=4835124

Screen Shots:
screenshot1.jpg

screenshot2.jpg

screenshot3.jpg


YouTube:


Games Using Tool

Modulus
https://www.youtube....5Fruk5iaozVQaif

Super TMC SGS Demo
http://gmc.yoyogames...howtopic=637430

Edited by icuurd12b42, 18 January 2016 - 02:12 PM.

  • 9

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#2 Greenhawk

Greenhawk

    Gue Games

  • GMC Member
  • 722 posts
  • Version:GM:Studio

Posted 06 July 2014 - 11:11 PM

So this is what TMC has been working on  :thumbsup: .No lag with thousands of bullets? Good Call  :teehee:


  • 0

Games Made:

 

Youtube Channels:

One of the many GMC Gurus.


#3 slayer 64

slayer 64

    Slayer of gingers

  • GMC Member
  • 4301 posts
  • Version:GM:Studio

Posted 07 July 2014 - 12:07 AM

this was all implemented in gml?
  • 0

5y5rs3d.pngfg0UQNL.png


#4 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 07 July 2014 - 12:26 AM

this was all implemented in gml?


Yes
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#5 gadgetmawombo

gadgetmawombo

    GMC Member

  • GMC Member
  • 330 posts
  • Version:Unknown

Posted 09 July 2014 - 12:47 AM

Im thinking about buying this, does this extension work on all platforms, or is it windows only?


  • 0

Merv%20combo_zpsklyiqgwb.gif

39134.png


#6 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 09 July 2014 - 01:28 AM

Im thinking about buying this, does this extension work on all platforms, or is it windows only?

All platforms... it's gml scripts
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#7 gadgetmawombo

gadgetmawombo

    GMC Member

  • GMC Member
  • 330 posts
  • Version:Unknown

Posted 09 July 2014 - 04:49 AM

Will we get any updates, or do we have to pay again?


  • 0

Merv%20combo_zpsklyiqgwb.gif

39134.png


#8 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 09 July 2014 - 04:55 AM

The marketplace is set up so you get updates when a update is uploaded. I see no options to force paying for updates... so no, you don't pay for updates
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#9 gadgetmawombo

gadgetmawombo

    GMC Member

  • GMC Member
  • 330 posts
  • Version:Unknown

Posted 09 July 2014 - 05:32 AM

Cool then, sorry for all the questions.


  • 0

Merv%20combo_zpsklyiqgwb.gif

39134.png


#10 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 15 July 2014 - 04:24 AM

I got a review!!

Herminio S 14 July 2014


A good extension that needs better commenting.

Gave it a weekend of implementing, and was disappointed the performance wasn't much different. I'm guessing its because I implemented it into a complex 2D platforming engine, rather than just using it for basic collision checks.

In my platforming code wherever I used: instance_place, place_meeting, collision_line or collision point, I replaced them with SGS versions of them, making sure that my platforming still worked as intended. The game functioned correct but the performance practically stayed the same...

I'm not factoring that^ into my score since it could have been my implementing.

But this is a universal critique: The API could use better commenting. The only reason I implemented this is because I copied the example file, but maybe the reason I had no luck with it is because I didn't actually KNOW how anything really worked, or the relations between the scripts. I studied it to the best of my ability and kind of assumed how things worked...A PDF would have helped.


As a result I updated the system with a new example callback script, fixed the docu-comments and added a READ_ME script

Herminio, PM me if you have troubles, maybe your setup is not right or maybe your original game did not needs sgs... or maybe you still have the original collision events in there :)

New readme script added

/*
TMC_SGS works to improve the collision speed from Studio's default collision system.

You need to be aware of how things work to allow for a proper porting from Studio's collision event to the TMC_SGS system.

first in a controller object, you create a sgs field

on room_start or create:

global.ai_sgs_field = sgs_field_create(sgs_demo_obj_ai,256);
where sgs_demo_obj_ai is the target object, can be a parent or a specific object

where 256 is the size of the grid cells for the room, this value should be twice as large as your largest object and big enough the encompass the target object speed. having this too small may cause skipping, lag the system or even fail if the number of generated cells is too enormous, for example if your room is 100000x1000000 and your cell size is 32, that would make 9765625 cells, and will fail to allocate the grid at worst, or hang the system at best

Do this for every collision types you wish to convert to, using another global for each types, ultimately you may use parenting and only have one field, it's up to you. You can segregate the object type either in the collision_check function or the collision event callback script later.

global.ai1_sgs_field = sgs_field_create(sgs_demo_obj_ai2,256);
global.ai2_sgs_field = sgs_field_create(sgs_demo_obj_ai3,413);
global.ai3_sgs_field = sgs_field_create(sgs_demo_obj_ai4,128);
or
global.all_ais_sgs_field = sgs_field_create(sgs_demo_obj_ai_parent_obj,256);
Note that having multiple fields you can set the cell size to different values depending on the circumstances.


if the cell size is too large, like the same size as the room, then well then the system will act in a manner similar to Studio's collision system and give no benefits

Second you need an initial step iteration, you call this after you create the field and every step or end step after that:
sgs_step(global.ai_sgs_field,(1000000/room_speed) * frameskip);
where global.ai_sgs_field is the field you created and frameskip is the number of frames to skip, it is a good idea to allow frame skipping so the system does not bog down the cpu calculating the field content each step especially if not running under YYC

Do this for every field you created...
sgs_step(global.ai1_sgs_field,(1000000/room_speed) * 4);
sgs_step(global.ai2_sgs_field,(1000000/room_speed) * 6);
sgs_step(global.ai3_sgs_field,(1000000/room_speed) * 8);
or
sgs_step(global.all_ais_sgs_field,(1000000/room_speed) * frameskip);
Your cell size and the frameskip act together to limit the cpu processing and so you have to take the object size, speed and the frameskip into consideration. for example if your object is 200x200 and travels at 100 in speed (unlikely) and your framskip is 6, meaning it fills the cells every 6 frames, then your object may have traveled 600 pixels and so your cell size should be 600+200....

You have to test and tweak until you are satisfied there is no skipping in collision and the framerate is optimal. Be sure to have a debug output for fps_real and tweak until it is the largest value

Note that having multiple fields you can set the skipping to a different values depending on the circumstances

If you are replacing collision events with SGS:
In your object that has the collision event you wish to replace with sgs, copy the collision event code,
duplicate
callBack_GenericCollision script,
name it obj_collides_with_obj, for example: bullet_collides_with_ship

delete the original collision event, ultimately you can change the event to user event 0 or whatnot to keep the code intact if you want to revert later.

Paste the code in the callback script at the location preferable to your situation, see the script for more details.... and type in the object name or parent object name for the collideswith object you are handling. If your object has multiple collision events, copy and paste the code section to handle all the other object, and nuke the collision events in the object of course.... Or make a new callback event for each collision if you have individual fields...

Now in your object, add a end step event if you did not have one and add the code that will emulate the collision event.

if(sgs_collision_event_emu(global.ai_sgs_field,bullet_collides_with_ship))
{
alarm[0] = 1;
}
if you have separate field, do this for every field... ultimately you may have multiple collision callback scripts or a single all encompassing script. it is up to you.

[/code]
Collision Functions:
If you are replacing a collision function with a sgs equivalent, simply call the script matching the function you want. For the function to work, the sgs field must have the object type in question in the cells of course

if(sgs_collision_point(global.ai_sgs_field ,x,y,obj_ai,0,1))
{
//collision point here.
}

We have tested the event emulation versus the collision functions and tested all collision functions against each other and there is no noticeable difference between sgs_collision_point() and sgs_instance_place() and sgs_place_meeting() and *sgs_collision_event_emu(). (*if the callback performs an early exit.)

sgs_collision_line() is slower than the other functions but still faster than Studio's version, unless the line encompasses the entire room, in which case use studio's collision_line().

sgs_instance_nearest() is much faster than studio's and also has a range value which is usually how you would use the feature. the range is needed to limit the search in the affected cells. DO NOT USE IT if you do not want to use a range; that is do not call it with a range that makes it look in the entire set of cells in the field. use Studio's version in that case.
*/

Edited by icuurd12b42, 15 July 2014 - 05:26 AM.

  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#11 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 06 September 2014 - 09:30 PM

v1.0.3 is up!!
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#12 Csus

Csus

    Cranberry

  • GMC Member
  • 293 posts
  • Version:GM:Studio

Posted 06 September 2014 - 10:43 PM

it's a shame i don't get the luxury to spend money on excellent thing's like this. from the demo video it looks like you've done one hell of a good job on this! bravo man, bravo :)


  • 0

#13 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 06 September 2014 - 10:58 PM

cheaper that buying YYC :) It's the cost of 3 coffees at starbucks ;)

Edited by icuurd12b42, 06 September 2014 - 10:58 PM.

  • 4

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#14 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 785 posts
  • Version:GM:Studio

Posted 07 September 2014 - 08:15 AM

cheaper that buying YYC :) It's the cost of 3 coffees at starbucks ;)

 

So much THIS^


  • 0

lord5.png

 


#15 Indecom4000

Indecom4000

    GMC Member

  • GMC Member
  • 1636 posts
  • Version:GM:Studio

Posted 07 September 2014 - 08:33 AM

Too bad my paypal is all dried up right now cuz this is totally worth a buy!


  • 0

LD-Logo-sml.png


#16 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 25708 posts
  • Version:GM:Studio

Posted 07 September 2014 - 09:25 AM

I've been playing with this and I notice that it's only really worthwhile with LOADS of instances. If you set the ALS instances to 100 instead of 4000, the GMS collisions are actually faster for me. The TMC version gives me about 93 FPS with the demo settings and 100 enemies, but the native GMS version gets me 120. I need to bump up the enemy instances to 200+ before parity is reached, and higher still to get the improvement. So, these scripts are really designed for Danmaku type games? Or am I missing something? Oh, and the OneDrive demo link is broken it appears...


  • 0

U1FVsm3.png

40799.png


#17 gadgetmawombo

gadgetmawombo

    GMC Member

  • GMC Member
  • 330 posts
  • Version:Unknown

Posted 07 September 2014 - 09:59 AM

Yeah I got similar results from this. It's MUCH better than the normal collisions but only if their is a lot of collisions going on at once, otherwise the default collisions are faster.

 

I'd say for a lot of games tho, this is a good tradeoff and a solid engine. I'll keep this in my toolbox until I find a game idea (such as a bullethell) that would benefit from lots of collisions. Either way, I didn't regret the purchase.


Edited by gadgetmawombo, 07 September 2014 - 10:02 AM.

  • 1

Merv%20combo_zpsklyiqgwb.gif

39134.png


#18 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 785 posts
  • Version:GM:Studio

Posted 07 September 2014 - 10:34 AM

Well, there is a threshold where normal collisions can be faster (when dealing with small numbers) due to the number of operations involved. Though this curve is much sharper with native compile where the gml and regular functions start on a level playing field. That said, if your numbers are small enough to be on the wrong side of the curve consistantly, you probably don't need it.

Another thing is thoughtfully crafting the project around the nature of the system. Profiling with different tick rates, cells sizes can massively impact the runtime performance. Make maximum use of temporal coherance and given a choice sgs track the smaller and slower of the two object types( it is often better to track the targets rather then the projectiles). Cell sizes should be as small as the tracked object's mask * top speed * desired tick rate allows.

Another thing to keep in mind is the possibility of more creative uses. In Modulus(my long term project) I use a modified sgs process to cull light sources for the lighting shader.

Another non obvious use is in collision avoidence schemes, the optimized instance nearest can be used to keep objects aware of potential collisions ( think cars in a large traffic system) for effective steering behaviors, to say nothing of low cost targeting of instances in range.

Edited by lordvtp, 07 September 2014 - 11:27 AM.

  • 2

lord5.png

 


#19 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 07 September 2014 - 09:16 PM

The one drive link does seem to work for me. please retry and tell me if that works now
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#20 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 25708 posts
  • Version:GM:Studio

Posted 07 September 2014 - 11:28 PM

Its saying that I don't have permission to view it or that it's been deleted....


  • 0

U1FVsm3.png

40799.png


#21 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 08 September 2014 - 12:49 AM

Its saying that I don't have permission to view it or that it's been deleted....


Stupid Ondrive... I think I fixed it. care to try again?
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#22 Nocturne

Nocturne

    Nocturne Games

  • Administrators
  • 25708 posts
  • Version:GM:Studio

Posted 08 September 2014 - 05:33 AM

Yep. all fixed! Btw, it would be really nice if the demo and the Marketplace file had some other examples of use, like those mentioned by Lordvtp above.... It would possibly help with sales too, since at the moment it looks like all this is useful for is bullet-hell style games. I'd love to see it used in other situations.


  • 0

U1FVsm3.png

40799.png


#23 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 08 September 2014 - 06:41 AM

I have not thought of any other situation than a mega bullet hell game

here is Lordvtp's Modulus Playlist


Another use COULD be huge platform system such as Terraria



Where in which case one would likely modify the "fill" loop or simply call sgs_step() once ore when there is a change in content as there is no need to update the non moving instances

UPDATE:
Changes in 1.0.4
Tweaked the collision functions to performs object type check before the collision check, making the least costly operation first. Added zxc keyboard support to perform the collision functions test. Holding Space will make the demo use the gm equivalent of the function checks for the zxc test as well as the instance_nearest and collision line check already in place


Edited by icuurd12b42, 08 September 2014 - 07:56 AM.

  • 1

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#24 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 10 September 2014 - 07:37 AM

UPDATE 1.0.5
Fixed collision detection to use surrounding cells on cell overlap (if instance calling sgs_place_meeting() overlaps). Changes affect sps_place_meeting, sgs_instance_place and sgs_collision_emu
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#25 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 10 September 2014 - 11:33 PM

UPDATE 1.0.6
added _c and _s for Cell only and Safe for a few functions. the _c versions of a function performs the check on a single cell. the _s versions are safer to use in the case you instance_destroy() instances loaded in the sgs field cells. With this you have an option for the faster and safer functions.
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#26 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 785 posts
  • Version:GM:Studio

Posted 11 September 2014 - 06:51 AM

Just butting in,  but I have been working on demonstrators for GMS tools and spend the last three days making this-

 

http://gmc.yoyogames...howtopic=637430

 

It makes use of SGS methods for several things.

 

Next demo I plan to do that large scale traffic SGS scheme, this current demo is largely limited by the huge number of multi lighted meshes being drawn rather then typical logic. 


  • 0

lord5.png

 


#27 alexamfm

alexamfm

    GMC Member

  • Banned Users
  • 22 posts
  • Version:GM:Studio

Posted 30 September 2014 - 10:20 PM

does it works with the gms physics engine?? box2d

 



#28 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 01 October 2014 - 12:40 AM

does it works with the gms physics engine?? box2d

Never tried but it should though you would not get any benefits at that point since the physics engine which is slower than GM's own is still in use
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#29 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 28 November 2014 - 11:38 PM

Get it on sale this Thanksgiving Weekend for a fraction of the cost!!
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#30 FelixPF

FelixPF

    GMC Member

  • GMC Member
  • 38 posts
  • Version:GM:Studio

Posted 30 April 2015 - 06:49 AM

Hi icuurd12b42,

Does TMC SGS Fast Collision System support iOS and App Store export?


  • 0

8k854It.png  YGyckni.png  rIw1WmT.png

Follow me on Twitter: @Gnefnap


#31 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 30 April 2015 - 09:31 AM

It's all GML so it should
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#32 csanyk

csanyk

    GMC Member

  • GMC Member
  • 624 posts
  • Version:GM:Studio

Posted 01 May 2015 - 05:08 PM

 

Im thinking about buying this, does this extension work on all platforms, or is it windows only?

All platforms... it's gml scripts

 

 

GML scripts doesn't imply that it will work on all platforms. There's plenty of native GML functions that do not work exactly the same on all platforms, or don't work at all on certain platforms (I'm looking at YOU, HTML5 :(  :whistle: ).


  • 0

#33 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 01 May 2015 - 08:18 PM

Im thinking about buying this, does this extension work on all platforms, or is it windows only?

All platforms... it's gml scripts

 
GML scripts doesn't imply that it will work on all platforms. There's plenty of native GML functions that do not work exactly the same on all platforms, or don't work at all on certain platforms (I'm looking at YOU, HTML5 :(  :whistle: ).


Right... it's all gml scripts that involve ds grids, ds lists, collision functions like instance_place, loops and math... so I doubt very much there are incompatibilities. If you find any tell me and we'll work together to solve any issues
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#34 csanyk

csanyk

    GMC Member

  • GMC Member
  • 624 posts
  • Version:GM:Studio

Posted 02 May 2015 - 01:10 AM

icuurd12b42, I had a look at your other Marketplace assets, and they look really, really good to me.  I just bought three of them, I'm sure you'll be glad to know:)  I don't have an immediate need for this one, but the demo video makes it apparent it's high quality as well.  I am looking forward to playing around with them.  Your free particle system designer looks freaking amazing.  Top notch.


Edited by csanyk, 02 May 2015 - 01:12 AM.

  • 0

#35 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 02 May 2015 - 02:48 AM

icuurd12b42, 

I had a look at your other Marketplace assets, and they look really, really good to me.  I just bought three of them, I'm sure you'll be glad to know:)  I don't have an immediate need for this one, but the demo video makes it apparent it's high quality as well.  I am looking forward to playing around with them.

Thanks and enjoy!

Your free particle system designer looks freaking amazing.  Top notch.

TMC Franke made the particle effects designer and the related assets
http://gmc.yoyogames...opic=655654&hl=

Edited by icuurd12b42, 02 May 2015 - 02:49 AM.

  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#36 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 05 July 2015 - 08:13 PM

New YYC Error

"In Object sgs_demo_debug_square, in Event DrawEvent action number 1 at line 3 : using uninitialised variable 'txt'


in the create of sgs_demo_debug_square, add txt = ""; in there

the YYC is getting stricter every release and it does not like seeing variables in the object (which was) created elsewhere. This would be classified as a YYC bug really as in some instances it does not mind variables created elsewhere and sometimes it does. We have yet to figure out the conditions... but mainly the txt should be in the create...

Since the problem resides in the demo object, no changes/updates will be made
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#37 Mania

Mania

    GMC Member

  • GMC Member
  • 231 posts
  • Version:GM:Studio

Posted 29 September 2015 - 10:41 AM

Was keen to give this a try as I saw it half priced the other day. I couldn't get it however because YYG couldn't log me in properly. Now it's back to normal price. :/ Anyway, was going to ask whether there will be support for the other collisions such as collision_circle and collision_rectangle?


  • 0

gb_greenlight.png


#38 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 29 September 2015 - 11:38 AM

Was keen to give this a try as I saw it half priced the other day. I couldn't get it however because YYG couldn't log me in properly. Now it's back to normal price. :/ Anyway, was going to ask whether there will be support for the other collisions such as collision_circle and collision_rectangle?

Frankly I thought those were in there but downloading the asset I see they are missing.

I had added those a long time ago, but I guess it was during the time there was issues with updating assets... When I changed my drive to a ssd while cleaning my disk to be able to clone my drive I did not keep these asset projects since I could get them from the store. I guess I never got around to updating the asset.

I can post scripts for those here if you really need them.
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#39 Mania

Mania

    GMC Member

  • GMC Member
  • 231 posts
  • Version:GM:Studio

Posted 14 October 2015 - 11:49 AM

Hey mate any chance I could buy the asset somewhere else? I can Paypal if needed. I've tried so many times through the marketplace but it just won't work (some issue logging/integrating with Steam).

 

Edit. Nm, managed to push through it. Gosh I hate the Marketplace. First off I had to use the browser to login to Steam because doing it via GM wasn't working. Then I tried to purchase the asset but ran into this unresolved payment issue. Luckily the Paypal option worked! Buying things shouldn't be this hard. :angry:


Edited by Mania, 14 October 2015 - 12:04 PM.

  • 0

gb_greenlight.png


#40 Mania

Mania

    GMC Member

  • GMC Member
  • 231 posts
  • Version:GM:Studio

Posted 14 October 2015 - 12:49 PM

Uhh, I should've probably read everything more carefully. I was under the impression I would get a bunch of collision scripts that would replace the core ones. Instead this is quite a complex system to use. The Readme really should explain some basic things like what is it that this thing is / what we're doing. "Spatial Grid Segregation" says absolutely nothing to me and I don't know why I'm needing these sgs fields in the first place. There's frameskipping even. I would add some warnings to the marketplace that expert knowledge is required for implementation. Now back to it, hoping I'll figure it out...


  • 0

gb_greenlight.png


#41 Mania

Mania

    GMC Member

  • GMC Member
  • 231 posts
  • Version:GM:Studio

Posted 14 October 2015 - 01:42 PM

I followed the instructions and it seems to work (in a way that nothing breaks and collisions still work) however the speed is no different and the FPS really tanks periodically which I think is due to the step event command.

 

 

global.ai_sgs_field = sgs_field_create(sgs_demo_obj_ai,256);

 

where 256 is the size of the grid cells for the room, this value should be twice as large as your largest object and big enough the encompass the target object speed

 

I'm not really sure why you have 256 here considering your biggest object is 32 pixels wide? Anyway, I've tried 24, 48 and 256, doesn't really make a difference (my room is divided into 24 wide cells).

 

 

sgs_step(global.ai_sgs_field,(1000000/room_speed) * frameskip);

 

Is 1000000 some specific number related to frame skipping? As for the frameskip variable I tried 2, 4 and 10 (as per your demo) but doesn't really make a difference.

 

What gives? Am I doing things completely wrong?


  • 0

gb_greenlight.png


#42 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 14 October 2015 - 02:36 PM

>this value should be twice as large as your largest object and big enough the encompass the target object speed
This is the minimum size grid for your game, however it is not a requirement as the demo uses 256 which makes for larger cells and therefore fewer cells for the room. If your room is huge and the cells small it could result in a ridiculous and unmanageable amount of cells and therefore lagg or even crash from failure to allocate a grid or from having to iterate through a too large number of cells.

>Is 1000000 some specific number related to frame skipping
1000000 This is one second in game time
1000000/room_speed calculates the time for 1 frame and * frameskip adjusts the time to match a specific number of frames (steps). so if the value is 5, it will recalculate the field every 5 steps. This formula tells the system to recalculate the grid information every N steps, but in actual time as opposed to a specific number of steps. An equivalent value for steps but in actual time.

If you are wondering why I don't use a actual step value/count for this but a time delay equivalent, it is because my games mostly use delta time.

>Am I doing things completely wrong?
Possibly. I did not spoof that video so there has to be a mistake somewhere. If you want to PM me your GMZ (File Export) I can see what's wrong in there.

Edited by icuurd12b42, 14 October 2015 - 02:46 PM.

  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#43 Mania

Mania

    GMC Member

  • GMC Member
  • 231 posts
  • Version:GM:Studio

Posted 14 October 2015 - 02:53 PM

>this value should be twice as large as your largest object and big enough the encompass the target object speed
This is the minimum size grid for your game, however it is not a requirement as the demo uses 256 which makes for larger cells and therefore fewer cells for the room. If your room is huge and the cells small it could result in a ridiculous and unmanageable amount of cells and therefore lagg or even crash from failure to allocate a grid or from having to iterate through a too large number of cells.

 

How much is too much? My room is 1920x1080 with 24x24 cells.


  • 0

gb_greenlight.png


#44 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 14 October 2015 - 03:58 PM

>this value should be twice as large as your largest object and big enough the encompass the target object speed
This is the minimum size grid for your game, however it is not a requirement as the demo uses 256 which makes for larger cells and therefore fewer cells for the room. If your room is huge and the cells small it could result in a ridiculous and unmanageable amount of cells and therefore lagg or even crash from failure to allocate a grid or from having to iterate through a too large number of cells.

 
How much is too much? My room is 1920x1080 with 24x24 cells.

Depends if you are compiling under YYC or not. I found having 20 instances per cell (larger cells) is more efficient than having 1 instance per cell (tiny cells). In any case it depends on the game, the distribution of the instances in the game, the number of instances. If for example you have instances in each and every cell all the time that would cause the update to constantly manage (in your case) 3600 cells each time sgs_step is called. Under YYC this is not an issue, but under normal output this can cause a problem. In most case you have to play with the sizes until the performance is stable. In the demo's case, 5(speed of ai) * 10(step skip) = 50 + 42(sprite width) = 92... * 2 = 184... so I set it to 256. which give 25 * 19 cell. 475 cells in all. which is a lot less than your setup. And it manages 4000 AI with 2000 bullets under normal output...

Non moving instances, like walls for example, dont require sgs_step to be called (well needs to be called once and done) and in such case you can get away with the cell being the same size as the wall tile.
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#45 lordvtp

lordvtp

    GMC Member

  • GMC Member
  • 785 posts
  • Version:GM:Studio

Posted 15 October 2015 - 04:52 AM

 

>this value should be twice as large as your largest object and big enough the encompass the target object speed
This is the minimum size grid for your game, however it is not a requirement as the demo uses 256 which makes for larger cells and therefore fewer cells for the room. If your room is huge and the cells small it could result in a ridiculous and unmanageable amount of cells and therefore lagg or even crash from failure to allocate a grid or from having to iterate through a too large number of cells.

 

How much is too much? My room is 1920x1080 with 24x24 cells.

 

My game Modulus uses a 30,000x30,0000 room with 5 layers of sgs grids ^___-


  • 0

lord5.png

 


#46 Pro Pro.

Pro Pro.

    GMC Member

  • GMC Member
  • 739 posts

Posted 25 January 2016 - 11:31 AM

I'm trying to figure out what the downsides to this is.

 

This can do precise pixel perfect collisions right?

 

If I use YYC its basically as fast or faster no matter what right? Even if i have timestep at 1 (because i need collisions every step)?

 

Do both objects that are colliding need to be in a field?

 

EDIT: Actually, i think i understand what this is... it gets a list of objects within certain cells to check instead of checking all objects right?


Edited by Pro Pro., 25 January 2016 - 11:53 AM.

  • 0

#47 Pro Pro.

Pro Pro.

    GMC Member

  • GMC Member
  • 739 posts

Posted 26 January 2016 - 10:30 AM

I was Sent this reply via PM:

 

 

 

a field is a grid, each cell has a list, containing the instance ids of the type you told the field

When you update the field, the cell will be repopulated, you should not do this every step. the cell size should be large enough to take into account how much the instances in the field can move

when you do a collision check call at a position, only the instances in the potential cells are checked as opposed to every instance in the whole room

An instance will be in every cell it intersects with

http://snag.gy/cp833.jpg

and doing a collision check the instance doing the check will also do the check against every cell it intersects with. 

if you do a field update every step it can very well break to optimization system. Best approach is to have the cell the size of the largest object + the speed it travels over a time period.

the more instance you have of a particular type, the more delay you should have between checks because to more time it takes to fill the grid and lists. it's better to fill the field ever 1/2 second if you have 10000 instances, using a field cell size of 256 if mostly only 3-4 instance will occupy each cell than have a small cell size updated every step where each cell is mostly empty or have one instance in them....

It about balancing.

Non moving objects (walls) should be in a field of their own, you don't need to update non moving object field unless something is added or removed in the world... a wall is destroyed or added. Non moving object field can have their cell size exactly the size of the wall pieces. but I never really bothered being that perfect myself. The system is very forgiving


Yes is does do precision collision but if you cell size is too small VS the instance movement vs the field update time then you will have skippage. You have to tweak until their is no more skipage. I favor increasing the cell size of the field as opposed to reducing the update check time.

  • 0





Also tagged with one or more of these keywords: engine, extension