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 / [STICKY] Some usefull 2D and 3D tools effects and snippets

Author
Message
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Apr 2018 17:32 Edited at: 1st Jan 2021 02:57
Some Shaders with full source created at runtime with example code
2D dissolve shader color tints a whole image (needs an image)

2D dissolve shader2 color tints a whole image and becomes totally transparent(needs 2 images)

with the 2dShaders you could change this line SetShaderConstantByName(1,"myColor",time#,time#,time#,time#) replacing time with a color amount between 0 and 1.0
for example SetShaderConstantByName(1,"myColor",1.0,0,0,0) would make the pic red without changing alpha similar can be done to the 3D ones
3D dissolve shader allows a method of color tinting a group of objects a set amount in one step

For those that want to play with Shaders in AGK There is some great documentation available here
https://www.appgamekit.com/documentation/guides/13_shaders.htm

Please feel free to share any of your own tools, effects and snippets


Quote: "I have included the links to the relevant pages so as people may have discussions on the appropriate page to help make it
easier for people to find helpful code should this thread get larger "


My webpage where it showcases all of my AppGameKit developments that are available free to download from Google Play
http://users.tpg.com.au/subarpk/index.htm

another 2D tinter shader great for colour to black and white

fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Apr 2018 19:03 Edited at: 12th Apr 2018 20:00
2D Text modifications on screen by subtracting ascii values
https://forum.thegamecreators.com/thread/218514

2D Multi direction scrolling with wrapping
https://forum.thegamecreators.com/thread/216193

Rotating a group of sprites around one location with help from CJB
https://forum.thegamecreators.com/thread/216392
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Apr 2018 19:15 Edited at: 12th Apr 2018 23:43
2d Physics motion game
https://forum.thegamecreators.com/thread/218886

2D Platform Tile Editor need to have your own tiles named 1 to 50 for example
https://forum.thegamecreators.com/thread/219932

2D Path Editor using Clonkex Bezier Curve
https://forum.thegamecreators.com/thread/221096

If you want to see something how I have combined both the tile editor and path editor
to make a never ending scrolling game visit https://forum.thegamecreators.com/thread/221096#msg2614055
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Apr 2018 19:20 Edited at: 12th Apr 2018 19:46
2d Snow without particles
builds up
https://forum.thegamecreators.com/thread/219225

2D snow with particles

2D Fireworks with trails
https://forum.thegamecreators.com/thread/218535
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Apr 2018 19:25 Edited at: 8th May 2018 17:50
3D Modifying a mesh height in real time with some help from puzzler
https://forum.thegamecreators.com/thread/221994


An easier way to modify mesh great for building a terrain but not for real time


Complete 3D minigame showing a never ending world by wrapping objects in a predefined workspace
https://forum.thegamecreators.com/thread/222010
fubar
puzzler2018
User Banned
Posted: 10th Apr 2018 19:38 Edited at: 10th Apr 2018 19:40
Hi

A really nice thought to create something iike this, 2D an 3D tools and things al under one thread

Movement of Camera in a 3D world would be a good one cause its asked all the time.

Well done - im sure if and when I can think of something ill post my examples but you got a good starting block for the moment

-)

EDIT - the last example with shadow etc is some really good and powerful work there, well done.

Just a small critism - maybe start slow at beginning and proressively speeds up through out the levels

Really good use of particals too
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Apr 2018 20:14 Edited at: 9th Jul 2018 09:36
Thanks puzzler I changed the code to include speed increasing over time to the 3D minigame

The following were part of my contributions to the minecraft thread which is very long and can be off putting to someone to search through
the whole thread, but there is much useful code and teachings on that thread so below is the link
https://forum.thegamecreators.com/thread/221407

3D snowman artifact

Rolling menu code snippet just copy paste and run

moving a 3D object in 3D Space with Mouse


A 3D Apple (fruit) really needs a texture created instead of color
but does slope in at the top

If I spent a bit of time working out a cylinder for a twig instead of the box I could bend it with a sinecurve and perhaps add a leaf lol
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 11th Apr 2018 01:59 Edited at: 9th May 2018 01:07
Added some useful tutorials ive found across forums

AGK First Video Tutorial - Random number guessing game

https://forum.thegamecreators.com/thread/188244

[Video Tutorial] ScribbleSquash (Full game tutorial)
https://forum.thegamecreators.com/thread/188387

How to add in-app purchase in your games. a step by step tutorial.
https://forum.thegamecreators.com/thread/191568

AGK online help file
https://www.appgamekit.com/documentation/home.html

AGK video tutorial one hello world sprites and more
https://www.youtube.com/watch?v=CbC7ju2kew8&list=PL62008E8509FB652B&feature=plcp

AGK Video tutorial two physics sounds sprites
https://www.youtube.com/watch?v=NR9sutVdBmg&feature=BFa&list=PL62008E8509FB652B

AGK Video tutorial three scrolling sprites
https://www.youtube.com/watch?v=rQ1-Zw6SGbk&feature=BFa&list=PL62008E8509FB652B

AGK Video tutorial four cameras and more
https://www.youtube.com/watch?v=kWAfHgrBb-M&feature=BFa&list=PL62008E8509FB652B

AGK Video tutorial five putiing your app in xCode
https://www.youtube.com/watch?v=EF5liNrFxMY&feature=BFa&list=PL62008E8509FB652B

Dans video tutorial sprite shadows
https://forum.thegamecreators.com/thread/204491

Smackit lite video tutorial
https://forum.thegamecreators.com/thread/204969

Working with UV coordinates in AGK
http://www.zimnox.com/resources/articles/tutorials/?ar=t004

Basic Parallax scrolling Video tutorial
https://forum.thegamecreators.com/thread/206458

Parallax scrolling tutorial 2
https://forum.thegamecreators.com/thread/206518

Pinch Zoom code and mini Tutorial
https://forum.thegamecreators.com/thread/205033

Scrolling lists tutorial
https://forum.thegamecreators.com/thread/207792

Dvaders video tutorials
https://forum.thegamecreators.com/thread/206716

Creating a simple GUI Tutorial
https://www.gamedev.net/articles/programming/general-and-gameplay-programming/creating-a-very-simple-gui-system-for-small-games-part-i-r3652

Free platformer code and tutorial
https://forum.thegamecreators.com/thread/211652

2D Tile engine tutorial with code
https://forum.thegamecreators.com/thread/212717

Blender to AppGameKit Tutorial
https://forum.thegamecreators.com/thread/221714

Newsletter with introduction to server code
https://www.thegamecreators.com/pages/newsletters/newsletter_issue_147.html
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 11th Apr 2018 04:22 Edited at: 11th Apr 2018 05:04
Quote: "I really hope people will post code here they are willing to share, including tools, effects, snippets and perhaps links to useful
tutorials with some title as to what they are about. Preferably code that doesn't require downloading as over time when
someone visits this thread these links may not work. One of the main reasons I like to create examples that may create
media on the fly or don't use media. The ones that need media and cant just be copied pasted and run are commented
above appropriately. THANKS "


APOLOGIES if the quotes sound like rules they're not, but firstly going through long threads can be off putting for
someone that just needs a small example to kickstart their code. I've been searching allot through some long threads lately
and it can be disheartening when you finally find what you believe is the perfect example for what you want but the
download link no longer works and there's probably plenty useful code already been shared, so people ask the same
question again.

For new people to AGK I recommend the following page its rather long but def has some great code shared
AGK Code Challengehttps://forum.thegamecreators.com/thread/218129 all code there is just copy
paste run
fubar
MikeHart
AGK Bronze Backer
21
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 11th Apr 2018 05:25
I would have used either Github or the codebase here to share all this.
Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200. Using AGK2 Tier 1.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 11th Apr 2018 07:15 Edited at: 11th Apr 2018 07:17
Quote: "I would have used either Github or the codebase here to share all this."

Thanks Mikehart I forgot all about the codebase

The code base for those interested it also has a good search ability
https://www.thegamecreators.com/codebase

I added some of the above

Manage Codebase Entries you can manage your own entries in the codebase at
https://www.thegamecreators.com/codebase/manage
fubar
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 11th Apr 2018 10:51
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 12th Apr 2018 15:08 Edited at: 30th Apr 2018 21:27
3D UV shifting

Create Sound From Memblocks

A Different Algorithm to make sounds from memblocks

3D Snow Example
fubar
The Next
Web Engineer
16
Years of Service
User Offline
Joined: 3rd Dec 2007
Location: United Kingdom
Posted: 12th Apr 2018 15:20
@fubarpk

We recently updated the forum AUP to require the use of properly formatted code blocks please update your code blocks to use the AppGameKit language code block tags instead of the default ones. You can do this by using [code lang="agk"]

This will help with code readability for everyone.
Windows 10, Intel i7 3.8 GHz, 16GB DDR3, NVIDIA GTX 780 4GB Superclocked

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 12th Apr 2018 21:22 Edited at: 12th Apr 2018 21:27
Quote: "We recently updated the forum AUP to require the use of properly formatted code blocks please update your code blocks to use the AppGameKit language code block tags instead of the default ones. You can do this by using [code lang="agk"]"

Apologies @The next I do remember seeing the new comment blocks but not that it was a requirement
but then I haven't been in a good headspace lately so that is probably me. But I have changed the necessary
codeblocks and I Agree it does make it easier to read.

I also notice now we have a mark as answer to forum questions, what a great idea
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 12th Apr 2018 22:57 Edited at: 12th Apr 2018 23:16
Scrolling TechDemo like in the past Does alsorts of stuff with sinewaves text and particles easier to just try no media required
which I used as an intro in my game Smiley Madness available free https://play.google.com/store/apps/details?id=smiley.Madness


Some Code demonstrating my fadein and fadeout functions requires 2 background images to test


These were my submissions in the AGK code challenge a very handy place to look for stuff
https://forum.thegamecreators.com/thread/218129?page=1
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 13th Apr 2018 02:11 Edited at: 14th Apr 2018 05:59
My frogger clone
video of what I did with it is shown below


and available free from google play here
https://play.google.com/store/apps/details?id=my.frogger

My Frogger Template no media required
in this version movement is done with the arrow keys and there
is one screen for the road and one screen for the river.
fubar
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 14th Apr 2018 20:33 Edited at: 14th Apr 2018 20:47
I made a simple app to create the text file for tiles in a atlas image
simply input image size and tile size and it creates the text file because iam lazy...
https://www.thegamecreators.com/codebase/view/d49d244179286fbfbfa13f17f6f8df0a

the app text says it creates in media folder but is in your documents folder so you know..
Some error on the codebase page so it cant be updated?

Attachments

Login to view attachments
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 15th Apr 2018 03:18
Very amazing resource for us newbs!
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Apr 2018 02:03 Edited at: 16th Apr 2018 02:05
Thanks Cliff Mellangard for sharing

Thanks Golelorn for your feed back

A Parabolic effect on a terrain mesh no media required

https://forum.thegamecreators.com/thread/222010
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Apr 2018 20:38 Edited at: 12th Apr 2019 14:20
Collisions between two objects


Check for collision between a sprite and 3D object
This example assumes you have placed the sprite by offset and the offset is in the center of the sprite
fubarpk
fubarpk on Itch...………...https://fubarpk.itch.io/
fubarpk on googleplay..https://play.google.com/store/apps/developer?id=fubarpk
kaband
21
Years of Service
User Offline
Joined: 22nd May 2003
Location: Chicago
Posted: 19th Apr 2018 14:09
Thanks for all this stuff. Its great!
I'm digging into the path editor now.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd May 2018 04:38 Edited at: 4th Jul 2018 11:25
3D Night Driving Original full source no media required makes for a great template
Now includes car headlights and a possibility of cows on road and stereoscopic options
arrow keys to steer and space to brake


The Explosion in the above uses a combination of sending blocks into orbit and sending the vertexs
of objects in all directions. Here is an easier explode function that should work on any mesh.
Vertex Explosion
fubar
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd May 2018 06:12
There's also the Useful Functions Community Project (which I've added this thread to)
And the Community Toolkit
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th May 2018 22:38 Edited at: 15th May 2018 18:21
A Speedometer created with code


A Vertical Health Bar
in this example width is set to 20 and height is set to 200 (easily changed)

Modifications could be made easy enough so as it uses a percentage system I left that out for simplicity.
A Horizontal Health Bar in this example width is set to 200 and height is set to 20 (easily changed)

Both of these health bars were written this way so as you could gradually change the health of a player using an image like a picture of a person etc
that you have previously loaded (ie Img and img3 with the two different images you plan to use). They both use 2 sprites to do this and 3 images
Because Sprite 1 is created before Sprite 2 it works otherwise you would have to use the SetSpriteDepth command to place Sprite 2 in front of Sprite 1.

A Radial Health Bar could be done similar to this gradually hiding the sprite beneath. This isn't a perfected method and there
are better radial ones on the forum including the use of shaders, its just a quick example to show how it could be done.

In the above the most distant back ground might be an animated sprite ie a heart pumping blood etc

A Simpler Horizontal Health Bar If you don't have a sprite youd like to hide or show as a background sprite its much easier to have a progress bar
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd Jun 2018 03:39 Edited at: 5th Aug 2018 16:03
Retrieve the color at x,y location on screen

Some string handling routine can be used to get the red or green or blue values individiualy

or if you just want the color for use with drawing commands
fubar
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Jun 2018 15:27
why are you returning the color value as a string and not dword/integer?
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd Jun 2018 16:50
Quote: "why are you returning the color value as a string and not dword/integer?"

at the time when I created that routine I wanted to output the red green blue values as a string
but it has been handy doing it that way for other effects and I am not sure if I return as a Dword
how I would address individual values doing it with a Dword. When I came across someone with
a problem on the forums I dug that routine up out of my code snippets and thought I would share
here
fubar
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Jun 2018 14:34
To extract the colors:

alpha = (color && 0xFF000000) >> 24
red = (color && 0x00FF0000) >> 16
green = (color && 0x0000FF00) >> 8
blue = color && 0x000000FF


To put them back together:
color = (alpha*16777216)+(red*65536)+(green*256)+blue


Technically, you wouldn't need the bitwise AND to extract the alpha but I put it in there to help demonstrate the pattern of how it's working. First, we mask the component we want, then we shift over to the first byte in the integer leaving everything else in the last 3 bytes empty.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 20th Jun 2018 03:41 Edited at: 22nd Jun 2018 20:20
A growing tree using draw commands and a Fractal formula demonstrating recursion




Adding some randomness to produce 3 prettier trees with varying thickness


The next step to the above is to try varying thickness with the use of a sprite pasting it to an image
0110 The sprite being designed something like it is to the left with 1 being white black being 0
1111 That would allow the branches to get smaller but without the previous branches last thickness showing (best to try the above if you aren't sure what I mean)
Replacing the drawline command and loop in the cantor function to something like
This could be used with the render to image capabilities of AppGameKit or using getimage to make even better trees (something to try)

If you change the cantor function to below you can control how many recursions


an example of controlling the recursion can be done with the following
fubar
puzzler2018
User Banned
Posted: 20th Jun 2018 06:56
I cant see what these look like as of now cause at work, but will certainly take a look later. Maybe very good to go onto a 3D Plane with transparency for the air spaces... interesting...

Well done.


fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 20th Jun 2018 07:10
Thanks @Puzzler
I really was curious how a lightning effect could be produced, I wasn't even sure AppGameKit would support recursion.
It sure does support recursion and the tree effect kinda produces a line drawn tree with branches. If I can get a
lightning design im happy with I just might try a shader to produces 2d lightning
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 29th Jun 2018 17:55 Edited at: 1st Jul 2018 01:45
For those interested in the above tree fractal may like this
Fern Fractal
Converted to AppGameKit from Phaelax's Darkbasic code found here https://forum.thegamecreators.com/thread/80144


Using the Fern code to create a 3D Shrub with planes


Using my Fractal Tree algorithm to create a dead looking 3D Tree with planes



fubar
puzzler2018
User Banned
Posted: 29th Jun 2018 18:36 Edited at: 29th Jun 2018 18:37
Thats cool

Here is a Barnsley Fern if you like me to add stuff here too



fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 29th Jun 2018 19:24 Edited at: 30th Jun 2018 05:04
Thanks Puzzler your most welcome to post code and comment etc

The Barnsley fern looks very good

Think the Barnsley Fern algorithm could be used to create a fern garden with a mixture of plane objects scattered about perhaps
with some tiling of the texture similarly to the way I created the 3D tree and 3D shrub above. I think that would be allot easier to
do with modelling software which kinda defeats the purpose with what I am trying to achieve here, That is create models, textures
etc with code. As a fractal example its fantastic tho and appreciate the sharing of the code.

I may use the tree and shrub in something lol not sure what yet. Maybe a code challenge as they usually require everything to be
created with code
fubar
puzzler2018
User Banned
Posted: 30th Jun 2018 14:53
2D Water Ripple



Change the dampening and spread for other effects

eg
dampening# = 0.9
spread# = 2
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 30th Jun 2018 18:52 Edited at: 13th Jul 2018 08:34
Love the water Ripple @Puzzler

Using Pixel or Fragment Shaders
https://steamcommunity.com/sharedfiles/filedetails/?id=370165947

I converted that pixel shader to show on a 3D Plane
You can now have a transparency texture added to the second texture and it will not draw where there is transparency
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 1st Jul 2018 01:45 Edited at: 15th Jul 2018 04:08
A small random 3D world of fractals and Kaleidoscopes

What started as a test is turning out to be a minigame
Using a character Controller and physics, spawns enemies that can be shot
and these are shown on a radar and uses particle effects on enemy shot

At the moment levels increase every 5 Kills
Which increases the movement speed of the enemy exponentially with log
and decreases the spawn time. There is a bonus level once you reach level 5



Controls
mouse sets direction and aims
up arrow move forward
down arrow move backward
left arrow strafe left
right arrow strafe right
mouse left button shoots
mouse right button jumps
fubar
Sph!nx
15
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 1st Jul 2018 22:09
Wow, Thanks for sharing all this mate!
Regards Sph!nx
puzzler2018
User Banned
Posted: 1st Jul 2018 22:14
Thats really great effects with Shaders too great stuff- keep the snippets coming

I been working on a Maze Generator for the Coding Train one, well my interperations of how this guy codes - nearly finished just a bit of backtracking to do

This can then be used for 3D maze apps

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 5th Jul 2018 16:16 Edited at: 5th Jul 2018 16:53
Thanks Sphinx and puzzler2018

The shader was a bit tricky to convert to 3D but the shader mix command don't want to work for me
which the plan was to have a second texture as a mask. So the kali could be round etc I can get the
mix command to work but not the way the colors work with this shader. I posted on the shader thread
but no solution yet

It would be a great spawn enemy location and can easily be turned on or off by choosing to update the
the shader or not

Quote: "I been working on a Maze Generator for the Coding Train one"

They are tricky to produce I believe it was phaelax who produced a good one in here already with various
sizing capabilities. I used that one to produce a 2D game with the gyroscope. I believe with any array a
map could produce a great 3D world so curious how yours turns out
fubar
puzzler2018
User Banned
Posted: 5th Jul 2018 19:33
Moving 2D objects with the mouse no matter where the mouse is positioned on the sprite


puzzler2018
User Banned
Posted: 13th Jul 2018 17:04
Hi

Here is a 1D array conversion to 2D array - insprired by TensorFlow.js



Maybe useful one day

puzzler2018
User Banned
Posted: 13th Jul 2018 17:16 Edited at: 13th Jul 2018 17:20
1D to 3D array



1D to 4D



and it goes on and on just like that...
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 13th Jul 2018 19:11 Edited at: 15th Jul 2018 01:11
Thanks @Puzzler

3D Kaleidoscope using 3 textures and blended allowing for the kali to be placed on a wall for example


3D Kaleidoscope A slightly different method of blending that should just be tried but the most usefull of the lot I think


It now can be added to a model perhaps you want to use it for the fire from the engine of a fighter jet or a
walkthrough gateway inside the ship etc

Shader Help
Texture0 is where the kaleidosope is drawn
Texture1 is a masking layer, anything on this layer that isn't transparent is used for drawing the Kali in texture0
Texture2 is the texture you want to replace the transparent parts in texture1

If no textures are set to an object the whole object will be a kaleidoscope
if texture1 and setobjecttransparency is used then the transparent parts in texture1 will be transparent
If texture2 is used with or without setobjecttransparency the parts visible on this texture will be drawn on the invisible bits in texture1
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 13th Jul 2018 21:30 Edited at: 13th Jul 2018 21:38
Here is what happens when you turn the bonnet of the car into a Kali



the code for that was quite easy so to illustrate what I did il share it
but as you don't have the images or the car object it wont
run but im demonstrating just how easy it was to do
fubar
puzzler2018
User Banned
Posted: 13th Jul 2018 22:35
Wow - these are really cool - well done for your learning experiences with Shaders and objects
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 13th Jul 2018 23:07 Edited at: 14th Jul 2018 00:05
Thanks Puzzler
I was pretty stoked when I got that to work hence the video

Not sure what to use it for apart from portals at the moment perhaps for warpspeed and perhaps use the
version which would blend the bonnet with the kali instead of replacing it.

WarpSpeed


fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Jul 2018 00:47 Edited at: 16th Jul 2018 03:12
I was looking for an old encryption algorithm I had but to no avail

but I came across Phaelaxs solution for media here https://forum.thegamecreators.com/thread/205037
Which uses a water mark technique to encrypt pictures. It didn't quite work out of the box possible cos of obsolete
commands or a pseudocode approach the thread is also locked.

1 Functions to watermark media and 1 to remove watermark USE AT OWN RISK and always store your original images safe



the example code I used to test it


The media it saves can be found on a windows10 machine at
C:\users\username\AppData\local\AGKApps\nameofproject\media

I may have a go at doing similar with sound files using a waterMarkSound(whitenoise)
and when we have a save mesh command it should be possible to use a similar technique

could also use a ROT13 approach The way its done with strings is as follows
The simplest encryption is simply just add an amount to the asci value of a character at a time
ie your key might be 13
cipher = (value + key) Mod(26) .......... to restrict it to the first 26 printable characters for example
to convert back
ciphertextLetter = (cipher + 65).......65 the starting character

using ROT13 and a watermark on a image
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 28th Jul 2018 04:28 Edited at: 28th Jul 2018 08:53
Always wanted to do a 3D puzzle well last night I stopped procrastinating and got to work
and wanted to show my progress it is very short but i took advantage of using includes so
to test it you will have to make a project and add the following files

Labrynth 3D

main.agc



Declarations.agc


CreateMaze.agc



I had to invert the maze drawing so as rotations of sprites would be correct etc
How to play
Start at bottom left of maze and work your way to top right corner
If you take to long a munchkin will eat you he eats everything in site
including the trail of bread crumbs you leave behind


The maze is generated real time i still need to not use the save load method
I am currently using. The maze generator was designed by puzzler2018
https://forum.thegamecreators.com/thread/222579
fubar

Login to post a reply

Server time is: 2024-11-21 12:31:46
Your offset time is: 2024-11-21 12:31:46