4 ms·
Not quite ready to submit this to the list yet, but I've been working on a Quake 3 engine clone from scratch in C# with Bridge.NET, targeting the browser and We
by daeken 9y ago
Not quite ready to submit this to the list yet, but I've been working on a Quake 3 engine clone from scratch in C# with Bridge.NET, targeting the browser and WebGL. It's been a super fun project so far -- a few days of part-time work and I have levels rendering nearly perfectly and I'm making progress on character model rendering. Repo is at https://github.com/daeken/WebArena https://github.com/daeken/WebArena and you can see a live version at http://demoseen.com/bridge/ http://demoseen.com/bridge/
Still a ton to do, but I'm really digging it.
Edit to add: WASD + Space/Shift + arrows to control the camera.
- westoncb 9y agoAwesome! I wrote an MD3 loader/renderer/animator years ago[0] and had a lot of fun with it—always wanted to try loading the levels as well, though I've yet to try it. Any comment on how difficult that was in comparison to dealing with characters? I imagine you are pulling the data from WAD files (err.. does quake 3 still use those?), and static geometry is in a 3D BSP tree? [0] http://symbolflux.com/statichtml/oldprojects/md3library.html http://symbolflux.com/statichtml/oldprojects/md3library.html (No source or anything available atm—just a screenshot and description, though I could up it up if anyone were interested.)
- daeken 9y agoThe actual level loading itself is stupid easy -- I had the geometry loading and rendering in something like two hours. The tough part is converting their "shader" model over to something that modern GPUs can understand. That took about a day and a half and still isn't entirely complete -- I'm missing environment mapping and vertex deformation. MD3 has been pretty straightforward on the whole, but I didn't design my mesh abstraction super well out the gate, so I've mainly been redesigning that and trying to make it futureproof. I think I have it to about the minimum repeated code possible at this point, but I'm sure I'll reach some other snag down the road and have to refactor again!
- westoncb 9y agoInteresting—yes, I was wondering about their shader model. I glanced through your source and saw what looked to me like some of the conversion. In any case, the shaders you have running so far (I assume they generate the animations on various objects in the scene) look very nice :) Good luck with the project!
- throwaway2016a 9y agoAwesome. Looks great. This brings back memories. I wrote a MD2 loader for my final project in my 3d graphics elective in college years ago. It was a ton of fun. Quake 3 came out my freshman year, the format wasn't very well documented yet but MD2 had tons of documentation. Can't comment to how much easier / harder level loading would be but I'd venture to say probably much easier. Characters have more animation and such along with them.
- westoncb 9y agoThanks! That's funny, Doom 3 was just coming out when I was in college and I had the same issue when considering doing something with MD5s—and they also just appeared super intimidating to me at the time :)
- indescions_2017 9y agoGood on you! 60 FPS and looks terrific. From 10 years ago, how they did the (mostly automated) managed port of Quake II :) https://gregs-blog.com/category/quake-2-c-net-port/ https://gregs-blog.com/category/quake-2-c-net-port/
- throwaway2016a 9y agoLooks great. Just out of curiosity why C# for the engine but Python for the tools? What strengths does each offer that lead to those choices vs doing the tools and the engine in the same language?
- daeken 9y agoI love Python for file format manipulation, especially with my Struct.py library. Also, the tools themselves are largely derived from an older version of WebArena where the client was written in Coffeescript + Three.js. That said, the tools are unbelievably slow and will be rewritten in C# once things are functionally complete. Python just allows for very, very rapid development of this sort of thing (for me).
- vvanders 9y agoReally cool stuff, seeing that level brings back some pretty powerful memories. Didn't know about Bridge.NET. That's way cool, how is it from a development perspective?
- daeken 9y agoI am absolutely loving Bridge.NET so far. There are some mild rough edges and it doesn't support C# 7 syntax yet, but I went from never having used it to having built a simple 3d engine in a matter of a couple hours. I consider that a big win.
- geoffreymcgill 9y agoC#7 support is coming soon to Bridge. Several features like Local Functions are done, just not in the master branch yet.
- daeken 9y agoI will weep tears of joy when Bridge.NET supports destructuring. That will be so, so nice!
- kstenerud 9y agohmm it breaks on Chrome on mac os: System.Exception: TypeError: Cannot read property 'viewport' of null at ctor.Resize (http://demoseen.com/bridge/WebArena.js:180:37 http://demoseen.com/bridge/WebArena.js:180:37) at new ctor (http://demoseen.com/bridge/WebArena.js:158:22 http://demoseen.com/bridge/WebArena.js:158:22) at Function.Main (http://demoseen.com/bridge/WebArena.js:119:13 http://demoseen.com/bridge/WebArena.js:119:13) at http://demoseen.com/bridge/bridge.js:2973:39 http://demoseen.com/bridge/bridge.js:2973:39 at HTMLDocument.delayfn (http://demoseen.com/bridge/bridge.js:481:21 http://demoseen.com/bridge/bridge.js:481:21) at HTMLDocument.listenHandler (http://demoseen.com/bridge/bridge.js:498:30 http://demoseen.com/bridge/bridge.js:498:30)
- daeken 9y agoLooks like it's not getting a WebGL context. Perhaps your setup doesn't support it?
- geoffreymcgill 9y agoCheck for browser extensions|plugins that might be prevent "fingerprinting". These plugins often disable WebGL support by default.