Hacker News new | past | comments | ask | show | jobs | submit | Rohansi's comments login

Not really. It's easy to abort after exceeding a number of uncompressed bytes or files written. The problem is the typical software for handling these files does not implement restrictions to prevent this.


This is a mostly Unity-specific issue. Unity unfortunately has a potato for a GC. This is not even an exaggeration - it uses Boehm GC. Unity does not support Mono's better GC (SGen). .NET has an even better GC (and JIT) that Unity can't take advantage of because they are built on Mono still.

Other game engines exist which use C# with .NET or at least Mono's better GC. When using these engines a few allocations won't turn your game into a stuttery mess.

Just wanted to make it clear that C# is not the issue - just the engine most people use, including the topic of this thread, is the main issue.


What makes Lua the best for game logic? You don't even have types to help you out with Lua.


Yeah, I actually recently tried making a game in Lua using LOVE2D, and then making the same one in C with Raylib, and I didn't feel like Lua itself gave me all that much. I don't think Lua is best for game logic so much as it's the easiest language to embed in a game written in C or C++. That said, maybe some of its unique features, like its coroutines, or stuff relating to metatables, could be useful in defining game logic. I was writing very boring, procedural, occasionally somewhat object-oriented code either way.


Lua would definitely help with iteration times vs. C/C++/Rust but C# compiles very quickly. Especially in Unity where you have an editor that keeps assets cached and can hot reload code changes (with a plugin).

Coroutines can definitely be very useful for games and they're also available in C#.


Stuff that hooked me:

you integrate it tightly with the engine so it only does game logic, making files small and very quick and easy to read.

platform independent, no compiling, so can modify it in place on a release build of the game.

the "everything is a table" approach is very easy to concept mentally means even very inexperienced coders can get up and running quickly.

great exception handling, which makes most release time bugs very easy to diagnose and fix.

All of which means you spend far more time building game logic and much, much less time fighting the programming language.

Heres my example of a 744 flight data recorder (the rest of the 744 logic is in the containing folders)

https://github.com/mSparks43/747-400/blob/master/plugins/xtl...

All asynchronously multithreaded, 100% OS independent.


FWIW if you really want to be able to edit code in-place on a live system, you can do that in C# with Roslyn without all that much effort.

So much so, in fact, that it can be bolted onto an existing game written in C#. I did exactly that for Bannerlord: https://www.nexusmods.com/mountandblade2bannerlord/mods/1651


how well does that work with linux mac android and ios?


Most likely because they don't use Linux. Or because it's kind of a mine field to support with bugs that occur on different distros. Even Unity has their own struggles with Linux support.

They're distributing their game on Steam too so Linux support is next to free via Proton.


> it's kind of a mine field to support with bugs that occur on different distros

Non-issue. Pick a single blessed distro. Clearly state that it's the only configuration that you officially support. Let the community sort the rest out.


This is a terrible solution, you're better off just making it Windows only and ensuring it can be run via Proton/Wine.


Why is it terrible? It gives a concrete target that the build is tested on. If someone cares they can most likely create an environment on their system that matches it. I don't see how that's any different from providing (for example) a flatpak.


And whatever they are doing is clearly working well. /s


Of course - but that is the best case scenario. You will need to support other kinds of queries as well, including writes, which is where it gets even more complicated. The guarantees provided by your RDBMS go away when you shard your database like this. Transactions are local to each database so writes to multiple cannot be a single transaction anymore.


It's in closed alpha so there's a limited number of players but I am curious to hear more about how BitCraft is scaling out. Is it a single, seamless world for all players? How much scaling is currently required? How is data replicated when horizontal scaling comes into the picture?


Since SpacetimeDB would be your backend (game client <-> SpacetimeDB) you would need to verify the inputs to your reducers to prevent cheating. Not really different from anything else.


But that's completely different from how Unreal typically does it. Movement is client-side predicted and server authoritative out of the box. How does SpacetimeDB even know the collisions of my level?

If I were to cheat and disable all wall collisions on the client. An Unreal server would roll me back, to all other people it would look like I'm walking into the wall. How do you even get SpacetimeDB to run Unreal's runtime (because movement kind of depends on deterministic results for frames). How does SpacetimeDB get hold of the assets (collisions)?


I am also skeptical of SpacetimeDB for the same reason. There is no game engine helping you do any simulation and that makes development harder. Your (server-side) assets would somehow need to be synced to SpacetimeDB which possibly means you can't use your editor tools to design them anymore.

As a service backend+database the concept is cool and probably useful. But I don't see it being good at being a game server.


Reading/hearing talks from people doing server backends there is many half insane things being done to keep servers and persistence in check, and everyone still a different custom solution.

A common scenarios:

- "Game-server" using "regular" server+DB frameworks, often works but seldom in real-time scenarios.

- Realtime Game-servers (with in-memory state, sometimes supporting rollback,etc) that then has persistence more or less as an afterthought (duplicating state management between client<->server<->persistence)

What spacetime tries to do (and my current experiment) is to merge the server and DB to move persistence _performance_ concerns into the backend process.

We _rightfully_ moved databases out of server processes for easier management and safety in the 90s, but since f.ex. SQLite has been a bit of a resurgence because the usercode was in a managed language and wasn't as likely to cause a corruption issue.

WASM is a great enabler here because it allows the server/DB to sandbox the logic-code even in "unsafe"/realtime languages from the more precarious DB parts of the process so we don't have to risk data-safety even as we move back to co-locating server-state and persistence data within the same process.


I have also experimented in this space but came to the conclusion that it's not good for games. Not necessarily because it's a bad idea but because it's not how games are made. To make a game with something like SpacetimeDB you would need to build a game engine. You'd also need to build out tooling for managing assets for the server.

One thing about SpacetimeDB that I'm not sure about is if reducers can run concurrently or not. I would hope so but it's very possible they don't and that can be a big regression vs. current game servers.


Agreed, going for a custom engine anyhow in my scenario so that's fine.

It seems that they're built to run serially to achieve reproducible simulations so my guess would be no, this is one thing my experiment does differently although formally it might just be a naming difference.

It's not a major issue though I think, the stuff I work on could shard work by area so single areas are single-threaded but world-wise it's parallel (Eve online has done this for ages).


Serial execution makes the most sense from a database perspective because they work off a transaction log. Parallel execution may require separate transaction logs (basically durable queues) to accomplish sharding but that introduces a whole new set of issues because tables can only be mutated from a single transaction log. Code that needs to access multiple suddenly gets a lot more complex. There was actually a post on HN the other day about this: https://news.ycombinator.com/item?id=43661181


It's not meant as a regular SQL database with full ACID semantics (even if that is a interesting stretch target).

Rather the main thing is mainly about coupling storage and sharding decisions with the simulation, since both a sharded simulator and sharded storage system will need logic for sharding and time-versioning, it's silly to duplicate work (or worse have out of sync semantics). In addition cohabiting simulation and storage will lessen latency and other issues w.r.t. to separating them.

Now, it's entirely possible that I'm barking up the wrong tree but considering that many are exploring this design-space means that there is interest and merits even if only the Spacetime and a few others have taken the leap yet.


What games do you know that are hard or firm real-time?

Real-time in this context is more like real-time communication rather than process scheduling.


I think we've diverged from the game context, towards discussion "universal brain reorganizing technologies", nodejs being considered one, and what real-time means in the context of node.

That said, real-time communication _is_ a soft real-time system.


As a game dev I don't really see what problems this solves. Most of the work you would have in games is related to simulation - something this doesn't help you with at all. It can actually make simulation more difficult because all your state would be decoupled from a game engine (which is built for simulation). So you'd end up having game servers running the simulation syncing to SpacetimeDB... or of course you try to build the simulation inside SpacetimeDB with no help from it.


It solves 3 problems:

1. Server <> client sync is handled for you 2. Server <> database sync is eliminated 3. Deployment is super easy because you just upload your wasm module to the database, and SpacetimeDB schedules it (similar to Kubernetes honestly, but at a different level of the stack)


The first two problems are nothing, IMO. Server <> client sync is handled by your engine or, if you need to roll your own, it's not that hard. Syncing to a database is more tedious than difficult.

Getting rid of a game engine on the server side adds a lot more work. I don't think it would even balance out.


Having implemented the first two for a web game i absolutely guarantee you those are far from "nothing". It takes considerable diagraming & handling to coordinate FE + API on state changes.

If they in fact can solve that (haven't checked myself), it would be a massive time saving for development.


Maybe I'm just used to it having implemented it several times. But my point is that they require a relatively fixed amount of effort. Once it's implemented you shouldn't need to touch it again.


> 1. Server <> client sync is handled for you

In what sense? Is it as fast as using UDP with protobuf packets?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: