Releases: DoubleFaceProgramming/2DMC
v0.2.1
Version 0.2.1
Version 0.2.1 is a minor release with a host of technical changes and new features, most notably a new sprite draw system, cinematic mode & screenshots and player walk particles / held blocks!
We also now have a new way of downloading 2DMC! You can download a non-standalone release at the bottom of this page. This is a zip that contains an executable and the game assets and information. Download this if you want to change any assets or view anuy information provided with 2dmc without having to download the repo and set up the pip packages. Also use this if you want to take screenshots or make profiles!
Full changelog
Additions
Screenshot
- Press F2 to screenshot
- The screenshot image will be stored in a folder named "screenshots" in the same directory as main.py
- The image will be the same resolution as the resolution of the game (1200 x 600)
Cinematic Modes
- To toggle cinematic modes, press F3
- There are 4 option to toggle through in order:
- Show both the hotbar and crosshair
- Hide both
- Show crosshair but hide hotbar
- Show hotbar but hide crosshair
- The current cinematic mode state will be shown by a popup displayed on the top-right
Hand Held Blocks
- Blocks will now physically appear in the player's hand when the player is holding an item
Walking particles
- When the player walks at over 3 blocks per second, block particles would be spawned underneath its feet
2DMC logo
- 2DMC now has... a logo! It will be shown on the top left corner of the game window and in Alt + Tab menu!
- You can see it below:
Changes
- Optimized particles with conditional collision testing
- Text boxes now show their outer border / rect whilst in debug mode
- Velocity now shows up as BPS (blocks per second) in debug
- Paperdoll no longer covers held item when in inventory
- Optimized chunk loading and structure generation
- Spacebar is now also binded to jumping
Bug Fixes
- Fixed particles occasionally falling into solid blocks
- Fixed void fog particles spawning in extremely large numbers when the player enters the upper threshold of void fog particles
- Fixed player being able to tunnel through blocks as FPS gets extremely low
- Fixed player tunnelling when the window is moved, now, the game will just pause with dt being set to 0
Licensing
- 2DMC is now an officially Open Source project!
- It is licensed with the GNU General Public License v3
- You can view the full license here!
- All src/ files now have a short header to reflect this.
Technical Changes
-
Reworked the sprite system to allow better control over draw order, and to make the sprites easier to work with!
- We now have a custom defined sprite class
- This sprite class serves as a superclass for all other sprites, and provides a constructor and a number of methods that make all sprites compatible with our SpriteManager
- We have a SpriteManager class that manages draw order, updates and other useful management functions
- Draw order is defined in an automatic enumeration
- Sprites can have a custom debug layer (debug information is rendered on a different layer to the sprite) or a regular debug layer (debug information is rendered on the same layer as the sprite)
- If you want to get a better understanding of this system then you are best off looking at the code (particuarly sprite.py), be warned the code is kinda gross >.<
- We now have a custom defined sprite class
-
Velocity is now set and calculated with BPS (blocks per second)
-
We have implemented a Single Instance Superclass. This class ensures any subclasses can only have 1 instance of themselves at a time.
- This is useful, for example for the inventory labels, where whenever you move the mouse a new label will spawn. However, we only want one label to spawn at a time. Previously this required a very complicated and extremely ugly system of kill methods and class attributes and conditional checks which was, in short, gross.
- This system removes the need for this. Any sprite that inherits from SingleInstance and calls it's constructor will have this handled automatically
- Demo (because the constructor is slightly confusing):
class Foo(Sprite, SingleInstance): def __init__(self, layer: int | LayersEnum) -> None: Sprite.__init__(self, layer) SingleInstance.__init__(self, self) # The second self call passes the instance to SingleInstance, the first is just a __init__ thing ¯\_(ツ)_/¯
-
We have implemented a new system called "Information Labels"
- These labels can be defined as "anything non-permanent that conveys information or any other content".
- This includes images, popups, labels, toasts, ect.
- Made a information label class to better how these labels are handled. Labels are considered sprites internally, and so can be given different layers
- Labels are designed with OOP in mind. As of 0.2.1 the inheritance tree is as follows:
InformationLabel └── GenericTextBox ├── InventoryLabelTextBox └── HotbarLabelTextBox
- NOTE: GenericTextBox also inherits from SingleInstance but this is hard to show on an inheritance tree.
-
Structure generation and chunk loading is now done slightly differently
- Structure that extend into already existing chunks will simply place down the extra blocks directly into the neighboring chunk
- Base block generation is now cached by position
- Since perlin noise (which is used for cave generation) is very slow, it is now done once per loop instead of 64 times at once
- The cave heighmap will be generate block by block while chunks are not loading, so that when chunks load, the heightmap values have already been cached
v0.2.0
Version 0.2.0
Version 0.2.0 is a major update that focuses primarily on underground generation and features.
Other notable changes include pickblock, block selection, better particles and profiling.
Additions
New blocks
- Bedrock
- Granite
- Diorite
- Andesite
- Coal ore
- Iron ore
- Gold ore
- Lapis ore
- Redstone ore
- Diamond ore
- Emerald ore
- Deepslate
- Cobbled deepslate
- Deepslate coal ore
- Deepslate iron ore
- Deepslate gold ore
- Deepslate lapis ore
- Deepslate redstone ore
- Deepslate diamond ore
- Deepslate emerald ore
Caves
- Generated with Perlin Noise
- You will sometimes find grass and dirt getting cut off without any actual cave generating, that is a quirk of cave generation
- Caves will not be able to cut through bedrock
Stone Types
- There are 4 new stone types:
- Granite
- Diorite
- Andesite
- Tuff
- Granite, diorite, and andesite generate anywhere above deepslate level ( < chunk-y 64)
- Tuff only generates below deepslate level ( > chunk-y 64)
- Their shapes are determined by a Cellular Automata algorithm
- They will not generate overlapping with ore veins, neither will they replace dirt, ores, nor bedrock
Bedrock + World Height
- Bedrock generates from y 1024+
- There is a blend between stone and bedrock, generated the same as stone -> deepslate
- The player cannot break bedrock
Ore Veins
- Ore vein shapes are determined by a Cellular Automata algorithm.
- They will turn into deepslate variants of the ores if they generate replacing deepslate
- Ores will not replace bedrock or dirt
Distribution
- They generate underground with the following distribution (all percentages represent the chance of generation per chunk):
- Coal ore (2 attempts per chunk) starts generating with a 16% chance at the top of the world, decreases until it reaches chunk-y 64, gets more common going down until chunk-y 96 with a 3% chance, then gets rarer until chunk-y 128
- Iron ore (2 attempts per chunk) starts generating at the top of the world rarely, quickly goes to 10% chance at chunk-y 8, then gets rarer as chunk-y goes down to 72
- Lapis ore (1 attempt per chunk) starts generating at chunk-y 32, gets more common until chunk-y 64 with a 6% chance, then gets rarer until chunk-y 96
- Gold ore (1 attempt per chunk) starts generating at chunk-y 56, gets more common until chunk-y 88 with a 7% chance, then gets rarer until chunk-y 120
- Redstone ore (2 attempts per chunk) starts generating at chunk-y 56, gets more common until chunk-y 120, then quickly gets rarer until chunk-y 128
- Diamond ore (1 attempt per chunk) starts generating at chunk-y 56, maintains a 1% chance of generating until chunk-y 96, then gets more common until chunk-y 128 with a 5% chance
- Emerald ore (1 attempt per chunk) starts generating at chunk-y 56, maintains a 1% chance of generating until chunk-y 72, then gets more common until chunk-y 96 with a 3% chance, then gets rarer until chunk-y 120
Best y-level for mining
- The best chunk-y to mine for each ore, the attempts per chunk, and the chance per attempt:
- Coal: 2 (not 1 because a large portion of chunk-y 1 is made up of dirt), 16%, 2
- Iron: 8, 10%, 2
- Lapis: 64, 6%, 1
- Gold: 88, 7%, 1
- Redstone: 120, 15%, 2
- Diamond: 126 (not 128 or 127 because a large portion of them are made up of bedrock), 5%, 1
- Emerald: 96, 3%, 1
Particles
Void Fog Particles
- Void fog particles start to spawn below y 896
- The lower down the player is:
- The more particles spawn
- The bigger the particles on average
- Void fog particles will be deleted if they either move behind a block or move outside the screen
Player Fall Particles
- Player fall particles will be spawned when the player falls for more than or equal to 4 blocks and lands
- The longer the player falls for, the most particles are spawned, to a maximum of 15 blocks
- The particles will take the color of a random pixel of the block that the player fell onto
Block Selection Box
- Added a selection box around the block that the crosshair is hovering over
- It is 2 pixels thick, and is offset towards the topleft corner by 2 pixels to fit the selected block entirely within the box
Sky Gradient
- The background colour now has a gradient between the default blue (y = 0-) and black (y = 1024)
Pick-block
- Press the MMB (middle mouse button) to pick the block the crosshair is hovering over
- Some blocks cannot be pick-blocked, like bedrock, tall grass top, and leafed oak log
- Pick-blocking will move the targeted block to the slot that you are selecting, no matter if it is on the hotbar or in the inventory
Changes
- Crosshair now fades between colors instead of instantly changing
- Added "Block position" to the debug menu, which shows the coordinates of the block the crosshair is hovering over
- Added "Particles" to the debug menu, which shows the number of particles that is being calculated
- Added a transparent white overlay on the inventory slot that is being hovered over
Bug fixes
- Fixed floating tall grass on chunk borders
- Particles float upwards when inside a block, now they just fall out
- Fixed tall grass being cut off by a tree on chunk borders
Technical changes
-
Grouped code into different files in the "src" folder
-
Added comments, docstrings and type annotations explaining the code
-
Separated collision detection from camera because that is just very bad
-
Improved particle performance
-
Greatly improved chunk loading performance considering the new terrain features that have been added
-
The system by which we create, update and draw particles has been completely reworked.
- We are now using OOP in the inheritance tree:
Particle ├── PhysicsParticle │ ├── BlockParticle │ └── PlayerFallParticle └── EnviromentalParticle └──VoidFogParticle
Profiling
- To make a profile for a function, pass the callable into src.utils.profile, along with its parameters
- It will create a .prof file in build/profiles on the function that has been passed when F9 is pressed
- The file will have the time of creation in its file name
In game you can presss F9 and it will generate a profile of <callable>
in build/profiles.
# variable = <callable>(<*args>)
import src.utils as utils
variable = utils.profile(<callable>, <*args>)
For instance, to time the loading of chunks, you could do the following:
# self.rendered_chunks = load_chunks(self.player.camera)
import src.utils as utils
self.rendered_chunks = utils.profile(load_chunks, self.player.camera)
If you want to generate a profile without you having to press a key (for example,
if you want to time a function if a certain condition is met), you could do the following:
import src.utils as utils
if <condition>:
utils.do_profile = True
profile(<callable>, <*args>)
For instance, to time the loading time of a certain chunk at (x, y), you could do the following:
import src.utils as utils
if chunk == (x, y):
utils.do_profile = True
profile(Chunk, chunk)
v0.1.1
Release v0.1.1 of 2DMC.
An update following v0.1.0 with minor changes.
Changelog
Additions
- Camera is now offset from the player towards the cursor to increase viewing distance
Changes
- Player speed has been tweeked again
- The textbox above the hotbar will now fade gradually instead of staying on the screen all the time
- FPS is now synced with the monitor refresh rate (aka Vsync in Minecraft), and FPS is now more stablized
Bug fixes
- Player no longer slows down when walking as FPS increases
- Textbox will no longer appear beside the cursor in the inventory if an item has already been picked up
Installation and running
Therefore to play this version please extract the "2DMC_v0.1.1" zip into a directory of your choice. Do not move the exe out of the directory containing the assets and data folders! Then you can just double click the exe to run it.
As for linux and mac users, try installing the packages that are imported in the .py files, and running main.py from the command line. In the future, I may provide proper instructions for running on non-windows OSs, but I don't have easy access to a Linux / Mac computer as I (sadly) use Windows, and I don't really want to fiddle around with WSL or VirtualBox to try and figure out some instructons, sorry.
Executable's zip below vv
v0.1.0
Release v0.1.1 of 2DMC.
The biggest update as of yet!
Changelog
Additions
- Player animation
- New blocks
- Oak log
- Naturally generate in trees
- Oak leaves
- Naturally generate in trees
- Leafed oak log
- Naturally generate in trees
- Has 2 layers, first layer is oak leaves, second layer is oak log
- Poppy
- Naturally generate
- Dandelion
- Naturally generate
- Tall grass
- Naturally generate
- Oak planks
- Cobblestone
- Glass
- Oak log
- Tree generation
- 5 different tree types
- Regular oak tree
- Short oak tree
- Medium oak tree
- Balloon oak tree
- Large oak tree
- 5 different tree types
- Crosshair
- Changes color according to the color of the pixels underneath it
- Particles
- When blocks are broken
- Maximized FPS (FPS can go as high as possible instead of being restrained at 60)
- Hotbar
- Control with the numbers 1-9 or with the mouse scroll wheel
- Inventory
- By clicking the item you want to move, and clicking again to drop it off
- Minecraft font
Changes
- Player speed has been increased slightly
- Doubled game resolution
- Thinner, less obstructive lines
- The texture of grass has been tweeked slightly
- The debug info is now offset 6 pixels from the left of the window
- The debug info on blocks is now offset from the cursor so that it can be seen more clearly
Bug fixes
- Player x velocity no longer stays fast when not jumping (player slows down when on the ground)
- Block no longer gets placed on grass if the player is standing in the grass
- Fixed the bug where red squares stack up when debug mode is not on, and appear all at once when debug mode is turned on
- Frame rate independent movement: The game no longer slows down when the FPS drops
- Grass on chunk borders no longer breaks off when the block below is gets unloaded
- Fixed glitchy movement when player is moving at max speed
Technical changes
- Block update system as in real Minecraft
- Data folder to store all text based information
- Cleaned up the code
Installation and running
Packaging directories with pyinstaller is difficult, and as far as we know not possible without modifying the code. Therefore, to preserve the "originality" of the code we haven't bundled the game assets with any version before v0.1.1.
Therefore to play this version please extract the "2DMC_v0.1.0" zip into a directory of your choice. Do not move the exe out of the directory containing the res folder! Then you can just double click the exe to run it.
As for linux and mac users, try installing the packages that are imported in the .py files, and running main.py from the command line. Beware some older versions may require you to downgrade certain packages or modify the code. In the future, I may provide proper instructions for running on non-windows OSs, but I don't have easy access to a Linux / Mac computer as I (sadly) use Windows, and I don't really want to fiddle around with WSL or VirtualBox to try and figure out some instructons, sorry.
Executable's zip below vv
v0.0.2
Another very old release of 2DMC.
There was actually a version between this and v0.0.1, which, judging by the discrepancy between this versions changelog and features, added block breaking and placing as well as some other features. This version has been lost to the sands of time, so I have rewritten the changelog to add the changes made in this "0.0.1.5" update by finding differences between 0.0.1 and 0.0.2, and presuming any difference not mentioned in the 0.0.2 changelog is a 0.0.1.5 change. However this is imperfect - any small tweaks made in 0.0.1.5 that I havent noticed will be lost, so feel free to open a github issue if you notice anything! Also note some changes may me mis-attributed to the wrong version, not sure if there is any way around this sadly. I have tried my hardest to include every 0.0.1.5 feature but again if I missed anything open a github issue ^-^. I will attatch the original 0.0.2 changelog here for completionists sake along with the executable. Running installation below.
Changelog
Additions
- Block selection (0.0.1.5 feature)
- The currently selected block is shown in white in the bottom-left.
- This block is the block placed when placing a block.
- You can cycle through the "hotbar" using the keys 1-4 (no scroll wheel support)
- The items or the order of items in the hotbar cannot be changed.
- The order of the hotbar is as follows:
{
1: grass_block
2: dirt
3: stone
4: grass
}
- The currently selected block is shown in white in the bottom-left.
- Block breaking and placing (0.0.1.5 feature)
- Block breaking - blocks can be broken by pressing the left mouse button over the block's hitbox
- Block placing - blocks can be placed by pressing the right mouse button over any overwritable block
- Overwritable blocks are air and grass
- The block placed is the currently selected block.
- Camera (0.0.1.5 feature)
- The camera has a slight momentum
- If you stop moving in one direction suddenly, the camera keeps on going before returning to the player
- This is displayed by the camera offset display in debug mode
- Debug Mode (0.0.1.5 feature unless otherwise stated)
- Debug mode can be toggled using the F5 key
- Information is displayed in the top left:
- Seed (the seed of the world, used for terrain generation): ex. 1400917286
- Velocity (the velocity of the player): ex. (2.7, 0.0) when walking
- Position (the position of the player, aka their co-ords): ex. (-52, 3)
- Camera offset (the offset of the camera relative to the player): ex (26, 0) when walking
- Chunk (the chunk the player is standing in): ex. (-7, 0)
- Chunks loaded (the amount of chunks the game has loaded): ex. 78
- Rendered blocks (the amount of blocks the game is rendering): ex. 385
- Chunk borders are displayed with yellow lines
- The block below the mouse cursor is displayed in white text next to the mouse cursor
- The blocks being tested for collision are highlighted in red (0.0.2 feature)
- The player is outlined in white (0.0.2 feature)
Tweaks (0.0.2)
- The player hitbox size has been reduced in width to 0.225 block size
- Player movement speed has been tweeked
Bug fixes: (0.0.2)
- When player travels beyond 4000 blocks, the frame rate starts to drop below 60
- Fixed some moving left and right inconsistencies (not being able to land on a block on the left but being able to land on the right... etc)
- Optimized the performance further
Installation and running:
Packaging directories with pyinstaller is difficult, and as far as we know not possible without modifying the code. Therefore, to preserve the "originality" of the code we haven't bundled the game assets with any version before v0.1.1.
Therefore to play this version please extract the "2DMC_v0.0.2" zip into a directory of your choice. Do not move the exe out of the directory containing the res folder! Then you can just double click the exe to run it.
As for linux and mac users, try installing the packages that are imported in the .py files, and running main.py from the command line. Beware some older versions may require you to downgrade certain packages or modify the code. In the future, I may provide proper instructions for running on non-windows OSs, but I don't have easy access to a Linux / Mac computer as I (sadly) use Windows, and I don't really want to fiddle around with WSL or VirtualBox to try and figure out some instructons, sorry.
Executable's zip and original 0.0.2 changelog below vv
v0.0.1
The oldest version of 2D Minecraft we have access too!
Very few features because of this - and we have had to write the changelog after the fact so there may be some things missing or mis-described, I'm trying my best!
Changelog:
Additions:
- Blocks & Chunks
- Added blocks! 32x32 pixels in size
- Added 4 blocks (grass, dirt, grassy dirt and stone)
- Added chunks made of 8x8 blocks each.
- Chunks are unrended, rendered and generated as the player moves throughout the world.
- Terrain Generation
- Chunks are generated using perlin noise as the player moves throughout the world.
- All 4 block types are used in generation.
- Player
- Added a player (a player might be generous, its a grey rectangle)
- Added player movement using WAD
- Added collision between the player and blocks
- Camera
- Added a static camera.
- The player is always at the center of the camera's vision.
- Game FPS, chunks and blocks loaded are displayed on window title.
Installation and running:
Packaging directories with pyinstaller is difficult, and as far as we know not possible without modifying the code. Therefore, to preserve the "originality" of the code we haven't bundled the game assets with any version before v0.1.1.
Therefore to play this version please extract the "2DMC_v0.0.1" zip into a directory of your choice. Do not move the exe out of the directory containing the res folder! Then you can just double click the exe to run it.
As for linux and mac users, try installing the packages that are imported in the .py files, and running main.py from the command line. Beware some older versions may require you to downgrade certain packages or modify the code. In the future, I may provide proper instructions for running on non-windows OSs, but I don't have easy access to a Linux / Mac computer as I (sadly) use Windows, and I don't really want to fiddle around with WSL or VirtualBox to try and figure out some instructons, sorry.
Executable's zip attatched below vv