eu07 / maszyna

MaSzyna Train Simulator
http://eu07.pl
Mozilla Public License 2.0
124 stars 50 forks source link

Port to Godot Engine #58

Open JezSonic opened 5 months ago

JezSonic commented 5 months ago

As a game developer and train enjoyer I have an idea Why don't we port this beautiful game onto Godot Engine? (We because I want to help with port)

As far as I have used this engine for years I know the code can be easily rewritten and therefore performance would be much better

1. Models

Godot supports very well LOD without need to provide lod layers in the model itself what is done in the current game - such modelling practices are prohibited. It would also disable the need to have custom model extension

2. Code

Godot has python based GDScript, nothing more to say

3. Maps

Godot would allow anyone to develop better maps

4. Audio

Godot has very well audio support that we can extend by adding FMOD Engine

5. Custom scenarios

People could create custom scenarios in Godot, export them as Godot's .PCK file. Godot can dynamically load content from .pck files in code so that's not a problem at all

jakubg1 commented 5 months ago

There have been recent efforts to make an editor for MaSzyna in Godot recently: https://eu07.pl/forum/index.php/topic,35181.0.html The project has since died out, but you can see some potential problems and challenges which would need to be resolved in order to make the simulator fully functional. We will also lose a good chunk of performance when running GDScript instead of compiled C++, unless I've missed a big improvement which makes it run as fast as say, LuaJIT. You can talk to the editor's author if you have any questions, but currently there are no plans to move this project to another engine.

marcinn commented 2 months ago

Hi. As an author of MaSzyna Editor based on Godot I just need to say, that for personal reasons I had to withdraw from open source projects for about half a year, but I'm slowly getting back into it. I'll publish the editor source codes soon. I don't know how much they'll help with the work on a potential port of the game engine, but maybe it would at least be an inspiration for someone.

JezSonic commented 1 month ago

Hi. As an author of MaSzyna Editor based on Godot I just need to say, that for personal reasons I had to withdraw from open source projects for about half a year, but I'm slowly getting back into it. I'll publish the editor source codes soon. I don't know how much they'll help with the work on a potential port of the game engine, but maybe it would at least be an inspiration for someone.

I'd love to help in any way ❤️

JezSonic commented 1 month ago

Hi. As an author of MaSzyna Editor based on Godot I just need to say, that for personal reasons I had to withdraw from open source projects for about half a year, but I'm slowly getting back into it. I'll publish the editor source codes soon. I don't know how much they'll help with the work on a potential port of the game engine, but maybe it would at least be an inspiration for someone.

Hi. Mind letting me know about the publication of source code?

I am currently trying to plan what I can implement there. I am also curious if you did implement physics and audio and if so - how

I would like to continue this to make a replacement for MaSzyna's exe. E.g. new and better code and graphics, but using assets from installed copy of simulator

marcinn commented 1 month ago

Hi. Yes, I'll let you know.

I'm working on an addon which handles scenery files (all type of nodes, including tracks and events), e3d, materials, etc. The goal of the prototype is to work with scene files directly in the Godot Editor, then export results to the MaSzyna data dir. Next step is to make standalone editor in Godot, because Godot Editor is too generic for an end user.

I'm not reimplementing MaSzyna's engine, so there is no physics. The addon I'm working on can be used to handle MaSzyna native files, i.e. to load sceneries, assets, textures and work with these quite easy with GDScript. So you can use the addon to work with your exe port. There is a basic audio handling - addon is creating preconfigured AudioStreamPlayers for specific nodes. Please note that Godot uses PBR and MaSzyna does not, so assets can look a little different.

For physics, instead of rewriting it, I'd recommend to try decoupling MaSzyna's physics from the rendering pipeline, create Godot's interface for it, and compile as a C++ module.

Editor in the Godot Editor: https://www.youtube.com/watch?v=0EhTUikZ7lE https://www.youtube.com/watch?v=2V8e-cz1ang https://www.youtube.com/watch?v=VZJ_unYcKTw

Examples of a hypothetical new engine using the addon: https://www.youtube.com/watch?v=VZJ_unYcKTw https://www.youtube.com/watch?v=smxQIuwBcIY

JezSonic commented 1 month ago

I am planning to recreate physics from the beginning so I am aware of that.

My plan is to use jolt and apply rotation to the engine which would spin axles and therefore move the train with having in mind slopes, slippery etc.

Not perfect but something good to start with. And I'd like the port to use MaSzyna's assets (from the install dir) :)

P. S. We can also discuss/talk on discord: dos_cutey

jakubg1 commented 1 month ago

Keep in mind that MaSzyna has been getting support for lots of engine types throughout the years, all of which very carefully crafted, parametrized and verified with real results for every vehicle for the most realistic experience. If the physics engine is going to be rewritten, we're likely to lose the balance, and we'll need to create a new set of physics for a few hundred vehicles that are available in the simulator. @xoov (youBy on the forum), the author of most of the physics code and the only one still active, might not be willing to take on this job, which would mean that MaSzyna will lose its realism in favor of candy graphics. This is not the direction towards which I want this project to be taken.