Jump to content


Photo

[Mostly Free] Random point inside a sprite

sprites scripts

  • Please log in to reply
9 replies to this topic

#1 GamerXP

GamerXP

    GMC Member?

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

Posted 04 March 2015 - 09:24 AM

It's actually called "Sprite Area Analyzer",but noone will get what it do from the name, so let's call it "Random point inside a sprite".

 

This system allows you to quickly find uniformly distributed random point inside any sprite.

Why would you want to find a random point inside a sprite? Usually, for effects like burning, different auras, etc.

 

Marketplace page

Free Download Link (For non-commercial usage only)

Feel free to download it from free link if you just want to take a look or not planning on selling your game. Otherwise - please, buy it, ok? It's only 3$.

Yep. If you're already downloaded it for free from marketplace, but wishing to send me some money - my PayPal is gamerxp@mail.ru

 

USAGE:

1. Call global initialization script.

2. Add sprites to the system.

3. Call script that will return random point.

 

FEATURES:

1. High performance of random point script.

2. Quick setup.

3. Multiple options for generating area data, that's used to find random point.

4. Cache system to save previously generated area data.

5. Two-step area generation script, that will allow to recreate existing area data must faster.

6. Draw function for previewing.

 

SCREENSHOTS:

Screenshot 1

Screenshot 2

Screenshot 3

 

For area data generation, it's recommended to use YYC since it improve performance a lot. After data is generated, cache system can be used instead for quick loads.

 

//••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

Drawing works in Create events no more. (Except first room create event)

 

Since this system uses surfaces for edge detection - you can make parsing calls only from 2 places:

1. First room's create events.

2. Draw event (make sure to call it only once of course)

 

Just so you know. If sprite data is not generated - you probably used it from some bad place.

//••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

 

PS. Init function and cache functions can be used from anywhere.

PS. Will be glad to hear comments, suggestions... and bugreports maybe (since I tested it only on Windows).

PPS. Come to think of it, I better make it free since I just want some feedback anyway.

PPPS. Changed paypent terms. It's free from non-comercial usage only now (search free download link somewhere in the post). Though, I can't stop you from pirating it.


Edited by GamerXP, 01 October 2015 - 03:41 PM.

  • 2

#2 jaimitoes

jaimitoes

    GMC Member

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

Posted 22 March 2015 - 12:50 PM

Very cool asset! Performance are good, works pretty well, no much more to say...thank you so much
  • 0

#3 CloudBomb

CloudBomb

    GMC Member

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

Posted 22 March 2015 - 05:15 PM

I thought this was a neat extension when I first saw it. This idea is useful for a lot of things, and I think making it free is very generous of you. 

 

Good job!


  • 0

#4 GamerXP

GamerXP

    GMC Member?

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

Posted 22 March 2015 - 05:28 PM

Well, just though I should first make some sort of "portfolio" before actually selling stuff, so people will know what to expect before actually buying it. Thinking about making pack of scripts and shader for working with palette. Like palette swap, dithering, indexing, etc. Should be even more useful than those scripts.


  • 0

#5 GamerXP

GamerXP

    GMC Member?

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

Posted 05 May 2015 - 03:19 PM

Attention those, who actually downloaded it. I changed a bit payment option. It's still free, but I want you to buy it if you're going to use it for commercial game. Marketplace asset is paid now, but there are free download links in this thread and in description at marketplace page.

 

Well. If you still don't want to pay for commercial usage - it's not like I can do anything about it. Think of it as 3$ donation. Maybe I'll make another asset with same usage terms if people are actually wishing to pay at least a bit.


  • 0

#6 Pixelated_Pope

Pixelated_Pope

    GMC Member

  • GMC Member
  • 338 posts

Posted 30 September 2015 - 04:34 PM

Just bought it.  Looks awesome, GamerXP.  Thanks for all your assistance. 


  • 1
 

D3svqFp.pngen_generic_rgb_wo_60.png

  Currently in a "beta" state.  Working on the new graphic overhaul right now!
 

#7 Pixelated_Pope

Pixelated_Pope

    GMC Member

  • GMC Member
  • 338 posts

Posted 30 September 2015 - 07:49 PM

So, I've started to implement this in my project... any idea why it would only work in Debug mode?


  • 0
 

D3svqFp.pngen_generic_rgb_wo_60.png

  Currently in a "beta" state.  Working on the new graphic overhaul right now!
 

#8 GamerXP

GamerXP

    GMC Member?

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

Posted 01 October 2015 - 04:37 AM

Eh... maybe you're using YYC as compiler, and you need to clear C++ cache since GM messed it up a lot. Debug mode uses normal compiler even if YYC selected. Otherwise it will be weird that it won't work since I obliviously tested it in both modes.

 

PS. Just  checked it on latests GM version - thought maybe something broke it. Nope, works fine for me. Both normal and YYC Windows versions


Edited by GamerXP, 01 October 2015 - 04:40 AM.

  • 0

#9 Pixelated_Pope

Pixelated_Pope

    GMC Member

  • GMC Member
  • 338 posts

Posted 01 October 2015 - 02:53 PM

Yeah, I don't know what to tell you.  I was doing both normal and YYC.  It just wouldn't work.  I went to step through it and it started working.  So I started putting debug messages throughout the code and it looked like data grid returned from get rectangle had a size of 0.  *shrug*  I removed it from my project for now, but I'll try and reproduce it and get you a copy of my project to see if it happens on your end.

 

[edit]Sent you a PM with my project in it.


Edited by Pixelated_Pope, 01 October 2015 - 03:07 PM.

  • 0
 

D3svqFp.pngen_generic_rgb_wo_60.png

  Currently in a "beta" state.  Working on the new graphic overhaul right now!
 

#10 GamerXP

GamerXP

    GMC Member?

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

Posted 01 October 2015 - 03:39 PM

Yep. There was this thing in latest GM versions. Title is:

 

Drawing works in Create events no more. (Except first room create event)

 

Since this system uses surfaces for edge detection - you can make parsing calls only from 2 places:

1. First room's create events.

2. Draw event (make sure to call it only once of course)

 

Just so you know. If sprite data is not generated - you probably used it from some bad place.

 

PS. Init function and cache functions can be used from anywhere.


Edited by GamerXP, 01 October 2015 - 03:39 PM.

  • 0





Also tagged with one or more of these keywords: sprites, scripts