3D Block game (complete)
-
I had a go of this, it was pretty nice.
-
This post is deleted! -
Wow! Awesome work :D
-
saving and loading :
-
Now I made it so save data contains texture data. We can choose from 7 different textures or colours.
One downside of this is that it takes up 3 times more space. This means currently I can only save and load 1 25x25x25 world.
I tried increasing the world size to something like 32 but it keeps giving me a stack overflow error. I think this is because I store the world in memory as 3d 32x32x32 array. Maybe I should store it as a 1d array of length 32^3?
The stack overflow error came from inside the for loop I used to convert the 3d array into a saveable format. It said I called too many functions or something.
Also I think I may have a go at using run length emcoding to further shrink the size of the save data.
How I saved the world:
3d world array, elements are integers 0 to 7 --->
Flatten into 1d array, element are ints --->
Convert integers to bits and store them into an array -->
Group six bits together, bit shift left by 1 and then add 1-->
Convert the 7 bits to an integer. use this integer to get a character. --->
Append all characters together into a string--->
Save this string to file.(Loading is the reverse of this)
Looking at the steps now, i think because each stage has a for loop, this may have contributed to the stack overflow error. I don't know how to fix it though.I should probably stop working on this for now. I have exams next week ðŸ˜. I'll try picking it up after exams tho.
in the future i want to create a game where you can use, combine and place coloured blocks. Each block has their own unique power up. Health, speed, jump, ice, break, explosion, wind block, portal, gravity, colour mixing block. Idk if I'll be able to do all that but it's good to keep a note of. Also I could just save each level like I did here.nah -
Saving and loading with a block palette of size 7:
-
@monkeee You are so legit. This is brilliant - I'm sure the kids at our workshops would absolutely adore playing with it - I'll show them this amongus clip because I'm sure they'd get a kick out of it :D
-
Wow, that's epic @monkeee! Amazeballs!
-Alien
-
@dave thanks :) .i haven't uploaded the project yet though, I'll try do so after exams are over next month
-
This is really impressive! I'm excited to see where it goes!
-
@monkeee Here is probably the final program:
ID : DEZ73M5ZEBSBU73MNDHB.(LIVE) -
I realise now I could make it more like Minecraft:
Random Terrain --> use perlin noise/ hash stuffye doableTextures --> use fuze's own terrain objects like https://fuzearena.com/catalogs/view/4917use provided models instead. frame rate takes a huge hitChunk system --> use rle to compress size of matricies saved to file.No compression so far but i am able to save and load multiple worlds. also chunk system sounds like effort. my code feels so fragile, i dont want to change anything lol.
main problem is frame rate takes a hit when loads of cubes drawn on screen. sadge
-
-
Very impressive stuff! Could make a nice little 3D shooter out of it with randomized levels...
Are you using the terrain functions for the custom texture?
-
@vinicity tank you. thats a great game idea, wish i had thought of it. Originally was going to turn it into a parkour type game but idk if i will be able to finish the base mechanics to actually start on that.
yeah then i used 6 terrain objects and oriented them to make a cube to place down. I have a feeling the lag is from this massive array that i have in memory rather than from rendering it all but idk.
-
-
@monkeee How cool is that! It's almost Minecraft!
-
@monkeee update:
added ability to place up to 63 models and 126 colours. Added a model selection menu. saving and loading works okay. one problem i have encountered is saving a world doesnt preserve the models rotation, so i might have to work around that.preview:
The code is getting pretty spaghetti now to a point where its very difficult to work with. might remove some stuff and refactor. Ui code is pretty overcomplicated.
-
@monkeee update:
got rid of colours. now only 63 models.nearly done just got to clean everything up a bit. Everything user interface is a tangled mess.Project is very large probably wont update in future. Rotations can now be saved but the save file is now 65kb instead of just 32kb. Alot of optimizations could be made but im too lazy to thinkAnyone have any models which would make a good addition to this? I have quite a few more slots open for models which i could theoretically load.
Also i dont know what to call this game since it has deviated a bit from the original projects. Any suggestions would be great.
Heres another preview:
-