Thank you. Yeah the load times could probably be improved. It's still the desktop assets and all pre-loaded ahead of time. It could benefit from some streaming of assets in future updates.
In terms of gravity, I actually recall this was a team debate. The original design was to use real gravity but the team thought it was simpler to have discrete areas of influence. We never really had time to A/B test it. Kerbal Space Program uses a similar model.
I had too much physics in my life so my brain is screaming "Is energy and angular momentum conserved here???". I'm not sure if I'm a typical user :) What I dislike about influence areas is that sometimes small changes in the direction or speed makes big changes in the trajectory.
* I'm not sure if it's a good idea to start the first game with so many weapons. I understand it's more fun, but not knowing what they do and the cost is confusing.
* In the weapon buying screen, it would be nice to have a visual representation of the explosion. (This looks like a very hard change. I'm not sure if you are going to add more features.)
* In the weapon buying screen, I prefer that the list is not cyclic, i.e. if I click down it stops when the list ends instead of cycling to the more expensive weapons again.
I ported my old project from 2007 to WASM.
Original game was built in C++ for Win32 DirectX.
This was an educational project with a team of 6 and 5 months of development.
How to play: Press Quick Start.
Left/Right keys to aim,
Up/Down for power.
W/A/S/D to move the camera, tab to lock/unlock the camera.
Works on mobile too, though not perfect yet - drag the arrow around to aim, adjust the power bar, tap fire.
Originally started porting back in 2020. The first step was to port native DirectX code into OpenGL, DirectSound to SoLoud and platform code to SDL.
I ended up porting the rendering code to bgfx and coding agents game me a big boost this year so to finish the project.
The aesthetics and feature all remain original.
Some of the porting challenges:
- Lots of DirectX code. Back in 2007 portability was not a high priority for us. Custom-built engine.
- Packed 32 bit custom model and animation file format with packed structures.
Back then we also made some interesting choices:
- Wrote our own custom STL-like library.
- For performance, the model loading code was pre-allocating a block, reading the entire file and then fixing up the binary structure offsets into pointers. This was the packed structure binary format and was not portable to modern systems so had to rewrite the loader.
- Originally I wrote a custom Maya exporter plugin and model format that supported skeletal animations. Ironically we ran out of budget to produce the animations so it ended up barely used.
- We had a strict rule: Absolutely no exception handling or RTTI. This ended up paying off 19 years later because it made it easier to port to WASM.
Trivia:
- The weird player names are mostly nicknames of other students and staff at the time.
- There are some pop culture sci/fi references to Space Balls and other movies if you notice them.
- The game pre-dates Angry Birds by 2 years but has some of the same vibes to it.
It seems that the agentic search benchmarks have fallen victim to reward hacking, just like the coding benchmarks. It's good to see mitigation efforts being made to address this problem.
What do you foresee in the future releases and improvements to this?
I just finished a similar project for fun and education.
It was a 20-year-old codebase from my old game in win32 and DirectX 9.
I first ported it to native and also switched to bgfx for rendering. This was the bulk of the work - converting all of the old DirectX fixed function pipeline code to shaders. Luckily all modern shaders can simulate all of the old fixed-function DX pipeline features with little effort. Including the coordinate system. Loading DDS textures didn't present a major challenge either.
Had similar native asset loading as yours - no deserializer. It loaded an entire asset file into a preallocated memory block, used packed structures and converted file offsets to pointers after loading. I had to convert it to 64bit for native first.
The most surprising thing: I had no idea WASM is 32bit until I read your article! Once I ported to 64bit, I then ported to WASM and I didn't even encounter any arch related bugs. In hindsight I guess it's because most of the original code was 32bit and the asset file format is still 32bit format. When I ported to 64bit I used a deserializer, so I guess that's why it all worked out in the end.
For native audio I ended up using SoLoud library, but for emscripten I #ifdef'd it out to use inline JS instead. I figured there is no point in having all that extra audio library code compiling to WASM when modern browsers natively support playing audio, oggvorbis, etc. It worked out ok, but there's still a minor bug where the music doesn't loop perfectly. You can hear a split second gap between end/start. I haven't looked deeply into it yet.
Originally when we wrote the game we had banned ourselves from using C++ Exception handling and RTTI. The decision likely paid off as it makes the generated binary smaller and faster. Although I haven't had time to measure. Supposedly C++ exceptions introduce a much heavier overhead in Emscripten.
> I had no idea WASM is 32bit until I read your article!
WASM(32) is a hybrid 32/64 bit architecture. The address range (and thus pointer size) is 32 bits, but it has native 64-bit integers. E.g. it's similar to the Linux x32 ABI.
There is also a 'true' 64-bit wasm, but that's still too recent to be used in real-world code:
> (but wasm64 doesn't really make sense unless you really need an address space greater than 32 bits, because the downside is slower performance)
Or unless you need to use integer types that depend on pointer size (such as size_t or usize), but your integers are too large to fit in 32 bits. That's a pretty common occurrence in bioinformatics. I've been waiting for years for Wasm to become usable, but it looks like Apple is still holding it back.
Actually, WASM32 usually runs in a 64-bit browser, so it can utilize most of the 64-bit instructions and general purpose registers. The problem is it's much harder to ensure that 64-bit pointer don't access browser critical data structures such as stack or heap contents. At least for WASM32, the pointer arithmetic is easily forced to be 32-bit in natively running JIT-ed code without dramatic performance loses. So, it's guaranteed that the WASM32 module won't access anything further than 4 or 8GiB (4GiB + 4GiB, when doing more complicated effective memory addressing instructions), thus, it's easy to cage a 4GiB memory block and surround it with guard buffers of comparable size inside a 64-bit virtual address space. With WASM64 you can't do this optimization because 64-bit pointers easily access your browser's memory, you have to add a lot of runtime bound checks if the compiler static checker can't guarantee landing inside the safe address range.
Unix shells are conceptually simple but hide a surprising amount of complexity under the hood that we take for granted. I recently had build my own PTY controller. There were so many edge-cases to deal with. It took weeks of stress testing and writing many tests to get it right.
There's a liability exemption for software manufacturers that are microenterprises or small enterprises at the time of placing the relevant product on the market.
"I haven’t looked at Flutter for other platforms than web so I cannot comment on it other than that the general principle of Flutter is a terrible idea."
The author completely missed the point of Flutter. It is a mobile-first platform positioned as an alternative to ReactNative. Its main goal was to provide a way to build cross-platform iOS/Android mobile apps with a minimal performance trade-off. For example, its code is compiled into native machine code for iOS, Android, and desktop. Its apps tend to be more lightweight and feel snappier. Unlike ReactNative they do their own rendering so that you can have pixel-perfect consistency across platforms.
Flutter's web and desktop support is more of an experiment and a convenience for those who want to port their existing mobile apps to web and desktop.
ReactNative was targeted for web developers who want to port their existing apps to mobile, Flutter's web support is the reverse of that.
I'm not sure that equal is the best way to describe it. Web has been there longer than desktop and embedded because Dart came with the ability to compile to JS, but web is given nowhere near the same attention by the Flutter team as other platforms.
> Unlike ReactNative they do their own rendering so that you can have pixel-perfect consistency across platforms.
You can make an argument for this, but this is exactly what people are generally objecting to. Most people expect native apps to look and feel like they are native to the platform, that they support accessibility and other platform features consistently and don’t introduce surprising conventions from other platforms.
People get frustrated and still use completely inconsistent softwares. Windows is still the most used operating system on desktop, and is a complete mess of consistency. That never blocked people from doing what they want. Just to say, consistency is great to have, but isn’t really what drives people decision making.
In terms of gravity, I actually recall this was a team debate. The original design was to use real gravity but the team thought it was simpler to have discrete areas of influence. We never really had time to A/B test it. Kerbal Space Program uses a similar model.