Ever wondered how wonderful it would be to port Minecraft to the GoldSrc engine? Well, now it exists! The gameplay should be similar to the alpha/beta versions of Minecraft, so block placing/breaking, health, crafting, smelting, and mobs are going to be in the mod
Hello everyone!
For the past months, I have been online-offline with the mod, occasionally working on it and not working on it. However, I managed to rewrite the entire mod in that time period to be more optimized and more manageable in the future.
The problem with the older version was that it was unmanageable, in a code sense, and slow in game. You see, it was a prototype and I didn't care too much about how good the code was, I just wanted something out. This worked for a couple of months until the memory started corrupting out of nowhere. I didn't want to deal with that, so I rewrote the mod, this time with a plan.
The plan was to somewhat keep the old version's structure, but start using the safer C++ way of dealing with data (STL) from this point on.
As for the slow in-game performance, I started looking into OpenGL instancing, which makes the GPU's work easier by uploading the graphics data before rendering it. I also went to render as few polygons as possible, but the current implementation is less than stellar.
Networking
The second problem was the networking. Half-Life works in a standard server-client model, meaning that the server updates the client periodically of the current game status so it doesn't get out of sync. Of course, the old implementation was bad. Like really bad. For every block, it sent its description in 13 bytes. For reference, Half-Life only allows 3990 bytes out of the server every second. That method would take 216 seconds to fill one chunk!
The solution that came into my mind is to divide up the positions into different rows and chunks, so for every 16 blocks in a row, it would send their chunk's position first, then the row's position, and then the blocks' types and relative positions in the row. This method is much more faster than the previous method, but it still takes 32 seconds at best to fill a chunk.
For some reason, I hesitated to use compression for networking, but since the previous method was really bad, I tried out ZSTD. It worked much better, only using ~200 bytes for one chunk, which prompted a maximum of 20 chunks per second at best!
I'm not gonna lie to you, this is kind of an early access version, as in it still has some bugs that really need stamping out. But I didn't want you to wait, and I wanted to start this season with a release as soon as possible.
Gameplay is very rudimentary, you can only place, break and shoot blocks and explore. Like, that's it. No stepping sounds, the water is arbitrary, and the physics are totally unrealistic and annoying, and the graphics are unreliable. Unbelieveable, but it still can carry on at least 10 minutes of gameplay, if dedicated, 15 minutes.
I didn't test multiplayer yet, and the code is not written to host multiplayer games, so don't try it.
To give yourself blocks, you have to press Y on your keyboard and the enter /give <block id> into the chat. You should fill in the <block id> area with a block type number or a block name. Here is a chart of all of the block names and numbers which you can type in <block id>:
There are also some special keybindings in this version of the mod
WASD: Move
Space: Jump
Left Ctrl: Crouch
V: Fly/noclip
E: Inventory
Left Mouse Button: Break blocks/Fire
Right Mouse Button: Place blocks/Use
Here is some sample gameplay of the mod:
I plan to release multiple, improved versions in this month, including heaps. I really want to start including survival elements into the mod, so stay tuned!
Half-craft official discord server for updates:
See you soon!!!
b4n4n4
In this article, I describe what happened in the last 3 months, and show you what have I done in the last 3 months.
Advent update 1: Well, it was a month since there I updated this mod, and I also missed advent by one day! It's a shame, however, I managed to get world...
In this article I will summarize the events of how I got infinite blocks working, provide a link to a Discord server, and a link to the mod.
In this article I summarize the development process of Half-Craft.
Keep in mind that this won't fix the sliding physics bug, the weird sky in fullscreen bug, and the ability to run on Xash3D and on cracked HL bug, but...
If you don't want to play a broken game, download Half-Craft 1.0.1
Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.
this is stupid but how do i actually play it?
Is source code available?
Is this still alive?
Yes
how do i play normal maps
Is this dead?
No way
WTF!? Why demo neaded cilent dll? In final version will by dont neaded silent?
Half life modding at its finest. This is something i never expected to see here.
How did you manage to do the rendering? Are you just calling fixed pipeline OpenGL calls? If so, how are you managing collisions? How do you handle going out of bounds of a standard BSP level? So many technical questions, I would love if you could elaborate.
I use OpenGL instancing (which in 1.0.0 I don't check if the user's GPU supports, oh well...). I don't use fixed pipeline calls, I use shaders also, which I might toy around with sometime in the future, but for now, they just calculate the offsets to the blocks and render the texture that is assigned currently.
Managing collisions is one of the really weak points of this mod, as it is really hard to get right due to my lack of knowledge of advanced maths and just Half-Life physics. I just smashed the keyboard a couple of times until it worked "just enough". If you want to know how it actually works, in a TLDR it's just ray tracing and an AABB response.
As for avoiding BSP limitations, it's easy. There's this thing called delta.lst, which lists all of the parameters of each entity IIRC. Now, all of the parameters have a fixed size, as in, a fixed bit size, so like for example 24 bits, 16 bits, 1 bit, etc. I don't know how many bits the position was (10?), but I basically bumped it up to a higher size. Consequently, if you travel long enough out of the center of the world, the player rotation starts to get inaccurate, and the game starts being a lot more unstable.
Thanks for the response!
Doesn't HL render with the old OpenGL methods? You're able to mix both modes? This entire thing is really impressive.
Well, yeah, turns out that OpenGL really does allow mixing different modes. If I did it with the oldschool glBegin/glEnd, then it wouldn't have 60 fps, it would more like have 2 fps