ZDoom / Raze

Build engine port backed by GZDoom tech. Currently supports Duke Nukem 3D, Blood, Shadow Warrior, Redneck Rampage and Powerslave/Exhumed.
664 stars 59 forks source link

[Feature] Web port #1065

Closed midzer closed 5 months ago

midzer commented 5 months ago

Raze version

Raze 1.9.1 (current master)

Which game are you running with Raze?

Duke3D Shareware

What Operating System are you using?

Linux x86_64

If Other OS, please describe

No response

Is your feature request related to a problem? Please describe.

Hi,

since a few days, I am working on a web port of Raze via Emscripten tool chain for GLES.

I got pretty far, everything (including dependencies) compiled and linked.

Now, I am stuck with runtime errors. Debugging shows for example

raze.pk3:zscript/engine/base.zs, line 390: Class Shape2DTransform has circular inheritance

Probably not an error, I am unsure though. I've picked raze.pk3 from Raze 1.3.1 Windows release as I did not pack the file myself.

Finally, program crashes in

Uncaught CRecoverableError: Script error, "raze.pk3:zscript/engine/base.zs" line 21:
Invalid global identifier 'CHAN_ITEM'

    at ___cxa_throw (index.js:1652:23)
    at imports.<computed> (index.js:15899:33)
    at index.wasm.I_Error(char const*, ...) (index.wasm:0x82bc47)
    at index.wasm.FScriptPosition::Message(int, char const*, ...) const (index.wasm:0x6c2d39)
    at index.wasm.FxIdentifier::Resolve(FCompileContext&) (index.wasm:0x2de191)
    at index.wasm.FxBitOp::Resolve(FCompileContext&) (index.wasm:0x2b8c45)
    at index.wasm.ZCCCompiler::CompileConstant(ZCC_ConstantWork*) (index.wasm:0x3eeeb5)
    at index.wasm.ZCCCompiler::CompileAllConstants() (index.wasm:0x3e99ed)
    at index.wasm.ZCCCompiler::Compile() (index.wasm:0x3e3ee5)
    at index.wasm.ParseScripts() (index.wasm:0x13ef574)

Describe the solution you'd like

Any support on this would be cool. Gonna contribute back to this repo if suitable.

Describe alternatives you've considered

Commenting out LoadScripts() in gamecontrol.cpp. Afterwards program crashes elsewhere.

Add any other context or screenshots about the feature request here.

No response

mjr4077au commented 5 months ago

Please don't use old pk3 files against the current code base. If you're building against master, you must also build a fresh pk3. If you're building off a release tag, you can use the pk3 that came with the Windows binary for that version. We're up to 1.9.1 now, a lot's changed in the pk3 in that time.

midzer commented 5 months ago

@mjr4077au Thanks for your reply. No, I am not building against current master. I use 1.3.1 release code because it has less dependencies and (hopefully) proper GLES support. The .pk3 is from 1.3.1, too.

midzer commented 5 months ago

@mjr4077au Okay, I've built and linked against latest master branch now, with current raze.pk3.

The error mentioned in initial post is the same.

mjr4077au commented 5 months ago

Hi @midzer, I'm sorry I've only just seen these now.

So much has changed between 1.3.1 and now so I can only offer help against current code, not stuff from two years ago.

In saying this though, I don't know why you'd be getting such an error. Line 21 is referencing an enum value declared line 9, there's nothing untoward there. I can only hypothesise that your compiler is doing something funky, unfortunately.