summaryrefslogtreecommitdiff
path: root/README
blob: f5a87357fdda5ec6e9713fa2bf086537d96620dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Minecraft 1.19.3 (exactly) is required.

The default resource pack must be present at resources/assets.
Use unzip client.jar -d resources/ 'assets/*' to extract from a client jar.

Set online-mode=false and network-compression-threshold=-1
in server.properties.

Hint: handy client and server download links are provided at
<https://minecraft.wiki/w/Java_Edition_1.19.3>.

Vsync is hardcoded to be disabled. You can change this in window.ha. I used
GALLIUM_HUD to view frame times, so there is no built-in FPS display.

The chunk tessellation runs on the main thread, and the work distribution is
rather dumb, so a frame rate drop will be visible whenever new chunks are being
loaded.

Patched versions of the following libraries are included in the source tree:
 - hare-json <https://sr.ht/~sircmpwn/hare-json/>
 - hare-png <https://git.sr.ht/~sircmpwn/hare-png>
 - hare-sdl2 <https://sr.ht/~sircmpwn/hare-sdl2/>
 - hare-glm <https://sr.ht/~vladh/hare-glm/>

A few words on what to expect:

Most of this code is pretty bad, really. Most of the "architecture"-level stuff
is questionable (I knew this back then, but not really how to fix it). A lot
was written to be cleaned up in the future; such code may or may not have a
TODO attached.

Weirdly enough, the less deep you are in the call stack, the messier things
seem to get. The destructors for various global state in particular are
half-implemented, and probably broken in numerous ways. Nowadays I'd try to
resist the urge to split application glue logic over so many pseudo-modules.
Ideally it would all be in one file.

Overall, if you came here expecting examples of good ways to do things in Hare,
you're probably in the wrong place. The utility modules dejson, htab and trace
are kinda okay, though.

The part that is probably the most complete is model rendering. Pretty much
everything there is supported (unless I forgot something), with the exception
of tintindex (which is why grass etc. is gray), and block transparency
information (which is why there are holes everywhere). Both of these require
hardcoded information about blocks, though I had plans to possibly implement
the latter by inspecting the model and textures instead.

There's some sketchiness to the asset loading too, though. I went back and
forth on whether to load textures up front, or on demand while loading models.
There are similarish problems with model loading, where you get spurious error
messages about unresolved texture names in template model files that aren't
ever actually used directly.

I don't like how registries are handled. The split into objreg and idreg was
probably a mistake; I used to have everything handled with IDs.

Notable world interactions that work are health/death and portals.

The Android support did work, at least at one point. (Though it's very
half-baked.) I didn't bother making sure that it does anymore, though.

Also, yes, the naming style used here differs from the usual Hare convention.
This is because I got fed up with name conflicts between types and local
variables. For globals I used SCREAMING_SNAKE_CASE, which, yes, is very
exhausting given the amount of them that there are. Probably not a choice I'll
make again.

Copyright notice (if anyone really cares):

	Copyright (C) Lassi Pulkkinen

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License version 3 as
	published by the Free Software Foundation.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <https://www.gnu.org/licenses/>.