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 / MeshMemblock Function

Author
Message
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 2nd Nov 2018 13:12
puzzler2018: Your doing some great work here

Just a note , im going to make a AppGameKit 3D update on GitHub that will include the command SetObjectMeshVisible(obj,mesh,visible) , so when you need to dig you could just use this, then you dont have to change the objects data

Just an idea. and it will be way way faster.

Subscribe and checkout great AppGameKit video's here: Videos click here
Latest GameGuru Loader news: News click here
Get GameGuru Loader PBR version here: Steam click here
best regards Preben Eriksen,
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 2nd Nov 2018 13:26 Edited at: 2nd Nov 2018 13:26
Nice that could work so I can use the AddObjectMeshFromMemblock command again.
It just excludes the mesh from the rendering process right ?
Collision would be a problem then
puzzler2018
User Banned
Posted: 2nd Nov 2018 13:32
I feel AddObjectMeshFromMemblock is so slow for starters and i think it doesn't populate the mesh data for any object which we could potentailly use with commands like

SetMeshMemblockVertexColor
SetMeshMemblockVertexNormal
SetMeshMemblockVertexPosition
SetMeshMemblockVertexUV

Thats why i shyed away from this command- but others may have some other ideas to use it for


janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 2nd Nov 2018 14:02 Edited at: 2nd Nov 2018 14:18
Of course I would still create the world in a similar way but with the benefit of not needing to rebuild the mesh every time.
But I like the "do it yourself" more because you have more control and collision will work out of the box although I would/I'am trying to add and remove faces from the mesh memblock without building it from the ground up again.
Which I don't exactly know how to achieve it without a SetMemblockSize command as I would need to create a new bigger memblock then
The SetObjectMeshVisible is useful in many ways anyhow.
puzzler2018
User Banned
Posted: 3rd Nov 2018 13:11 Edited at: 3rd Nov 2018 13:12
I thought id have a go at a day / night cycle system - with a moon, sun, and inveted box for a "color" mode box



Press N and M to increase cycle time
Press R to position back on the chunk incase you wish to head up into space to visit the moon

This time you just need the test.png graphic

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Nov 2018 13:23
looks good
fubar
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 3rd Nov 2018 13:41
Yes collision , i just added this : void agk::SetObjectMeshCollisionMode(UINT objID,int meshIndex, int mode) , works perfectly.

Subscribe and checkout great AppGameKit video's here: Videos click here
Latest GameGuru Loader news: News click here
Get GameGuru Loader PBR version here: Steam click here
best regards Preben Eriksen,
puzzler2018
User Banned
Posted: 3rd Nov 2018 13:46
Thanks Guys - looking forward to having a go with the collisions - although i only work in Tier 1 - my C++ is not so good
Preben
AGK Studio Developer
20
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 3rd Nov 2018 14:07
The commands will also work in Tier1
Subscribe and checkout great AppGameKit video's here: Videos click here
Latest GameGuru Loader news: News click here
Get GameGuru Loader PBR version here: Steam click here
best regards Preben Eriksen,
puzzler2018
User Banned
Posted: 3rd Nov 2018 14:39 Edited at: 3rd Nov 2018 14:51
Thanks - will have to have a look

Ive now re-added the inventory - still needs centring up a bit and a bit of tidying of the code

Maybe add a text for each in the top corner of each representing how many of the individual cubes we have in the inventory available for use

Shall have a go at this next

EDIT - That was ok to do..

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 3rd Nov 2018 16:31 Edited at: 3rd Nov 2018 19:07
Here is the code for the inventory selector - select one and indeed it should choose that block and should also decrease when left click around



Going to do other bits and peices now, so shall catch up tomorrow with more

EDIT

I have now got them attached to a player object by fix object to object and the player lives at the cameras location and it rotates as the camera does

Attahced 3 for example

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 4th Nov 2018 10:38
Think its now time for collision work, i believe Notch used AABB Axis Aligned Bounding Box collision detection

https://tutorialedge.net/gamedev/aabb-collision-detection-tutorial/

So, here goes for nothing.

Catch up soon
puzzler2018
User Banned
Posted: 4th Nov 2018 20:36 Edited at: 4th Nov 2018 21:22
Ill let you all take a peek on what have so far with the inventory and the player handling the inventory item and even a place holder to choose a block (will come) lots more to do on the block identifying (like with the height levels of the blocks etc)



I have just slightly tweaked the atlas map for the tiles - so has one tile in the graphic that looks like tree bark and is easily identify the blocks on the main chunk when it loads in

Press "I" to load the Inventory and select

Press Left mouse button to use the iitem

Lots more work to do though, but can have a go at tweaking it to your refinements if you like


Enjoy and Catch up soon

EDIT - Janbo... I shall do the drectional faces and cull the blocks too - promise - its easy to do - but been side tracked to get inventory system at work.

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 8th Nov 2018 19:21
Im currently looking into real Sun and Moon shaders at the moment. Be back soon with an update
puzzler2018
User Banned
Posted: 8th Nov 2018 20:37 Edited at: 8th Nov 2018 20:38
Ooooh - maybe an AppGameKit GLSL Shader coder developer suite - a real time shader code engine, where it interprets our GLSL code and can run them like ShaderToy does - thats in future - but posting this, so i dont forget the idea
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 9th Nov 2018 12:19 Edited at: 9th Nov 2018 12:23
Quote: "where it interprets our GLSL code and can run them like ShaderToy does"

Thats why I asked Preben who is working on the imgui wrapper to look at nodes also.
So more like the shader tools from unity or unreal engine.
Not promising anything, but that is a project idea from me for a long time now.

Also tell me about the sun/moon shader...anything special in mind ?
puzzler2018
User Banned
Posted: 16th Nov 2018 21:41 Edited at: 16th Nov 2018 21:55
Thanks Janbo.. Ill get back to you on that

Ive added a new mesh command to be able to attach a box object to another object by its pivot point from centre to its end



norm.png - is what AppGameKit CreateObjectBox will do - pivot around its centre

but sometimes, we need

offset.png - my version to move the offset to an end of a box that we may need

A platform on a Waltzer / Ride for example. A full working of this will be on my Fun Fair thread after the weekend

We could achieve the same result by positioning something by an offset before Fixing it to another object. but it just doesnt wanna know.

Ive given easier way - my maths is crud at best of times

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 17th Nov 2018 02:02
You can do that with FixObjectPivot() but it's no where near as much fun
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Nov 2018 11:42 Edited at: 17th Nov 2018 11:45
I was just thinking when you have your load/save object commands perfected
it should be easy enough to write a model encryption routine

in reference to this thread
https://forum.thegamecreators.com/thread/223266#msg2633433

or towards the bottom of this thread which encrypts/decrypts pictures
https://forum.thegamecreators.com/thread/222027

I think it could be done with an encryption object similar to the mask image concept
fubar
puzzler2018
User Banned
Posted: 17th Nov 2018 11:46 Edited at: 17th Nov 2018 11:47
Yes - thats an awesome idea, maybe perhaps create our own model file format, which can load back in to an app once saved to our our format - hee hee

.AGM (App Game Model) or something.

ooooh interesting....

Thanks Blin0k - didnt see that one...
puzzler2018
User Banned
Posted: 17th Nov 2018 15:56
A possible encrypion method would be similar to what you say Fubarpk and that is to:-

- Generate a 16x16 black and white pixel image(randomised) - this will equate to 256 bis - black is 0, white is 1

- read a file (any file)

- read byte indeed as a byte

- XOR it with the 16x16 image

- save the image data and the file together

Reverse procedure to decrypt

- Load the encrypted file

- Grab the image data out

- XOR the object data with the image data

- Save / use the result in the app

But not for this moment in time

But certainly is aheiveable in AGK
puzzler2018
User Banned
Posted: 17th Nov 2018 17:39
Something like this

Encrypter

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 17th Nov 2018 17:40
Wont work without a decrypter



the attatched AGM file is what the Encrypter code creates

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Nov 2018 18:03 Edited at: 17th Nov 2018 18:05
Perfect puzzler

Now we have images and models that can both be encrypted/decrypted
and using whitenoise too
fubar
puzzler2018
User Banned
Posted: 17th Nov 2018 18:29
Thanks

Tamper with those AGM files that should be distributed in your Apps - will make the App crash and burn

Re-install please....
puzzler2018
User Banned
Posted: 17th Nov 2018 19:54
If this interests anyone.

Tomorrow, i will make a version 2 of the enc/dec - which will encrypt a bunch of varying media data files into 1 AGM file.

and a decryptor which will indeed decrypt that 1 file back into there original form.

So if you have loads of media files, all you need to distribute is 1 AGM file and decrypt whilst the app is "loading"....

Catch up soon.



fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Nov 2018 20:34 Edited at: 17th Nov 2018 20:37
Theres always someone asking for encryption so im sure it will get good use

Quote: "Tomorrow, i will make a version 2 of the enc/dec - which will encrypt a bunch of varying media data files into 1 AGM file."


That sounds like a great way of doing it

Might make a good plug in aswell, I think with objects it could be done without the need to rewrite the objects but with a
convert memblock to object mesh command. And images could use a copyright overlay that way it wouldnt hurt if they
could find the images they just couldnt make use of them without the decryption algorithm. Ive been toying with only
changing the vertices values and rewriting that as a model. but havent had much success as of yet. That way sure they
can find the models but they would be all bent and twisted out of shape. It would also need some serious housekeeping
to clear any memory used in the process of setting up the objects
fubar
puzzler2018
User Banned
Posted: 18th Nov 2018 12:15
Thanks Fubpark for your valuable inputs

I think we have a packer



Use the atathed OBJs - can be many OBJs really i hope

It creates 1 AGM file

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 18th Nov 2018 12:16 Edited at: 18th Nov 2018 12:27
Decryptor for the packager



Use just the 1 AGM in this

Let me know how we get on

Going to go back to my waltzer and other funfair creations now

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 18th Nov 2018 13:14 Edited at: 18th Nov 2018 13:15
We could even change the line in the Encrypter and Decrypter

WriteInteger(file, ReadInteger(newfile) ~~ encryptionkey[enclocx,enclocy])

to

WriteInteger(file, (ReadInteger(newfile) ~~ encryptionkey[enclocx,enclocy]) ~~ a)

for a more deeper encryption

Take a look at the AGM file in Wordpad or similar - its garbled no end...

Could go further with this and do images/sound/music etc etc

This will work pretty well i think at the moment.

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 18th Nov 2018 14:17
I think we good for images too



Ive had to create AppGameKit Object Box - cause the OBJs im been using doesnt have any UVs attatched to them - but its only to test if images coming through ok too.

Really am sorry for the constant posts

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 18th Nov 2018 14:24
Looks good
fubar
puzzler2018
User Banned
Posted: 18th Nov 2018 15:00
Thanks..

Maybe for the internal strings that we possibly have in our apps, like

CreateText ( "Score ")
CreateText ( "Level ")
CreateText ( "Health ")

These are inevitably are stored somehow as readable text in the Bytecode file

We can possibly put these into a txt file

Score
Level
Health

and read each line in the txt file and CreateText that way

We can encrypt / decrypt that text file too in the same manner

But all depends how much we want to really lock it all down for hacking eyes


fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 18th Nov 2018 15:23
Can be handy if you decide to do competitions etc
otherwise saving as bytes would probably be good enough
and better than plain text

hahahha I opened up another can of worms

but you do great work and as I send people to your pages
from time to time I thought encryption was something good
to consider
fubar
puzzler2018
User Banned
Posted: 18th Nov 2018 15:27
Thank you

Im always happy to lend a helping hand with tools creations to all that requires it (indeed if i know how to)


puzzler2018
User Banned
Posted: 18th Nov 2018 15:40
Oh my - Im on a roll - Slow down puzzler!!!



the strings.txt file format is



Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 18th Nov 2018 16:54
I have now tested it with a peice of music - this music comes from Kevin MacLeod. Royalty Free stuff

https://incompetech.com/music/



Let me know if works and how ya get on.

Catch up soon

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 18th Nov 2018 18:58 Edited at: 18th Nov 2018 19:11
and if wanna be smarter - we may like our apps require a serial key, and this key will be the encryption data file and to be created on first run of the app

meaning.

1 People download our apps

2 On first run - it grabs the files out of the AGM file.

3 Re-encrypts them all with a new generated key and deletes the files

4 A new file is created - something like "seral.key" with the new encryption key that was just generated

5 A brand new AGM file with all the assets, is created with that key with an addition at the beginning (for fastness , this been some extra information is stored, like Getdevice name. Getdevice IP, GetDocumentsPath, a date and time of when the first run was created) etc -and self encrypt this data too, so its not in readable form

6 On future runs of the app - will use that file to decrypt its packages

7 This means that it will use a different key every single time

So you now cannot copy it to a different device - cause the data at the beginning of the serial.key will be a mismatch if copied..that was created of when it was first run (step 5)

if thats any different to its first run of the app then it deletes itself or just tells you to bugger off this has been copied...

Im going way far fetched it with this really, but this will work...
puzzler2018
User Banned
Posted: 18th Nov 2018 19:40
Been thinking...

If one particularly has say 1000 files in there app media directory of sounds/objects/music etc then loading this 1 AGM file as a whole to extract them all out maybe be a nightmare waiting time.

So maybe an individual file enrypter option too.

For example

cube.obj encrypts to cube.objenc
cube.png encrypts to cube.pngenc

sound.ogg encrypts to soung.oggenc

etc

so it will be hundred quicker to load things in. Maybe..

Time for music
puzzler2018
User Banned
Posted: 21st Nov 2018 19:10
Feels ive been neglecting memblock work recently - so this weekend - i will concentrate on:-

- Object Groups and Seperating them into individual objects

- Saving an mesh full of objects into an .Obj

Catch up over the weekend

Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 23rd Nov 2018 20:51 Edited at: 23rd Nov 2018 20:53
puzzler2018,
just found some time to walk though your code, and you are about four hours away from a binary space partitioning system
Every needed theory step for .bsp is already made by you

[/url]
puzzler2018
User Banned
Posted: 25th Nov 2018 13:38
Wow - thats a compliment an half - thank you

But whats BSP (Binary Space Partitioning) and how in this world have i achieved that and where - may i ask.

im gobsmacked

Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 4th Dec 2018 23:35
Hey Puzzler,

Have you done anything with indices? I exported an object to use as a template, but the vertices are in indices. This has caused the vertices to be out of order if read in sequence.

I wasn't sure if you have tacked this. Thanks for any guidance.
puzzler2018
User Banned
Posted: 5th Dec 2018 07:07
Sure. Ill have a think?

Do you have a model for me to have a look at

I noticed that you queried this in the Showcase thread and was a FBX model your working with - this format is unknown to me regrettably, could you possibly convert your model to OBJ using Blender and such like at all? then I may stand a better chance to work it out?
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 5th Dec 2018 17:49
Yeah, I posted it in the wrong sub-forum like a dummy.

Attached is the file. Thanks!

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 5th Dec 2018 18:23
Great stuff

OK, cool.. Now, what seems to be the quirky issue




Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 5th Dec 2018 18:46 Edited at: 5th Dec 2018 18:57
Using the functions I created



I get the attached results - i dont see an issue uness you have a more keen eye for detail

EDIT - What does it look like at your end?

Attachments

Login to view attachments
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 5th Dec 2018 19:09 Edited at: 5th Dec 2018 19:19
@golelorn: I just thought about this last night. If you're consolidating to optimize your app then maybe you might want to look at InstanceObject()
It will make a copy of your object but shares the original vertex data.

@puzzler: Super nice work as usual matey! Great job
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 5th Dec 2018 22:01
Sorry for my late reply,
Binary space partitioning is a rendering method that requires to split each model face by face in order to calculate a rendering tree.
It's a performance optimized method to render only the used chunks of a 3d model level.


[/url]
puzzler2018
User Banned
Posted: 5th Dec 2018 23:10
Thanks @Jack - im still bermused though on how im accomplishing this

Thanks for the faith of my programming.

Login to post a reply

Server time is: 2024-11-23 15:26:46
Your offset time is: 2024-11-23 15:26:46