These past two weeks I've been fixing and creating the saving functionality and adding trees to the game, as I began to add trees to the game, I noticed how much data I have to store and process.
Currently I only store chunks that have been modified by anyone in the game and I'm looking at storing the noisemap, heightmap, treemap and biomemap, currently the problem is storing the treemap, it's easy to store if a certain location in a 2D plane has a tree but if I want to store multiple trees into a certain location, I have to store the height and the type of the tree, of course I could store this data in chunks like.. the chunks, but I could save quite a bit of space if I don't store the type of a tree but just the height but even then it's quite much.
I'm planning on creating a map of a size of 131072 * 131072 * 512 which is quite large (I don't plan on creating an infinite map because there is no point in that), the treemap for multiple trees in a certain spot would be a short type which is 16 bits which in turn is 16 trees upwards, this means that the treemap would be 274877906944 bits which is 34 gigabytes, sure I could compress this to make it smaller but I don't see the point because I plan to have the data ready to be used in the game and compressing and decompressing takes time (Because I plan to have multiple save slots I will compress the whole save to save space), but just as I wrote earlier I will be storing these things in chunks so the game won't eat the whole 34 gigabytes from beginning.
As I don't know how much of the world a player will actually discover I can't really estimate how much space a single game would take, so I'm just trying to plan ahead and try to minimize how much space a save will take.
The cube chunk is stored directly in bytes, int index, float x, float y, float z and then all of the 2048 cubes but only the cube type which is a short, so in total a chunk is 4112 bytes which is around 4 kilobytes.
If you're interested in what I've already done, check the older post to view the list of tasks.
Saturday, February 20, 2016
Wednesday, February 3, 2016
Onwards
For now I've finished the basics of cube construction and removal so that the player's character
will move and do the certain tasks. I've also gained more GUI graphics, textures and trees from Samuli which I need to add.
Here are some of the things that I thought of that need to be either fixed or done.
-Fix the mouse raycast to work better, specially to be able to fire upwards. // Fixed and optimized.
-Fix the problem that the character floats when building or removing.
- Fix the movement of the character so it does not get stuck.
-Fix the pathfinding lag when building/removing cubes.
- Fix the issue when using actionpoints in pathfinding that the character is
not able to move to the edge of the map.
-Update the GUI with Samuli's new graphics.
- Refactor map generator and make it so that it can generate much bigger maps.
- Add a timer bar above the character when it's building or removing cube.
- Gain cubes when mining them and use cubes when building.
-Saving and loading of chunks.
-Saving chunk exists check to a file.
-Saving and loading of other map related things and characters.
-Add the trees Samuli made and so that they can be cut down.
-Create tree creator.
- Add iron veins.
- Add crafting (food, potions, equipments).
- Add equipment and items weapons/armor/potions/etc.
-Add graphics for items.
-Add the rest of inventory functionality (dragging items done).
- Add better way to build or remove cubes.
-Add a 3D model for the character.
- Add magic functionality.
- Finish the combat system, so you can dodge/block/etc when an enemy is attacking.
- Add weapon skills.
- Add enemies and neutrals to roam around.
- Make npcs fight each others.
- Add loot and equipment to npcs.
-Add foraging for food.
- Add "fluid simulation"
- Add basic survival gameplay.
- Program so that the character can be seen indoors, possibly by cutting everything above the character and do a sort of reverse frustum culling to the camera so it cuts everything between the character and camera.
- Try to find a way to view stuff inside a house or cave so they don't get cut out (possibly do a some sort of fluid simulation).
- Add interraction with npcs.
-Add water and plants.
- Add caves.
-Possibly recreate the GUI system.
-Add better functionality to the cube creator.
will move and do the certain tasks. I've also gained more GUI graphics, textures and trees from Samuli which I need to add.
Here are some of the things that I thought of that need to be either fixed or done.
-
-
- Fix the movement of the character so it does not get stuck.
-
- Fix the issue when using actionpoints in pathfinding that the character is
not able to move to the edge of the map.
-
- Add a timer bar above the character when it's building or removing cube.
- Gain cubes when mining them and use cubes when building.
-
-
-
-
-
- Add iron veins.
- Add crafting (food, potions, equipments).
- Add equipment and items weapons/armor/potions/etc.
-
-
- Add better way to build or remove cubes.
-
- Add magic functionality.
- Finish the combat system, so you can dodge/block/etc when an enemy is attacking.
- Add weapon skills.
- Add enemies and neutrals to roam around.
- Make npcs fight each others.
- Add loot and equipment to npcs.
-
- Add "fluid simulation"
- Add basic survival gameplay.
- Program so that the character can be seen indoors, possibly by cutting everything above the character and do a sort of reverse frustum culling to the camera so it cuts everything between the character and camera.
- Try to find a way to view stuff inside a house or cave so they don't get cut out (possibly do a some sort of fluid simulation).
- Add interraction with npcs.
-
- Add caves.
-
-
Subscribe to:
Posts (Atom)