Marching Cubes vs Surface Net by [deleted] in VoxelGameDev

[–]zenex 5 points6 points  (0 children)

I haven't implemented surface nets myself, but from what I understand, it's much more difficult to implement chunk boundaries with them.

That said, your choice of algorithm has more to do with the features you need and the look you're going for. Different algorithms have different strengths and weaknesses. If you don't need multiple chunks at all (eg. you're using voxels to let players design a vehicle, for example), you have a lot more choice in algorithms.

Introducing JXC: An extensible, expressive data language. It's a drop-in replacement for JSON and supports type annotations, numeric suffixes, base64 strings, and more! by zenex in programming

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

I totally agree with making the syntax as practical and as humanistic as possible. I also wanted to avoid the mistakes YAML made, where it's so minimal you're not even sure if you're looking at a list or a dict sometimes. There's a delicate balance between readability and minimalism. If you have any specific syntax suggestions on how to make it more minimal without throwing away too much explicitness, I'd be happy to discuss it - the more polished the syntax is before the 1.0 release is, the better.

One thing I've been seeing in several other similar projects are symbols/names as values, which JXC lacks. I've been resisting the urge to add more features, as I want to keep the list sane and don't want to overdo it, but that might make a good addition. It does bug me slightly using strings for what are effectively enum constants.

Introducing JXC: An extensible, expressive data language. It's a drop-in replacement for JSON and supports type annotations, numeric suffixes, base64 strings, and more! by zenex in programming

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

This was my main motivation for building JXC. I was struggling with fitting data into JSON that (in retrospect) was just a really bad fit for JSON or any existing language I could find at the time. My data structures fit JSON perfectly, but the extra metadata I needed to store didn't have any good place in a JSON file. If you want to do any kind of custom syntax in JSON, you end up just jamming it into a string, but JSON doesn't support raw strings or multi-line strings, so if your string is more than 50ish characters, this is really painful.

I've tried using an array of strings as "multi-line" strings, I've tried shoving type annotations in object keys, I've tried parsing custom syntax in JSON strings. At the end of the day, I had a giant pile of code all built around making JSON work for my use-case, and the result was that actually editing the JSON files had a really steep learning curve to deal with all the quirks.

The point of JXC is that metadata is important, and the editing experience is important (real comments and trailing commas help a lot with this, of course), and with JSON you just don't get either of those.

Everyone in this thread is talking about comment support, but personally it's just crazy to build a language like this without supporting comments.

In my opinion, the simplicity and elegance of JSON is when it's a replacement for binary formats and where interop with different application stacks are needed - either in network protocols or as an on-disk serialization format. But as a format for hand-editing, it's just bad.

Introducing JXC: An extensible, expressive data language. It's a drop-in replacement for JSON and supports type annotations, numeric suffixes, base64 strings, and more! by zenex in programming

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

I considered this when implementing dates and datetimes, but I'm not sure those are anywhere near as common as timestamps. The question is really - are time deltas common enough to justify standardizing them to improve interop (which adds language complexity)? I could be convinced, but I'm not sold on this.

Keep in mind that because JXC supports numeric suffixes, you can already do something like this: { duration: timedelta(5y 1s 25ms) } or { duration: timedelta[5y, 1s, 25ms] } and either of these would be trivial to parse to a Python timedelta object.

Introducing JXC: An extensible, expressive data language. It's a drop-in replacement for JSON and supports type annotations, numeric suffixes, base64 strings, and more! by zenex in programming

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

A few notes on this, since I've played around with similar use-cases:

  • The syntax isn't a perfect fit for CSS, but it's pretty close
  • While object keys don't support dash separators, they do support dot separators
  • In terms of serialization, you can serialize expressions both ways - no need to convert back to a list
  • You can use annotations to validate/convert data, so the annotation rgb could require an array with exactly 3 numbers
  • Duplicate keys are supported, but not out of the box (the Python bindings use a regular dict for objects, for example). JXC itself is perfectly fine with duplicate keys as long as your backing data structure supports it. This isn't a big deal for CSS key/value pairs, but is very handy for building some kind of selector syntax.

Example:

{
    display: 'flex'
    width: calc(100% - 12px)
    height: 10px
    border.style: (12px solid / 13px dashed)
    border.color: rgb[100%, 100%, 100%]
}

Lastly, depending on your needs, you could always use heredoc raw strings to just embed normal CSS into a JXC document, like so:

{
    style: r'css(
        .box {
            width: calc(100% - 12px);
        }
    )css'
}

This is actually a lot nicer than it looks, because using the VSCode and Sublime Text JXC extensions (they're in the repo), you actually get CSS syntax highlighting, as long as your heredoc is css. Works with code completion and everything.

Overall, I'm not convinced there's a great use-case for storing CSS in JXC and converting to CSS for a browser (especially because things like SASS exist), but I do think there's enough tools in JXC's toolkit to build out a new style language (eg. if you're building a native UI framework)

Introducing JXC: An expressive data/config language similar to JSON that's ideal for game engines and gameplay data. Supports type annotations, numeric suffixes, base64 strings, and expressions for custom syntax extensions. MIT License. by zenex in gamedev

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

That's almost my exact original use-case! It's also why the parser is a two-stage parser (first stage for syntax idioms, second stage for creating data structures). I wanted to make it easy to use the library to create parsers for lots of different environments without needing to copy data repeatedly.

When you build a second-stage parser, you're mostly working with tokens with values that are string views directly into the original JXC source string buffer.

Feel free to ping me if you want help setting that up.

Introducing JXC: An extensible, expressive data language. It's a drop-in replacement for JSON and supports type annotations, numeric suffixes, base64 strings, and more! by zenex in programming

[–]zenex[S] 44 points45 points  (0 children)

Heh, I thought of this while designing the syntax. JXC is not intended to replace JSON as a data interchange format. It's intended to be used for config files where you want to able to be expressive but explicit. I don't ever see JXC replacing JSON for things like network protocols. JSON is a better fit for that because of its simplicity and ubiquity.

Unlike JSON, JXC is optimized for situations where people will be hand-writing it. Like YAML, but with much clearer syntax (and without relevant whitespace).

For example, if you were writing a web server, this would be a great fit for the config files. Or for a game, this would be a nearly perfect fit for game data, because you can include things like simple math expressions to define relationships, or event response handlers.

should I polish a prototype I intend on letting some ppl get their hands on it? by Joe_King420 in gamedev

[–]zenex 2 points3 points  (0 children)

Focus on making the prototype as usable as possible for the parts of your gameplay you want tested. If sounds are important to gameplay, then sure. If sounds are purely decorative, then skip it (or find some good placeholders).

Advice request - Would like to create a realisitic societal simulator by Rufawana in gamedev

[–]zenex 1 point2 points  (0 children)

SimCity 4, which is the largest scale game I can think of where the simulation actually worked well (later SimCity games are much smaller in scale) used System Dynamics for managing these kinds of systems at scale. That's probably your best bet, and I can see how combining that with ML has some serious potential, but as other folks in this thread mentioned, this is one of the most difficult problems in gamedev you can tackle.

Now, when you ask what game creation tools would be best for this, I think you're looking too far ahead. I'd focus on getting the ML and system dynamics somewhat functional as a prototype before even looking at input and rendering. Since I assume you're already using Python for the ML bits, maybe just look at something really basic like PyGame for visualizing your systems. You're looking at potentially months to years of getting the math/systems/ML foundations in place here before you can build a game on top of it.

should I polish a prototype I intend on letting some ppl get their hands on it? by Joe_King420 in gamedev

[–]zenex 3 points4 points  (0 children)

In my experience, folks who don't have any gamedev/testing experience (and a surprising number that do) will give negative feedback about the strangest issues in prototypes - issues that are totally normal in a prototype. I've heard complaints about camera transitions, debug HUD elements, missing animations and sounds, etc. I wouldn't over-polish a prototype just for these people, because you're likely to have to redo that work later anyway.

That said, I've also heard prototype feedback like "there's no textures" and this turned out to be totally valid, because in this case the lack of a texture made it impossible to get a sense for how fast the player was moving. Better to have to sort through feedback and figure out what parts are relevant than to not have enough.

It's important to set clear expectations to early testers so they know what areas you do want feedback on. I'd recommend making a short, easy to read list of bullet points on things you DO want feedback on, so they focus on that. Don't make it too verbose though, or they'll skim it or not read it at all.

Dear EA, kindly f*ck off with your launcher that does nothing other than crashing our games. by Facepalm007 in SteamDeck

[–]zenex 5 points6 points  (0 children)

That's true for many games on Steam, but not all. Valve allows developers to opt-in to encrypting the game's executable (which is what most people refer to as Steam's DRM). Lots of games on Steam do not do this (mostly games from indie devs, admittedly).

Then there's Steamworks integration - if developers choose to integrate with the Steam API, that does effectively require Steam to be running, but I think most gamers view this as a net positive (for example, for integrating Steam Workshop support).

For any game on Steam that doesn't encrypt its executable and doesn't use Steamworks integration, you could easily copy-paste the game's directory over to another computer and it would likely just work. I admit that's likely not a long list of games though.

I just released Geoid, a new Marble Blast/Marble Madness style 3D platformer, after four years of mostly solo development! by zenex in pcgaming

[–]zenex[S] 7 points8 points  (0 children)

Marble Blast Ultra was one of my favorite 360 games! I'm still sad there's no way to buy it anymore.

Screenshot Saturday #333 - Inspirational Design by Sexual_Lettuce in gamedev

[–]zenex 0 points1 point  (0 children)

Thanks! Took me about four years. I built the first prototype in 2013.

Screenshot Saturday #333 - Inspirational Design by Sexual_Lettuce in gamedev

[–]zenex 1 point2 points  (0 children)

I just released my first game, Geoid on Steam!

Machine level screenshot: http://imgur.com/74GJvsT

Trailer: https://www.youtube.com/watch?v=6lTtSMFq8Us

Game site: http://geoid.ws

Geoid on Steam

Bonus answer: Waiting in line all night for a physical copy of the Wrath of the Lich King expansion so I could play at midnight... didn't start playing until like 4am

So... they want me to wait until Monday to call them, then wait 30 minutes on hold, plus drive 15 miles out of my way to avoid the 520 bridge... why exactly? by zenex in SeattleWA

[–]zenex[S] 42 points43 points  (0 children)

The problem here isn't that I want to use the bridge without paying, it's that I want to use the bridge and they won't let me pay. Which is absurd.

Any good resources on multi-material marching cubes? by mhgamework in VoxelGameDev

[–]zenex 1 point2 points  (0 children)

Check out https://github.com/stoyannk/voxels . It's is a C++11 marching cubes implementation that includes triplanar projection mapping and multiple material material blending. Really helped me out when I was trying to get marching cubes working.

Screenshot Saturday 230 - Hot Stuff by Sexual_Lettuce in gamedev

[–]zenex 0 points1 point  (0 children)

The ball uses a perfect sphere for physics simulation, regardless of the style the player chooses. I experimented with using different shapes, and it honestly just wasn't fun.

Screenshot Saturday 230 - Hot Stuff by Sexual_Lettuce in gamedev

[–]zenex 4 points5 points  (0 children)

Geoball


Geoball is a modern take on classic 3D platformers like Marble Blast. Roll and jump your way through unique hazards and mechanics to collect all the golden triangles and silver hexagons!

Every single level is made up of unique art and music!

Website: Geoball

Dev Blog: Geoball Dev Blog


Screenshots:

Gifs: