Author Topic: NeoLemmix source - auto C# translation?  (Read 5389 times)

0 Members and 1 Guest are viewing this topic.

Offline joe@joesblog

  • Posts: 5
    • View Profile
NeoLemmix source - auto C# translation?
« on: April 17, 2021, 11:27:32 AM »
I didn't wish to start a new thread as it's probably not worth it, though if this is considered thread hijacking I'll remove it..
I'm in the process of writing a semi automatic transpiler for delphi to C# ( though with some imagination it could be extended to CPP).

I'm using neolemmix as the test project due to the size and libraries that it imports, would the result of it be of any use to this community?
I couldn't guarantee 1:1 likeness as I'm aiming it more at business based systems.




Offline IchoTolot

  • Global Moderator
  • Posts: 3608
    • View Profile
Re: NeoLemmix source - auto C# translation?
« Reply #1 on: April 17, 2021, 11:50:16 AM »
I didn't wish to start a new thread as it's probably not worth it, though if this is considered thread hijacking I'll remove it..
I'm in the process of writing a semi automatic transpiler for delphi to C# ( though with some imagination it could be extended to CPP).

I'm using neolemmix as the test project due to the size and libraries that it imports, would the result of it be of any use to this community?
I couldn't guarantee 1:1 likeness as I'm aiming it more at business based systems.

I would say the result would definitly be worth a look. :)

Offline Simon

  • Administrator
  • Posts: 3860
    • View Profile
    • Lix
Re: NeoLemmix source - auto C# translation?
« Reply #2 on: April 17, 2021, 01:53:58 PM »
Welcome to the forum!

NL transpiled into C# or C++ would be really handy. It would be nice to build NL on Linux with a purely open-source toolchain. Even if it's C# and not C++, I can build from C# via Mono and Wine.

namida wouldn't start a fresh project in Delphi today. He really likes C#.

-- Simon

Offline namida

  • Administrator
  • Posts: 12398
    • View Profile
    • NeoLemmix Website
Re: NeoLemmix source - auto C# translation?
« Reply #3 on: April 17, 2021, 08:40:34 PM »
I've split this off into a seperate topic from the one it was posted in, as it is a bit different (but nothing wrong with it existing).

I'm not sure if NeoLemmix would be an ideal test case - the code is very messy, and I think if it were going to be ported to another language, it would be well and truly beneficial to start from scratch specifically so that it can be written more cleanly in the process. Ideally, it would be an outright "clean room" reimplementation (minus the pedanticness around legal concerns).

However, you're certianly welcome to use NeoLemmix as a test case anyway. I've also made a few other, simpler, Delphi / Lazarus apps that could be useful as test cases. Again I should stress that I'm not too likely to make use of the conversion myself; this is more a "if you're looking for more code to use to test your app, feel free to use these".

CubeGuy (Delphi. Clone of Blockman / Block-Dude): https://bitbucket.org/namida42/cubeguy/
L3DEdit (Primarily Delphi, also has a Lazarus port. Lemmings 3D level editor): https://bitbucket.org/namida42/l3dedit/
Phart (Lazarus. Simple pixel art image editor designed for touchscreen use): https://bitbucket.org/namida42/phart/
« Last Edit: April 19, 2021, 08:13:18 PM by namida »
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline joe@joesblog

  • Posts: 5
    • View Profile
Re: NeoLemmix source - auto C# translation?
« Reply #4 on: April 21, 2021, 10:20:14 AM »
I've split this off into a seperate topic from the one it was posted in, as it is a bit different (but nothing wrong with it existing).

I'm not sure if NeoLemmix would be an ideal test case - the code is very messy, and I think if it were going to be ported to another language, it would be well and truly beneficial to start from scratch specifically so that it can be written more cleanly in the process. Ideally, it would be an outright "clean room" reimplementation (minus the pedanticness around legal concerns).

However, you're certianly welcome to use NeoLemmix as a test case anyway. I've also made a few other, simpler, Delphi / Lazarus apps that could be useful as test cases. Again I should stress that I'm not too likely to make use of the conversion myself; this is more a "if you're looking for more code to use to test your app, feel free to use these".

CubeGuy (Delphi. Clone of Blockman / Block-Dude): https://bitbucket.org/namida42/cubeguy/
L3DEdit (Primarily Delphi, also has a Lazarus port. Lemmings 3D level editor): https://bitbucket.org/namida42/l3dedit/
Phart (Lazarus. Simple pixel art image editor designed for touchscreen use): https://bitbucket.org/namida42/phart/

Ah okay, thank you!

I will take a look at those other repo's too. The code's not too bad! from what I can tell it's a project that's evolved over time, for what I have to use it for outside of this I need something that does not confirm to rigidly to set patterns or designs just the Delphi structure; so this works quite well. C# makes a lot of sense for me when it comes to delphi conversion as the forms and stuff are pretty similar when porting from one to another.

It'd be nice to help or be part of a community project if it was to ever get a C# implementation, my thoughts would be on cross compatibility between platforms and devices; the graphics libraries specified by Microsoft or built into VS installer seem to be pretty obtrusive when it comes to pixel level stuff as far as I can see. I know in the GDI you can run it in an unsafe context and lock bits of memory to do special operations but it's not as efficient as SDL or something akin to that. Wrapping SDL2 is an option that I've played with on windows alone but I'm not sure how that then translates into Mono/Core to be cross platform. Without C# the only viable way would be a CPP system, which is great but is far more complex beast, it also lacks reflection and decent llambda expressions. Then of course there is backwards compatibility with all the level packs etc..

p.s. I know I'm new to this forum but I really appreciate neolemmix, it's a great improvement over a great game!



Offline joe@joesblog

  • Posts: 5
    • View Profile
Re: NeoLemmix source - auto C# translation?
« Reply #5 on: June 29, 2022, 12:58:29 AM »
Not sure on the interest in this,

I used that converter I wrote to port some of the functions rather than the whole project, I fixed a few bugs, and implemented a quick GUI Down the bottom, I thought I'd done more than is here but it could be on my old PC.

I wanted to see if I could get this to run on android though have yet to test, I'm using raylib for the graphics library that connects to the GL pipeline.

all it does so far is load levels, the routines for walking, falling, ascending, climbing, floating and bashing are in too.

Here's a quick video, not sure if I'll take it much further from here though:

https://www.youtube.com/watch?v=T8rIIxYfXuI

Offline WillLem

  • Posts: 3345
  • Unity isn't sameness, it's togetherness
    • View Profile
Re: NeoLemmix source - auto C# translation?
« Reply #6 on: July 07, 2022, 01:23:18 AM »
Not sure on the interest in this

I for one am very interested in seeing NL's code translated into a more accessible language than Delphi, particularly if the code is tidied up along the way.

I'm very much a beginner when it comes to programming, and from what I've seen there's much more help and support available for those learning C#.

Keep up the good work! If I could help, I absolutely would.

Offline joe@joesblog

  • Posts: 5
    • View Profile
Re: NeoLemmix source - auto C# translation?
« Reply #7 on: July 15, 2022, 11:53:58 PM »
A Couple of more vids:

The first video I've added entrances and basic CRT/Halation shaders (I like the amiga/crt aesthetic, It's toggleable though)
https://www.youtube.com/watch?v=KsENOkAZlZs.

The second video I've added the rest of the legacy skills, I rewrote the skill handling section using an abstract class and inheriting it for all the skills, it makes it easier to create new ones or grab the code from the delphi converter.
https://www.youtube.com/watch?v=duzR0iBSpD4.


Offline joe@joesblog

  • Posts: 5
    • View Profile
Re: NeoLemmix source - auto C# translation?
« Reply #8 on: August 21, 2022, 06:39:16 PM »
Hi All,

Not updated this thread for awhile.. been busy with preparing to change jobs.

In some of my spare time, I've looked at actually getting this to run on android and discovered that C++ is the only viable answer. ( I know that sounds complicated to some people but once some of the complexities are out of the way it's not much different to C#).

Here's a quick demo of it running on android (It runs on windows out of the box), Apologies in advance for the dreadful quality. My phone hates doing screen recordings. I ported over the Terrain, Gadgets and Skill handler functionality, With this method It should also be possible to port the codebase to WebAssembly, Win, RaspberryPi, Linux, Android etc...

https://www.youtube.com/watch?v=0WbH4uU6A24

Not sure if anyone's actually interested in this, it's more of a side hobby for me to do (I seem to like writing software/games more than playing it lately), though any thoughts or comments, even if its to stop wasting my time! :D

Joe.