What I did today

Learning about JavaScript generator functions, and made a game loop in it (just to have some fun). Small GIF, just 60 KB.

Who said JavaScript cannot do infinite loops??

If you want to have coroutines/generators/continuations in Java too: https://code.google.com/archive/p/coroutines/

Try MatthiasM’s continuation-library instead.
http://www.matthiasmann.de/content/view/24/26/
It’s actually properly rewriting bytecode. :point:

Thanks, I think I’m going to learn something new today. Do you actually recommend using these coroutines in Java? If so, I’d like to know under what conditions their use is going to benefit me.

Lazily building and iterating complex and possibly infinite data structures, like a tree, which usually functional programming languages are good for. :point:

Worked on a simple sci-fi name generator (in other words: string concatenator). It generates different styles of names for members of different galactic races, e.g.:

Humanoid:

[quote]Ignacia Tanner
Melany Sabbagh
Romelia Safar
Ingeborg Seif
Luvenia Ramirez
Natacha Valdez
Mariko Mccarty
Cheyenne Rich
Zula Mcpherson
Genna Bass
[/quote]
Rocklike race:

[quote]Hyalite the Cubic
Hydroxylapatite the Opaque
Rock the Minor
Magnesiostaurolite the Powdered
Arsenic the Quartz
Nevada the Soft
Sulphur the Opaque
Jasper the Fracturous
Prase the Blue
Spinel the Apatite
[/quote]
and so on, for 7 different races.

Continued crawling towards the goal of getting a hunter to stick an arrow in a deer. To make things fair, I upgraded deer today with PanicBehavior, so they will run off in semi-random direction if they spy a human, bear or wolf approaching. Also, I let deer run a bit faster.

PanicBehavior is a standard behavior of all creatures actually. Aside from panicking at the sight of specific types of creatures, it will also have to monitor health and have a panic response when the creature takes a serious injury.

Also been writing some galactic history:

So far the galaxy is very sparse and boring, but I intend to do something like Dwarf Fortress (only a bit less ambitious) in generating a galactic history in which a game will take place.

Reference source is online…demo isn’t yet

I actually gave this a shot one week ago, and found that it often behaved bizarrely when used with multiple threads (i.e. suspending in one thread and resuming in another). I haven’t found the time to investigate the cause, but offbynull’s library was a well-behaved replacement, aside from a bug in the instrumentation task. Can’t vouch for the quality of the generated bytecode without spending more time with the library, though.

The library is not threadsafe (by design), so if you don’t provide your own concurrency mechanisms, it will be non-deterministic.

Ditto the alternative I posted. IIRC with matthiasm’s library, I encountered nonsensical changes in state even when I demonstrably had no attempts at concurrent access to the same continuation. Do you have a lot of familiarity with the continuations library? I might want to revisit the code and shoot you a PM if I’m still scratching my head after.

Began upgrading my engine’s map format to allow for some more features like dynamic loading and unloading of chunks on the fly - it was possible before, but my original implementation had a file for every individual chunk so folders would get very cluttered with potentially thousands of files… that and I wasn’t storing tiles that were solid.
The solution is to store regions of many chunks in one file. Just got to figure out what’s best in terms of memory usage and minimizing IO.

It’s a funny feeling being able to call certain parts of my engine ā€˜legacy’.

Just because a piece of code is not concurrently accessed, does not mean you don’t have to take measures to ensure the code is thread safe. You’ll see that with proper locking/fencing (ensuring happens-before behavior) all these ā€˜nonsensical’ changes in state disappear.

LWFLg49cw-A

paper, code and link to shadertoy imp:

https://research.nvidia.com/publication/real-time-rendering-procedural-multiscale-materials

Give me some credit. It’s not like I just slapped a synchronized block on there without thinking about it. I slapped a phaser on there without thinking about it. :slight_smile:

The nature of the aforementioned nonsense appears to have been that the number of unarrived parties was sometimes incorrect: 0 instead of 16 (the number of registered parties). In other words, there was a bit of code that relied on the assumption that the phaser had already advanced to the next phase, when in fact the phaser would sometimes be found in the process of transitioning instead. All this seemingly because I failed to take note that the documentation for onAdvance() says ā€œupon impending phase advanceā€ and not ā€œafter phase advance,ā€ which evidently becomes a pretty important distinction once you start using the phaser’s non-blocking methods. Really should’ve waited until I was back at my computer before running my mouth.

tl;dr: Matthias’s library works like a dream, and 3 AM is not the correct time to be dicking around with concurrency, which is a lesson that no sensible person needs, but one that I repeatedly fail to learn. Carry on. :clue:

I use MatthiasM’s continuation-library in a many threads applications all the time. It works fine. As expected. In fact my only question is, does the code weaving need updating with new versions of the JVM? Same with Riven’s Structs for java?

As to what i did today. My internet and local network(wifi) has been just too flaky. I finally went all wired network yesterday with a gigabit 8 port switch and a Power line network from upstairs. It is working perfectly despite the fact that i have the power line network stuff plugged into power strips at both ends. Apparently a big no no. But i get my full 20Mbit internet download speed no probs. Was struggling to get 1.5Mbit before so i assume i was getting a lot of interference.

As for code… i am seeing greener grass on the Scala side of the fence :confused:

Today I ā€œenjoyedā€ programming a protocol for RS485. It seems that getting Windows to talk to RS485 should be the simplest thing in the world - how hard could it possibly be? - but nothing at all works as expected. The APIs are the usual rubbish as well (buggy, poorly documented, not even nicely formatted source code) because Oracle in their wisdom dropped the javax.comm APIs a long time ago and never picked them up again. It just makes my blood boil.

Cas :slight_smile:

After an entire YEAR, I’ve recovered my JGO account, which I am really happy about.

I’ve been working on a voxel engine and managed 500 FPS. I have yet to implement frustum culling and uploading meshes to the GPU on another thread.

@princec I have to ask. Why RS485?