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: 29th Jul 2018 18:42
SetImageMagFilter(cubeimage,0)
SetImageMinFilter(cubeimage,0)

Fantastico
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 29th Jul 2018 19:15 Edited at: 29th Jul 2018 19:18
Seamless in terms of tiling textures if you look at a cube from lets say front and top i.e -45° the bottom edge of the top texture should fit the top edge of the front texture.
Well you don't notice it on a cube using 16x16 textures.
puzzler2018
User Banned
Posted: 29th Jul 2018 19:28 Edited at: 29th Jul 2018 19:57
Oh yeah - I see that too, spot on - thanks for that.

Ill adjust the block generation code tomorrow to resolve this

EDIT
Fixed



The tiles just wasnt 8x8 in the shadering areas - they are now


The tile generator - save the resulting test.png in the minecraft app after its created

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 30th Jul 2018 13:43
Hello,

I thought to make an attempt of a main menu for this.



Hope you like

Attachments

Login to view attachments
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 30th Jul 2018 14:26 Edited at: 30th Jul 2018 14:28
It still takes the the wrong uv coords.
1=top,2=side,3=bottom
Now:
[1][2]
[3]
How you intended it to be:
[1][2][3]
puzzler2018
User Banned
Posted: 31st Jul 2018 08:25 Edited at: 31st Jul 2018 09:31
Oooops and Thanks for noticing - now fixed now runs across with 5 potential cubes across and 11 down - 55 cubes (that should be enough for in-game play I think)

If we cry out for anymore then ill adjust the code to cater for more.



I thought id try and build a proper chunk now - with 100 down



Perlin Noised it



Just tweak the constants

#constant perlinheight=10.0 / the low this value is the higher the perlin - the higher this is the lower the perlin
#constant chunksizex=170
#constant chunksizey=1
#constant chunksizez=170



Enjoy - catch up soon

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 31st Jul 2018 10:24
It may be my video card or some memory needs refreshing but im only getting black textures
love the perlin map being used but still black textures il try reboot and see if that helps
fubar
puzzler2018
User Banned
Posted: 31st Jul 2018 10:31
Thats a bit odd - seems ok to me and quiet worrying.


Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 31st Jul 2018 10:39 Edited at: 31st Jul 2018 10:41
Oh it was me ….silly me had a different test.png it was using as I was commenting out code in a project to try
once I placed your file in there it worked great. didn't realize it needed test png was just copy and pasting lol

My apologies they all worked well and the perlin map wow


I thought it was because I had too much stuff open and haven't relogged today
fubar
puzzler2018
User Banned
Posted: 31st Jul 2018 10:43 Edited at: 31st Jul 2018 10:45
Phew!
Oh yes - the test.png is required unless change it in the loadimage function

Spendid news

Time to carry on with the nitty gritty now - memblock collisions / adding / removing / navigating through a rolling map etc

Still a million and 1 things to do on it - but least we got there now with multitextured UV implementation -

Did you catch the loading system that I did yesterday - it is further up the thread
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 31st Jul 2018 10:52 Edited at: 31st Jul 2018 10:54
Quote: " navigating through a rolling map etc"


If you want full direction movement you need to use a charactercontroller one for a player object and one for camera which may just be offset
if your going to only rotate in 90 degree increments an invisible object will do rotating and moving local on z. That's what ive learnt lately if
theres a better way someone please correct me.

if you use a character controller it will take advantage of a physics world


Quote: "collisions"
really depends how your going to work the world for example if you go with physics the character controller will automatically
adjust but there may be an issue with your group of blocks not sure. If you don't go with that method you could use slidingcollision all commands in the
help file Ide try the physics method first I think that's better more suitable for mine crafter but will use more resources I imagine


That's my two cents LOL
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 31st Jul 2018 11:08 Edited at: 31st Jul 2018 11:13
How does Minecraft movement work in original ?

If you only want to rotate 90 degrees at a time rotate and move local do this very well. and you could still look around
with mouse just aslong as you reset it everytime you move

If you plan to move like at angle 45degree then you really have to use a character controller and physics. Which has some
great benefits such as crouch and jump


my labrynth uses the rotate 90 only and move local method
https://forum.thegamecreators.com/thread/222690

and book of portals uses physics and two character controllers one for movement and one for camera
https://forum.thegamecreators.com/thread/222027 but that's not the latest version as the latest I had to zip
and upload as its too big for a thread comment

fubar
puzzler2018
User Banned
Posted: 31st Jul 2018 11:20 Edited at: 31st Jul 2018 11:32
Ive seen some amazing resource https://forum.thegamecreators.com/thread/216683

So I shall now have some enlightening studying to do

and will trail back through here with the examples that been posted here too


puzzler2018
User Banned
Posted: 31st Jul 2018 12:20
Currently on with adding and removing, but hit a snag

delete code



This works great, but adding a cube to the already pre-defined chunk is not happening cause its already been generated and loading the app.

So, maybe

- generate a brand new mesh for any added ones
or
- add a few empty vertices cubes on load generation - this will provide some empty slots that can be used to build new cubes when add them

A bit similar to minecraft... When delete a cube - it adds on to an inventory, so then can use that cube elsewhere on the chunk

all inventory items start with having 64 extra (available) cubes to get you going, once there reach 0 - then need to start deleting cubes from elsewhere in order to add in a new location

I think the latter will work very well
puzzler2018
User Banned
Posted: 31st Jul 2018 16:59
I have now the latter in place and it adds 64 extra cubes so can get started and adds them randomly - until get the world coordinates sussed

Everytime delete a cube then its available to be added elsewhere too.

Just fine tuning to do on that bit

Here is an inventory style system that could be developed strong to use



Going to come away from this until tomorrow now

janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 31st Jul 2018 17:49 Edited at: 31st Jul 2018 17:52
I guess the trick is to create/render only those vertices you can actually see from outside the mesh.
As suggested some pages earlier, I would create a bunch of small meshes, so it doesn't take long to create the mesh completely from scratch.
But at the same time, create the meshes large enough, to gain performance from culling.

So I suggest to use your first method
Eventually you will come up with something to update the old mesh.
puzzler2018
User Banned
Posted: 31st Jul 2018 18:10
Wow - Yeah - that works surprisingly well. Cheers once again



press the right mouse click to add

ill remove the commented code out of it what did today lol

puzzler2018
User Banned
Posted: 1st Aug 2018 00:07
Its always nice to comment code or organisation - needs refacturing still but if you head to the ground then the horizon feels its infiniate



Im aware of the adding/deleting of cubes - i need to work out the world coordinates and what chunk mesh im on, that will come


puzzler2018
User Banned
Posted: 1st Aug 2018 11:19
This is nothing much but thinking of a cube selector that could move around with the mouse or cursors



End object is in the "holder" object

puzzler2018
User Banned
Posted: 1st Aug 2018 21:07
Im so glad i did the maze generation app cause the algorithm in that will allow me to decide which faces to create or not. Must admit just showing the top face loads remarkably quick

Im still working hard on the add and delete at any given point -, so please bear with me and will share soon - its looking good i think but just not quite ready for an update

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 1st Aug 2018 21:57
From what ive seen its coming along great
fubar
puzzler2018
User Banned
Posted: 1st Aug 2018 22:52 Edited at: 1st Aug 2018 23:06
Getting an understanding on how its built



See the chunk size 16x16 and the render size - ive called it worldsize# - i might change it.

So,

- Loading and Saving the chunk as and when pass over it will work well and have a data structure of 16x256x16 which will store the underground and above data

- so when move around forwardly - it identifies which chunk to load and change the meshes accoringly

- every chunk behind the camera gets ignored too.


EDIT

PS - that is a pretty cool lamp at 15minute mark on the vid - anyone like to have a go at that?
puzzler2018
User Banned
Posted: 2nd Aug 2018 22:31

My mind boggles...

- Got faces sorted for culling, so that if any neighouring blocks are there then doesnt create faces - thats all tickety boo

- Add and remove blocks is straight forward, on ground level, just need to work out how to get a selected cube on a 3D level

Idea is now:-

- Loading and saving say 16x16x16 chunks with a rendering distance of say 5 from the player chunk - this will build 5 chunks surrounding the player chunk - this is working fast.

- All chunks behind camera doesnt get created

- Moving in the camera facing direction and loading the chunks in front of you


This is where things are.

Still, my mind boggles

puzzler2018
User Banned
Posted: 2nd Aug 2018 22:44
can anyone advise for culling say on a 3D cube

does AppGameKit automatically cull the 3 faces that the camera doesnt see anyway - even though a lonesome cube sitting on top of something will obviously create top, east, west , north and south faces - with bottom not been created

but the angle of the camera to that cube - then at least 3 faces could also be culled

Do we need to develop that strategy or does the GPU do that for us?

puzzler2018
User Banned
Posted: 2nd Aug 2018 22:59 Edited at: 2nd Aug 2018 23:05


camera is way off, so use WASD and mouse to look down and move away

The culling of cubes is there - promise

The blocks look wired if all 256 in height were grass and over hanging - so implemented a "fulltextured" variable to distinguish whats the top of the height and anything will be UV mapped to
the same texture through out the cube

ps remember to put the tilemap in there

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 Aug 2018 08:19
That's pretty awesome puzzler, didn't realize just how far down the blocks went until I cammed down through them
fubar
puzzler2018
User Banned
Posted: 3rd Aug 2018 09:42
Thanks

Im going to put the chunk rendering a side for a while until can figure it out better

So will now make a start on a Character controller and a mesh collider / collisions system - wouldn't want to fall through or peek behind things.


puzzler2018
User Banned
Posted: 3rd Aug 2018 10:02
For the rendering aspect - im thinking along the lines of this



Just a primative example of the world - the 25 boxes you see in the centre are the rendering chunks and the dead centre one is the players chunk so could be 16x16x16 virtual chunks which get loaded as and required from disk

puzzler2018
User Banned
Posted: 3rd Aug 2018 21:48
Character controller

// We cannot use the bog standard AppGameKit collision detection for this type of app, one which tests collision on standard normal objects - with GetObjectCollision for example,so going to have tomake our own

// cause we now use mesh building, we need to find a way of moving around a world with the position that you are on the chunk, find the Height of the your standing on and move the camera there + cubesize

// If The player always sits on top of a chunk/cube height identified by its Y# axis + cubesize

// any moves that you do require a check in north east south west to see if there is a block in the way and dont allow to move that direction again - If its air block then move if not then dont move in the direction?
//
// Movement of the player of which way the camera is facing is now fixed and works great

// 360 rotation too.

// Space bar to jump to the blocking cube

// It drops down to lower cubes

Thats the principle anyway



Shall post code soon
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 4th Aug 2018 04:34
Collision shouldn't be too hard.

Get the camera position, x and z, then get the mesh min and max for each chunk (store these in advance for speed) and do a simple check to see if the camera is within the bounds of a chunk. Then take the mesh min x and z away from the camera x and z, divide this by the number of blocks in the chunk......that's the specific cube inside the chunk your on.

Detecting collision for building and mining is exactly the same, just using a ray cast collision point instead of the camera.

The hard parts are biome generation and altering the chunk meshes intelligently. I would do it using a resolute index system, make each chunk a fixed size.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Aug 2018 05:12 Edited at: 4th Aug 2018 06:16
Movement should be possible

if the angle between two vectors can be calculated with

Im sure it should be quite possible to calculate the second vector from the first vector and its known angle


Stab in the dark software provides a function here to calculate a forward vector
https://forum.thegamecreators.com/thread/219449


I use a similar method for shooting in book of portals

You may wish to have a player object for collisions etc but you will also have to do the same calculations again for the
camera movements as just offsetting just don't work the same so a camera object is also needed unless you want the
camera on the ground then in which case you don't need one
fubar
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Aug 2018 07:16
Something I thought you may find interesting
https://codekingdoms.com/parents/
They are aiming at teaching kids how to program their ownMinecraft
for $19.99 a month or $99.99 yearly allot of dollars for something that wouldnt have all the mesh modification you are doing
with memblocks here. Should stick it to them and make a tutorial out of it, at the end that TGC can use to get people to more
people using AppGameKit
fubar
puzzler2018
User Banned
Posted: 4th Aug 2018 15:43 Edited at: 4th Aug 2018 16:38
Cheers guys -I shall review this soon

I have done a sample to get the movement right - dont worry, we are not using primitives - just something to work with to get the camera movements good
and justsomething a little extra

Press R to start and stop rain



The rain could be better i know and my shader programming is zilch im afraid - cause rain magnification would look exceedingly well

EDIT - Ive added more Rain from Thundery, Heavy, Medium, Light, Drizzle press R to clear and R again to make a new mode

Double EDIT - I have now added a compass - North, East South, West world identies
puzzler2018
User Banned
Posted: 4th Aug 2018 18:09 Edited at: 4th Aug 2018 18:14
Sorry chaps - im getting way into this

3D Letters anyone?




PS . this is just to see if can build them - they are currectly going onto a pivot which uses Object primitives i know, but ultimately they will be added to its own mesh using the AddCube mechanism later,so ultimately there will be no objects created here



Im going to have a rest from this for today
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Aug 2018 18:15
Cool letters
fubar
puzzler2018
User Banned
Posted: 4th Aug 2018 18:26
Thanks

For laugh, You could change them to:-



Remember to change all the "for letter=" loops from 12 to 9

eg, for letter=1 to 9
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 4th Aug 2018 22:34
Allot more useful than it may seem as a whole font can be designed from the 5by5 method
I seem to recall writing my own 2d font program that allowed you to change the thickness
and size of letters with a similar method
fubar
puzzler2018
User Banned
Posted: 4th Aug 2018 22:52 Edited at: 4th Aug 2018 23:01
yeah that does seem a lot of code though to make fonts

We using 1s and 0s here- thats binary to me.

How about if we could develop these as binary instead and could create a full character set - thats not for this project but would be helpful to other projects


EDIT - and having a rather more 8x8 (1 byte x 8 bytes) can have more of detail to fonts - could be like a flintsones effect on all its media lol
puzzler2018
User Banned
Posted: 4th Aug 2018 23:25 Edited at: 4th Aug 2018 23:26
This is making me think of a 3D font builder, hmmm - dont want to get off track now.

Anyone that wishes to have a 3D / 4D font builder then post your votes. Thats a remarkably thought - not many devices accept fonts from different systems (unless you copy them across too) and can be an headache to get it working with the non standard font

I agree, if we going the full works here - then why not go the full works.
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 5th Aug 2018 00:13
Quote: "This is making me think of a 3D font builder, hmmm - dont want to get off track now."


Baahahahahaha
fubar
puzzler2018
User Banned
Posted: 5th Aug 2018 00:17
Also been thinking about a nice loader as such, which you can choose to play in :-

- screen dimensions

- render distance

- keyboard and mouse controls

- windowed or fullscreen

This will save the above settings to a file

This will need to be a seperate app that goes along with the main app, which makes use o fRunApp command to load the main
app and depending on the settings the app will run at those settings

puzzler2018
User Banned
Posted: 5th Aug 2018 00:20 Edited at: 5th Aug 2018 00:22
Everyone.... Please feel free to make some comments - all feedback is positive
puzzler2018
User Banned
Posted: 5th Aug 2018 00:30
baaaa - sheep required
puzzler2018
User Banned
Posted: 6th Aug 2018 14:27
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 6th Aug 2018 15:47
puzzler2018 I'm glad to see you stuck with this. Had a quick look at that last article you linked to above and it is very detailed good stuff.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
puzzler2018
User Banned
Posted: 6th Aug 2018 17:51 Edited at: 6th Aug 2018 17:53
It is indeed

Quote: "Minecraft worlds are rendered in an approximated Isometric projection at an oblique angle. ."


This means that only need to worry about 3 faces instead of all 6

Quote: "A cube sprite is built in two stages. First, the texture is transformed for the top of the cube. Then the texture is transformed for the left side of the cube, which is mirrored for the right side of the cube."


Excellent for helping with culling
Santman
13
Years of Service
User Offline
Joined: 15th Sep 2011
Location: Inverness
Posted: 7th Aug 2018 08:49
Um......since about 6 pages ago you were told you only need to render three faces.....AGK does this for you automatically. Actually, if it was a cube, you COULD only ever see 3 faces unless using a fisheye view.

And for the faces, just set the UVs then all six sides can be different.
puzzler2018
User Banned
Posted: 7th Aug 2018 10:03
Sorry, Ive slept since 6 pages ago
puzzler2018
User Banned
Posted: 13th Aug 2018 14:29 Edited at: 13th Aug 2018 17:54
Hello, thought give this a nudge.

Cause we work with memblocks - we have to think about individual block movements, so I looked at Rotations for now and I think something a long these lines will do the trick.



Shall properly test sometime next weekend

Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 19th Aug 2018 20:05






I saw it on Facebook and someone ask the publisher of the posting:

If he utilizes the new C# Jobs System, Entity Component System, and the Burst Compiler?
He said, that it could be possible to have about 90,000 troops and get over 150 FPS.
And he talked about that the Entity Components are going to replace Game Objects in the near future.

I am not using Unity, of course, I am an App Game Kit guy. So maybe there could be a chance, that we integrate something like that also in AppGameKit, to have a performance boost?

The idea is, to create all transformation in the GPU before the Drawcall cames. I don't know, if that is possible with the AppGameKit pipeline.

Login to post a reply

Server time is: 2024-11-22 06:44:56
Your offset time is: 2024-11-22 06:44:56