Robertvokac (talk | contribs) No edit summary |
Robertvokac (talk | contribs) No edit summary |
||
Line 115: | Line 115: | ||
After these changes, MonoGame should be able to find and load the world*.txt files properly. | After these changes, MonoGame should be able to find and load the world*.txt files properly. | ||
Installing dotnet on Debian 12: https://learn.microsoft.com/cs-cz/dotnet/core/install/linux-debian?tabs=dotnet8 | |||
[[Category:Fan projects]] | [[Category:Fan projects]] |
Latest revision as of 18:33, 26 November 2024
Mobile Eggbert is the planned game created from the decompiled C# source code of Speedy Blupi for Windows Phone.
Probably the C# decompiler named ILSpy will be used to get back the C# source code. See: Category:C Sharp decompilers
MonoGame, the alternative of XNA Game Framework, is planned to be used too. MonoGame is almost a drop-in replacement for the XNA game framework.
The main reason for the existence of the Mobile Eggbert project is the fact, that Windows Phone is a discontinued mobile operating system (developed by Microsoft Mobile for smart phones), devices with Windows Phones are no more produced and without such device the only way to run this version of Speedy Blupi is the emulator, which is uncertain to work in the future, as it is a closed-source proprietary technology.
Current status: Work on "Mobile Eggbert" started on 23rd November 2024.
Update as of 23rd November 2024 - project Mobile Eggbert started
Porting of Speedy Blupi for Windows Phone to modern devices started on 23th November 2024
Visual Studio 2015 is used. "New project" was created: Visual C#/Windows/Windows 8/WindowsPhone/BlankApp (Windows Phone Silverlight)The target platform is Windows Phone 8.0, which is different from the original release by Daniel Roux in 2013, which targeted Windows Phone 7.5Visual Studio Express 2010 was installed: Microsoft Visual Studio Express 2010: https://archive.org/details/visual_studio_2010_expressXNA Game Studio 4.0 Refresh was installed: https://www.microsoft.com/en-us/download/details.aspx?id=23714Workaround for Windows 10 or newer: Install Games for Windows – LIVE Redistributable from https://www.microsoft.com/en-us/download/details.aspx?id=5549 or https://go.microsoft.com/fwlink/?LinkID=201134Unfortunately it seems, that this workaround does not work and XNA Game Studio cannot be installed on Windows 10 on newer.
But installation of XNA on Windows 10 was not successful.- MonoGame will be used. https://docs.monogame.net/articles/getting_started/index.html
- .NET 8 SDK was installed. Also run:
dotnet workload install android
- Visual Studio 2022 was installed.
- This command was executed: dotnet new install MonoGame.Templates.CSharp
- Note: If you are running in VirtualBox, you have to enable the 3D acceleration
The source code repository for Mobile Eggbert is: https://github.com/openeggbert/mobile-eggbert
How to fix loading world{}.txt
In MonoGame, when you use TitleContainer.OpenStream(worldFilename) to open a file like world*.txt, it expects the file to be located in the correct directory within your game's content directory structure. If the file is not found, it could be due to the following reasons:
1. Ensure the Files Are in the Correct Directory
MonoGame looks for content files in specific locations, typically within the Content directory. By default, files should be added under the Content directory in your project.
Here’s what you should do:
Place your world*.txt files in the Content folder of your project. For example:
YourProject
└── Content
├── world1.txt
├── world2.txt
└── world3.txt
In this case, TitleContainer.OpenStream("world1.txt") will be able to find and open the file. However, MonoGame doesn’t automatically place non-content files like .txt files into the appropriate build output folder unless you configure it properly.
2. Set the Build Action for the .txt Files
You need to set the proper build action for these files so that they are copied to the output directory when the game is built.
Right-click the world*.txt file(s) in the Solution Explorer.
Select Properties.
Set the Build Action to Content.
Set the Copy to Output Directory to Copy if newer or Copy always.
This ensures that the files are included in the final build and can be found by TitleContainer.OpenStream.
3. Verify the File Path
When you call TitleContainer.OpenStream(worldFilename), you should be passing the correct relative path to the file. If the file is in the Content folder, you should use the file name relative to that folder.
For example:
Stream stream = TitleContainer.OpenStream("world1.txt");
If the files are in a subfolder inside the Content directory (e.g., Content/Worlds/), use the full path relative to Content:
Stream stream = TitleContainer.OpenStream("Worlds/world1.txt");
4. Debugging
If the file is still not found, check the following:
Ensure that the file path is correct (check for typos or incorrect folder structure).
Verify that the file exists in the correct directory after building the project. You can do this by inspecting the output directory (e.g., bin/Debug or bin/Release) after building the game.
You can also print out the file path to ensure it's being referenced correctly:
Console.WriteLine("Looking for file: " + worldFilename);
5. Consider Using ContentManager for Loading Content
If you are using MonoGame's ContentManager to load other content (like textures, sounds, etc.), you might want to load text files through the same system to ensure better integration. For loading text files with ContentManager, you could add them as "Text" content and load them like this:
var textContent = Content.Load<string>("world1");
In this case, you should:
Set the file’s Build Action to Content.
Set the Copy to Output Directory to Copy if newer.
The file should be placed under the Content folder.
Summary:
To fix the issue of not finding your world*.txt files, you need to:
Place the .txt files inside the Content directory.
Set the Build Action for these files to Content.
Set Copy to Output Directory to Copy if newer or Copy always.
Use the correct relative path when calling TitleContainer.OpenStream().
After these changes, MonoGame should be able to find and load the world*.txt files properly.
Installing dotnet on Debian 12: https://learn.microsoft.com/cs-cz/dotnet/core/install/linux-debian?tabs=dotnet8