Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / best way for physical destruction

Author
Message
brunuu
5
Years of Service
User Offline
Joined: 4th Jun 2018
Location:
Posted: 29th Feb 2020 00:50
That's a good idea, I hadn't thought about it.
brunuu
5
Years of Service
User Offline
Joined: 4th Jun 2018
Location:
Posted: 1st Mar 2020 16:38 Edited at: 1st Mar 2020 16:41
i was doing this in c++ in tier 2 but i converted to BASIC
in case someone in the future looks for this subject.

I did 2 methods with several ideas from this thread

Static Method




Dynamic method with connections




the Virtual Nomad method is also great
https://forum.thegamecreators.com/thread/225827?page=1#msg2653100
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 1st Mar 2020 17:08
Thanks for sharing the solution it will come in handy to others im sure

The static method is my personal favourite the dynamic method with connections
looks a bit like the start of a Christmas tree to me on my old pc which im sure some
updating might fix and or closing off some of the apps im running atm. Weird how
I have that issue now and not before.

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 1st Mar 2020 19:38
That looks superb. What an excellent set of solutions. Thanks!!
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 1st Mar 2020 19:51 Edited at: 1st Mar 2020 19:55
Quote: "the Virtual Nomad method is also great"

not quite 2 mistakes in mine:

1) not also checking the y velocity to ensure the sprite is static; easily fixed:


2) not checking if there is a block below to hold it up (which should also make it dynamic/let it fall - if there's something on both sides, maybe they'd squeeze it in place?). this is where i like your latest jointed effort. i would go back into mine and add the check, but that will lead to something more (and more, and more). i'm not up for that ATM.

but, thanks for the mention. and, thanks for the OP; i hope to revisit some day.
brunuu
5
Years of Service
User Offline
Joined: 4th Jun 2018
Location:
Posted: 2nd Mar 2020 03:45
I tried to use shaders but then I got to the conclusion that I have no idea how shaders work
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 2nd Mar 2020 12:45
@brunuu: What shader do you need ?
brunuu
5
Years of Service
User Offline
Joined: 4th Jun 2018
Location:
Posted: 2nd Mar 2020 13:26 Edited at: 2nd Mar 2020 13:26
I don't know very well, because I have no idea how they look in 2D
I tried to find shader tutorials for AppGameKit but most of them are for 3D
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 2nd Mar 2020 20:40
Quote: "What shader do you need ?"


I think a "stamp" shader would be the go.

Have an image with shapes that need to be erased in one texture slot
Mesher
User Banned
Posted: 3rd Mar 2020 01:13 Edited at: 3rd Mar 2020 01:24
A shader or anything is 2D unless we change projections to 3D ourselves. Just thought give you that insight.

thats why there is * Projection in shaders to convert to 3D

but everthing is indeed in 2D unless we tell it otherwise by the projection

A shader works on pixels from top right to bottom left in a 2D screen resolution

Each frame in the shader main loop is per pixel - so what ever you wish to do in every main loop of the pixel PS file, is your choice. with only certain limitations of Fract, len, mix, smoothstep, dot etc i cannot see how this can be acheived by shaders

Interested....


blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 3rd Mar 2020 02:30
Attached is a project that will "erase" a particular shape from an image at the cursor position when you click.
The idea would be that you would track the motion of the wrecking ball and apply the "stamp" to each position erasing that piece of the image, which i guess, (In the case of a rampage game) would reveal the underlying girders and support structure (image below)

Attachments

Login to view attachments
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 3rd Mar 2020 15:44 Edited at: 3rd Mar 2020 15:46


So I too made a little test demo.
As you can see there are many problems with it.
AGK's mesh generation only produces convex meshes thats why I'd take a marching quad algorithm or something to produce a custom concarve mesh.
If you cut through the whole sprite like I did in the video, It doesn't split into 3 seperate sprites at the end(the stamp, the top and bottom sprite), so you end up with a floating part.
I think the guys who made notia made a good job, if you know what i mean ^^
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 3rd Mar 2020 21:23
Nice work. It looks quite good.
brunuu
5
Years of Service
User Offline
Joined: 4th Jun 2018
Location:
Posted: 4th Mar 2020 18:39
it would be nice if the forum had a way to give upvotes or likes
there is a lot of cool stuff in this thread.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 4th Mar 2020 22:55
Quote: "it would be nice if the forum had a way to give upvotes or likes"

a sound +1 from me.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 5th Mar 2020 06:33
@janbo
what would be the best method of showing like a bullet hole effect with AppGameKit (it looks like your stamp demo would work well for that)

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 5th Mar 2020 21:53 Edited at: 5th Mar 2020 21:56
@fubarpk: I guess Blink0K's will do too, with some raycasting to get the normal and rotate the bullethole appropriately.
Our shaders are pritty basic but gathering all the attributes and calculation from world position into render target pixel position is somewhat harder.
One part might look like this:
brunuu
5
Years of Service
User Offline
Joined: 4th Jun 2018
Location:
Posted: 4th Apr 2020 19:07


these strange dents
I still don't know why that happens
sometimes it doesn't and sometimes it does

Login to post a reply

Server time is: 2024-04-19 18:55:43
Your offset time is: 2024-04-19 18:55:43