Duke4.net Forums: Duke Nukem 3D - C# Unity - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Duke Nukem 3D - C# Unity

#1

Hey,

I couldn't find my old post, but quite a few people have been asking what I'm doing with my Unity Build C# port. I didn't plan to unveil this now, but just wanted to catch people up who were interested. I couldn't find my old post, sorry about that Evan :(.

I have Duke Nukem 3D ported to C#.
https://i.ibb.co/D4Vjfjh/Untitled.png
https://i.ibb.co/M25dRmq/Untitled2.png


I need to preface it with, its not that playable yet. I'm confident in 90% code, except for the con-script virtual machine. The layers of pointers in that system are driving my crazy, so that's one of the biggest reasons I'm sharing right now, I need some help understanding what these three pointers actually do: actorscrptr and insptr. I ran some tests and I think I have most of the system working. I think that because I put a lizzard trooper in a room, and output the script command it wants to execute in parse(). And all of the execute commands line up(that was a HUGE milestone for me today). I think the last bit of problems I have is understanding actorscrptr, specifically this area isn't working(this is inside of function EGS).

https://i.ibb.co/C2ZtQg4/image.png

Which eventually causes a crash here:
https://i.ibb.co/F4Y0vsw/image.png

The same issue is I believe causing some of the remainder of my AI state problems as well.

If anyone has any ideas let me know:
https://github.com/j...all23/DukeSharp

Duke Specific C# bits are here:
https://github.com/j...ssets/Code/Game

I have implemented quite a few changes and fixes to the BuildEngine C# code in this depot since I released the original BuildEngine C# code. The DukeSharp code I first ran through tangible c# converter, but I converted most of that work by hand, and fixed up all 15,000 errors. I'm not using any pointers(it compiles with safe code), the sector annimation code I need to do, Multiplayer I haven't done as well.Anim Movies are not implemented yet. Automap isn't implemented.

This post has been edited by icecoldduke: 16 November 2020 - 05:38 PM

5

User is offline   Hudson 

  • Meat Popsicle

#2

Woah, this is some really impressive work ICD! I know a few folks who will find this news quite up their alley and most welcome :D

This post has been edited by Hudson: 16 November 2020 - 08:08 PM

1

#3

I made quite a bit of progress and fixed quite a lot of bugs, but one huge issue that still hangs over the project is the con script virtual machine. I just created a tool that converts the con scripts to C#. Here's the result(retail con scripts), the tool and source is in the same folder. Next step is I'm going to try and rip out the con script virtual machine and have it call the generated c# code directly.

https://i.ibb.co/wRTxP5V/image.png
Generated C# on the left, con code on the right, I think it looks pretty good

Full con code to C# conversion result:
https://github.com/j...ls/conscript.cs
4

#4

I released a progress video, aside from the automap and multiplayer, its playable just has bugs at this point. Only show stopper at the moment is swinging doors.

6

User is online   Danukem 

  • Duke Plus Developer

#5

Nice! Looks like you already have gamepad support, too.
0

#6

I have fixed quite a few things, and I'm able to play through all of E1M1, and proceed to E1M2 without any progression blockers. Doors are fixed, audio is implemented, and lots of other bug fixes are implemented as well.

1

User is offline   Reaper_Man 

  • Once and Future King

#7

https://media1.tenor.com/images/61a7ccfb94fb9cdb357edf74c1da1c84/tenor.gif?itemid=14505707
0

#8

I released a build today for Windows, Linux and MacOS. I'm trying to get as much feedback as possible, so try it out and let me know what you think.
This is the first release of IceDuke(formally DukeSharp). IceDuke is a full C# port of original Duke Nukem 3D GPL release. Everything is ported over to C#, including the con code. As a result of the con code being converted to C#, .CON files are not loaded.

DOWNLOAD(Windows, Linux, MacOS)
https://github.com/j...ases/tag/Alpha1

INSTALLATION:
Windows:
Copy duke3d.grp to windows\DukeNukem_Data\StreamingAssets
Linux:
Copy duke3d.grp to linux\linuxtest_Data\StreamingAssets
MacOS
Copy duke3d.grp to mac.app\Contents\Resources\Data\StreamingAssets

KNOWN ISSUES:
The game is fully functional, and there aren't any known progression blockers preventing you from playing from the start of the game to the end of the game, but because this is a complete language port, there will be bugs, and crashes.

1) E1L2 - 30% crash when opening the rotating door from the door, for some reason the code puts the player into a -1 sector and that causes a out of bounds index crash.
2) The hud sometimes has the wrong sector color palette.
3) Save/load is not implemented yet.
4) Automap is not implemented yet.
5) Underwater sector color changes don't work yet.
6) Only works with Duke Nukem 3D 1.5(non of the addons).
7) Command line arguments are not implemented yet.
8) Some animations run very quickly.
9) Holoduke causes a crash.

MODDING:
Since all of the game code(including the con code) is hardcoded, the only way to mod the game currently is to install Unity. This will be fixed in a later release. However modding IceDuke is a lot easier because its all in C#, and debugging is quite a bit easier.

This post has been edited by icecoldduke: 22 November 2020 - 09:07 PM

1

#9

I uploaded a new build with modding support for those that want to check it out:
https://github.com/j.../tag/Alpha1-MOD

Just open up DukeScript.csproj in the mods folder and hit build

https://i.ibb.co/wgs3j2f/image.png

This post has been edited by icecoldduke: Yesterday, 05:09 PM

3

User is offline   gerolf 

  • Honored Donor

#10

Great job! Duke under C# is cool 😎
0

User is online   Danukem 

  • Duke Plus Developer

#11

What are the goals as far as being able to make scripted mods with more robust capabilities like in eduke32? So for the included actor scripts only seem to replicate the functionality of the old script system from 1996 (which is pretty impressive!)
0

#12

View PostDanukem, on 23 November 2020 - 06:22 PM, said:

What are the goals as far as being able to make scripted mods with more robust capabilities like in eduke32? So for the included actor scripts only seem to replicate the functionality of the old script system from 1996 (which is pretty impressive!)

Getting DukeScript right is more important to me then adding 3d rendering support. I think we should start a open discussion on were to go next with DukeScript.dll. I think the first step is get to a functionality level similar to eduke 2.1 and go from there. What kind of specific things are you guys doing?
0

User is online   Ninety-Six 

#13

2020 seems to be the year of resurging Duke 3D source ports.

Naturally this is hardly a bad thing.
0

User is online   Danukem 

  • Duke Plus Developer

#14

View Posticecoldduke, on 23 November 2020 - 07:29 PM, said:

Getting DukeScript right is more important to me then adding 3d rendering support. I think we should start a open discussion on were to go next with DukeScript.dll. I think the first step is get to a functionality level similar to eduke 2.1 and go from there. What kind of specific things are you guys doing?


There's a lot. But the guiding principle is to expose as much of the game to the scripting system as possible.

To start with, manipulation of the game structs:

https://wiki.eduke32...ructure_members

Any of those members can be read and nearly all of them can be written. That includes the player, all sprites, sectors, walls, input, user settings, and even the "tsprites".

With EDuke32 we also have the ability to draw sprites and text directly to the screen:

https://wiki.eduke32...wiki/Screentext
https://wiki.eduke32.../Rotatesprite16

The custom projectile system is pretty handy:
https://wiki.eduke32...efineprojectile

Actor sprites run code 30 times per second and custom ones can be made to do a lot of work behind the scenes. But that doesn't help in menus or in various other situations. It's also handy to have access points to the game when specific things happen. So in EDuke32 we have "events", and there are a lot of them:

https://wiki.eduke32...wiki/Event_list

A good example of when events are needed as an access point for inserting code is for creating a custom hud display, since that needs to be updated in time with the framerate and can't depend upon an in game actor.

There's definitely some reduncancy in EDuke32 because various events and commands have been added over the years, making many older ones obsolete, but the older ones are kept around for compatibility.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options