This is a compiled and categorized list of the #Heaps channel in Haxe discord because we ran out of pins and searching them is a massive pain.
The Source
links point to specific messages from Discord for more context/original text. If it has an asterisk (I.e. Source*
) that means text was altered to update with current state of the engine as of writing (January 2024) or omitted, and source link may provide more context.
Warning: As of writing this (January 2024), this list is still very WIP but usable.
TODO:
- Sort and categorize remaining posts
- Re-verify everything to be up-to-date with current state of the engine
- Reorder categories/content to be in order of usefulness/importance, rather than oldest->newest
- Add proper markings on post sources and such.
- Add descriptions to libraries
- Add more example source links (like Deepnight jam games)
- Update the FAQ
Changelog (Last update: 2024-05-26)
- If you're not already using Heaps, you probably shouldn't use Heaps
- See #1
— Spitko
Yes, we can and will meme.
Spitko: As a general note, Heaps is not particularly community friendly. Development is driven largely by the two companies which use it. documentation is fairly sparse and often out of date. If you're not someone who is good at digging through code to figure out how things work, heaps might not be the best choice. | Source (2019)
Note: Due to departure of Deepnight from Motion Twin and them moving away from Haxe, it's now just one company - Shiro Games themselves.
Yanrishatum: On engine stability. Engine basics will remain the same more or less. If breaking changes would occur, it wouldn't be regular or would be well grounded. But in general things like scene, audio system, resource system etc should remain the same. However small unintended bugs can and likely will slip in as community usually uses parts of the engine neglected by Shiro. | Source*
Yanrishatum: What to expect from Heaps | Source*
- Poor documentation. h2d is the most documented part, at the cost of my sanity lol.
- Poor samples and explanation of how innards operate.
- In general you need to look for answers yourself, and not a be script kiddie who only can use stackoverflow. Skills at extracting information from source code is a must. Reading pinned messages here is a good idea as well.
- Due to how barebones engine is - you also need to know how to set up the game foundation. You can take shortcuts with gameBase and such, but you still better know that stuff.
- With 3D it's a nightmare due to Shiro 3D pipeline being somewhat obscure, especially on model import as well as animation system being not only antiquated but also very unwieldy to use. The forward rendering material setup (which is on by default) is likely currently broken as Shiro moved to PBR setup.
- Knowledge of how rendering functions is also a must. I.e. what shaders do, how graphics are rendered in general, etc.
I can't stress it enough: This engine is not for newbies, it's for people who know what they're doing. Newbies can try to use it, but it definitely won't be a pleasant experience, because there's no helping crutches to learn the ropes.
- Unofficial FAQ | Warning: Outdated
- HXSL Cheat-sheet
- Dead Cells sold over 2 million copies
- Introduction to the technology stack used at Shiro Games (Evoland, Northgard, Darksburg)
- Passive-aggressive 15-minute rant about people inability to do basic search in broken English
-
For HL/C and mobile, see dedicated section.
-
Deepnight
- Quick guide to install Haxe + Heaps | Note: Some parts of it may be/are outdated due to bleeding edge nature of Heaps.
- Using GameBase (see libraries)
- List of other Deepnight tutorials
-
Video Heaps tutorials by Let's make games youtube channel | Source
-
Video Heaps tutorial by SabeDoesThings | Source
-
Heaps tutorial by Mezo | Source
- Game template by Mezo | Source
-
!Sacramentix - how to setup hashlink ( for windows ) | Source
-
Crystal: On learning Heaps/programming in general | Source*
For me, I learn everything coding related like this:
- Get sample code from internet (preferably one that exists in a single file)
- Get sample code working (if it doesn't work, get help from people, don't struggle yet)
- Go through the code, line by line, and comment what that code does. If you don't get it, add a TODO (this INCLUDES the build system if you're unfamiliar, in this case the compile.hxml file etc)
- When you get to the end of your file, go back through and see if you can reason about your TODOS
If you don't know how something works, some ways to try and understand are:
- A: Comment it out, and see what breaks
- B: Play around with values and order of execution, see what changes
- C: Look in the source code (inspect what the class is and see its methods)
- D: Compare source code to other source codes (how does h3d.col.Polygon differ from h3d.prim.Polygon, for example)
- Extend the sample - try and combine this sample with other samples
- Modularise - try to take what you've got in your single-file project and break it up into new files, breaking things up into functions and parameters, taking care not to change the program
-
ZwodahS: TTF to SDF .fnt | Source*
Just want to share this in case someone needs it. I was looking at finding a TTF lib, and started looking at all the discussions of TTF in this channel. Turns out Yanrishatum recommends to use SDF instead if we want to dynamically scale font.
Following the threads/discussion, i found Fontgen (by searching from history). Couldn't get it to compile. I then follow the tracks to Msdfgen and MSDF-atlas-gen, but they do not generate the .fnt that we need for heaps.
By following the issues, and following someone who also needed bmfont, I eventually found MSDF-bmfont-xml. It works great, out of the box, generates .fnt which is supported by heaps. It is also a node package, so you don't even need to build it yourself.
You will need use
.to(hxd.res.BitmapFont).toSdfFont(14, MultiChannel)
to use the font instead of the usualtoFont()
-
CLYDE: Improving HLSDL compat with various gamepads | Source
Just a tip for anyone in the future trying to fix XBox controllers/gamepads on linux with bluetooth: SDL has an environment variable called
SDL_GAMECONTROLLERCONFIG_FILE
. If you specify this asgamecontrollerdb.txt
, there is a publicly running controller mapping db Getting that txt file into your games working directory, setting the env variable, will fix a lot of controller problems
-
Nightly builds of HIDE are available here: http://build.heaps.io:8080/hide/
-
donach: Compiling/debugging HIDE | Source (2020)
Post | Note: Hidden due to being outdated
Maybe this will help someone - in order to be able to run HIDE, I had to do the following:
- installed haxe from https://haxe.org/download/file/4.0.5/haxe-4.0.5-win64.exe/
- cmd:
haxelib setup -> c:/HaxeToolkit/haxe/lib haxelib git hxnodejs https://github.com/HaxeFoundation/hxnodejs haxelib git heaps https://github.com/HeapsIO/heaps haxelib git hxbit https://github.com/HeapsIO/hxbit haxelib git hscript https://github.com/HaxeFoundation/hscript haxelib git castle https://github.com/ncannasse/castle haxelib git hx3compat https://github.com/HaxeFoundation/hx3compat haxelib git domkit https://github.com/HeapsIO/domkit cd c:/HaxeToolkit/ git clone https://github.com/HeapsIO/hide
- Open
c:/HaxeToolkit/hide
as workspace in VSCode - Install "Debugger for NWjs" extension
- Install "Haxe Extension Pack" extension
- Run Debug of task "Launch HIDE"
Note: See Libraries/IDEs section for more Heaps-related stuff.
- Solar Rabbit: Heaps Platformer Demo by Solar Rabbit | Source (2019)
here's a very simple and probably definitely unoptimised/bad platformer demo I wrote in, like, less than 30 minutes; it can do AABB collision checking and resolution, as well as has a player controller with smooth accel/deccel and a customisable number of mid-air jumps.
- bh213: Domkit example app — 29/01/2022 00:05 | Source
- fredlangva: A HaxeUI demo for Heaps — 12/05/2022 00:48 | Source
- ratrogue a simple 3d game with heaps | Source
- Yanrishatum: Some of Red Ray Band sources of jam games (3D/2D) | Source
- ZwodahS: Various jam game sources — 30/01/2023 05:45 | Source
- Crystal : 3D Hex Voronoi | Source
- Beeblerox: Simplest Heaps Examples
- kiwwisk: Simple 2D platformer
-
ddmills - script to convert CP347 bitmap to .fnt file | Source
-
ZwodahS: How to fix sound bug | Source*
See issues Heaps#1068 and Haxe#10682
A simple fix is to put this line in yourApp.init
:
@:privateAccess haxe.MainLoop.add(() -> {});
-
ZwodahS: 2D Interactives break after resize | Source*
See Heaps#1147 and reproduction -
amusei: Taking a screenshot | Source*
// Usage: takeScreenshot("path/to/my_screenshot.png"); function takeScreenshot(path: String) { var tex = new h3d.mat.Texture(640, 480, [Target, IsNPOT, Serialize]); s2d.drawTo(tex); var pixels = tex.capturePixels(); sys.io.File.saveBytes(path, pixels.toPNG()); }
-
l_asticot: Saving .png screenshot on JS as href-url | Source
var download = document.createAnchorElement(); download.href = 'data:image/png;base16,' + data.toHex(); download.download = "pock.png"; download.click(); download.remove();
-
Nevergarden: Getting 3D outline shader to work | Source
Although not ideal but found a little bit of solution might be useful to some and maybe change it to a better one in future?
I did this:
var outlineShader = new h3d.shader.Outline(); outlineShader.size = 0.05; outlineShader.color.setColor(0x000000); var base = new BaseMesh(); base.color.setColor(0xE7A35A); var basePass = new h3d.mat.Pass("Outline"); basePass.load(obj1.material.mainPass); basePass.addShader(base); obj1.material.mainPass.culling = Front; obj1.material.mainPass.addShader(outlineShader); obj1.material.addPass(basePass);
-
Spitko: Opening links | Source
If by link you mean to a website in the user's own browser, you'll probably need to do an os-specific shell call for that. Something like Sys.command( "start", [ "http://mysite.com/about" ] );. the command is going to be different by platform so you'll probably need some ifdefs :pensive_loaf:
In short: if you want mobile, you're in for a lot of pain.
- Generic tooling by Rainy: Zyheaps | Source
Note: read instructions, it may require using custom Heaps fork.
- Official android project files - Very old (6+ years), likely won't work at all.
- qkdreyer's fork - A bit less old (4+ years), also likely won't work at all.
- FylmTM's fork of qkdreyer's fork - Slightly less old (3+ years), once again, no guarantees. | Source (Comes with basic instructions)
- qkdreyer's ios project files - You guessed it! Old (3+ years), no guarantees.
- FylmTM supposedly have an updated fork of qkdreyer's project, but it's not public. (See discord link to their Android fork above)
-
How to compile HL/C (Windows-specific, more generic samples in the comments)
-
Solar Rabbit: Linux Companion Piece to How to compile HL/C from @Yanrishatum https://1drv.ms/w/s!Ai5MQy3tFQ9SiK0VfvTMzcmuXEPuvg | Source (2019)
-
Instructions/scripts on how to get HL/C on M1 Macs by kejuu | Source 1; Source 2
-
Era - compiling HL/C | Source
For my way:git clone https://github.com/HaxeFoundation/hashlink.git
cd hashlink
git checkout 1.10
- Download https://www.libsdl.org/release/SDL2-devel-2.0.10-VC.zip
- Download https://openal-soft.org/openal-binaries/openal-soft-1.19.1-bin.zip
- Extract
SDL2-devel-2.0.10-VC.zip
- Extract
openal-soft-1.19.1-bin.zip
- Copy
SDL2-2.0.10/*
tohashlink/include/sdl/
- Copy
openal-soft-1.19.1-bin/*
tohashlink/include/openal
- Build
hl.sln
- Open
hlc.vcxproj
- Add
openal.lib
to the linker options - Build your project but change
-hl ./bin.hl
to-hl /path/to/hashlink/src/_main.c
- Build
hlc.vcxproj
2024; Editor note: Library versions are out of date, likely won't work.
-
Dedicated HL/C library to automate HL/C compilation - Warning: May or may not be broken at the moment. | Source
- Deepnight's toolkit
- deepnightLibs - Helper library with a lot of various features.
- gameBase - Game structure Deepnight uses
- Also contains
legacy
branch that is more minimal version of the engine. Source
- Also contains
- heapsTiled - Tiled map importer
- heapsOgmo - Ogmo 3 map importer
- Heeps
- Hashlink-launcher by jefvel | Source
a hashlink/heaps based game launcher with support for updating game and launcher files
- Game template by Mezo | Source
- 2d Editor by Nayata | Source
- gameBase by jefvel
- HPP-Package by NewKrok
- Heaps Base Game by LTNGames/inc0der
- Cerates by Spitko - hlimgui-based game framework.
- hlimgui by Spitko/Yanrishatum/others - HL bindings for Imgui.
- tiledhx by Yanrishatum - the Tiled support library with most of recent features supported and Heaps integration built-in.
Those posts contain dead links, and remain here until I get confirmation that they are truly dead.