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 / Is there anything like a Minecraft clone out there, made with AGK?

Author
Message
puzzler2018
User Banned
Posted: 3rd Apr 2018 22:52 Edited at: 3rd Apr 2018 23:04
It doesnt do anything other than create a few triangles which shows how to use Color in memblocks on the same mesh

Convert to a cube and things will fall into place next few days

I now can get rid of the layers idea I thought of hopefully - 1 mesh per chunk instead of 7 layers per layer per chunk

We will get there

Edit - thanks to Tom Toad for the bit on the F1 on this, in knowing to add the color attribute
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 3rd Apr 2018 23:15 Edited at: 3rd Apr 2018 23:21
The teaser definitely showed progress

and was allot better than my attempt lol
fubar
puzzler2018
User Banned
Posted: 3rd Apr 2018 23:43 Edited at: 3rd Apr 2018 23:47
Bless -

Now we created memblock with the defined variables, we could possibly use

SetMemBlockInt(chk,24,0x0C000300) //float, 3 components, no normalizing, position
SetMemblockString(chk,28,"position")
SetMemblockInt(chk,40,0x08000300) //same as position, but for normals
SetMemblockString(chk,44,"normal")
SetMemblockInt(chk,52,0x08010401) //For color we have byte, 4 components, normalize data
SetMemblockString(chk,56,"color")


position, normal, color attributes in a shader too using setConstantByName variables defined on the memblock through to the shader.

Wll need to add a uniform color, uniform normal or uniform position in the shader code

This is going way too much for me at moment

Maybe!!
puzzler2018
User Banned
Posted: 4th Apr 2018 00:19
For shaders we need to understand what each of the elements are capable of doing

Vertex Shader

Pixel Shader

I would send position and normals to the vertex shader code

and colours to the pixel shader

Its not as easy said than done.

What we all think?

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 5th Apr 2018 03:42
puzzler Have you got a function that can create a memblock from a mesh with multiple indices
that in turn can recreate the mesh with multiple indices from that memblock

I have been trying but I have came up blank

it dont work but i think it could if certain data was set and certain data copied
maybe i need to write out the bytes of the original object and reload them i dont know
fubar
puzzler2018
User Banned
Posted: 6th Apr 2018 22:57
Thanks furbarpk, you have introduced and interesting concept on finding world coordinates - thanks for that.

This is far not been neglected - just been having a little bit of a time out from hard core programming.

Be back on this again from tomorrow hopefully
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 7th Apr 2018 02:07
Your welcome thanks for your help aswell

for anyone interested the thread is https://forum.thegamecreators.com/thread/221994
it includes a single mesh terrain editor that modifies the texture and terrain in real time by just clicking
with the left mouse button. The next step will be to get it to work with multiple meshed objects
fubar
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 7th Apr 2018 16:31
I saw that post, and I thought, that we could have the same optimisation solution

https://twitter.com/bonzajplc/status/962762369532399617

@bonzajplc wrote: "#unity3d Tip: If you want to draw a lot of small objects - DON'T use mesh instancing! Instead go for DrawProcedural with numIndices * numInstances primitives and then assemble the meshes in shader. In my case I got around 100% speedup and could make this scene at 60fps: #gamedev"



fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 7th Apr 2018 18:01
That's an extremely impressive demo Xaby the shader used for it, must be very well written! all those balls falling on
what looks like a minecraft world with physics. My thoughts tho is shaders arent for the light hearted and puzzler is
achieving some very good results with frame rates at the moment. In a way that is easier for someone to follow and
learn from than i think the way they are achieving that in unity. But it would be good to hear the opinions of some
of the shader experts in here that would understand how the demo was achieved allot more than i can only imagine.
Instancing meshes using a shader may be a great alternative but not supported on mobile and tablets very well.

What do others think?





fubar
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Apr 2018 22:50
I'm pretty sure we can't do mesh instancing on t1, I looked at that.....it seems to be a common way of doing grass these days but you have to pass more data into the shader. So I imagine in t2 it would be possible, but not t1.

May be wrong though, I gave up on that avenue pretty quickly in favour of meshes so it's utterly possible I missed something, or there's a way around it. I've got a fairly large number of objects rendering across a large landscape at speed......in the next 2-3 weeks I should have something pretty decent to show.

One thing is for sure, instanced rendering seems to do very little in AppGameKit T1.
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 7th Apr 2018 23:35 Edited at: 7th Apr 2018 23:35
In OpenGL you can pass attributes per instance, instead of per vertex, but we don't have access to it in AppGameKit Tier1.
I'm still not completely sure what InstanceObject() does.
For dynamic objects I would try AGK's InstanceObject or just draw the same object with DrawObject() again.
For static objects I think merging it into one mesh, like it is discussed here, is a pretty good solution.
puzzler2018
User Banned
Posted: 10th Apr 2018 22:07
Hi guys,

for starters that demo is awesome and thanks to Santman and Janbo for you imputs.

This is all in mind.. and will back soon with something - I might tackle shader things too but thats long way to go for that..
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 15th Apr 2018 17:42
I hope everything is ok @puzzler

fubar
puzzler2018
User Banned
Posted: 15th Apr 2018 22:04
Hi, Yeah im ok thanks- sorry ive been been tied up with other things recently (not game programming), work tiring me out too etc so finding difficult to make time to programming.

Ill try and give myself an hour a night and get started aggain with this and get something to you all by end of the week using meshing
puzzler2018
User Banned
Posted: 30th Apr 2018 17:52 Edited at: 30th Apr 2018 17:54
Sorry folks, i have been neglecting this for a while now, maybe cause I exhausted myself on it for all those weeks back

ill boost my motivation this week to do some more work done on it.

and Im sure most of you like to see this thread spring back to life again too, I certainly do at least

Shall crack on with it again
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 1st May 2018 03:33 Edited at: 1st May 2018 03:56
All good puzzler we all get a bit drained on projects and need a break, I am one that's excited to see this thread worked on again.
But with that said it did give me a chance to test my new learned skills on different projects.

Before this project I had not attempted projects in 3D mainly because getting good low poly models that work with AppGameKit is hard and then
theres all the extra math. But this thread gave me excitement as it created everything by code . Still not sure how you create all the meshes
from planes with different textures too and then you even kull objects. So the project is a very good one
fubar
puzzler2018
User Banned
Posted: 1st May 2018 18:46 Edited at: 1st May 2018 18:48
Hi folks

This is using mesh IDs for each textured block on a single object - can use up to 256 mesh indexes, so why not make use of them


The mesh indexes will use a mesh memblock, so memory issues could arise if aim high, have to tweak the chunk sizees and how many layers we want.

This gives a nice example and how i would do it for multiple textured objects on a object


More to come

Enjoy
puzzler2018
User Banned
Posted: 1st May 2018 20:34 Edited at: 1st May 2018 20:47
My bad - that last example generated chunks like createobjectbox does

This verson uses InstanceObject



Fly up with the WASDs

and FPS is respectable too

WOW!!!!

EDIT

Change the following to:-



Nearly 2Billion Cubes

Beat that Mr Minecraft
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 1st May 2018 20:50
both examples are good
but the second I must say wow so many objects
fubar
puzzler2018
User Banned
Posted: 1st May 2018 20:55
Thanks - will perlin it tomorrow / Thursday
puzzler2018
User Banned
Posted: 2nd May 2018 19:21 Edited at: 2nd May 2018 19:23
The first example I gave where it generated the chunk works well for setmemblockvertexposition, and instanceobject doesnt work with that - so its the first one we need to work with.

Here is an example of increasing the height of cubes

Press and hold space



We can now change blocks / cubes on any chunk with it looking like its duplicating like one of my previous examples a few week back.

Setmemblockvertexpositon is the way to go with adding / removing blocks

More later
puzzler2018
User Banned
Posted: 2nd May 2018 20:03
Replace to whole DO LOOP with this



Press Left and Right mouse buttons now

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 2nd May 2018 20:27
Very good @puzzler

Im heading to bed lol its 5am so i really should sleep
been up doing a texture for a model
fubar
puzzler2018
User Banned
Posted: 2nd May 2018 21:36 Edited at: 2nd May 2018 21:48
Thanks

Has anyone got Setmemblockvertexposition working on InstanceObject(s) at all?

EDIT

unless we have to add the memblock header info into it after instancing it

for example



but not sure if this is correct,
puzzler2018
User Banned
Posted: 2nd May 2018 22:05
I think the best way to attack this is to

- create a chunk
- create an instance of that chunk,
- retrieve the memblock header info from it
- note the header values already applied
- add the position/color header info as extras
- changing the "starting vertex data" of where the data starts - cause this will be different if adding the positon/color setups onto it

Tough!!!

puzzler2018
User Banned
Posted: 2nd May 2018 22:16
Unless InstanceObject is the similar to creating Shortcuts on Wiindows to files for example - that are just memory pointers to a master object. OUCH!! if thats the case

Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 3rd May 2018 11:32 Edited at: 3rd May 2018 11:37
@puzzler2018

InstanceObjects are no real Objects. You also can't clone an Instance of an Object or Instancing an Instance. So for that, we have to save the IDs of the Instance and from which Object it was an Instance, so we can look up in the list and Clone or Instancing from that Original-Object.

@ShortCut -- as Alias on Windows ... (Linux has a soft and a hard-link)
I think a link can provide more information. Because under Windows you would get the Real-Object as reference. With the file-size and thumbnail and so on ... and not the size of the INK (Link), I guess since Windows 7 or so.
For using Instances like that, we have to know: GetInstanceObjectID(ObjectID or InstanceObjectID)

Position, Rotation, Colour and so on, are "cloned", but not the Mesh-Data itself.
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 3rd May 2018 13:02
Instancing uses one mesh for multiple objects. So day for example you had a tree mesh, you could have one object once then instance it multiple times......so in theory it's one draw call repeated. But, from what I've seen the real advantage here is done within a shader and we can't really use that properly.for example, some grass demos use instancing to generate thousands of blades based around a mathematicaloffset value for each instance. It may be AppGameKit sets all this up for us, but I've never found significant boosts from instancing an object.

Maybe someone else had better luck?
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 3rd May 2018 15:53
I tested the loading times on Intel HD graphics (3000, 4000) and with Instances it is much faster, because the mesh-data don't have to be loaded multiple times into the RAM.

e.g. 6 MB for the animated soldier (you can get it down to 2 or 3 MB, but maybe our compressed object is about 6 MB) and now you are on a low-end PC or Android device. And loading time is insane.
So 50 animated soldiers would take 300 MB in RAM and have to be loaded 50 times from the harddrive or flash. But with Instances, you have only the first time the load. It is the same with textures. You don't need 50 times the same texture in memory and don't have to decode 50 times the PNG or JPEG.
You do it onces and than reference to the ImageID.

puzzler2018
User Banned
Posted: 3rd May 2018 18:12
Thanks guys:- im really sorry to disappoint but will have to go with the one without instanceobject - cause we cannot change the Vertices on a chunk to remove / add blocks or adjust the heights of the blocks

Its going to be painful but will do it

Here is the example of multple textured meshes and built an underground chunk 16x32x16



Fly around with WASD
Move around with cursors

Espectallly look underneath

Time to take it to the extreme now by seeing its memory limitations before it boooooms and then
puzzler2018
User Banned
Posted: 4th May 2018 19:27 Edited at: 4th May 2018 19:28
Hi

I dont think we will get any better than this - but is respectable for a nice mini mincraft



Now time for the following

- Add/remove blocks using SetVertexPositions

- stop the camera/player if hit a block - collisions

- Rolliing map - so when move - the layers at the back heads to the opposte direction and re-textured of what really that should be there

- Always keep the chunk underneath the player - by changing their textures when move around

I think this will keep me occupied this weekend

Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 4th May 2018 19:45
Sorry, I meant actual 3d performance didn't seem to much affected by instancing, loading would be I guess......but then what's the difference to cloning if it's just loading speed?
puzzler2018
User Banned
Posted: 4th May 2018 19:50
The issue with Instancing especially for this type of app would not be good, cause if add/remove blocks on a certain memblock - then the original memblock would reflect those changes too

and if instance all of the memblocks - then every instanced object would see those removed / added blocks

wouldnt look spectacular for this type of app, but like for yours like what your acheiving with the grass etc would be really benefical for you

Instancing can get up to 20 millions cubes - but not really,it will be just a duplication of the original mesh.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th May 2018 20:25
My two cents worth
if the original group of objects remains hidden
then can use instance and you would get your 20 million cubes

but you cant change the vertex of instanced objects, I think you can change the scale of instanced objects which would allow
the ability to size up or down the land block or changing the whole blocks color this would be great making a landscape for
minecraft the problem then becomes to how do you build with your own blocks. If your own blocks were just instance blocks
of certain colors then you could just place them and allow the users machine to keep track of them as if they were stand
alone blocks
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th May 2018 20:29
I'm not sure how that helps as the objects are a mesh created from a group of objects
fubar
puzzler2018
User Banned
Posted: 4th May 2018 20:42
Interesting concept,

Im not going to try this now cause settling down after a long day.

But if this interest serves us well - then maybe use the near chunks as full objects and far ones as instanced ones - then when the map moves around you then change the vertices on the near chunks and keep the instanced ones as is -
they will disappear into distant fog anyway,so wlll look neat.

Near chunks maybe perhaps a 16x16 chunk layer x surounded 2 times

I think i have a plan, willl put something up together in a little while of this concept.

Great little idea!!!

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th May 2018 20:52
yeh its a pain sometimes but your doing great and when you crack it I will put in a request to change your
name to "Mr Minecraft" lol

Quote: "PS near chunks as full objects and far ones as instanced ones is a great idea, allot of work to do "

fubar
puzzler2018
User Banned
Posted: 4th May 2018 20:53 Edited at: 4th May 2018 20:55
What the heck - it was easy to implement



The green is the chunk layers that are verticable changes

The red / brown in the distance are the instanced objects

Enjoy

Catch up tomorrow

EDIT - not the FPS is rubbish now, cause there is no culling in place to look after it - that can be remedied later
puzzler2018
User Banned
Posted: 6th May 2018 13:55 Edited at: 6th May 2018 13:56
Hi guys,

Ive added perlin but just not 100% perfect at moment, but what was thinking is adding pictures on progression on here instead of sending daily not 100% code

How do you send an Image to here (so it displays in the message,, ive seen a few that does this

[img]perlin.png[/img]

I have attached an image and assigned its filename of the uploaded image

But i bet it doesnt display in this window here, but rather you have to click attatchment instead

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 6th May 2018 14:27 Edited at: 6th May 2018 14:29
Images have to be uploaded to a webpage then you use the link
wish there was another way

I love the perlin tho
fubar
puzzler2018
User Banned
Posted: 7th May 2018 11:46 Edited at: 7th May 2018 11:47
Hello

I was getting an head ache with what i was producing and code getting into a right mess or disorganization of code, so I have chopped and changed it a bit for optimization



Added a loading text too, so can see what its doing so you dont think it hung...
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 7th May 2018 14:06
looking good
code optimzation is one of those crazy things we often leave till projects almost over
well i know i do, i often have very weird code with stuff in it that may or may not mean
something to me which could be something as simple as a formula a=10*10+20-10 lol
sounds crazy but that -10 might actually mean something at the time hence why it was
left there.

but with that said your doing good work


fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 11th May 2018 07:23 Edited at: 11th May 2018 08:29
Sometime ago you mentioned health status for the minecraft player that I can help with


A Vertical Health Bar

Modifications could be made easy enough so as it uses a percentage system I left that out for simplicity.
A Horizontal Health Bar

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

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.


These methods also allow the most distant sprite in background to be animated (pumping blood etc)
fubar
puzzler2018
User Banned
Posted: 11th May 2018 15:32
Yeah that would be handy - thank you for your input and offerings - ill take a look a little later

Good man!

puzzler2018
User Banned
Posted: 17th May 2018 21:23
I havent lost contact with this, work taken over big time - shall present future work on weekends
puzzler2018
User Banned
Posted: 5th Jun 2018 21:48 Edited at: 5th Jun 2018 21:52
I will get back to this as soon as I have some huge free time.

if anyone likes the last latest update then feel free to say, instead of trailing back through the messages to find the last update

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 5th Jun 2018 22:20
I liked the last update and look forward to any new ones
fubar
puzzler2018
User Banned
Posted: 10th Jun 2018 16:21
Sorry for the delay - i just needed a little time off this beast

But here is a refreshing change,, not much but i think the world cooridnate system is the next port of call.



Have a go at left clicking away

Lots of fine tuning though - but gives you something to work with.

It will only remove blocks from the first chunk at the minute

Shall carry on...

But just wanted to give this a nudge to advise im cracking on again with this
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 10th Jun 2018 16:31
Working quite well from what I just tested
fubar
puzzler2018
User Banned
Posted: 10th Jun 2018 18:13 Edited at: 10th Jun 2018 18:15
This may sound too easy but got a mind blank - does anyone know how to make the following mathemetics to do the following

Chunk that may have 5 x 5 chunks, so the chunksize say is 5 and have say 5 chunks together =

cube numbers im getting is =

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25

i would like to convert the above to the following

chunk 1 chunk 2, chunk 3 chunk 4 chunk 5
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
1 , 2, 3, 4, 5, 1, 2, 3, 4 ,5 , 1 , 2 , 3 , 4 , 5 , 1 , 2 , 3, 4 , 5 , 1 , 2, 3 , 4, 5


so if i hit cube 18 the result will be

Chunk 5 - cube 3

If could be a simple trick with the MOD command but its not happening
Any help would be grand


Thanks

Login to post a reply

Server time is: 2024-11-22 05:46:34
Your offset time is: 2024-11-22 05:46:34