Better HN
topnewbestaskshowjobs
Log inSign up

daniel_rh

561 karma · joined Jun 29, 2016 (10y ago) · 68 submissions

https://graphics.stanford.edu/~danielh/projects.html
Submissions

comment 5d ago · link · parent

Author here. A couple of weeks ago, I posted the Wing Commander together project https://news.ycombinator.com/item?id=50369895 which took 11 years (on and off). Folks in the video comments asked if the same approach would generalize to TIE Fighter.

I gave it a try and added it to the TIE Fighter 32-bit DOS/4GB game in about 11 days with some machine-assisted tooling helping porting the hook layer, writing the cockpit generator for that Tydirium Shuttle I always wanted to fly and helping me debug some of the sync errors.

TIE Fighter had these large spanning missions and relied a lot of exact aim as a gameplay mechanic, so I decided to have ownership of NPC craft shift around between players. And turns out since TIE Fighter has a demo from 1994, you can give it a try and if you like it can buy the GOG version. You can try it here: https://fireflyk64.github.io/tf/ , and hopefully I’ll see you online. Many thanks to the OpenTIE project for the address map.

2.

Show HN: TIE Fighter co-op in 11 days, built from 11 years of Wing Commander(fireflyk64.github.io ↗)

3 points · by daniel_rh · 5d ago · 1 comment

comment 2w ago · link · parent

0 minutes because the entire 11 years this project has been open source on a dosbox branch; therefore, it has all been harvested in the training set, and it's a matter of requesting that the model reproduce the training set and replicate my and others' memory debugging adventures.

comment 2w ago · link · parent

Blog co-author here: this year, it was interesting to see people walking around the halls with their laptop slightly askew so their agents could keep processing. I think the reasonable next step is putting compute both in an isolated sandbox but also close to the data.

Initially, I had sketched some ideas of having some sort of "safe" artifact-hosting service to serve any vetted packages to an agent that it may want to install, but then the huggingface "note passing" incident made me think it was safest to just have a frozen, pre-installed image that was configured to have all the vetted packages.

If anyone's interested in the cityscape render, I pasted it here: https://www.dropbox.com/scl/fi/w78fzyd80qvy5uya9x1vq/citysca...

comment 2w ago · link · parent

I love what you've done. I see your multiplayer is on a lan with UDP. Would you mind looking into lobbylink ? Lobbylink uses webRTC to punch through firewalls and send both reliable and unreliable packets. It works with nearly every language on every platform. The server side is completely game-independent and feel free to use the same server I do for your game lobby if you want. If you need help getting started you can file an issue at https://github.com/danielrh/lobbylink or direct message me

comment 2w ago · link · parent

I think we could target both Privateer (have it so that when your ship shows up at the same nav point as another you spawn the other player) or the x-wing and tie-fighter series.

One problem I'm noticing is that people are much more interested in one-click play (which means using the Open Source RetroVega space game, which I checked in at https://github.com/danielrh/wcmulti/tree/master/retrovega ) rather than going through the trouble to dig up the installer and get the full year 1990 retro experience with Wing Commander. I worry that making older games work is not worth the time it takes if no one tries it.

comment 2w ago · link · parent

Ya especially with DRM or multiplayer lockdown measures.

But there is still a revolution where most game files are JSON or plain text (like that build list from Star Trek Armada 2).

comment 2w ago · link · parent

Yes! I remember finding out which integer was the money in my Sim City save. And I remember when I figured out the build order list for Star Trek: Armada 2 and fixed the Borg AI to be so formidable that we'd have to play the First Contact sound track at full blast to even have a chance of winning against 3 Borg players.

comment 2w ago · link · parent

Thanks for the feedback! I'll have a look. I do worry about congestion coupling since it would mean a bursty voice stream could affect game packets. Keeping it on a different stream allows game data priority over voice.

comment 2w ago · link · parent

I can port https://github.com/danielrh/lobbylink to rust if that's helpful.... probably would have the same external interface.

comment 2w ago · link · parent

I definitely used AI to bring my old Vega Strike DOS game up to speed and make it work with the layout. Some of the art is better than the rest, but it did feel good to dust off the old dos game from the geocities era and write an equivalent "accelerator" in DOSBox, so that we could get 640x480 graphics in dos. The new Vega Strike is still being developed at https://www.vega-strike.org/

However, that original WC-only 8+ years of figuring out how the data segment was organized and how to call original functions was all by-hand hacking. It was indeed like cutting through a dark forest with no guide.

comment 2w ago · link · parent

Author here: in 2015, I was playing the classic Wing Commander in DOSBox and suddenly realized the game state fit in the 64k data segment.

Over ten years my brother and I went through a set of experiments (stop and go, turn, communicate) while probing the memory. We uncovered where the variables were, how to inject calls into the game functions, and how to sync the gamestate across the network, so we can fly the story missions together.

My favorite finding is that the camera lives in entity slot 0x3D, which is possibly a "3D" reference by the original developers.

You can play it at https://fireflyk64.github.io/dosbox in browser. If you own Wing Commander, drag in the installer since no game files are hosted. If you don't, the page will load the original DOS/3Dfx version of Vega Strike, before I open sourced it. I upscaled and redid DOS Vega Strike art using AI, but it now has multiplayer and a similar feel.

I'll be in the lobby for the next few hours if anyone wants to fly together.

Disclosure: I also used AI for the final step to help compile for the browser and port our TCP networking stack to WebRTC with voice and solve a few lingering bugs.

13.

Show HN: After a decade of reversing, I got co-op working in DOS Wing Commander(fireflyk64.github.io ↗)

257 points · by daniel_rh · 2w ago · 41 comments

comment 1mo ago · link · parent

I love that idea! Please let me know if it's of any help :-)

Since the Playdate doesn't have any of the sprite rendering hardware that made the gameboy both underpowered in compute and overpowered in graphics at the time, some of the tricks may be unnecessary.

I suppose you could do some kind of shift of a whole row of the framebuffer easily with a memmove sort of operation. The gameboy's shift registers and the per sprite drawing are what really made this both difficult and possible at such a slow CPU clock speed. The playdate CPU is about 40x faster than that on the gameboy, so probably all these kinds of tricks and more would work just fine.

comment 1mo ago · link · parent

This is so cool! I've been working on trying to minimize the F-zero render loop to fit on gameboy and multiplayer over the link cable...it's been a journey. (I rushed the writeup cus of this article--still polishing the text), but give the game a try on the in-browser emulator: https://fireflyk64.github.io/makingfsub/

comment 1mo ago · link · parent

Yes the old game only ran at 15-20 fps and it wasn't even synced to the clock! This endeavour also added time sync and I chose 20 fps (which makes some missions harder). Wingman shots are delayed by up to a few frames, but the system has a high latency mode that double-sends steering commands over the lossy layer. The weapon commands are at least synced with where the ships fly. I haven't tried too much in high latency scenarios (mostly LAN) so we will see how well it holds up online

comment 1mo ago · link · parent

Here's the source code: https://github.com/danielrh/wcmulti if you notice any issues and want to file any tickets (or want to add support for X-Wing or others)

18.

Show HN: Reversing Wing Commander to find the entity table in 64k to add co-op(fireflyk64.github.io ↗)

4 points · by daniel_rh · 1mo ago · 5 comments

comment 3y ago · link · parent

I've been looking for a really engaging solid intro to number theory course on youtube, including rings, Abelian groups, etc for early teens.

Does anyone have a recommendation here?

comment 3y ago · link · parent

Or go for one of these gamified math tutorials.

For instance: this one teaches geometric proofs without mentioning the formalism, just letting you "unlock" the tools from a few "axiom" starter tools.

https://www.euclidea.xyz/

comment 4y ago · link · parent

This is similar to the solution we used in Vega Strike https://www.vega-strike.org/ detailed here https://graphics.stanford.edu/~danielh//classes/VegaStrikeBl...

comment 4y ago · link · parent

This article mentions the woes of circular imports. I thought MyPy let you work around that by doing if False: around your imports

eg a.py: import c

  if False:
     import b

  class X:

   def x(self):
       #type: () -> b.Y
       from b import something_that_returns_y

       return something_that_returns_y(self)
b.py:

  from a import X

  class Y:

    pass

  def something_that_returns_y(x : X) -> Y:

    return Y()
per https://github.com/asottile/flake8-typing-imports

comment 4y ago · link · parent

I think the newer version of this is https://github.com/bazelbuild/rules_rust which lets you either vendor the dependencies or pull them from your Cargo.toml directly every time.

Per the article: bazel + rules_rust should have the flexibility to override the linker flags that Cargo may take as required since that would be a property of the bazel toolchain used.

It's a nice amalgamation of how cargo works and how bazel works.

In general bazel supports hermetic builds, multiple toolchains, cross complilation, and ways to compile multi-language projects.

I still wish that Cargo.toml didn't support build.rs as it can cause a lot of system-dependent problems that bazel sidesteps entirely by being hermetic.

comment 5y ago · link · parent

Does anyone have experience with eBPF on aarch64? How well is it supported? On what kernel revisions was it phased in and well tested there?

comment 5y ago · link · parent

I was just experimenting with eBPF and ran into a limitation: Is there a way to load the source IP into a register when working in userspace? When I SO_ATTACH_BPF to a SOCK_DGRAM it only makes the udp header accessible, per https://github.com/danielrh/bpf_buffer_per_source/blob/main/... I would love to be able to run logic based on both IP and port rather than being limited to port alone. Yet it's not worth the inconvenience/danger of running as root to operate with RAW sockets.

comment 5y ago · link · parent

Highly recommend http://privateer.sourceforge.net/ Gemini gold

comment 5y ago · link · parent

Hi! Just noticed this post :-) I started the game in the late 90’s and open sourced it in 2001 The previous versions were win Mac Linux but the current dev team has been focusing on Linux right now.

At the time there were some mod communities like privateer Gemini gold with a polished release and Vega Trek; those also had windows builds that also work on wine. You might need to install into a folder with read/write permissions.

28.

A Statement on the Walled Metaverse(github.com ↗)

5 points · by daniel_rh · 5y ago · 1 comment

comment 5y ago · link · parent

Ya we briefly corresponded in a mailing list some time back... he liked the multiplayer version, but wasn't interested in opening the source code yet. Maybe one of these years he will--I should reach out again... until them I have some pretty well annotated IDA file

comment 5y ago · link · parent

Wow you played begin too! I added multiplayer through DOSbox--

it was interesting that the AI craft were just like player craft but had a different controller. It was possible to splice in keyboard input for that. Then I wrote some screen scraping software to send the commands remotely.

Here's the software project http://begin2.sourceforge.net/

Unfortunately the sourceforge matchmaking server has long gone offline, but you could connect direct to IP addresses too, so it should still be playable

123