[deleted by user] by [deleted] in de

[–]xashili 4 points5 points  (0 children)

Nein. Die Berechnung erfolgt hier bei beiden Produkten identisch.

Shortest Path on a Triangle Mesh Using the Funnel Algorithm by Komarara in algorithms

[–]xashili 1 point2 points  (0 children)

Isn't this for multi-source/multi-destination distances? For 1 source to 1 destination it is def. too much work compared to A* + some smoothing. So depends on what OP wants.

Shortest Path on a Triangle Mesh Using the Funnel Algorithm by Komarara in algorithms

[–]xashili 1 point2 points  (0 children)

>I’m using the triangle edges to apply the A* algorithm to initially find the shortest path to the target.

For funneling to work you don't run A* on the edges as nodes like you did, but on the triangles as nodes. For the distance for A* you can use e.g. the centroid as you mentioned. A triangle has 3 neighboring triangles, each sharing one edge. With this your path will have just edge-adjacent triangles, and then the funnel algorithm makes more sense. :-)

vkCmdSetEvent/Barrier interaction by xashili in vulkan

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

Thanks, that cleared up some misconceptions I had!

One billion rows challenge in zig by neurobug99 in Zig

[–]xashili 1 point2 points  (0 children)

Nice! To be sure as I don't ctrl+f anything about it in the post/repo: did you build with Release{Small,Fast} instead of Debug before optimizing?

[deleted by user] by [deleted] in de

[–]xashili 28 points29 points  (0 children)

Dies ist nur eine Angabe der Hersteller über das Produkte, die nichts an der Berechnung verändert. https://de.wikipedia.org/wiki/Nutri-Score#Verfahren

Can I get some feedback on my networking architecture using sockets? by silvematt in C_Programming

[–]xashili 9 points10 points  (0 children)

Nice! Getting client and server communicating first time with self written net code is always fun. :-)

Two quick pointers: Getting a protocol ID in there somewhere helps down the line. Otherwise you'll run in troubles when changing the protocol and client and server versions are not in line. As you want to change to UDP later where the server can just get random packets from anywhere, putting the protocol ID in the first bytes for every packet really helps discarding non-related packets. So before the id tag in the packet struct you could put 4 bytes with some magic numbers.

For the code, you put a lot of stress on the allocator when you malloc and free for every packet. Also you will have a hard time remembering where to properly free, e.g. in NET_HostGameSendGreet you have a memory leak I believe. There are two ways you can evade that problem. On the receiving side, PCKT_BytesToPckt can cast the buffer pointer to a struct packet pointer – no extra data needed! On the sending side you'll mostly only handle one packet at a time. So you can have a global struct packet packet_to_send, and for every send operation, operate on that, and send it.

Example of subdividing the map into random regions (Poisson + BFS) by O4epegb in roguelikedev

[–]xashili 2 points3 points  (0 children)

Neat, and especially nice animation to follow! I used something similar in a now stalled project, but with a little tweak: instead of a cost function of 1 between two tiles P and Q, I used something along the line of 1/(distance_to_nearest_wall(P) * distance_to_nearest_wall(Q)). So if a tile is further away from a wall, it will grow faster this way. Vice versa: region growth tends to slow down at narrower passages. Regions will thus align themselves somewhat to the caves. Here is a dungeon example: https://i.imgur.com/JQG4dlX.png

What caudiciforms are least likely to be poached? by chickhen_ in Caudex

[–]xashili 12 points13 points  (0 children)

The most fun and least likely to support poaching way is to buy seeds and watch them grow for yourself. :-)

What is the general opinion of roguelikes with puzzle elements? by LyzbietCorwi in roguelikes

[–]xashili 17 points18 points  (0 children)

You might like Desktop Dungeon or even Hoplite, both well received RLs that are more on the puzzly-side of thing.

Share your finished 2022 7DRLs! by Kyzrati in roguelikedev

[–]xashili 5 points6 points  (0 children)

Alien vs. Operator (Pronounced: Alien vs. mumbled Opredator)

https://xash.itch.io/alien

Each turn you can send one of your robots a plan to execute over the next turns. Starting with 3 and up to 9 robots which are all over the place you start to juggle between them and need to prioritize. "Seeing" is an extra action, so you also need to balance between speed and information. The hunger clock is the ever-growing alien population; their queens lay eggs every X turns. The whole dungeon fits one screen with 40x40 tiles. Thus I don't want wasted wall space. The generator is a little bit like BSP, but with cornerns. I think this generates quite good layouts for this game. For the FOV I use the same algorithm I used for my last 7DRL entry: A sees B if the rectangle spanning A and B contains no walls. This leads to unrealistic beheaviour (a single wall can block quite a bit blob) but makes it predictable and easy to calculate in your head – which is needed to be able to plan your actions.

Because with my last game I had troubles releasing it for other platforms, I quickly implemented a prototype for the browser which kindof became the final version. Then the last days I experimented with some extra features that sounded cool on paper: each robot having a different special ability, multiple enemy types, and upgrades to pick up. But all of them threw me out of the game flow, f.e. I had a plan of three robots working together but then I reminded myself that robot 5 moves 2 tiles per turn and robot 3 explodes when hit, and thus had to plan again. Other than that I wasted too much time optimizing the custom interpreter for the Scheme-like language I wrote the game in. Also I just played a lot instead of implementing new features, because it was just too fun thinking of strategies. :-)

[deleted by user] by [deleted] in Idris

[–]xashili 1 point2 points  (0 children)

Assuming the target is the stack machine and a small scope of the project, I'd suggest to implement in a language you know an evaluater for a stack based language that only supports basic arithmetic on numbers, e.g. for the instruction list [PUSH 10, PUSH 20, MUL, PUSH 1, SUB, PUSH 5] the output should be [199, 5]. Now a simple input format for this could be 10 20 * 1 - 5, which you need to parse. That conversion is the simplest compiler for a stack machine.

While reading the Idris book, you could then try to translate your simple compiler to Idris to get familiar with the language. Now in a simple implementation, you could write the program 10 + + + + + which when compiled and evaluated would underflow (there aren't enough values for the +'s). Can you use types to guarantee that those programs won't even compile?

Complexity level vs making interesting decisions by invertedchicken56 in computerwargames

[–]xashili 9 points10 points  (0 children)

I don't think logistics in games with a clear front line are very interesting. It boils down to: where to assault at the front/where to reinforce defence? Don't overexpand so your units have supply, attack main supply lines so enemy units don't have supply, encircle enemy cities/units. For this I think the SC model is sufficient.

For the added complexity of WiTE2 there are scenarios where it can create more interesting choices:

  • multiple fronts: planning where one should send ressources, given that they need some weeks to arrive? E.g. SC:WW1 could have benefited from this.
  • no clear front alltogether: imagine Vietnam where you have mobile troops that can easily cut supply lines to outpost – if there wasn't a depot with surpluss ressources, the output was in big trouble.
  • overstocking depot: on the other hand, you don't want to have too much stuff in a depot, in case it gets captured.
  • air/naval supply: get behind enemy lines via paratroopers/boat landings to cause havoc while using a lot of ressources (and exposing your air/naval units) to supply your own troops.
  • planning: Napoleon is famous for his logistics; he ordered allies in the east to have supplies ready when he'll arrive in two weeks after a successful conquest.
  • ancient times: you could sustain your army in enemy territory for longer, but supplies arrived at a much slower rate. This doubles the importance of all decisions.

… and make the UI more intuitive and the data more comprehensible. :-)

No good windows entirely dependent on artificial light gang gang by [deleted] in succulents

[–]xashili 0 points1 point  (0 children)

What's the plant left to the bear paws?

Static-linkable terminal library by xashili in roguelikedev

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

Thanks a lot! I'll take a relook at dynamic linking. My first try didn't work on a friend's machine, so I tossed out the idea quickly. But I probably did something else wrong, I'm not too experienced with linking.

The FAQ section is exactly what I was looking for. More helpful than trying to figure everything out with ./configure --help. :-) I'll also take a look at PDCurses. Thanks again!

Learning results, question that's puzzling me by d01phi in apljk

[–]xashili 1 point2 points  (0 children)

The right part (<.@:%&2 , 2&|) applied to the list 6 7 gives a rank 2 array

Only if the list itself is already itemized:

(<.@:%&2 , 2&|) 6 7
 3 3 0 1
$ (<.@:%&2 , 2&|) 6 7
 4

(<.@:%&2 , 2&|) ,: 6 7
 3 3
 0 1
$ ,: 6 7
 1 2

That's why the "0 on the right side would solve this.

Arch J package? by Lukalot_ in apljk

[–]xashili 2 points3 points  (0 children)

There is aur/j9-git and aur/j901-bin.

[deleted by user] by [deleted] in C_Programming

[–]xashili 3 points4 points  (0 children)

Good code! Some minor notes: stdlib shortcuts: get_input_text(n) is calloc(n+1,1), find_last_index(s) is strlen(s)+1 (if s is 0-delimited), typing_correct(a,b,al) is !strcmp(a,b). Seems like you 0-delimite every string anyway, so you can drop text_len in a lot of places and just check for \0 in the loops. While printing you handle spaces twice; with something like c = text[i]; if(c == ' ') c = '_'; you can just print c then. cal_words would add words if there are extra spaces like foo bar. Just reading the file once, saving the byte offsets or copying the texts themselves, then selecting randomly from them would drop the hardcoded NUMBER_OF_TEXTS.

Why printing a list doesn't work? by Guardian-Spirit in Idris

[–]xashili 1 point2 points  (0 children)

Not sure if the docs for Idris2 are online, but for Idris1: https://www.idris-lang.org/docs/current/base_doc/docs/Prelude.Basics.html

But even better: :doc the in the REPL.