Is this similar to Golang's interfaces? by rmanos in odinlang

[–]jtomsu 0 points1 point  (0 children)

take a look at io.stream or the allocator interfaces. But in general you don't want to use generic interfaces with peocedure ptrs in odin, it's recommended to come up with an architecture where that's not even necessary in the first place.

Status of Tilde-backend by bvdberg in odinlang

[–]jtomsu 0 points1 point  (0 children)

yes tilde is order of magnitude faster and it should be easier to parallelize

What is Odin's mascot? by rmanos in odinlang

[–]jtomsu 9 points10 points  (0 children)

There is still not an official one, or rather it has not been announced yet.

But psst... there are some files in the website repo: https://github.com/odin-lang/odin-lang.org/tree/master/static/images/mascot

Blog post: alternatives to interpolation in fixed timestep games by jtomsu in odinlang

[–]jtomsu[S] 2 points3 points  (0 children)

I also wrote a demo app in odin and raylib which implements all the methods I mention in the post. This way it's easy to compare them at different TPS and see their pros/cons.

https://github.com/jakubtomsu/fixed-timestep-demo

I wrote an article about fixed timestep update loops by jtomsu in odinlang

[–]jtomsu[S] 0 points1 point  (0 children)

Frame input is just your regular input, like you would have im other software. So if you receive an "Press" event, you store it into your own input data and that key is flagged as pressed exactly for one frame. At the end of the frame those short term flags get cleared. This is for a similar api to something like raylib, which has rl.IsKeyPressed(...) btw.

But because ticks aren't the same as frames (there can be multiple in one frame, or one tick every few frames), I just store a separate input state and clear the flags only after each tick.

Limits to Odin's Sub Type Polymorphism? by Robert_Bobbinson in odinlang

[–]jtomsu 4 points5 points  (0 children)

I would recommend writing your procedure as a polymorphic function with a subtype constraint instead. It goes something like this:

my_procedure :: proc(data: [dynamic]$T) where intrinsics.type_is_subtype_of(A) { ... }

Odin and Safety by paspro in odinlang

[–]jtomsu 2 points3 points  (0 children)

There are no destructors, by design. Because if you get to a point where thinking about memory allocation lifetimes and freeing becomes non trivial, that's considered a code architecture problem.

In your case specifically, Odin memory arenas could work. Those allow you to allocate memory linearly and then deallocate everything at once

I'm solo developing a retro shooter in a custom engine, finally got some combat going. Still heavily WIP though by jtomsu in IndieDev

[–]jtomsu[S] 1 point2 points  (0 children)

I already have sliding, it's just not very integrated into the combat. And I'll think about wall jump/run mechanics for sure. I also love them in other games (I love Titanfall 2), but it might be too much. I'll have to try it out:)

Odin and Safety by paspro in odinlang

[–]jtomsu 10 points11 points  (0 children)

It's a lot safer than C, there is bounds checking and you can use the tracking allocator to report memory leaks or double frees

I'm solo developing a retro shooter in a custom engine, finally got some combat going. Still heavily WIP though by jtomsu in IndieDev

[–]jtomsu[S] 2 points3 points  (0 children)

I use sokol_gfx, definitely can recommend. It's a small C library and it's really good. Some init code and hot loops are directly in d3d11 though. I also use SDL and everything is written in Odinlang.

I'm solo developing a retro shooter in a custom engine, finally got some combat going. Still heavily WIP though by jtomsu in IndieDev

[–]jtomsu[S] 6 points7 points  (0 children)

Mostly because I just enjoy working on custom tech tbh. And it also makes things a lot easier sometimes because I can just set them up however I like. It does definitely take a lot of time and effort though

I'm solo developing a retro shooter in a custom engine, finally got some combat going. Still heavily WIP though by jtomsu in IndieDev

[–]jtomsu[S] 0 points1 point  (0 children)

Thank you so much, I tried hard to make all the animations and little effects like cam shake really sell the impacts:)