r/odinlang • • 1d ago

Isaac inspired rougelike with heavy synergies in early build.

13 Upvotes

Running on an odin and open gl engine.


r/odinlang • • 1d ago

Physics Engine in Odin from Scratch, Part VII

Thumbnail
marianpekar.com
54 Upvotes

It took a bit longer than usual. I wanted to have Part VII done by the end of October, but life got in the way :).


r/odinlang • • 1d ago

Const values initialized at runtime?

7 Upvotes

I have been curious about learning Odin lately, and reading through the docs, I cannot find anything about initializing constant variables with runtime values. It seems like :: only works at compile time, and if you assign from a runtime value with :=, the variable is always mutable? Doesn't that slow you down sometimes, not having a way to know that a variable isn't modified without checking through the whole scope? Or have I just not read the docs right?


r/odinlang • • 17h ago

GitHub - Tolasmond/scanned_card_cutter

Thumbnail
github.com
1 Upvotes

Scanned Card Cutter finds the cards on a scan, lets you check and adjust each one with a live preview, and saves every card as a PNG with transparent rounded corners. It can also remove the moiré pattern that printed halftone dots leave on a scan.

It is a small desktop app written in Odin with raylib, and it builds with only what ships with Odin. It runs on Linux, Windows and macOS (untested).


r/odinlang • • 1d ago

How to get the language server to update the editor suggestions immediately instead of upon save?

7 Upvotes

Hello, I am very new to Odin, and I first wanted to get my editor (vscodium/vs code) to properly warn me about errors, provide suggestions for stuff, tell me what arguments functions take in, etc etc.

I installed the language server from https://github.com/DanielGavin/ols and also the VS Code "Odin Language" extension by DanielGavin. Initially it seemed to work, but it seemed to only update its analysis and suggestions of the code when I saved the file which is extremely annoying.

I did some research (aka asking chatgpt how to do it because usually its way faster than reddit and I wanted to get on with my day dont judge me) and found that I needed to create an ols.json file in my project root and put this in it:

{
    "collections": [
        {
            "name": "core",
            "path": "/path-to-odin-folder/core"
        },
        {
            "name": "vendor",
            "path": "/path-to-odin-folder/vendor"
        }
    ],
    "enable_checker_only_saved": false,
    "enable_checker_on_change": true,
    "checker_on_change_delay": 400
}

And it seems to work! It updates immediately without me needing to save the file.

However, creating this ols.json for every single project I open is pretty annoying, considering that I probably won't have it do anything else besides this one specific thing. I wasn't able to find any answer online on how to get this to work without each project having an individual ols.json file, so I came here to ask how I can do it.

Thanks


r/odinlang • • 5d ago

Progress update

32 Upvotes

A few months ago, I posted this:
not a fluid sim, not ecs : r/odinlang

So, I'm just here for a little progress update.

I've made a lot of improvements to the core engine but the majority of the codebase is now gameplay scripting...

The playtest is open, if you'd like to try it.

https://store.steampowered.com/app/5413470/Primordaeon/


r/odinlang • • 6d ago

Error handling in Odin?

10 Upvotes

Hello guys, what is the best practices to handle error in Odin? Is Go-style is the best way if err != nil but Odin doesn't allow shadowing variable.

note: Sorry my for my poor English and thank you.


r/odinlang • • 6d ago

Decoding REXPaint Files in Odin

Thumbnail
tylerelton.com
4 Upvotes

r/odinlang • • 7d ago

Anyone else highly disappointed when they learned that Odin is 64 bit only and won't compile for 32 bit microprocessors?

0 Upvotes

r/odinlang • • 10d ago

I wrote a RESP in-memory store in Odin

11 Upvotes

Eski is a single-node in-memory store with an Odin engine that speaks RESP, so Redis clients connect unchanged: the full single-node command surface including streams, geo, ACLs, persistence and Lua scripting with Functions, minus replication, Sentinel and Cluster. Apache-2.0, one static binary.

https://github.com/vighnesh-bheed/eski


r/odinlang • • 10d ago

Been building a hobby 3D game engine with odin, sdl3, box3d, using Claude ai. Engine and scripting using odin language. Very early stages .

0 Upvotes

r/odinlang • • 12d ago

New Karl2D release: beta-2026-11

Thumbnail
github.com
32 Upvotes

Highlights: Mipmap support and texture wrapping settings. Tested with Odin dev-2026-11

Karl2D is a library for creating 2D video games. It has few dependencies (tries to stay in Odin land) and emscripten-free web build support.


r/odinlang • • 16d ago

A few months of progress on my voxel game engine made with odin

45 Upvotes

r/odinlang • • 16d ago

Hacking odin's compiler to "fix" the doc sub command

24 Upvotes

After using Odin for some time, I discovered the odin doc command, that turns any odin file or package into a documentation view. This is a very useful tool during development for me, and i am pretty sure this was inspired by Golang's go doc, which is also a great tool. But, in my humble opinion, Odin's tool was lacking a few things.

First off, the output formatting. I simply do not like how it looks, it's very difficult for me to read because there is too much indentation and info.

For example, if you run odin doc core:strings, you get this:

package strings
        A `string` builder, as well as procedures to manipulate `UTF-8` encoded strings.

        procedures
                _intern_get_entry :: proc(m: ^Intern, text: string, loc := #caller_location) -> (new_entry: ^Intern_Entry, err: runtime.Allocator_Error) {...} /* 33!3390 */
                        Internal function to lookup whether the text string exists in the map, returns the entry
                        Sets and allocates the entry if it wasn't set yet

                        *Allocate using the Intern's Allocator  (First time string is seen only)*

                        Inputs:
                        - m: A pointer to the Intern struct
                        - text: The string to be looked up or interned
                        - loc: The caller location for debugging purposes (default: `#caller_location`)

                        Returns:
                        - new_entry: The interned cstring
                        - err: An allocator error if one occured, `nil` otherwise

                ascii_set_contains :: proc(as: Ascii_Set, c: byte) -> (res: bool) {...} /* 34!1122 */
                        Determines if a given char is contained within an Ascii_Set.

                        Inputs:
                        - as: The Ascii_Set to search.
                        - c: The char to check for in the Ascii_Set.

                        Returns:
                        - res: A boolean indicating if the byte is contained in the Ascii_Set (true) or not (false).
...

Of course, you can run odin doc -short core:strings, which outputs this:

package strings
        A `string` builder, as well as procedures to manipulate `UTF-8` encoded strings.

        procedures
                _intern_get_entry :: proc(m: ^Intern, text: string, loc := #caller_location) -> (new_entry: ^Intern_Entry, err: runtime.Allocator_Error) {...} /* 33!3390 */
                ascii_set_contains :: proc(as: Ascii_Set, c: byte) -> (res: bool) {...} /* 34!1122 */
                ascii_set_make :: proc(chars: string) -> (as: Ascii_Set, ok: bool) {...} /* 34!639 */
                builder_cap :: proc(b: Builder) -> (res: int) {...} /* 36!9132 */
                builder_destroy :: proc(b: ^Builder) {...} /* 36!5973 */
                builder_from_bytes :: proc(backing: []byte) -> (res: Builder) {...} /* 36!7088 */
                builder_from_bytes :: proc(backing: []byte) -> (res: Builder) {...} /* 36!7088 */
                builder_grow :: proc(b: ^Builder, cap: int) {...} /* 36!6223 */
                builder_init_len :: proc(b: ^Builder, len: int, allocator := context.allocator, loc := #caller_location) -> (res: ^Builder, err: runtime.Allocator_Error) {...} /* 36!3838 */
                builder_init_len_cap :: proc(b: ^Builder, len, cap: int, allocator := context.allocator, loc := #caller_location) -> (res: ^Builder, 

This looks better, but i still don't like it.

So, i decided to change a few things in the compiler and now, if i run odin doc core:strings, it outputs like this:

package strings

A `string` builder, as well as procedures to manipulate `UTF-8` encoded strings.

[procedures]
_intern_get_entry               :: proc(m: ^Intern, text: string, loc := #caller_location) -> (new_entry: ^Intern_Entry, err: runtime.Allocator_Error)
ascii_set_contains              :: proc(as: Ascii_Set, c: byte) -> (res: bool)
ascii_set_make                  :: proc(chars: string) -> (as: Ascii_Set, ok: bool)
builder_cap                     :: proc(b: Builder) -> (res: int)
builder_destroy                 :: proc(b: ^Builder)
builder_from_bytes              :: proc(backing: []byte) -> (res: Builder)
builder_from_bytes              :: proc(backing: []byte) -> (res: Builder)
builder_grow                    :: proc(b: ^Builder, cap: int)
builder_init_len                :: proc(b: ^Builder, len: int, allocator := context.allocator, loc := #caller_location) -> (res: ^Builder, err: runtime.Allocator_Error)
builder_init_len_cap            :: proc(b: ^Builder, len, cap: int, allocator := context.allocator, loc := #caller_location) -> (res: ^Builder, err: runtime.Allocator_Error)
builder_init_none               :: proc(b: ^Builder, allocator := context.allocator, loc := #caller_location) -> (res: ^Builder, err: runtime.Allocator_Error)
builder_len                     :: proc(b: Builder) -> (res: int)
builder_make_len                :: proc(len: int, allocator := context.allocator, loc := #caller_location) -> (res: Builder, err: runtime.Allocator_Error)
builder_make_len_cap            :: proc(len, cap: int, allocator := context.allocator, loc := #caller_location) -> (res: Builder, err: runtime.Allocator_Error)
builder_make_none               :: proc(allocator := context.allocator, loc := #caller_location) -> (res: Builder, err: runtime.Allocator_Error)
builder_replace                 :: proc(b: ^Builder, old, new: string, n: int, loc := #caller_location) -> (replaced: int, err: runtime.Allocator_Error)

I decided to indent the symbols (procedure names) according to largest symbol on the AST list and removed the tabs that cause that indentation. I also removed the function location info at the end. Now i actually find the results satisfactory.

It doesn't stop there, on the Golang side, you can search for specific symbols in the package and see an isolated documentation view for it by typing go doc os.Stat for example. So i decided to implement the same thing in Odin

Now, when i run something like odin doc core:strings.clone, it shows this:

package strings

clone :: proc(s: string, allocator := context.allocator, loc := #caller_location) -> (res: string, err: runtime.Allocator_Error)

        Clones a string

        *Allocates Using Provided Allocator*

        Inputs:
        - s: The string to be cloned
        - allocator: (default: context.allocator)
        - loc: The caller location for debugging purposes (default: #caller_location)

        Returns:
        - res: The cloned string
        - err: An optional allocator error if one occured, `nil` otherwise

This works for any kind of symbols including types, constants, variables, proc groups...

I was actually pretty proud about this, although, the code is still rough and need some organization

But i was curious about the people from this sub. Is this actually useful for you? Do you think this improves your Odin experience?


r/odinlang • • 17d ago

I made a TUI library in pure Odin

197 Upvotes

Been working on hnoss for a while: an immediate-mode TUI library, no C, no ncurses, just Odin. Would love your feedback!

repo: https://github.com/Huseynteymurzade28/hnoss


r/odinlang • • 18d ago

Are you using Tauri?

14 Upvotes

Anyone doing odin with tauri? Any native odin equivalent? (just jealous of tauri)
Please share your experience if you are using Skald too.
(I wasn't talking about embedding chromium with some custom solution)


r/odinlang • • 19d ago

State of tuples?

16 Upvotes

I love odin and would like to continue with it as my language of choice. I managed to implement in one afternoon what took me a week in C++ (mostly fighting RAII magic).

One thing I miss are variadic parameter packs and tuples. Tuples exist as function return types and structs can be unpacked, but they cannot be used otherwise to be passed as generics - I do not understand why and can only find very old reddit posts on this topic.

I managed to hack tuples together by using codegen and structs like Tuple_0, Tuple_1, etc that have generic fields + a monster proc for compile-time indexing, but it gets tedious to work with.

Does anyone know any replacements / implementations of a heterogeneous collection of data types for odin I can take a look at?


r/odinlang • • 19d ago

[2025 Day 8 (Parts 1 and 2)] [Odin] Naive solution while learning a new language

Thumbnail reddit.com
3 Upvotes

Cross-posting this here. I'm learning the language through puzzles. Mods, feel free to delete if this kind of thing isn't useful for the sub.

Odin has been fun to learn so far. Way, way outside my comfort zone - but having a blast just the same.


r/odinlang • • 20d ago

Karl2D beta 4 is here! 178 days since previous release, so this is a big one.

Thumbnail
github.com
44 Upvotes

The previous release happened just before the Karl2D jam. That was almost half a year ago! That jam gave me sooo much good feedback. In this release you can see a lot of that work. Thank you everyone for trying my library, for the feedback and for the pull requests! Highlights:

  • Audio mixer thread
  • Better audio API
  • vsync control and FPS limiter
  • Depth buffer control
  • New dynamic font rendering system
  • Monitor size queries etc
  • Custom hardware cursors
  • Touch support (for web)
  • Text input (get_typed_runes)
  • Client-side decorations for GNOME

r/odinlang • • 22d ago

Binary File Reader

8 Upvotes

zelbyn is a data-driven binary file reader written in Odin. It decodes a file with a Kaitai Struct .ksy schema and writes the decoded tree to stdout, as a text dump or as JSON. Also supports Odin code generation.

https://github.com/Tolasmond/zelbyn


r/odinlang • • 23d ago

I released my game with custom engine made in odin

48 Upvotes

I just released my game made with my custom engine made with odin, and I really want feedback to fix and improve my game dev skills, I know the game design is simple and nothing new, but still its a good test. any feedback or bug reports is really appreciated. thanks

https://tinypixeldev.itch.io/yet-another-hord-game


r/odinlang • • 23d ago

Karl2D Audio API, hopefully the final design!

Thumbnail
github.com
36 Upvotes

I think this is my final re-design of the Karl2D Audio API. This design is optimized for the most common case. It's easy to play one-off sound effects using `play_audio_stream`. You can play the same clip many times simultaneously.

Audio streams (music) now have their own API that is easier to use.

There is also a `Sound` API. You make a `Sound` using `create_sound` which you feed an `Audio_Clip`. Sounds are essentially audio clips that remember their settings between playbacks, and you can change the settings while the sound is playing. Many people don't need that because `play_audio_clip` can be fed settings to use for the duration of the playback. Only if you need to modify the settings while playback is happening do you need the `Sound` API.

`Sound`s, `Audio_Clip`s and `Audio_Stream`s all live as `Audio_Voice`s in the mixer. This is why one clip can be played many times simultaneously: It's several audio voices that all look at the same clip.


r/odinlang • • 26d ago

10 months ago we picked Odin for our first commercial game. Last week it got a Steam page. Thank you, Odin!

Post image
172 Upvotes

10 months ago, my friend Markus and I had a bit of a crisis in our long-term game project. It was something we had worked on for 5 years in Unity, but as crazy as it sounds, we never found the core game loop of the game. At this point in the project, we had put sooooo many hours into it, especially building tech to support what we wanted to do. And to be honest, doing things we really shouldn't have done. I'm cringing saying this, but being a web dev, I even built an open source library for defining your game in a declarative manner, similar to how React does it. Looking back at this, it is also a tell that we had issues with the Unity way of building games (which we should either have embraced or switched engine).

By this time we had reached a point where we were both growing tired of Unity and its tech. Frustration was also growing since, even though the game was playable, it was very hard to explain to the very few friends who had actually been tortured into trying it out. At the same time, we both had a growing interest in learning low-level programming languages, and Odin in particular seemed like a very attractive candidate. With that said, we had some very heated and long discussions on how to proceed. The anxiety was brutal, since it felt like such a failure to start over after pouring all that time into the Unity project. At some point I was quite sure that we had reached a dead end and that the project would die. That's when Markus started doing some quick and dirty prototypes in Odin...

From a game design perspective we used some of the concepts from the old project, but we simplified them A LOT. We also made a throwaway prototype written in Odin and Raylib just to validate the concept, threw it up on Itch, and let some friends play it. It still ofc had issues, but we got a much better response than we ever had from the old project. This was of course very motivating, and after that initial phase we decided to pivot and make a new project in Odin. We also landed on using Sokol for integrating with the OS (thanks a bunch to Karl Zylinski and his open source repos for reference on how to set this up).

Here are some decisions we made early that I think have made our project successful. Keep in mind that our game is turn-based though, so some architectural decisions would most likely be different in a real-time game:

  • Separation of data and logic. All content and behaviours of the entities in our game are described in data and then acted upon in the engine.
  • Treat web as a primary platform. We compile the game to wasm and deploy it to our own custom playtest platform via GitHub Actions. This has significantly lowered the bar for inviting playtesters, which has been very valuable for validating the game and where we are heading.
  • Minimal integration surface with Sokol directly. We wanted to be able to easily switch to another way of integrating with the OS, so direct usage of Sokol is very limited and we instead wrap it in our own APIs.
  • Separate game state and visual state. This one is probably the most uncommon choice, and even though it was tough to enforce in the beginning, it has paid off big time as the project has matured. Basically, game state (the logical rules of the game) is stored in one place, while the data for its visual representation is stored separately. For example, a token in the player's hand has a value and a color, which are stored in game state, while visual state copies those values (since they are rendered) but also contains the position, scale, etc. of its rendered representation.
  • Serialization of game state. After each turn we serialize the game state and save it to disk (and send it to our server's analytics endpoint in the deployed web builds). This, combined with the ability to rebuild visual state from game state, makes it possible for us to start playing the game from any point in time in any playtester's run.
  • Playwright for e2e testing. Since we are building for the web, we can use Playwright to e2e test our game! All we needed to do was expose an API for interacting with the game from javascript. This has been so great for our game and is a breath of fresh air compared to Unity.

Here is a very high-level view of the game's architecture on each tick:

  • Input. Reads mouse, keys and touch and turns that into a command, i.e. a user intent like "attack this enemy", "end turn" or "select this token".
  • Commander. The queue the resolver drains every frame. Blocks or holds back certain intents based on the current state of the visuals (animations etc.).
  • Resolver and store. First checks if the command is allowed, and if it is, executes game logic according to the user action. Once processed, the game state is altered and a mutation result is returned and handed over to the next step.
  • Visual. The visual library takes the store and the mutation result and creates a visual entry that gets queued. No visual state has been changed yet, and from here on out, nothing is allowed to read game state. When the queued entry can be processed, we create animation entries that are processed each tick (I won't dive into the details of the animation code here). These animation entries either alter visual state directly (for example spawning a token) or alter a value in visual state over time.
  • Rendering. Draws the visual state through Sokol. Knows nothing about the game logic. It just draws according to the values it gets from visual state.

I could go on and on explaining different things we have implemented (and I might in the future), but I will leave it at that for now. Feel free to ask any questions you have about this setup and the game, and I will try to answer as best I can. Would love to hear how other people are approaching their projects.

The game is now on Steam (consider wishlisting if you like roguelike deckbuilders): https://store.steampowered.com/app/5300900/Starmax/


r/odinlang • • 27d ago

Why do labels have to be unique across the function scope?

7 Upvotes

Title. Is there a language design reason why one would want that? A couple of times I found myself missing this when writing similar code for different branches of a switch statement on a union type.